diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..0ce392d5742b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -32,6 +32,7 @@ specifiers: '@rush-temp/arm-databricks': file:./projects/arm-databricks.tgz '@rush-temp/arm-datafactory': file:./projects/arm-datafactory.tgz '@rush-temp/arm-datalake-analytics': file:./projects/arm-datalake-analytics.tgz + '@rush-temp/arm-deploymentmanager': file:./projects/arm-deploymentmanager.tgz '@rush-temp/arm-desktopvirtualization': file:./projects/arm-desktopvirtualization.tgz '@rush-temp/arm-devtestlabs': file:./projects/arm-devtestlabs.tgz '@rush-temp/arm-eventgrid': file:./projects/arm-eventgrid.tgz @@ -213,6 +214,7 @@ dependencies: '@rush-temp/arm-databricks': file:projects/arm-databricks.tgz '@rush-temp/arm-datafactory': file:projects/arm-datafactory.tgz '@rush-temp/arm-datalake-analytics': file:projects/arm-datalake-analytics.tgz + '@rush-temp/arm-deploymentmanager': file:projects/arm-deploymentmanager.tgz '@rush-temp/arm-desktopvirtualization': file:projects/arm-desktopvirtualization.tgz '@rush-temp/arm-devtestlabs': file:projects/arm-devtestlabs.tgz '@rush-temp/arm-eventgrid': file:projects/arm-eventgrid.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 @@ -8458,6 +8460,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-deploymentmanager.tgz: + resolution: {integrity: sha512-RVC/3kBOmNUv2xRLzlhqZIN+NB7BOk6P4/ZxYnBsWcRL4BOSmTNPa39NfrteeruJUj+Dfvl7WUui7jLsL2vqlQ==, tarball: file:projects/arm-deploymentmanager.tgz} + name: '@rush-temp/arm-deploymentmanager' + 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-desktopvirtualization.tgz: resolution: {integrity: sha512-3U19vdKa3z0O/9CGkQMZc3+Q1ZmAx19snUOq6QF/djKcQEfdiP40NGU+EsN+Suc2sgUZZQUgw2mU7XMBvjd8Ag==, tarball: file:projects/arm-desktopvirtualization.tgz} name: '@rush-temp/arm-desktopvirtualization' @@ -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..ed2c7ac670e4 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-deploymentmanager", + "projectFolder": "sdk/deploymentmanager/arm-deploymentmanager", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/deploymentmanager/arm-deploymentmanager/CHANGELOG.md b/sdk/deploymentmanager/arm-deploymentmanager/CHANGELOG.md new file mode 100644 index 000000000000..2ae5e578bdf7 --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 4.0.0-beta.1 (2022-01-05) + +The package of @azure/arm-deploymentmanager is using our next generation design principles since version 4.0.0-beta.1, 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/deploymentmanager/arm-deploymentmanager/LICENSE.txt b/sdk/deploymentmanager/arm-deploymentmanager/LICENSE similarity index 96% rename from sdk/deploymentmanager/arm-deploymentmanager/LICENSE.txt rename to sdk/deploymentmanager/arm-deploymentmanager/LICENSE index b73b4a1293c3..5d1d36e0af80 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/LICENSE.txt +++ b/sdk/deploymentmanager/arm-deploymentmanager/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 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/deploymentmanager/arm-deploymentmanager/README.md b/sdk/deploymentmanager/arm-deploymentmanager/README.md index 1e3949dc85e0..f06fdeceaa50 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/README.md +++ b/sdk/deploymentmanager/arm-deploymentmanager/README.md @@ -1,112 +1,98 @@ -## Azure AzureDeploymentManager SDK for JavaScript +# Azure Service client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureDeploymentManager. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +REST APIs for orchestrating deployments using the Azure Deployment Manager (ADM). See https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deploymentmanager/arm-deploymentmanager) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-deploymentmanager) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-deploymentmanager?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-deploymentmanager` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-deploymentmanager` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure Service client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-deploymentmanager @azure/identity +npm install @azure/arm-deploymentmanager ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `AzureDeploymentManager` -### How to use +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]. -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +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). -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and get serviceTopologies 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`. -##### Sample code +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 { DefaultAzureCredential } = require("@azure/identity"); const { AzureDeploymentManager } = require("@azure/arm-deploymentmanager"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new AzureDeploymentManager(creds, subscriptionId); -const resourceGroupName = "testresourceGroupName"; -const serviceTopologyName = "testserviceTopologyName"; -client.serviceTopologies.get(resourceGroupName, serviceTopologyName).then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new AzureDeploymentManager(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and get serviceTopologies as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-deploymentmanager 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 + +### AzureDeploymentManager + +`AzureDeploymentManager` 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"); ``` +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). + +## 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) +- [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%2Fdeploymentmanager%2Farm-deploymentmanager%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/deploymentmanager/arm-deploymentmanager/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/deploymentmanager/arm-deploymentmanager/_meta.json b/sdk/deploymentmanager/arm-deploymentmanager/_meta.json new file mode 100644 index 000000000000..7d1942414b0c --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "fc5d283f8d0a0e67575658b48b1ebfa369d14b8e", + "readme": "specification/deploymentmanager/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/deploymentmanager/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/deploymentmanager/arm-deploymentmanager/api-extractor.json b/sdk/deploymentmanager/arm-deploymentmanager/api-extractor.json new file mode 100644 index 000000000000..5a3059197edc --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/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-deploymentmanager.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/package.json b/sdk/deploymentmanager/arm-deploymentmanager/package.json index 16e1a1791988..0a8cd06a239b 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/package.json +++ b/sdk/deploymentmanager/arm-deploymentmanager/package.json @@ -1,58 +1,90 @@ { "name": "@azure/arm-deploymentmanager", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "AzureDeploymentManager Library with typescript type definitions for node.js and browser.", - "version": "3.1.0", + "description": "A generated SDK for AzureDeploymentManager.", + "version": "4.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.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-deploymentmanager.js", - "module": "./esm/azureDeploymentManager.js", - "types": "./esm/azureDeploymentManager.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-deploymentmanager.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@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", - "uglify-js": "^3.6.0" + "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/deploymentmanager/arm-deploymentmanager", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "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-deploymentmanager.js.map'\" -o ./dist/arm-deploymentmanager.min.js ./dist/arm-deploymentmanager.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/deploymentmanager/arm-deploymentmanager/review/arm-deploymentmanager.api.md b/sdk/deploymentmanager/arm-deploymentmanager/review/arm-deploymentmanager.api.md new file mode 100644 index 000000000000..464f93a3bf69 --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/review/arm-deploymentmanager.api.md @@ -0,0 +1,656 @@ +## API Report File for "@azure/arm-deploymentmanager" + +> 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 { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type ApiKeyAuthentication = RestRequestAuthentication & { + type: "ApiKey"; + name: string; + in: RestAuthLocation; + value: string; +}; + +// @public +export type ArtifactSource = TrackedResource & { + sourceType?: string; + artifactRoot?: string; + authentication?: AuthenticationUnion; +}; + +// @public +export type ArtifactSourceProperties = ArtifactSourcePropertiesAutoGenerated & {}; + +// @public +export interface ArtifactSourcePropertiesAutoGenerated { + artifactRoot?: string; + authentication: AuthenticationUnion; + sourceType: string; +} + +// @public +export interface ArtifactSources { + createOrUpdate(resourceGroupName: string, artifactSourceName: string, options?: ArtifactSourcesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, artifactSourceName: string, options?: ArtifactSourcesDeleteOptionalParams): Promise; + get(resourceGroupName: string, artifactSourceName: string, options?: ArtifactSourcesGetOptionalParams): Promise; + list(resourceGroupName: string, options?: ArtifactSourcesListOptionalParams): Promise; +} + +// @public +export interface ArtifactSourcesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + artifactSourceInfo?: ArtifactSource; +} + +// @public +export type ArtifactSourcesCreateOrUpdateResponse = ArtifactSource; + +// @public +export interface ArtifactSourcesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ArtifactSourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ArtifactSourcesGetResponse = ArtifactSource; + +// @public +export interface ArtifactSourcesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ArtifactSourcesListResponse = ArtifactSource[]; + +// @public +export interface Authentication { + type: "Sas"; +} + +// @public (undocumented) +export type AuthenticationUnion = Authentication | SasAuthentication; + +// @public (undocumented) +export class AzureDeploymentManager extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureDeploymentManagerOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + artifactSources: ArtifactSources; + // (undocumented) + operations: Operations; + // (undocumented) + rollouts: Rollouts; + // (undocumented) + services: Services; + // (undocumented) + serviceTopologies: ServiceTopologies; + // (undocumented) + serviceUnits: ServiceUnits; + // (undocumented) + steps: Steps; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface AzureDeploymentManagerOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface CloudError { + error?: CloudErrorBody; +} + +// @public +export interface CloudErrorBody { + readonly code?: string; + details?: CloudErrorBody[]; + readonly message?: string; + target?: string; +} + +// @public +export type DeploymentMode = "Incremental" | "Complete"; + +// @public +export interface HealthCheckStepAttributes { + healthyStateDuration: string; + maxElasticDuration?: string; + type: "REST"; + waitDuration?: string; +} + +// @public (undocumented) +export type HealthCheckStepAttributesUnion = HealthCheckStepAttributes | RestHealthCheckStepAttributes; + +// @public +export type HealthCheckStepProperties = StepProperties & { + stepType: "HealthCheck"; + attributes: HealthCheckStepAttributesUnion; +}; + +// @public +export interface Identity { + identityIds: string[]; + type: string; +} + +// @public +export interface Message { + readonly message?: string; + readonly timeStamp?: Date; +} + +// @public +export interface Operation { + display?: OperationDetail; + name?: string; + origin?: string; + properties?: Record; +} + +// @public +export interface OperationDetail { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): Promise; +} + +// @public +export interface OperationsList { + value?: Operation; +} + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationsList; + +// @public +export interface PrePostStep { + stepId: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ResourceOperation { + readonly operationId?: string; + readonly provisioningState?: string; + resourceName?: string; + resourceType?: string; + readonly statusCode?: string; + readonly statusMessage?: string; +} + +// @public +export type RestAuthLocation = "Query" | "Header"; + +// @public +export type RestAuthType = "ApiKey" | "RolloutIdentity"; + +// @public +export interface RestHealthCheck { + name: string; + request: RestRequest; + response?: RestResponse; +} + +// @public +export type RestHealthCheckStepAttributes = HealthCheckStepAttributes & { + type: "REST"; + healthChecks?: RestHealthCheck[]; +}; + +// @public +export type RestMatchQuantifier = "All" | "Any"; + +// @public +export interface RestRequest { + authentication: RestRequestAuthenticationUnion; + method: RestRequestMethod; + uri: string; +} + +// @public +export interface RestRequestAuthentication { + type: "RolloutIdentity" | "ApiKey"; +} + +// @public (undocumented) +export type RestRequestAuthenticationUnion = RestRequestAuthentication | RolloutIdentityAuthentication | ApiKeyAuthentication; + +// @public +export type RestRequestMethod = "GET" | "POST"; + +// @public +export interface RestResponse { + regex?: RestResponseRegex; + successStatusCodes?: string[]; +} + +// @public +export interface RestResponseRegex { + matches?: string[]; + matchQuantifier?: RestMatchQuantifier; +} + +// @public +export type Rollout = TrackedResource & { + identity?: Identity; + buildVersion?: string; + artifactSourceId?: string; + targetServiceTopologyId?: string; + stepGroups?: StepGroup[]; + readonly status?: string; + readonly totalRetryAttempts?: number; + readonly operationInfo?: RolloutOperationInfo; + readonly services?: Service[]; +}; + +// @public +export type RolloutIdentityAuthentication = RestRequestAuthentication & { + type: "RolloutIdentity"; +}; + +// @public +export interface RolloutOperationInfo { + readonly endTime?: Date; + readonly error?: CloudErrorBody; + readonly retryAttempt?: number; + readonly skipSucceededOnRetry?: boolean; + readonly startTime?: Date; +} + +// @public +export type RolloutProperties = RolloutRequestProperties & RolloutPropertiesAutoGenerated & {}; + +// @public +export interface RolloutPropertiesAutoGenerated { + readonly operationInfo?: RolloutOperationInfo; + readonly services?: Service[]; + readonly status?: string; + readonly totalRetryAttempts?: number; +} + +// @public +export type RolloutRequest = TrackedResource & { + identity: Identity; + buildVersion: string; + artifactSourceId?: string; + targetServiceTopologyId: string; + stepGroups: StepGroup[]; +}; + +// @public +export interface RolloutRequestProperties { + artifactSourceId?: string; + buildVersion: string; + stepGroups: StepGroup[]; + targetServiceTopologyId: string; +} + +// @public +export interface Rollouts { + beginCreateOrUpdate(resourceGroupName: string, rolloutName: string, options?: RolloutsCreateOrUpdateOptionalParams): Promise, RolloutsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, rolloutName: string, options?: RolloutsCreateOrUpdateOptionalParams): Promise; + cancel(resourceGroupName: string, rolloutName: string, options?: RolloutsCancelOptionalParams): Promise; + delete(resourceGroupName: string, rolloutName: string, options?: RolloutsDeleteOptionalParams): Promise; + get(resourceGroupName: string, rolloutName: string, options?: RolloutsGetOptionalParams): Promise; + list(resourceGroupName: string, options?: RolloutsListOptionalParams): Promise; + restart(resourceGroupName: string, rolloutName: string, options?: RolloutsRestartOptionalParams): Promise; +} + +// @public +export interface RolloutsCancelOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RolloutsCancelResponse = Rollout; + +// @public +export interface RolloutsCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface RolloutsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + rolloutRequest?: RolloutRequest; + updateIntervalInMs?: number; +} + +// @public +export type RolloutsCreateOrUpdateResponse = RolloutsCreateOrUpdateHeaders & RolloutRequest; + +// @public +export interface RolloutsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface RolloutsGetOptionalParams extends coreClient.OperationOptions { + retryAttempt?: number; +} + +// @public +export type RolloutsGetResponse = Rollout; + +// @public +export interface RolloutsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RolloutsListResponse = Rollout[]; + +// @public +export interface RolloutsRestartOptionalParams extends coreClient.OperationOptions { + skipSucceeded?: boolean; +} + +// @public +export type RolloutsRestartResponse = Rollout; + +// @public +export interface RolloutStep { + readonly messages?: Message[]; + name: string; + readonly operationInfo?: StepOperationInfo; + readonly resourceOperations?: ResourceOperation[]; + readonly status?: string; + stepGroup?: string; +} + +// @public +export type SasAuthentication = Authentication & { + type: "Sas"; + sasUri?: string; +}; + +// @public +export type Service = ServiceProperties & { + name?: string; + serviceUnits?: ServiceUnit[]; +}; + +// @public +export interface ServiceProperties { + targetLocation: string; + targetSubscriptionId: string; +} + +// @public +export type ServiceResource = TrackedResource & { + targetLocation: string; + targetSubscriptionId: string; +}; + +// @public +export type ServiceResourceProperties = ServiceProperties & {}; + +// @public +export interface Services { + createOrUpdate(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceInfo: ServiceResource, options?: ServicesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options?: ServicesDeleteOptionalParams): Promise; + get(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options?: ServicesGetOptionalParams): Promise; + list(resourceGroupName: string, serviceTopologyName: string, options?: ServicesListOptionalParams): Promise; +} + +// @public +export interface ServicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesCreateOrUpdateResponse = ServiceResource; + +// @public +export interface ServicesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ServicesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesGetResponse = ServiceResource; + +// @public +export interface ServicesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesListResponse = ServiceResource[]; + +// @public +export interface ServiceTopologies { + createOrUpdate(resourceGroupName: string, serviceTopologyName: string, serviceTopologyInfo: ServiceTopologyResource, options?: ServiceTopologiesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, serviceTopologyName: string, options?: ServiceTopologiesDeleteOptionalParams): Promise; + get(resourceGroupName: string, serviceTopologyName: string, options?: ServiceTopologiesGetOptionalParams): Promise; + list(resourceGroupName: string, options?: ServiceTopologiesListOptionalParams): Promise; +} + +// @public +export interface ServiceTopologiesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServiceTopologiesCreateOrUpdateResponse = ServiceTopologyResource; + +// @public +export interface ServiceTopologiesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ServiceTopologiesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServiceTopologiesGetResponse = ServiceTopologyResource; + +// @public +export interface ServiceTopologiesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServiceTopologiesListResponse = ServiceTopologyResource[]; + +// @public +export interface ServiceTopologyProperties { + artifactSourceId?: string; +} + +// @public +export type ServiceTopologyResource = TrackedResource & { + artifactSourceId?: string; +}; + +// @public +export type ServiceTopologyResourceProperties = ServiceTopologyProperties & {}; + +// @public +export type ServiceUnit = ServiceUnitProperties & { + name?: string; + steps?: RolloutStep[]; +}; + +// @public +export interface ServiceUnitArtifacts { + parametersArtifactSourceRelativePath?: string; + parametersUri?: string; + templateArtifactSourceRelativePath?: string; + templateUri?: string; +} + +// @public +export interface ServiceUnitProperties { + artifacts?: ServiceUnitArtifacts; + deploymentMode: DeploymentMode; + targetResourceGroup: string; +} + +// @public +export type ServiceUnitResource = TrackedResource & { + targetResourceGroup: string; + deploymentMode: DeploymentMode; + artifacts?: ServiceUnitArtifacts; +}; + +// @public +export type ServiceUnitResourceProperties = ServiceUnitProperties & {}; + +// @public +export interface ServiceUnits { + beginCreateOrUpdate(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, serviceUnitInfo: ServiceUnitResource, options?: ServiceUnitsCreateOrUpdateOptionalParams): Promise, ServiceUnitsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, serviceUnitInfo: ServiceUnitResource, options?: ServiceUnitsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, options?: ServiceUnitsDeleteOptionalParams): Promise; + get(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, options?: ServiceUnitsGetOptionalParams): Promise; + list(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options?: ServiceUnitsListOptionalParams): Promise; +} + +// @public +export interface ServiceUnitsCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface ServiceUnitsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ServiceUnitsCreateOrUpdateResponse = ServiceUnitsCreateOrUpdateHeaders & ServiceUnitResource; + +// @public +export interface ServiceUnitsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ServiceUnitsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServiceUnitsGetResponse = ServiceUnitResource; + +// @public +export interface ServiceUnitsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServiceUnitsListResponse = ServiceUnitResource[]; + +// @public +export interface StepGroup { + dependsOnStepGroups?: string[]; + deploymentTargetId: string; + name: string; + postDeploymentSteps?: PrePostStep[]; + preDeploymentSteps?: PrePostStep[]; +} + +// @public +export interface StepOperationInfo { + readonly correlationId?: string; + readonly deploymentName?: string; + readonly endTime?: Date; + error?: CloudErrorBody; + readonly lastUpdatedTime?: Date; + readonly startTime?: Date; +} + +// @public +export interface StepProperties { + stepType: "HealthCheck" | "Wait"; +} + +// @public (undocumented) +export type StepPropertiesUnion = StepProperties | HealthCheckStepProperties | WaitStepProperties; + +// @public +export type StepResource = TrackedResource & { + properties: StepPropertiesUnion; +}; + +// @public +export interface Steps { + createOrUpdate(resourceGroupName: string, stepName: string, options?: StepsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, stepName: string, options?: StepsDeleteOptionalParams): Promise; + get(resourceGroupName: string, stepName: string, options?: StepsGetOptionalParams): Promise; + list(resourceGroupName: string, options?: StepsListOptionalParams): Promise; +} + +// @public +export interface StepsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + stepInfo?: StepResource; +} + +// @public +export type StepsCreateOrUpdateResponse = StepResource; + +// @public +export interface StepsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface StepsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StepsGetResponse = StepResource; + +// @public +export interface StepsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StepsListResponse = StepResource[]; + +// @public +export type StepType = "Wait" | "HealthCheck"; + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// @public +export interface WaitStepAttributes { + duration: string; +} + +// @public +export type WaitStepProperties = StepProperties & { + stepType: "Wait"; + attributes: WaitStepAttributes; +}; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/deploymentmanager/arm-deploymentmanager/rollup.config.js b/sdk/deploymentmanager/arm-deploymentmanager/rollup.config.js index 281d71c3e84c..9be1955eb7f1 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/rollup.config.js +++ b/sdk/deploymentmanager/arm-deploymentmanager/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -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 /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/azureDeploymentManager.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-deploymentmanager.js", - format: "umd", - name: "Azure.ArmDeploymentmanager", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - 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({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + 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/deploymentmanager/arm-deploymentmanager/src/azureDeploymentManager.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/azureDeploymentManager.ts index d45c245be8ee..d32ad298bc1e 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/azureDeploymentManager.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/azureDeploymentManager.ts @@ -1,61 +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 { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { AzureDeploymentManagerContext } from "./azureDeploymentManagerContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + ServiceTopologiesImpl, + ServicesImpl, + ServiceUnitsImpl, + StepsImpl, + RolloutsImpl, + ArtifactSourcesImpl, + OperationsImpl +} from "./operations"; +import { + ServiceTopologies, + Services, + ServiceUnits, + Steps, + Rollouts, + ArtifactSources, + Operations +} from "./operationsInterfaces"; +import { AzureDeploymentManagerOptionalParams } from "./models"; - -class AzureDeploymentManager extends AzureDeploymentManagerContext { - // Operation groups - serviceTopologies: operations.ServiceTopologies; - services: operations.Services; - serviceUnits: operations.ServiceUnits; - steps: operations.Steps; - rollouts: operations.Rollouts; - artifactSources: operations.ArtifactSources; - operations: operations.Operations; +export class AzureDeploymentManager extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; /** * Initializes a new instance of the AzureDeploymentManager class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param [options] The parameter options + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. + * The subscription ID forms part of the URI for every service call. + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.AzureDeploymentManagerOptions) { - super(credentials, subscriptionId, options); - this.serviceTopologies = new operations.ServiceTopologies(this); - this.services = new operations.Services(this); - this.serviceUnits = new operations.ServiceUnits(this); - this.steps = new operations.Steps(this); - this.rollouts = new operations.Rollouts(this); - this.artifactSources = new operations.ArtifactSources(this); - this.operations = new operations.Operations(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: AzureDeploymentManagerOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AzureDeploymentManagerOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-deploymentmanager/4.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - AzureDeploymentManager, - AzureDeploymentManagerContext, - Models as AzureDeploymentManagerModels, - Mappers as AzureDeploymentManagerMappers -}; -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); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2019-11-01-preview"; + this.serviceTopologies = new ServiceTopologiesImpl(this); + this.services = new ServicesImpl(this); + this.serviceUnits = new ServiceUnitsImpl(this); + this.steps = new StepsImpl(this); + this.rollouts = new RolloutsImpl(this); + this.artifactSources = new ArtifactSourcesImpl(this); + this.operations = new OperationsImpl(this); + } + + serviceTopologies: ServiceTopologies; + services: Services; + serviceUnits: ServiceUnits; + steps: Steps; + rollouts: Rollouts; + artifactSources: ArtifactSources; + operations: Operations; +} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/azureDeploymentManagerContext.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/azureDeploymentManagerContext.ts deleted file mode 100644 index fb0ea8f030d6..000000000000 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/azureDeploymentManagerContext.ts +++ /dev/null @@ -1,69 +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 { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-deploymentmanager"; -const packageVersion = "3.1.0"; - -export class AzureDeploymentManagerContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the AzureDeploymentManager class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.AzureDeploymentManagerOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2019-11-01-preview'; - 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; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/index.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/index.ts new file mode 100644 index 000000000000..16a19737ae65 --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/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 "./models"; +export { AzureDeploymentManager } from "./azureDeploymentManager"; +export * from "./operationsInterfaces"; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/lroImpl.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * 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 { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/models/artifactSourcesMappers.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/models/artifactSourcesMappers.ts deleted file mode 100644 index 756b213e1eb6..000000000000 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/models/artifactSourcesMappers.ts +++ /dev/null @@ -1,52 +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 { - discriminators, - ApiKeyAuthentication, - ArtifactSource, - Authentication, - AzureEntityResource, - BaseResource, - CloudError, - HealthCheckStepAttributes, - HealthCheckStepProperties, - Identity, - Message, - PrePostStep, - ProxyResource, - Resource, - ResourceOperation, - RestHealthCheck, - RestHealthCheckStepAttributes, - RestRequest, - RestRequestAuthentication, - RestResponse, - RestResponseRegex, - Rollout, - RolloutIdentityAuthentication, - RolloutOperationInfo, - RolloutRequest, - RolloutStep, - SasAuthentication, - Service, - ServiceProperties, - ServiceResource, - ServiceTopologyResource, - ServiceUnit, - ServiceUnitArtifacts, - ServiceUnitProperties, - ServiceUnitResource, - StepGroup, - StepOperationInfo, - StepProperties, - StepResource, - TrackedResource, - WaitStepAttributes, - WaitStepProperties -} from "../models/mappers"; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/models/index.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/models/index.ts index 68206a72b062..88960c923c70 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/models/index.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/models/index.ts @@ -1,1463 +1,815 @@ /* - * 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. */ -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 }; - -/** - * Identity for the resource. - */ -export interface Identity { - /** - * The identity type. - */ - type: string; - /** - * The list of identities. - */ - identityIds: string[]; -} - -/** - * The properties that define a step. - */ -export interface PrePostStep { - /** - * The resource Id of the step to be run. - */ - stepId: string; -} - -/** - * The properties that define a Step group in a rollout. - */ -export interface StepGroup { - /** - * The name of the step group. - */ - name: string; - /** - * The list of step group names on which this step group depends on. - */ - dependsOnStepGroups?: string[]; - /** - * The list of steps to be run before deploying the target. - */ - preDeploymentSteps?: PrePostStep[]; - /** - * The resource Id of service unit to be deployed. The service unit should be from the service - * topology referenced in targetServiceTopologyId - */ - deploymentTargetId: string; - /** - * The list of steps to be run after deploying the target. - */ - postDeploymentSteps?: PrePostStep[]; +export type StepPropertiesUnion = + | StepProperties + | HealthCheckStepProperties + | WaitStepProperties; +export type AuthenticationUnion = Authentication | SasAuthentication; +export type HealthCheckStepAttributesUnion = + | HealthCheckStepAttributes + | RestHealthCheckStepAttributes; +export type RestRequestAuthenticationUnion = + | RestRequestAuthentication + | RolloutIdentityAuthentication + | ApiKeyAuthentication; + +/** The properties of a service topology. */ +export interface ServiceTopologyProperties { + /** The resource Id of the artifact source that contains the artifacts that can be referenced in the service units. */ + artifactSourceId?: string; } -/** - * An interface representing Resource. - */ -export interface Resource extends BaseResource { +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * Fully qualified resource Id for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * The name of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The type of the resource. Ex- Microsoft.Compute/virtualMachines or - * Microsoft.Storage/storageAccounts. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; } -/** - * The resource model definition for a ARM tracked top level resource - */ -export interface TrackedResource extends Resource { - /** - * Resource tags. - */ - tags?: { [propertyName: string]: string }; - /** - * The geo-location where the resource lives - */ - location: string; +/** The error information object. */ +export interface CloudError { + /** The properties that define the error. */ + error?: CloudErrorBody; } -/** - * Defines the PUT rollout request body. - */ -export interface RolloutRequest extends TrackedResource { - /** - * Identity for the resource. - */ - identity: Identity; - /** - * The version of the build being deployed. - */ - buildVersion: string; - /** - * The reference to the artifact source resource Id where the payload is located. - */ - artifactSourceId?: string; +/** Detailed error information of any failure. */ +export interface CloudErrorBody { /** - * The resource Id of the service topology from which service units are being referenced in step - * groups to be deployed. + * Error code string. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - targetServiceTopologyId: string; + readonly code?: string; /** - * The list of step groups that define the orchestration. + * Descriptive error information. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - stepGroups: StepGroup[]; + readonly message?: string; + /** Error target */ + target?: string; + /** More detailed error information. */ + details?: CloudErrorBody[]; } -/** - * The resource that defines the source location where the artifacts are located. - */ -export interface ArtifactSource extends TrackedResource { - /** - * The type of artifact source used. - */ - sourceType: string; - /** - * The path from the location that the 'authentication' property [say, a SAS URI to the blob - * container] refers to, to the location of the artifacts. This can be used to differentiate - * different versions of the artifacts. Or, different types of artifacts like binaries or - * templates. The location referenced by the authentication property concatenated with this - * optional artifactRoot path forms the artifact source location where the artifacts are expected - * to be found. - */ - artifactRoot?: string; - /** - * The authentication method to use to access the artifact source. - */ - authentication: AuthenticationUnion; +/** The properties of a service. */ +export interface ServiceProperties { + /** The Azure location to which the resources in the service belong to or should be deployed to. */ + targetLocation: string; + /** The subscription to which the resources in the service belong to or should be deployed to. */ + targetSubscriptionId: string; } -/** - * Contains the possible cases for Authentication. - */ -export type AuthenticationUnion = Authentication | SasAuthentication; +/** Defines the properties of a service unit. */ +export interface ServiceUnitProperties { + /** The Azure Resource Group to which the resources in the service unit belong to or should be deployed to. */ + targetResourceGroup: string; + /** Describes the type of ARM deployment to be performed on the resource. */ + deploymentMode: DeploymentMode; + /** The artifacts for the service unit. */ + artifacts?: ServiceUnitArtifacts; +} -/** - * Defines the authentication method and properties to access the artifacts. - */ -export interface Authentication { - /** - * Polymorphic Discriminator - */ - type: "Authentication"; +/** Defines the artifacts of a service unit. */ +export interface ServiceUnitArtifacts { + /** The full URI of the ARM template file with the SAS token. */ + templateUri?: string; + /** The full URI of the ARM parameters file with the SAS token. */ + parametersUri?: string; + /** The path to the ARM template file relative to the artifact source. */ + templateArtifactSourceRelativePath?: string; + /** The path to the ARM parameters file relative to the artifact source. */ + parametersArtifactSourceRelativePath?: string; } -/** - * The properties that define the source location where the artifacts are located. - */ -export interface ArtifactSourcePropertiesModel { - /** - * The type of artifact source used. - */ - sourceType: string; - /** - * The path from the location that the 'authentication' property [say, a SAS URI to the blob - * container] refers to, to the location of the artifacts. This can be used to differentiate - * different versions of the artifacts. Or, different types of artifacts like binaries or - * templates. The location referenced by the authentication property concatenated with this - * optional artifactRoot path forms the artifact source location where the artifacts are expected - * to be found. - */ - artifactRoot?: string; - /** - * The authentication method to use to access the artifact source. - */ - authentication: AuthenticationUnion; +/** The properties of a step resource. */ +export interface StepProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + stepType: "HealthCheck" | "Wait"; } -/** - * Defines the properties to access the artifacts using an Azure Storage SAS URI. - */ -export interface SasAuthentication { - /** - * Polymorphic Discriminator - */ - type: "Sas"; - /** - * The SAS URI to the Azure Storage blob container. Any offset from the root of the container to - * where the artifacts are located can be defined in the artifactRoot. - */ - sasUri: string; +/** Identity for the resource. */ +export interface Identity { + /** The identity type. */ + type: string; + /** The list of identities. */ + identityIds: string[]; } -/** - * Detailed error information of any failure. - */ -export interface CloudErrorBody { +/** The properties for defining a rollout. */ +export interface RolloutRequestProperties { + /** The version of the build being deployed. */ + buildVersion: string; + /** The reference to the artifact source resource Id where the payload is located. */ + artifactSourceId?: string; + /** The resource Id of the service topology from which service units are being referenced in step groups to be deployed. */ + targetServiceTopologyId: string; + /** The list of step groups that define the orchestration. */ + stepGroups: StepGroup[]; +} + +/** The properties that define a Step group in a rollout. */ +export interface StepGroup { + /** The name of the step group. */ + name: string; + /** The list of step group names on which this step group depends on. */ + dependsOnStepGroups?: string[]; + /** The list of steps to be run before deploying the target. */ + preDeploymentSteps?: PrePostStep[]; + /** The resource Id of service unit to be deployed. The service unit should be from the service topology referenced in targetServiceTopologyId */ + deploymentTargetId: string; + /** The list of steps to be run after deploying the target. */ + postDeploymentSteps?: PrePostStep[]; +} + +/** The properties that define a step. */ +export interface PrePostStep { + /** The resource Id of the step to be run. */ + stepId: string; +} + +/** Defines the properties of a rollout. */ +export interface RolloutPropertiesAutoGenerated { /** - * Error code string. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The current status of the rollout. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly status?: string; /** - * Descriptive error information. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The cardinal count of total number of retries performed on the rollout at a given time. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly totalRetryAttempts?: number; /** - * Error target + * Operational information of the rollout. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - target?: string; + readonly operationInfo?: RolloutOperationInfo; /** - * More detailed error information. + * The detailed information on the services being deployed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - details?: CloudErrorBody[]; + readonly services?: Service[]; } -/** - * Detailed runtime information of the rollout. - */ +/** Detailed runtime information of the rollout. */ export interface RolloutOperationInfo { /** - * The ordinal count of the number of retry attempts on a rollout. 0 if no retries of the rollout - * have been performed. If the rollout is updated with a PUT, this count is reset to 0. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ordinal count of the number of retry attempts on a rollout. 0 if no retries of the rollout have been performed. If the rollout is updated with a PUT, this count is reset to 0. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly retryAttempt?: number; /** - * True, if all steps that succeeded on the previous run/attempt were chosen to be skipped in - * this retry attempt. False, otherwise. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * True, if all steps that succeeded on the previous run/attempt were chosen to be skipped in this retry attempt. False, otherwise. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly skipSucceededOnRetry?: boolean; /** * The start time of the rollout in UTC. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly startTime?: Date; /** - * The start time of the rollout in UTC. This property will not be set if the rollout has not - * completed yet. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The start time of the rollout in UTC. This property will not be set if the rollout has not completed yet. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly endTime?: Date; /** * The detailed error information for any failure. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly error?: CloudErrorBody; } -/** - * Detailed information of a specific step run. - */ +/** Defines a specific step on a target service unit. */ +export interface RolloutStep { + /** Name of the step. */ + name: string; + /** + * Current state of the step. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** The step group the current step is part of. */ + stepGroup?: string; + /** + * Detailed information of specific action execution. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operationInfo?: StepOperationInfo; + /** + * Set of resource operations that were performed, if any, on an Azure resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceOperations?: ResourceOperation[]; + /** + * Supplementary informative messages during rollout. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly messages?: Message[]; +} + +/** Detailed information of a specific step run. */ export interface StepOperationInfo { /** * The name of the ARM deployment initiated as part of the step. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly deploymentName?: string; /** * Unique identifier to track the request for ARM-based resources. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly correlationId?: string; /** * Start time of the action in UTC. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly startTime?: Date; /** * End time of the action in UTC. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly endTime?: Date; /** * Last time in UTC this operation was updated. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastUpdatedTime?: Date; - /** - * The errors, if any, for the action. - */ + /** The errors, if any, for the action. */ error?: CloudErrorBody; } -/** - * Individual resource operation information. - */ +/** Individual resource operation information. */ export interface ResourceOperation { - /** - * Name of the resource as specified in the artifacts. For ARM resources, this is the name of the - * resource specified in the template. - */ + /** Name of the resource as specified in the artifacts. For ARM resources, this is the name of the resource specified in the template. */ resourceName?: string; /** - * Unique identifier of the operation. For ARM resources, this is the operationId obtained from - * ARM service. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Unique identifier of the operation. For ARM resources, this is the operationId obtained from ARM service. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly operationId?: string; - /** - * Type of the resource as specified in the artifacts. For ARM resources, this is the type of the - * resource specified in the template. - */ + /** Type of the resource as specified in the artifacts. For ARM resources, this is the type of the resource specified in the template. */ resourceType?: string; /** - * State of the resource deployment. For ARM resources, this is the current provisioning state of - * the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * State of the resource deployment. For ARM resources, this is the current provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; /** * Descriptive information of the resource operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly statusMessage?: string; /** * Http status code of the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly statusCode?: string; } -/** - * Supplementary contextual messages during a rollout. - */ +/** Supplementary contextual messages during a rollout. */ export interface Message { /** * Time in UTC this message was provided. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly timeStamp?: Date; /** * The actual message text. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly message?: string; } -/** - * Defines a specific step on a target service unit. - */ -export interface RolloutStep { - /** - * Name of the step. - */ - name: string; - /** - * Current state of the step. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: string; - /** - * The step group the current step is part of. - */ - stepGroup?: string; - /** - * Detailed information of specific action execution. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operationInfo?: StepOperationInfo; - /** - * Set of resource operations that were performed, if any, on an Azure resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resourceOperations?: ResourceOperation[]; - /** - * Supplementary informative messages during rollout. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly messages?: Message[]; +/** The properties that define the source location where the artifacts are located. */ +export interface ArtifactSourcePropertiesAutoGenerated { + /** The type of artifact source used. */ + sourceType: string; + /** The path from the location that the 'authentication' property [say, a SAS URI to the blob container] refers to, to the location of the artifacts. This can be used to differentiate different versions of the artifacts. Or, different types of artifacts like binaries or templates. The location referenced by the authentication property concatenated with this optional artifactRoot path forms the artifact source location where the artifacts are expected to be found. */ + artifactRoot?: string; + /** The authentication method to use to access the artifact source. */ + authentication: AuthenticationUnion; } -/** - * Defines the properties of a service unit. - */ -export interface ServiceUnitProperties { - /** - * The Azure Resource Group to which the resources in the service unit belong to or should be - * deployed to. - */ - targetResourceGroup: string; - /** - * Describes the type of ARM deployment to be performed on the resource. Possible values include: - * 'Incremental', 'Complete' - */ - deploymentMode: DeploymentMode; - /** - * The artifacts for the service unit. - */ - artifacts?: ServiceUnitArtifacts; +/** Defines the authentication method and properties to access the artifacts. */ +export interface Authentication { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "Sas"; } -/** - * Defines a service unit. - */ -export interface ServiceUnit extends ServiceUnitProperties { - /** - * Name of the service unit. - */ - name?: string; - /** - * Detailed step information, if present. - */ - steps?: RolloutStep[]; +/** The operations response. */ +export interface OperationsList { + /** The list of supported operations */ + value?: Operation; } -/** - * The properties of a service. - */ -export interface ServiceProperties { - /** - * The Azure location to which the resources in the service belong to or should be deployed to. - */ - targetLocation: string; - /** - * The subscription to which the resources in the service belong to or should be deployed to. - */ - targetSubscriptionId: string; +/** Represents an operation that can be performed on the service. */ +export interface Operation { + /** The name of the operation. */ + name?: string; + /** The display name of the operation. */ + display?: OperationDetail; + /** The origin of the operation. */ + origin?: string; + /** The properties of the operation. */ + properties?: Record; } -/** - * Defines a service. - */ -export interface Service extends ServiceProperties { - /** - * Name of the service. - */ - name?: string; - /** - * The detailed information about the units that make up the service. - */ - serviceUnits?: ServiceUnit[]; +/** The detail about an operation. */ +export interface OperationDetail { + /** The name of the provider that supports the operation. */ + provider?: string; + /** The resource type on which this operation can be performed. */ + resource?: string; + /** The name of the operation. */ + operation?: string; + /** The description of the operation. */ + description?: string; } -/** - * Defines the rollout. - */ -export interface Rollout extends TrackedResource { - /** - * Identity for the resource. - */ - identity?: Identity; - /** - * The version of the build being deployed. - */ - buildVersion: string; - /** - * The reference to the artifact source resource Id where the payload is located. - */ - artifactSourceId?: string; - /** - * The resource Id of the service topology from which service units are being referenced in step - * groups to be deployed. - */ - targetServiceTopologyId: string; - /** - * The list of step groups that define the orchestration. - */ - stepGroups: StepGroup[]; - /** - * The current status of the rollout. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: string; - /** - * The cardinal count of total number of retries performed on the rollout at a given time. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly totalRetryAttempts?: number; - /** - * Operational information of the rollout. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operationInfo?: RolloutOperationInfo; - /** - * The detailed information on the services being deployed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly services?: Service[]; +/** The attributes for the health check step. */ +export interface HealthCheckStepAttributes { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "REST"; + /** The duration in ISO 8601 format for which health check waits idly without any checks. */ + waitDuration?: string; + /** The duration in ISO 8601 format for which the health check waits for the resource to become healthy. Health check fails if it doesn't. Health check starts to enforce healthyStateDuration once resource becomes healthy. */ + maxElasticDuration?: string; + /** The duration in ISO 8601 format for which the resource is expected to be continuously healthy. If maxElasticDuration is specified, healthy state duration is enforced after the detection of first healthy signal. */ + healthyStateDuration: string; } -/** - * Defines the properties of a rollout. - */ -export interface RolloutPropertiesModel { - /** - * The current status of the rollout. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: string; - /** - * The cardinal count of total number of retries performed on the rollout at a given time. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly totalRetryAttempts?: number; - /** - * Operational information of the rollout. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operationInfo?: RolloutOperationInfo; - /** - * The detailed information on the services being deployed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly services?: Service[]; +/** A REST based health check */ +export interface RestHealthCheck { + /** A unique name for this check. */ + name: string; + /** The request to the health provider. */ + request: RestRequest; + /** The expected response from the health provider. If no expected response is provided, the default is to expect the received response to have an HTTP status code of 200 OK. */ + response?: RestResponse; } -/** - * The resource representation of a service topology. - */ -export interface ServiceTopologyResource extends TrackedResource { - /** - * The resource Id of the artifact source that contains the artifacts that can be referenced in - * the service units. - */ - artifactSourceId?: string; +/** The properties that make up a REST request */ +export interface RestRequest { + /** The HTTP method to use for the request. */ + method: RestRequestMethod; + /** The HTTP URI to use for the request. */ + uri: string; + /** The authentication information required in the request to the health provider. */ + authentication: RestRequestAuthenticationUnion; } -/** - * The properties of a service topology. - */ -export interface ServiceTopologyProperties { - /** - * The resource Id of the artifact source that contains the artifacts that can be referenced in - * the service units. - */ - artifactSourceId?: string; +/** The authentication information required in the REST health check request to the health provider. */ +export interface RestRequestAuthentication { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "RolloutIdentity" | "ApiKey"; } -/** - * The resource representation of a service in a service topology. - */ -export interface ServiceResource extends TrackedResource { - /** - * The Azure location to which the resources in the service belong to or should be deployed to. - */ - targetLocation: string; - /** - * The subscription to which the resources in the service belong to or should be deployed to. - */ - targetSubscriptionId: string; +/** The properties that make up the expected REST response */ +export interface RestResponse { + /** The HTTP status codes expected in a successful health check response. The response is expected to match one of the given status codes. If no expected status codes are provided, default expected status code is 200 OK. */ + successStatusCodes?: string[]; + /** The regular expressions to match the response content with. */ + regex?: RestResponseRegex; } -/** - * Represents the response of a service unit resource. - */ -export interface ServiceUnitResource extends TrackedResource { - /** - * The Azure Resource Group to which the resources in the service unit belong to or should be - * deployed to. - */ - targetResourceGroup: string; - /** - * Describes the type of ARM deployment to be performed on the resource. Possible values include: - * 'Incremental', 'Complete' - */ - deploymentMode: DeploymentMode; - /** - * The artifacts for the service unit. - */ - artifacts?: ServiceUnitArtifacts; +/** The regular expressions to match the response content with. */ +export interface RestResponseRegex { + /** The list of regular expressions. */ + matches?: string[]; + /** Indicates whether any or all of the expressions should match with the response content. */ + matchQuantifier?: RestMatchQuantifier; } -/** - * Defines the artifacts of a service unit. - */ -export interface ServiceUnitArtifacts { - /** - * The full URI of the ARM template file with the SAS token. - */ - templateUri?: string; - /** - * The full URI of the ARM parameters file with the SAS token. - */ - parametersUri?: string; - /** - * The path to the ARM template file relative to the artifact source. - */ - templateArtifactSourceRelativePath?: string; - /** - * The path to the ARM parameters file relative to the artifact source. - */ - parametersArtifactSourceRelativePath?: string; +/** The parameters for the wait step. */ +export interface WaitStepAttributes { + /** The duration in ISO 8601 format of how long the wait should be. */ + duration: string; } -/** - * The detail about an operation. - */ -export interface OperationDetail { - /** - * The name of the provider that supports the operation. - */ - provider?: string; - /** - * The resource type on which this operation can be performed. - */ - resource?: string; - /** - * The name of the operation. - */ - operation?: string; - /** - * The description of the operation. - */ - description?: string; -} +/** The properties that define the service topology. */ +export type ServiceTopologyResourceProperties = ServiceTopologyProperties & {}; -/** - * Represents an operation that can be performed on the service. - */ -export interface Operation { - /** - * The name of the operation. - */ +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** The properties that define a service in a service topology. */ +export type ServiceResourceProperties = ServiceProperties & {}; + +/** Defines a service. */ +export type Service = ServiceProperties & { + /** Name of the service. */ name?: string; - /** - * The display name of the operation. - */ - display?: OperationDetail; - /** - * The origin of the operation. - */ - origin?: string; - /** - * The properties of the operation. - */ - properties?: any; -} + /** The detailed information about the units that make up the service. */ + serviceUnits?: ServiceUnit[]; +}; -/** - * The operations response. - */ -export interface OperationsList { - /** - * The list of supported operations - */ - value?: Operation; -} +/** The properties that define the service unit. */ +export type ServiceUnitResourceProperties = ServiceUnitProperties & {}; -/** - * Contains the possible cases for StepProperties. - */ -export type StepPropertiesUnion = StepProperties | HealthCheckStepProperties | WaitStepProperties; +/** Defines a service unit. */ +export type ServiceUnit = ServiceUnitProperties & { + /** Name of the service unit. */ + name?: string; + /** Detailed step information, if present. */ + steps?: RolloutStep[]; +}; -/** - * The properties of a step resource. - */ -export interface StepProperties { - /** - * Polymorphic Discriminator - */ - stepType: "StepProperties"; -} +/** Defines the properties of a health check step. */ +export type HealthCheckStepProperties = StepProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + stepType: "HealthCheck"; + /** The health check step attributes */ + attributes: HealthCheckStepAttributesUnion; +}; -/** - * The resource representation of a rollout step. - */ -export interface StepResource extends TrackedResource { - /** - * The properties that define the step. - */ +/** Defines the properties of a Wait step. */ +export type WaitStepProperties = StepProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + stepType: "Wait"; + /** The Wait attributes */ + attributes: WaitStepAttributes; +}; + +/** The properties that define a rollout. */ +export type RolloutProperties = RolloutRequestProperties & + RolloutPropertiesAutoGenerated & {}; + +/** The properties that define the artifact source. */ +export type ArtifactSourceProperties = ArtifactSourcePropertiesAutoGenerated & {}; + +/** Defines the properties to access the artifacts using an Azure Storage SAS URI. */ +export type SasAuthentication = Authentication & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "Sas"; + /** The SAS URI to the Azure Storage blob container. Any offset from the root of the container to where the artifacts are located can be defined in the artifactRoot. */ + sasUri?: string; +}; + +/** Defines the REST health check step properties. */ +export type RestHealthCheckStepAttributes = HealthCheckStepAttributes & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "REST"; + /** The list of checks that form the health check step. */ + healthChecks?: RestHealthCheck[]; +}; + +/** RolloutIdentity uses the user-assigned managed identity authentication context specified in the Identity property during rollout creation. */ +export type RolloutIdentityAuthentication = RestRequestAuthentication & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "RolloutIdentity"; +}; + +/** ApiKey authentication gives a name and a value that can be included in either the request header or query parameters. */ +export type ApiKeyAuthentication = RestRequestAuthentication & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "ApiKey"; + /** The key name of the authentication key/value pair. */ + name: string; + /** The location of the authentication key/value pair in the request. */ + in: RestAuthLocation; + /** The value of the authentication key/value pair. */ + value: string; +}; + +/** The resource representation of a service topology. */ +export type ServiceTopologyResource = TrackedResource & { + /** The resource Id of the artifact source that contains the artifacts that can be referenced in the service units. */ + artifactSourceId?: string; +}; + +/** The resource representation of a service in a service topology. */ +export type ServiceResource = TrackedResource & { + /** The Azure location to which the resources in the service belong to or should be deployed to. */ + targetLocation: string; + /** The subscription to which the resources in the service belong to or should be deployed to. */ + targetSubscriptionId: string; +}; + +/** Represents the response of a service unit resource. */ +export type ServiceUnitResource = TrackedResource & { + /** The Azure Resource Group to which the resources in the service unit belong to or should be deployed to. */ + targetResourceGroup: string; + /** Describes the type of ARM deployment to be performed on the resource. */ + deploymentMode: DeploymentMode; + /** The artifacts for the service unit. */ + artifacts?: ServiceUnitArtifacts; +}; + +/** The resource representation of a rollout step. */ +export type StepResource = TrackedResource & { + /** The properties that define the step. */ properties: StepPropertiesUnion; -} +}; -/** - * Contains the possible cases for HealthCheckStepAttributes. - */ -export type HealthCheckStepAttributesUnion = HealthCheckStepAttributes | RestHealthCheckStepAttributes; +/** Defines the PUT rollout request body. */ +export type RolloutRequest = TrackedResource & { + /** Identity for the resource. */ + identity: Identity; + /** The version of the build being deployed. */ + buildVersion: string; + /** The reference to the artifact source resource Id where the payload is located. */ + artifactSourceId?: string; + /** The resource Id of the service topology from which service units are being referenced in step groups to be deployed. */ + targetServiceTopologyId: string; + /** The list of step groups that define the orchestration. */ + stepGroups: StepGroup[]; +}; -/** - * The attributes for the health check step. - */ -export interface HealthCheckStepAttributes { +/** Defines the rollout. */ +export type Rollout = TrackedResource & { + /** Identity for the resource. */ + identity?: Identity; + /** The version of the build being deployed. */ + buildVersion?: string; + /** The reference to the artifact source resource Id where the payload is located. */ + artifactSourceId?: string; + /** The resource Id of the service topology from which service units are being referenced in step groups to be deployed. */ + targetServiceTopologyId?: string; + /** The list of step groups that define the orchestration. */ + stepGroups?: StepGroup[]; /** - * Polymorphic Discriminator + * The current status of the rollout. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - type: "HealthCheckStepAttributes"; + readonly status?: string; /** - * The duration in ISO 8601 format for which health check waits idly without any checks. + * The cardinal count of total number of retries performed on the rollout at a given time. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - waitDuration?: string; + readonly totalRetryAttempts?: number; /** - * The duration in ISO 8601 format for which the health check waits for the resource to become - * healthy. Health check fails if it doesn't. Health check starts to enforce healthyStateDuration - * once resource becomes healthy. + * Operational information of the rollout. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - maxElasticDuration?: string; + readonly operationInfo?: RolloutOperationInfo; /** - * The duration in ISO 8601 format for which the resource is expected to be continuously healthy. - * If maxElasticDuration is specified, healthy state duration is enforced after the detection of - * first healthy signal. + * The detailed information on the services being deployed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - healthyStateDuration: string; + readonly services?: Service[]; +}; + +/** The resource that defines the source location where the artifacts are located. */ +export type ArtifactSource = TrackedResource & { + /** The type of artifact source used. */ + sourceType?: string; + /** The path from the location that the 'authentication' property [say, a SAS URI to the blob container] refers to, to the location of the artifacts. This can be used to differentiate different versions of the artifacts. Or, different types of artifacts like binaries or templates. The location referenced by the authentication property concatenated with this optional artifactRoot path forms the artifact source location where the artifacts are expected to be found. */ + artifactRoot?: string; + /** The authentication method to use to access the artifact source. */ + authentication?: AuthenticationUnion; +}; + +/** Defines headers for ServiceUnits_createOrUpdate operation. */ +export interface ServiceUnitsCreateOrUpdateHeaders { + /** Contains the status URL on which clients are expected to poll the status of the operation. */ + azureAsyncOperation?: string; } -/** - * Defines the properties of a health check step. - */ -export interface HealthCheckStepProperties { - /** - * Polymorphic Discriminator - */ - stepType: "HealthCheck"; - /** - * The health check step attributes - */ - attributes: HealthCheckStepAttributesUnion; +/** Defines headers for Rollouts_createOrUpdate operation. */ +export interface RolloutsCreateOrUpdateHeaders { + /** Contains the status URL on which clients are expected to poll the status of the operation. */ + azureAsyncOperation?: string; } -/** - * Contains the possible cases for RestRequestAuthentication. - */ -export type RestRequestAuthenticationUnion = RestRequestAuthentication | RolloutIdentityAuthentication | ApiKeyAuthentication; +/** Defines values for DeploymentMode. */ +export type DeploymentMode = "Incremental" | "Complete"; +/** Defines values for StepType. */ +export type StepType = "Wait" | "HealthCheck"; +/** Defines values for RestRequestMethod. */ +export type RestRequestMethod = "GET" | "POST"; +/** Defines values for RestAuthType. */ +export type RestAuthType = "ApiKey" | "RolloutIdentity"; +/** Defines values for RestMatchQuantifier. */ +export type RestMatchQuantifier = "All" | "Any"; +/** Defines values for RestAuthLocation. */ +export type RestAuthLocation = "Query" | "Header"; -/** - * The authentication information required in the REST health check request to the health provider. - */ -export interface RestRequestAuthentication { - /** - * Polymorphic Discriminator - */ - type: "RestRequestAuthentication"; -} +/** Optional parameters. */ +export interface ServiceTopologiesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * The properties that make up a REST request - */ -export interface RestRequest { - /** - * The HTTP method to use for the request. Possible values include: 'GET', 'POST' - */ - method: RestRequestMethod; - /** - * The HTTP URI to use for the request. - */ - uri: string; - /** - * The authentication information required in the request to the health provider. - */ - authentication: RestRequestAuthenticationUnion; -} +/** Contains response data for the createOrUpdate operation. */ +export type ServiceTopologiesCreateOrUpdateResponse = ServiceTopologyResource; -/** - * The regular expressions to match the response content with. - */ -export interface RestResponseRegex { - /** - * The list of regular expressions. - */ - matches?: string[]; - /** - * Indicates whether any or all of the expressions should match with the response content. - * Possible values include: 'All', 'Any' - */ - matchQuantifier?: RestMatchQuantifier; -} +/** Optional parameters. */ +export interface ServiceTopologiesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * The properties that make up the expected REST response - */ -export interface RestResponse { - /** - * The HTTP status codes expected in a successful health check response. The response is expected - * to match one of the given status codes. If no expected status codes are provided, default - * expected status code is 200 OK. - */ - successStatusCodes?: string[]; - /** - * The regular expressions to match the response content with. - */ - regex?: RestResponseRegex; -} +/** Contains response data for the get operation. */ +export type ServiceTopologiesGetResponse = ServiceTopologyResource; -/** - * A REST based health check - */ -export interface RestHealthCheck { - /** - * A unique name for this check. - */ - name: string; - /** - * The request to the health provider. - */ - request: RestRequest; - /** - * The expected response from the health provider. If no expected response is provided, the - * default is to expect the received response to have an HTTP status code of 200 OK. - */ - response?: RestResponse; -} +/** Optional parameters. */ +export interface ServiceTopologiesDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines the REST health check step properties. - */ -export interface RestHealthCheckStepAttributes { - /** - * Polymorphic Discriminator - */ - type: "REST"; - /** - * The duration in ISO 8601 format for which health check waits idly without any checks. - */ - waitDuration?: string; - /** - * The duration in ISO 8601 format for which the health check waits for the resource to become - * healthy. Health check fails if it doesn't. Health check starts to enforce healthyStateDuration - * once resource becomes healthy. - */ - maxElasticDuration?: string; - /** - * The duration in ISO 8601 format for which the resource is expected to be continuously healthy. - * If maxElasticDuration is specified, healthy state duration is enforced after the detection of - * first healthy signal. - */ - healthyStateDuration: string; - /** - * The list of checks that form the health check step. - */ - healthChecks: RestHealthCheck[]; -} +/** Optional parameters. */ +export interface ServiceTopologiesListOptionalParams + extends coreClient.OperationOptions {} -/** - * RolloutIdentity uses the user-assigned managed identity authentication context specified in the - * Identity property during rollout creation. - */ -export interface RolloutIdentityAuthentication { - /** - * Polymorphic Discriminator - */ - type: "RolloutIdentity"; -} +/** Contains response data for the list operation. */ +export type ServiceTopologiesListResponse = ServiceTopologyResource[]; -/** - * ApiKey authentication gives a name and a value that can be included in either the request header - * or query parameters. - */ -export interface ApiKeyAuthentication { - /** - * Polymorphic Discriminator - */ - type: "ApiKey"; - /** - * The key name of the authentication key/value pair. - */ - name: string; - /** - * The location of the authentication key/value pair in the request. Possible values include: - * 'Query', 'Header' - */ - inProperty: RestAuthLocation; - /** - * The value of the authentication key/value pair. - */ - value: string; -} +/** Optional parameters. */ +export interface ServicesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * The parameters for the wait step. - */ -export interface WaitStepAttributes { - /** - * The duration in ISO 8601 format of how long the wait should be. - */ - duration: string; -} +/** Contains response data for the createOrUpdate operation. */ +export type ServicesCreateOrUpdateResponse = ServiceResource; -/** - * Defines the properties of a Wait step. - */ -export interface WaitStepProperties { - /** - * Polymorphic Discriminator - */ - stepType: "Wait"; - /** - * The Wait attributes - */ - attributes: WaitStepAttributes; -} +/** Optional parameters. */ +export interface ServicesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * The resource model definition for a ARM proxy resource. It will have everything other than - * required location and tags - */ -export interface ProxyResource extends Resource { -} +/** Contains response data for the get operation. */ +export type ServicesGetResponse = ServiceResource; -/** - * The resource model definition for a Azure Resource Manager resource with an etag. - */ -export interface AzureEntityResource extends Resource { - /** - * Resource Etag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly etag?: string; -} +/** Optional parameters. */ +export interface ServicesDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Optional Parameters. - */ -export interface StepsCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * The step object. - */ - stepInfo?: StepResource; -} +/** Optional parameters. */ +export interface ServicesListOptionalParams + extends coreClient.OperationOptions {} -/** - * Optional Parameters. - */ -export interface RolloutsCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * Source rollout request object that defines the rollout. - */ - rolloutRequest?: RolloutRequest; -} +/** Contains response data for the list operation. */ +export type ServicesListResponse = ServiceResource[]; -/** - * Optional Parameters. - */ -export interface RolloutsGetOptionalParams extends msRest.RequestOptionsBase { - /** - * Rollout retry attempt ordinal to get the result of. If not specified, result of the latest - * attempt will be returned. - */ - retryAttempt?: number; +/** Optional parameters. */ +export interface ServiceUnitsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * Optional Parameters. - */ -export interface RolloutsRestartOptionalParams extends msRest.RequestOptionsBase { - /** - * If true, will skip all succeeded steps so far in the rollout. If false, will execute the - * entire rollout again regardless of the current state of individual resources. Defaults to - * false if not specified. - */ - skipSucceeded?: boolean; -} +/** Contains response data for the createOrUpdate operation. */ +export type ServiceUnitsCreateOrUpdateResponse = ServiceUnitsCreateOrUpdateHeaders & + ServiceUnitResource; -/** - * Optional Parameters. - */ -export interface RolloutsBeginCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * Source rollout request object that defines the rollout. - */ - rolloutRequest?: RolloutRequest; -} +/** Optional parameters. */ +export interface ServiceUnitsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Optional Parameters. - */ -export interface ArtifactSourcesCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * Source object that defines the resource. - */ - artifactSourceInfo?: ArtifactSource; -} +/** Contains response data for the get operation. */ +export type ServiceUnitsGetResponse = ServiceUnitResource; -/** - * An interface representing AzureDeploymentManagerOptions. - */ -export interface AzureDeploymentManagerOptions extends AzureServiceClientOptions { - baseUri?: string; -} +/** Optional parameters. */ +export interface ServiceUnitsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines headers for CreateOrUpdate operation. - */ -export interface ServiceUnitsCreateOrUpdateHeaders { - /** - * Contains the status URL on which clients are expected to poll the status of the operation. - */ - azureAsyncOperation: string; -} +/** Optional parameters. */ +export interface ServiceUnitsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines headers for CreateOrUpdate operation. - */ -export interface RolloutsCreateOrUpdateHeaders { - /** - * Contains the status URL on which clients are expected to poll the status of the operation. - */ - azureAsyncOperation: string; +/** Contains response data for the list operation. */ +export type ServiceUnitsListResponse = ServiceUnitResource[]; + +/** Optional parameters. */ +export interface StepsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** The step object. */ + stepInfo?: StepResource; } -/** - * Defines values for DeploymentMode. - * Possible values include: 'Incremental', 'Complete' - * @readonly - * @enum {string} - */ -export type DeploymentMode = 'Incremental' | 'Complete'; +/** Contains response data for the createOrUpdate operation. */ +export type StepsCreateOrUpdateResponse = StepResource; -/** - * Defines values for RestRequestMethod. - * Possible values include: 'GET', 'POST' - * @readonly - * @enum {string} - */ -export type RestRequestMethod = 'GET' | 'POST'; +/** Optional parameters. */ +export interface StepsGetOptionalParams extends coreClient.OperationOptions {} -/** - * Defines values for RestMatchQuantifier. - * Possible values include: 'All', 'Any' - * @readonly - * @enum {string} - */ -export type RestMatchQuantifier = 'All' | 'Any'; +/** Contains response data for the get operation. */ +export type StepsGetResponse = StepResource; -/** - * Defines values for RestAuthLocation. - * Possible values include: 'Query', 'Header' - * @readonly - * @enum {string} - */ -export type RestAuthLocation = 'Query' | 'Header'; +/** Optional parameters. */ +export interface StepsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ServiceTopologiesCreateOrUpdateResponse = ServiceTopologyResource & { - /** - * 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: ServiceTopologyResource; - }; -}; +/** Optional parameters. */ +export interface StepsListOptionalParams extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ServiceTopologiesGetResponse = ServiceTopologyResource & { - /** - * 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: ServiceTopologyResource; - }; -}; +/** Contains response data for the list operation. */ +export type StepsListResponse = StepResource[]; -/** - * Contains response data for the list operation. - */ -export type ServiceTopologiesListResponse = Array & { - /** - * 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: ServiceTopologyResource[]; - }; -}; +/** Optional parameters. */ +export interface RolloutsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Source rollout request object that defines the rollout. */ + rolloutRequest?: RolloutRequest; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ServicesCreateOrUpdateResponse = ServiceResource & { - /** - * 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: ServiceResource; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type RolloutsCreateOrUpdateResponse = RolloutsCreateOrUpdateHeaders & + RolloutRequest; -/** - * Contains response data for the get operation. - */ -export type ServicesGetResponse = ServiceResource & { - /** - * 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: ServiceResource; - }; -}; +/** Optional parameters. */ +export interface RolloutsGetOptionalParams extends coreClient.OperationOptions { + /** Rollout retry attempt ordinal to get the result of. If not specified, result of the latest attempt will be returned. */ + retryAttempt?: number; +} -/** - * Contains response data for the list operation. - */ -export type ServicesListResponse = Array & { - /** - * 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: ServiceResource[]; - }; -}; +/** Contains response data for the get operation. */ +export type RolloutsGetResponse = Rollout; -/** - * Contains response data for the createOrUpdate operation. - */ -export type ServiceUnitsCreateOrUpdateResponse = ServiceUnitResource & ServiceUnitsCreateOrUpdateHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: ServiceUnitsCreateOrUpdateHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServiceUnitResource; - }; -}; +/** Optional parameters. */ +export interface RolloutsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ServiceUnitsGetResponse = ServiceUnitResource & { - /** - * 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: ServiceUnitResource; - }; -}; +/** Optional parameters. */ +export interface RolloutsCancelOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type ServiceUnitsListResponse = Array & { - /** - * 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: ServiceUnitResource[]; - }; -}; +/** Contains response data for the cancel operation. */ +export type RolloutsCancelResponse = Rollout; -/** - * Contains response data for the createOrUpdate operation. - */ -export type StepsCreateOrUpdateResponse = StepResource & { - /** - * 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: StepResource; - }; -}; +/** Optional parameters. */ +export interface RolloutsRestartOptionalParams + extends coreClient.OperationOptions { + /** If true, will skip all succeeded steps so far in the rollout. If false, will execute the entire rollout again regardless of the current state of individual resources. Defaults to false if not specified. */ + skipSucceeded?: boolean; +} -/** - * Contains response data for the get operation. - */ -export type StepsGetResponse = StepResource & { - /** - * 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: StepResource; - }; -}; +/** Contains response data for the restart operation. */ +export type RolloutsRestartResponse = Rollout; -/** - * Contains response data for the list operation. - */ -export type StepsListResponse = Array & { - /** - * 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: StepResource[]; - }; -}; +/** Optional parameters. */ +export interface RolloutsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type RolloutsCreateOrUpdateResponse = RolloutRequest & RolloutsCreateOrUpdateHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: RolloutsCreateOrUpdateHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RolloutRequest; - }; -}; +/** Contains response data for the list operation. */ +export type RolloutsListResponse = Rollout[]; -/** - * Contains response data for the get operation. - */ -export type RolloutsGetResponse = Rollout & { - /** - * 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: Rollout; - }; -}; +/** Optional parameters. */ +export interface ArtifactSourcesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Source object that defines the resource. */ + artifactSourceInfo?: ArtifactSource; +} -/** - * Contains response data for the cancel operation. - */ -export type RolloutsCancelResponse = Rollout & { - /** - * 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: Rollout; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type ArtifactSourcesCreateOrUpdateResponse = ArtifactSource; -/** - * Contains response data for the restart operation. - */ -export type RolloutsRestartResponse = Rollout & { - /** - * 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: Rollout; - }; -}; +/** Optional parameters. */ +export interface ArtifactSourcesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type RolloutsListResponse = Array & { - /** - * 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: Rollout[]; - }; -}; +/** Contains response data for the get operation. */ +export type ArtifactSourcesGetResponse = ArtifactSource; -/** - * Contains response data for the createOrUpdate operation. - */ -export type ArtifactSourcesCreateOrUpdateResponse = ArtifactSource & { - /** - * 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: ArtifactSource; - }; -}; +/** Optional parameters. */ +export interface ArtifactSourcesDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ArtifactSourcesGetResponse = ArtifactSource & { - /** - * 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: ArtifactSource; - }; -}; +/** Optional parameters. */ +export interface ArtifactSourcesListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type ArtifactSourcesListResponse = Array & { - /** - * 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: ArtifactSource[]; - }; -}; +/** Contains response data for the list operation. */ +export type ArtifactSourcesListResponse = ArtifactSource[]; -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationsList & { - /** - * 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: OperationsList; - }; -}; +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationsList; + +/** Optional parameters. */ +export interface AzureDeploymentManagerOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/models/mappers.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/models/mappers.ts index 7ebb98108d77..81c13dafb409 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/models/mappers.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/models/mappers.ts @@ -1,114 +1,107 @@ /* - * 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. */ -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 ServiceTopologyProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceTopologyProperties", + modelProperties: { + artifactSourceId: { + serializedName: "artifactSourceId", + type: { + name: "String" + } + } + } + } +}; -export const Identity: msRest.CompositeMapper = { - serializedName: "Identity", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Identity", + className: "Resource", modelProperties: { - type: { - required: true, - serializedName: "type", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - identityIds: { - required: true, - serializedName: "identityIds", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" } } } } }; -export const PrePostStep: msRest.CompositeMapper = { - serializedName: "PrePostStep", +export const CloudError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrePostStep", + className: "CloudError", modelProperties: { - stepId: { - required: true, - serializedName: "stepId", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "CloudErrorBody" } } } } }; -export const StepGroup: msRest.CompositeMapper = { - serializedName: "StepGroup", +export const CloudErrorBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StepGroup", + className: "CloudErrorBody", modelProperties: { - name: { - required: true, - serializedName: "name", + code: { + serializedName: "code", + readOnly: true, type: { name: "String" } }, - dependsOnStepGroups: { - serializedName: "dependsOnStepGroups", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - preDeploymentSteps: { - serializedName: "preDeploymentSteps", + message: { + serializedName: "message", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrePostStep" - } - } + name: "String" } }, - deploymentTargetId: { - required: true, - serializedName: "deploymentTargetId", + target: { + serializedName: "target", type: { name: "String" } }, - postDeploymentSteps: { - serializedName: "postDeploymentSteps", + details: { + serializedName: "details", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PrePostStep" + className: "CloudErrorBody" } } } @@ -117,29 +110,21 @@ export const StepGroup: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const ServiceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ServiceProperties", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", + targetLocation: { + serializedName: "targetLocation", + required: true, type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + targetSubscriptionId: { + serializedName: "targetSubscriptionId", + required: true, type: { name: "String" } @@ -148,226 +133,271 @@ export const Resource: msRest.CompositeMapper = { } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const ServiceUnitProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "ServiceUnitProperties", modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", + targetResourceGroup: { + serializedName: "targetResourceGroup", + required: true, type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } }, - location: { + deploymentMode: { + serializedName: "deploymentMode", required: true, - serializedName: "location", type: { - name: "String" + name: "Enum", + allowedValues: ["Incremental", "Complete"] + } + }, + artifacts: { + serializedName: "artifacts", + type: { + name: "Composite", + className: "ServiceUnitArtifacts" } } } } }; -export const RolloutRequest: msRest.CompositeMapper = { - serializedName: "RolloutRequest", +export const ServiceUnitArtifacts: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RolloutRequest", + className: "ServiceUnitArtifacts", modelProperties: { - ...TrackedResource.type.modelProperties, - identity: { - required: true, - serializedName: "identity", - type: { - name: "Composite", - className: "Identity" - } - }, - buildVersion: { - required: true, - serializedName: "properties.buildVersion", + templateUri: { + serializedName: "templateUri", type: { name: "String" } }, - artifactSourceId: { - serializedName: "properties.artifactSourceId", + parametersUri: { + serializedName: "parametersUri", type: { name: "String" } }, - targetServiceTopologyId: { - required: true, - serializedName: "properties.targetServiceTopologyId", + templateArtifactSourceRelativePath: { + serializedName: "templateArtifactSourceRelativePath", type: { name: "String" } }, - stepGroups: { - required: true, - serializedName: "properties.stepGroups", + parametersArtifactSourceRelativePath: { + serializedName: "parametersArtifactSourceRelativePath", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "StepGroup" - } - } + name: "String" } } } } }; -export const ArtifactSource: msRest.CompositeMapper = { - serializedName: "ArtifactSource", +export const StepProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ArtifactSource", + className: "StepProperties", + uberParent: "StepProperties", + polymorphicDiscriminator: { + serializedName: "stepType", + clientName: "stepType" + }, modelProperties: { - ...TrackedResource.type.modelProperties, - sourceType: { - required: true, - serializedName: "properties.sourceType", - type: { - name: "String" - } - }, - artifactRoot: { - serializedName: "properties.artifactRoot", - type: { - name: "String" - } - }, - authentication: { + stepType: { + serializedName: "stepType", required: true, - serializedName: "properties.authentication", type: { - name: "Composite", - className: "Authentication" + name: "Enum", + allowedValues: ["Wait", "HealthCheck"] } } } } }; -export const Authentication: msRest.CompositeMapper = { - serializedName: "Authentication", +export const Identity: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: { - serializedName: "type", - clientName: "type" - }, - uberParent: "Authentication", - className: "Authentication", + className: "Identity", modelProperties: { type: { - required: true, serializedName: "type", + required: true, type: { name: "String" } + }, + identityIds: { + serializedName: "identityIds", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } }; -export const ArtifactSourcePropertiesModel: msRest.CompositeMapper = { - serializedName: "ArtifactSourceProperties", +export const RolloutRequestProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ArtifactSourcePropertiesModel", + className: "RolloutRequestProperties", modelProperties: { - sourceType: { + buildVersion: { + serializedName: "buildVersion", required: true, - serializedName: "sourceType", type: { name: "String" } }, - artifactRoot: { - serializedName: "artifactRoot", + artifactSourceId: { + serializedName: "artifactSourceId", type: { name: "String" } }, - authentication: { + targetServiceTopologyId: { + serializedName: "targetServiceTopologyId", required: true, - serializedName: "authentication", type: { - name: "Composite", - className: "Authentication" + name: "String" + } + }, + stepGroups: { + serializedName: "stepGroups", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StepGroup" + } + } } } } } }; -export const SasAuthentication: msRest.CompositeMapper = { - serializedName: "Sas", +export const StepGroup: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: Authentication.type.polymorphicDiscriminator, - uberParent: "Authentication", - className: "SasAuthentication", + className: "StepGroup", modelProperties: { - ...Authentication.type.modelProperties, - sasUri: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + dependsOnStepGroups: { + serializedName: "dependsOnStepGroups", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + preDeploymentSteps: { + serializedName: "preDeploymentSteps", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrePostStep" + } + } + } + }, + deploymentTargetId: { + serializedName: "deploymentTargetId", required: true, - serializedName: "properties.sasUri", type: { name: "String" } + }, + postDeploymentSteps: { + serializedName: "postDeploymentSteps", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrePostStep" + } + } + } } } } }; -export const CloudErrorBody: msRest.CompositeMapper = { - serializedName: "CloudErrorBody", +export const PrePostStep: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudErrorBody", + className: "PrePostStep", modelProperties: { - code: { + stepId: { + serializedName: "stepId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const RolloutPropertiesAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RolloutPropertiesAutoGenerated", + modelProperties: { + status: { + serializedName: "status", readOnly: true, - serializedName: "code", type: { name: "String" } }, - message: { + totalRetryAttempts: { + serializedName: "totalRetryAttempts", readOnly: true, - serializedName: "message", type: { - name: "String" + name: "Number" } }, - target: { - serializedName: "target", + operationInfo: { + serializedName: "operationInfo", type: { - name: "String" + name: "Composite", + className: "RolloutOperationInfo" } }, - details: { - serializedName: "details", + services: { + serializedName: "services", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "CloudErrorBody" + className: "Service" } } } @@ -376,42 +406,40 @@ export const CloudErrorBody: msRest.CompositeMapper = { } }; -export const RolloutOperationInfo: msRest.CompositeMapper = { - serializedName: "RolloutOperationInfo", +export const RolloutOperationInfo: coreClient.CompositeMapper = { type: { name: "Composite", className: "RolloutOperationInfo", modelProperties: { retryAttempt: { - readOnly: true, serializedName: "retryAttempt", + readOnly: true, type: { name: "Number" } }, skipSucceededOnRetry: { - readOnly: true, serializedName: "skipSucceededOnRetry", + readOnly: true, type: { name: "Boolean" } }, startTime: { - readOnly: true, serializedName: "startTime", + readOnly: true, type: { name: "DateTime" } }, endTime: { - readOnly: true, serializedName: "endTime", + readOnly: true, type: { name: "DateTime" } }, error: { - readOnly: true, serializedName: "error", type: { name: "Composite", @@ -422,43 +450,104 @@ export const RolloutOperationInfo: msRest.CompositeMapper = { } }; -export const StepOperationInfo: msRest.CompositeMapper = { - serializedName: "StepOperationInfo", +export const RolloutStep: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RolloutStep", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + stepGroup: { + serializedName: "stepGroup", + type: { + name: "String" + } + }, + operationInfo: { + serializedName: "operationInfo", + type: { + name: "Composite", + className: "StepOperationInfo" + } + }, + resourceOperations: { + serializedName: "resourceOperations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceOperation" + } + } + } + }, + messages: { + serializedName: "messages", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Message" + } + } + } + } + } + } +}; + +export const StepOperationInfo: coreClient.CompositeMapper = { type: { name: "Composite", className: "StepOperationInfo", modelProperties: { deploymentName: { - readOnly: true, serializedName: "deploymentName", + readOnly: true, type: { name: "String" } }, correlationId: { - readOnly: true, serializedName: "correlationId", + readOnly: true, type: { name: "String" } }, startTime: { - readOnly: true, serializedName: "startTime", + readOnly: true, type: { name: "DateTime" } }, endTime: { - readOnly: true, serializedName: "endTime", + readOnly: true, type: { name: "DateTime" } }, lastUpdatedTime: { - readOnly: true, serializedName: "lastUpdatedTime", + readOnly: true, type: { name: "DateTime" } @@ -474,8 +563,7 @@ export const StepOperationInfo: msRest.CompositeMapper = { } }; -export const ResourceOperation: msRest.CompositeMapper = { - serializedName: "ResourceOperation", +export const ResourceOperation: coreClient.CompositeMapper = { type: { name: "Composite", className: "ResourceOperation", @@ -487,8 +575,8 @@ export const ResourceOperation: msRest.CompositeMapper = { } }, operationId: { - readOnly: true, serializedName: "operationId", + readOnly: true, type: { name: "String" } @@ -500,22 +588,22 @@ export const ResourceOperation: msRest.CompositeMapper = { } }, provisioningState: { - readOnly: true, serializedName: "provisioningState", + readOnly: true, type: { name: "String" } }, statusMessage: { - readOnly: true, serializedName: "statusMessage", + readOnly: true, type: { name: "String" } }, statusCode: { - readOnly: true, serializedName: "statusCode", + readOnly: true, type: { name: "String" } @@ -524,22 +612,21 @@ export const ResourceOperation: msRest.CompositeMapper = { } }; -export const Message: msRest.CompositeMapper = { - serializedName: "Message", +export const Message: coreClient.CompositeMapper = { type: { name: "Composite", className: "Message", modelProperties: { timeStamp: { - readOnly: true, serializedName: "timeStamp", + readOnly: true, type: { name: "DateTime" } }, message: { - readOnly: true, serializedName: "message", + readOnly: true, type: { name: "String" } @@ -548,472 +635,359 @@ export const Message: msRest.CompositeMapper = { } }; -export const RolloutStep: msRest.CompositeMapper = { - serializedName: "RolloutStep", +export const ArtifactSourcePropertiesAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RolloutStep", + className: "ArtifactSourcePropertiesAutoGenerated", modelProperties: { - name: { + sourceType: { + serializedName: "sourceType", required: true, - serializedName: "name", - type: { - name: "String" - } - }, - status: { - readOnly: true, - serializedName: "status", type: { name: "String" } }, - stepGroup: { - serializedName: "stepGroup", + artifactRoot: { + serializedName: "artifactRoot", type: { name: "String" } }, - operationInfo: { - readOnly: true, - serializedName: "operationInfo", + authentication: { + serializedName: "authentication", type: { name: "Composite", - className: "StepOperationInfo" - } - }, - resourceOperations: { - readOnly: true, - serializedName: "resourceOperations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceOperation" - } - } - } - }, - messages: { - readOnly: true, - serializedName: "messages", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Message" - } - } + className: "Authentication" } } } } }; -export const ServiceUnitProperties: msRest.CompositeMapper = { - serializedName: "ServiceUnitProperties", +export const Authentication: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceUnitProperties", + className: "Authentication", + uberParent: "Authentication", + polymorphicDiscriminator: { + serializedName: "type", + clientName: "type" + }, modelProperties: { - targetResourceGroup: { + type: { + serializedName: "type", required: true, - serializedName: "targetResourceGroup", type: { name: "String" } - }, - deploymentMode: { - required: true, - serializedName: "deploymentMode", - type: { - name: "Enum", - allowedValues: [ - "Incremental", - "Complete" - ] - } - }, - artifacts: { - serializedName: "artifacts", - type: { - name: "Composite", - className: "ServiceUnitArtifacts" - } } } } }; -export const ServiceUnit: msRest.CompositeMapper = { - serializedName: "ServiceUnit", +export const OperationsList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceUnit", + className: "OperationsList", modelProperties: { - ...ServiceUnitProperties.type.modelProperties, - name: { - serializedName: "name", - type: { - name: "String" - } - }, - steps: { - serializedName: "steps", + value: { + serializedName: "value", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RolloutStep" - } - } + name: "Composite", + className: "Operation" } } } } }; -export const ServiceProperties: msRest.CompositeMapper = { - serializedName: "ServiceProperties", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceProperties", + className: "Operation", modelProperties: { - targetLocation: { - required: true, - serializedName: "targetLocation", + name: { + serializedName: "name", type: { name: "String" } }, - targetSubscriptionId: { - required: true, - serializedName: "targetSubscriptionId", + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDetail" + } + }, + origin: { + serializedName: "origin", type: { name: "String" } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } } } } }; -export const Service: msRest.CompositeMapper = { - serializedName: "Service", +export const OperationDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Service", + className: "OperationDetail", modelProperties: { - ...ServiceProperties.type.modelProperties, - name: { - serializedName: "name", + provider: { + serializedName: "provider", type: { name: "String" } }, - serviceUnits: { - serializedName: "serviceUnits", + resource: { + serializedName: "resource", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ServiceUnit" - } - } + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" } } } } }; -export const Rollout: msRest.CompositeMapper = { - serializedName: "Rollout", +export const HealthCheckStepAttributes: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Rollout", + className: "HealthCheckStepAttributes", + uberParent: "HealthCheckStepAttributes", + polymorphicDiscriminator: { + serializedName: "type", + clientName: "type" + }, modelProperties: { - ...TrackedResource.type.modelProperties, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity" - } - }, - buildVersion: { + type: { + serializedName: "type", required: true, - serializedName: "properties.buildVersion", type: { name: "String" } }, - artifactSourceId: { - serializedName: "properties.artifactSourceId", + waitDuration: { + serializedName: "waitDuration", type: { name: "String" } }, - targetServiceTopologyId: { - required: true, - serializedName: "properties.targetServiceTopologyId", + maxElasticDuration: { + serializedName: "maxElasticDuration", type: { name: "String" } }, - stepGroups: { + healthyStateDuration: { + serializedName: "healthyStateDuration", required: true, - serializedName: "properties.stepGroups", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "StepGroup" - } - } - } - }, - status: { - readOnly: true, - serializedName: "properties.status", type: { name: "String" } - }, - totalRetryAttempts: { - readOnly: true, - serializedName: "properties.totalRetryAttempts", + } + } + } +}; + +export const RestHealthCheck: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestHealthCheck", + modelProperties: { + name: { + serializedName: "name", + required: true, type: { - name: "Number" + name: "String" } }, - operationInfo: { - readOnly: true, - serializedName: "properties.operationInfo", + request: { + serializedName: "request", type: { name: "Composite", - className: "RolloutOperationInfo" + className: "RestRequest" } }, - services: { - readOnly: true, - serializedName: "properties.services", + response: { + serializedName: "response", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Service" - } - } + name: "Composite", + className: "RestResponse" } } } } }; -export const RolloutPropertiesModel: msRest.CompositeMapper = { - serializedName: "RolloutProperties", +export const RestRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RolloutPropertiesModel", + className: "RestRequest", modelProperties: { - status: { - readOnly: true, - serializedName: "status", + method: { + serializedName: "method", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["GET", "POST"] } }, - totalRetryAttempts: { - readOnly: true, - serializedName: "totalRetryAttempts", + uri: { + serializedName: "uri", + required: true, type: { - name: "Number" + name: "String" } }, - operationInfo: { - readOnly: true, - serializedName: "operationInfo", + authentication: { + serializedName: "authentication", type: { name: "Composite", - className: "RolloutOperationInfo" - } - }, - services: { - readOnly: true, - serializedName: "services", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Service" - } - } + className: "RestRequestAuthentication" } } } } }; -export const ServiceTopologyResource: msRest.CompositeMapper = { - serializedName: "ServiceTopologyResource", +export const RestRequestAuthentication: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceTopologyResource", + className: "RestRequestAuthentication", + uberParent: "RestRequestAuthentication", + polymorphicDiscriminator: { + serializedName: "type", + clientName: "type" + }, modelProperties: { - ...TrackedResource.type.modelProperties, - artifactSourceId: { - serializedName: "properties.artifactSourceId", + type: { + serializedName: "type", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["ApiKey", "RolloutIdentity"] } } } } }; -export const ServiceTopologyProperties: msRest.CompositeMapper = { - serializedName: "ServiceTopologyProperties", +export const RestResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceTopologyProperties", + className: "RestResponse", modelProperties: { - artifactSourceId: { - serializedName: "artifactSourceId", + successStatusCodes: { + serializedName: "successStatusCodes", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + regex: { + serializedName: "regex", + type: { + name: "Composite", + className: "RestResponseRegex" } } } } }; -export const ServiceResource: msRest.CompositeMapper = { - serializedName: "ServiceResource", +export const RestResponseRegex: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceResource", + className: "RestResponseRegex", modelProperties: { - ...TrackedResource.type.modelProperties, - targetLocation: { - required: true, - serializedName: "properties.targetLocation", + matches: { + serializedName: "matches", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - targetSubscriptionId: { - required: true, - serializedName: "properties.targetSubscriptionId", + matchQuantifier: { + serializedName: "matchQuantifier", type: { - name: "String" + name: "Enum", + allowedValues: ["All", "Any"] } } } } }; -export const ServiceUnitResource: msRest.CompositeMapper = { - serializedName: "ServiceUnitResource", +export const WaitStepAttributes: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceUnitResource", + className: "WaitStepAttributes", modelProperties: { - ...TrackedResource.type.modelProperties, - targetResourceGroup: { + duration: { + serializedName: "duration", required: true, - serializedName: "properties.targetResourceGroup", type: { name: "String" } - }, - deploymentMode: { - required: true, - serializedName: "properties.deploymentMode", - type: { - name: "Enum", - allowedValues: [ - "Incremental", - "Complete" - ] - } - }, - artifacts: { - serializedName: "properties.artifacts", - type: { - name: "Composite", - className: "ServiceUnitArtifacts" - } } } } }; -export const ServiceUnitArtifacts: msRest.CompositeMapper = { - serializedName: "ServiceUnitArtifacts", +export const ServiceTopologyResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceUnitArtifacts", + className: "ServiceTopologyResourceProperties", modelProperties: { - templateUri: { - serializedName: "templateUri", - type: { - name: "String" - } - }, - parametersUri: { - serializedName: "parametersUri", - type: { - name: "String" - } - }, - templateArtifactSourceRelativePath: { - serializedName: "templateArtifactSourceRelativePath", - type: { - name: "String" - } - }, - parametersArtifactSourceRelativePath: { - serializedName: "parametersArtifactSourceRelativePath", - type: { - name: "String" - } - } + ...ServiceTopologyProperties.type.modelProperties } } }; -export const OperationDetail: msRest.CompositeMapper = { - serializedName: "OperationDetail", +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDetail", + className: "TrackedResource", modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - description: { - serializedName: "description", + location: { + serializedName: "location", + required: true, type: { name: "String" } @@ -1022,151 +996,92 @@ export const OperationDetail: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const ServiceResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "ServiceResourceProperties", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDetail" - } - }, - origin: { - serializedName: "origin", - type: { - name: "String" - } - }, - properties: { - serializedName: "properties", - type: { - name: "Object" - } - } + ...ServiceProperties.type.modelProperties } } }; -export const OperationsList: msRest.CompositeMapper = { - serializedName: "OperationsList", +export const Service: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationsList", + className: "Service", modelProperties: { - value: { - serializedName: "value", + ...ServiceProperties.type.modelProperties, + name: { + serializedName: "name", type: { - name: "Composite", - className: "Operation" + name: "String" } - } - } - } -}; - -export const StepProperties: msRest.CompositeMapper = { - serializedName: "StepProperties", - type: { - name: "Composite", - polymorphicDiscriminator: { - serializedName: "stepType", - clientName: "stepType" - }, - uberParent: "StepProperties", - className: "StepProperties", - modelProperties: { - stepType: { - required: true, - serializedName: "stepType", + }, + serviceUnits: { + serializedName: "serviceUnits", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServiceUnit" + } + } } } } } }; -export const StepResource: msRest.CompositeMapper = { - serializedName: "StepResource", +export const ServiceUnitResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StepResource", + className: "ServiceUnitResourceProperties", modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - required: true, - serializedName: "properties", - type: { - name: "Composite", - className: "StepProperties" - } - } + ...ServiceUnitProperties.type.modelProperties } } }; -export const HealthCheckStepAttributes: msRest.CompositeMapper = { - serializedName: "HealthCheckStepAttributes", +export const ServiceUnit: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: { - serializedName: "type", - clientName: "type" - }, - uberParent: "HealthCheckStepAttributes", - className: "HealthCheckStepAttributes", + className: "ServiceUnit", modelProperties: { - waitDuration: { - serializedName: "waitDuration", - type: { - name: "String" - } - }, - maxElasticDuration: { - serializedName: "maxElasticDuration", - type: { - name: "String" - } - }, - healthyStateDuration: { - required: true, - serializedName: "healthyStateDuration", + ...ServiceUnitProperties.type.modelProperties, + name: { + serializedName: "name", type: { name: "String" } }, - type: { - required: true, - serializedName: "type", + steps: { + serializedName: "steps", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RolloutStep" + } + } } } } } }; -export const HealthCheckStepProperties: msRest.CompositeMapper = { +export const HealthCheckStepProperties: coreClient.CompositeMapper = { serializedName: "HealthCheck", type: { name: "Composite", - polymorphicDiscriminator: StepProperties.type.polymorphicDiscriminator, - uberParent: "StepProperties", className: "HealthCheckStepProperties", + uberParent: "StepProperties", + polymorphicDiscriminator: StepProperties.type.polymorphicDiscriminator, modelProperties: { ...StepProperties.type.modelProperties, attributes: { - required: true, serializedName: "attributes", type: { name: "Composite", @@ -1177,166 +1092,77 @@ export const HealthCheckStepProperties: msRest.CompositeMapper = { } }; -export const RestRequestAuthentication: msRest.CompositeMapper = { - serializedName: "RestRequestAuthentication", - type: { - name: "Composite", - polymorphicDiscriminator: { - serializedName: "type", - clientName: "type" - }, - uberParent: "RestRequestAuthentication", - className: "RestRequestAuthentication", - modelProperties: { - type: { - required: true, - serializedName: "type", - type: { - name: "String" - } - } - } - } -}; - -export const RestRequest: msRest.CompositeMapper = { - serializedName: "RestRequest", +export const WaitStepProperties: coreClient.CompositeMapper = { + serializedName: "Wait", type: { name: "Composite", - className: "RestRequest", + className: "WaitStepProperties", + uberParent: "StepProperties", + polymorphicDiscriminator: StepProperties.type.polymorphicDiscriminator, modelProperties: { - method: { - required: true, - serializedName: "method", - type: { - name: "Enum", - allowedValues: [ - "GET", - "POST" - ] - } - }, - uri: { - required: true, - serializedName: "uri", - type: { - name: "String" - } - }, - authentication: { - required: true, - serializedName: "authentication", + ...StepProperties.type.modelProperties, + attributes: { + serializedName: "attributes", type: { name: "Composite", - className: "RestRequestAuthentication" + className: "WaitStepAttributes" } } } } }; -export const RestResponseRegex: msRest.CompositeMapper = { - serializedName: "RestResponse_regex", +export const RolloutProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestResponseRegex", + className: "RolloutProperties", modelProperties: { - matches: { - serializedName: "matches", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - matchQuantifier: { - serializedName: "matchQuantifier", - type: { - name: "Enum", - allowedValues: [ - "All", - "Any" - ] - } - } + ...RolloutRequestProperties.type.modelProperties, + ...RolloutPropertiesAutoGenerated.type.modelProperties } - } -}; - -export const RestResponse: msRest.CompositeMapper = { - serializedName: "RestResponse", - type: { - name: "Composite", - className: "RestResponse", - modelProperties: { - successStatusCodes: { - serializedName: "successStatusCodes", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - regex: { - serializedName: "regex", - type: { - name: "Composite", - className: "RestResponseRegex" - } - } + } +}; + +export const ArtifactSourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ArtifactSourceProperties", + modelProperties: { + ...ArtifactSourcePropertiesAutoGenerated.type.modelProperties } } }; -export const RestHealthCheck: msRest.CompositeMapper = { - serializedName: "RestHealthCheck", +export const SasAuthentication: coreClient.CompositeMapper = { + serializedName: "Sas", type: { name: "Composite", - className: "RestHealthCheck", + className: "SasAuthentication", + uberParent: "Authentication", + polymorphicDiscriminator: Authentication.type.polymorphicDiscriminator, modelProperties: { - name: { - required: true, - serializedName: "name", + ...Authentication.type.modelProperties, + sasUri: { + serializedName: "properties.sasUri", type: { name: "String" } - }, - request: { - required: true, - serializedName: "request", - type: { - name: "Composite", - className: "RestRequest" - } - }, - response: { - serializedName: "response", - type: { - name: "Composite", - className: "RestResponse" - } } } } }; -export const RestHealthCheckStepAttributes: msRest.CompositeMapper = { +export const RestHealthCheckStepAttributes: coreClient.CompositeMapper = { serializedName: "REST", type: { name: "Composite", - polymorphicDiscriminator: HealthCheckStepAttributes.type.polymorphicDiscriminator, - uberParent: "HealthCheckStepAttributes", className: "RestHealthCheckStepAttributes", + uberParent: "HealthCheckStepAttributes", + polymorphicDiscriminator: + HealthCheckStepAttributes.type.polymorphicDiscriminator, modelProperties: { ...HealthCheckStepAttributes.type.modelProperties, healthChecks: { - required: true, serializedName: "properties.healthChecks", type: { name: "Sequence", @@ -1352,49 +1178,48 @@ export const RestHealthCheckStepAttributes: msRest.CompositeMapper = { } }; -export const RolloutIdentityAuthentication: msRest.CompositeMapper = { +export const RolloutIdentityAuthentication: coreClient.CompositeMapper = { serializedName: "RolloutIdentity", type: { name: "Composite", - polymorphicDiscriminator: RestRequestAuthentication.type.polymorphicDiscriminator, - uberParent: "RestRequestAuthentication", className: "RolloutIdentityAuthentication", + uberParent: "RestRequestAuthentication", + polymorphicDiscriminator: + RestRequestAuthentication.type.polymorphicDiscriminator, modelProperties: { ...RestRequestAuthentication.type.modelProperties } } }; -export const ApiKeyAuthentication: msRest.CompositeMapper = { +export const ApiKeyAuthentication: coreClient.CompositeMapper = { serializedName: "ApiKey", type: { name: "Composite", - polymorphicDiscriminator: RestRequestAuthentication.type.polymorphicDiscriminator, - uberParent: "RestRequestAuthentication", className: "ApiKeyAuthentication", + uberParent: "RestRequestAuthentication", + polymorphicDiscriminator: + RestRequestAuthentication.type.polymorphicDiscriminator, modelProperties: { ...RestRequestAuthentication.type.modelProperties, name: { - required: true, serializedName: "name", + required: true, type: { name: "String" } }, - inProperty: { - required: true, + in: { serializedName: "in", + required: true, type: { name: "Enum", - allowedValues: [ - "Query", - "Header" - ] + allowedValues: ["Query", "Header"] } }, value: { - required: true, serializedName: "value", + required: true, type: { name: "String" } @@ -1403,15 +1228,38 @@ export const ApiKeyAuthentication: msRest.CompositeMapper = { } }; -export const WaitStepAttributes: msRest.CompositeMapper = { - serializedName: "WaitStepAttributes", +export const ServiceTopologyResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WaitStepAttributes", + className: "ServiceTopologyResource", modelProperties: { - duration: { + ...TrackedResource.type.modelProperties, + artifactSourceId: { + serializedName: "properties.artifactSourceId", + type: { + name: "String" + } + } + } + } +}; + +export const ServiceResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + targetLocation: { + serializedName: "properties.targetLocation", + required: true, + type: { + name: "String" + } + }, + targetSubscriptionId: { + serializedName: "properties.targetSubscriptionId", required: true, - serializedName: "duration", type: { name: "String" } @@ -1420,58 +1268,216 @@ export const WaitStepAttributes: msRest.CompositeMapper = { } }; -export const WaitStepProperties: msRest.CompositeMapper = { - serializedName: "Wait", +export const ServiceUnitResource: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: StepProperties.type.polymorphicDiscriminator, - uberParent: "StepProperties", - className: "WaitStepProperties", + className: "ServiceUnitResource", modelProperties: { - ...StepProperties.type.modelProperties, - attributes: { + ...TrackedResource.type.modelProperties, + targetResourceGroup: { + serializedName: "properties.targetResourceGroup", required: true, - serializedName: "attributes", + type: { + name: "String" + } + }, + deploymentMode: { + serializedName: "properties.deploymentMode", + required: true, + type: { + name: "Enum", + allowedValues: ["Incremental", "Complete"] + } + }, + artifacts: { + serializedName: "properties.artifacts", type: { name: "Composite", - className: "WaitStepAttributes" + className: "ServiceUnitArtifacts" } } } } }; -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", +export const StepResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProxyResource", + className: "StepResource", modelProperties: { - ...Resource.type.modelProperties + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "StepProperties" + } + } } } }; -export const AzureEntityResource: msRest.CompositeMapper = { - serializedName: "AzureEntityResource", +export const RolloutRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureEntityResource", + className: "RolloutRequest", modelProperties: { - ...Resource.type.modelProperties, - etag: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + buildVersion: { + serializedName: "properties.buildVersion", + required: true, + type: { + name: "String" + } + }, + artifactSourceId: { + serializedName: "properties.artifactSourceId", + type: { + name: "String" + } + }, + targetServiceTopologyId: { + serializedName: "properties.targetServiceTopologyId", + required: true, + type: { + name: "String" + } + }, + stepGroups: { + serializedName: "properties.stepGroups", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StepGroup" + } + } + } + } + } + } +}; + +export const Rollout: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Rollout", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + buildVersion: { + serializedName: "properties.buildVersion", + type: { + name: "String" + } + }, + artifactSourceId: { + serializedName: "properties.artifactSourceId", + type: { + name: "String" + } + }, + targetServiceTopologyId: { + serializedName: "properties.targetServiceTopologyId", + type: { + name: "String" + } + }, + stepGroups: { + serializedName: "properties.stepGroups", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StepGroup" + } + } + } + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String" + } + }, + totalRetryAttempts: { + serializedName: "properties.totalRetryAttempts", + readOnly: true, + type: { + name: "Number" + } + }, + operationInfo: { + serializedName: "properties.operationInfo", + type: { + name: "Composite", + className: "RolloutOperationInfo" + } + }, + services: { + serializedName: "properties.services", readOnly: true, - serializedName: "etag", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Service" + } + } + } + } + } + } +}; + +export const ArtifactSource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ArtifactSource", + modelProperties: { + ...TrackedResource.type.modelProperties, + sourceType: { + serializedName: "properties.sourceType", + type: { + name: "String" + } + }, + artifactRoot: { + serializedName: "properties.artifactRoot", type: { name: "String" } + }, + authentication: { + serializedName: "properties.authentication", + type: { + name: "Composite", + className: "Authentication" + } } } } }; -export const ServiceUnitsCreateOrUpdateHeaders: msRest.CompositeMapper = { - serializedName: "serviceunits-createorupdate-headers", +export const ServiceUnitsCreateOrUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServiceUnitsCreateOrUpdateHeaders", @@ -1486,8 +1492,7 @@ export const ServiceUnitsCreateOrUpdateHeaders: msRest.CompositeMapper = { } }; -export const RolloutsCreateOrUpdateHeaders: msRest.CompositeMapper = { - serializedName: "rollouts-createorupdate-headers", +export const RolloutsCreateOrUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RolloutsCreateOrUpdateHeaders", @@ -1502,16 +1507,15 @@ export const RolloutsCreateOrUpdateHeaders: msRest.CompositeMapper = { } }; -export const discriminators = { - 'Authentication' : Authentication, - 'Authentication.Sas' : SasAuthentication, - 'StepProperties' : StepProperties, - 'HealthCheckStepAttributes' : HealthCheckStepAttributes, - 'StepProperties.HealthCheck' : HealthCheckStepProperties, - 'RestRequestAuthentication' : RestRequestAuthentication, - 'HealthCheckStepAttributes.REST' : RestHealthCheckStepAttributes, - 'RestRequestAuthentication.RolloutIdentity' : RolloutIdentityAuthentication, - 'RestRequestAuthentication.ApiKey' : ApiKeyAuthentication, - 'StepProperties.Wait' : WaitStepProperties - +export let discriminators = { + StepProperties: StepProperties, + Authentication: Authentication, + HealthCheckStepAttributes: HealthCheckStepAttributes, + RestRequestAuthentication: RestRequestAuthentication, + "StepProperties.HealthCheck": HealthCheckStepProperties, + "StepProperties.Wait": WaitStepProperties, + "Authentication.Sas": SasAuthentication, + "HealthCheckStepAttributes.REST": RestHealthCheckStepAttributes, + "RestRequestAuthentication.RolloutIdentity": RolloutIdentityAuthentication, + "RestRequestAuthentication.ApiKey": ApiKeyAuthentication }; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/models/operationsMappers.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/models/operationsMappers.ts deleted file mode 100644 index 6c49bbac166a..000000000000 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/models/operationsMappers.ts +++ /dev/null @@ -1,15 +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 { - discriminators, - CloudError, - Operation, - OperationDetail, - OperationsList -} from "../models/mappers"; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/models/parameters.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/models/parameters.ts index 54f7af08e5b8..f20058f7647d 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/models/parameters.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/models/parameters.ts @@ -1,139 +1,210 @@ /* - * 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"; +import { + ServiceTopologyResource as ServiceTopologyResourceMapper, + ServiceResource as ServiceResourceMapper, + ServiceUnitResource as ServiceUnitResourceMapper, + StepResource as StepResourceMapper, + RolloutRequest as RolloutRequestMapper, + ArtifactSource as ArtifactSourceMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const serviceTopologyInfo: OperationParameter = { + parameterPath: "serviceTopologyInfo", + mapper: ServiceTopologyResourceMapper +}; + +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - required: true, - serializedName: "api-version", + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const artifactSourceName: msRest.OperationURLParameter = { - parameterPath: "artifactSourceName", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "artifactSourceName", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { + +export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { - required: true, - serializedName: "resourceGroupName", constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const retryAttempt: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "retryAttempt" - ], + +export const serviceTopologyName: OperationURLParameter = { + parameterPath: "serviceTopologyName", mapper: { - serializedName: "retryAttempt", + serializedName: "serviceTopologyName", + required: true, type: { - name: "Number" + name: "String" } } }; -export const rolloutName: msRest.OperationURLParameter = { - parameterPath: "rolloutName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "rolloutName", + defaultValue: "2019-11-01-preview", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const serviceName: msRest.OperationURLParameter = { + +export const serviceInfo: OperationParameter = { + parameterPath: "serviceInfo", + mapper: ServiceResourceMapper +}; + +export const serviceName: OperationURLParameter = { parameterPath: "serviceName", mapper: { - required: true, serializedName: "serviceName", + required: true, type: { name: "String" } } }; -export const serviceTopologyName: msRest.OperationURLParameter = { - parameterPath: "serviceTopologyName", + +export const serviceUnitInfo: OperationParameter = { + parameterPath: "serviceUnitInfo", + mapper: ServiceUnitResourceMapper +}; + +export const serviceUnitName: OperationURLParameter = { + parameterPath: "serviceUnitName", mapper: { + serializedName: "serviceUnitName", required: true, - serializedName: "serviceTopologyName", type: { name: "String" } } }; -export const serviceUnitName: msRest.OperationURLParameter = { - parameterPath: "serviceUnitName", + +export const stepInfo: OperationParameter = { + parameterPath: ["options", "stepInfo"], + mapper: StepResourceMapper +}; + +export const stepName: OperationURLParameter = { + parameterPath: "stepName", mapper: { + serializedName: "stepName", required: true, - serializedName: "serviceUnitName", type: { name: "String" } } }; -export const skipSucceeded: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "skipSucceeded" - ], + +export const rolloutRequest: OperationParameter = { + parameterPath: ["options", "rolloutRequest"], + mapper: RolloutRequestMapper +}; + +export const rolloutName: OperationURLParameter = { + parameterPath: "rolloutName", mapper: { - serializedName: "skipSucceeded", + serializedName: "rolloutName", + required: true, type: { - name: "Boolean" + name: "String" } } }; -export const stepName: msRest.OperationURLParameter = { - parameterPath: "stepName", + +export const retryAttempt: OperationQueryParameter = { + parameterPath: ["options", "retryAttempt"], mapper: { - required: true, - serializedName: "stepName", + serializedName: "retryAttempt", type: { - name: "String" + name: "Number" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const skipSucceeded: OperationQueryParameter = { + parameterPath: ["options", "skipSucceeded"], mapper: { + serializedName: "skipSucceeded", + type: { + name: "Boolean" + } + } +}; + +export const artifactSourceInfo: OperationParameter = { + parameterPath: ["options", "artifactSourceInfo"], + mapper: ArtifactSourceMapper +}; + +export const artifactSourceName: OperationURLParameter = { + parameterPath: "artifactSourceName", + mapper: { + serializedName: "artifactSourceName", required: true, - serializedName: "subscriptionId", type: { name: "String" } diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/models/rolloutsMappers.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/models/rolloutsMappers.ts deleted file mode 100644 index 1383c12ccac2..000000000000 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/models/rolloutsMappers.ts +++ /dev/null @@ -1,53 +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 { - discriminators, - ApiKeyAuthentication, - ArtifactSource, - Authentication, - AzureEntityResource, - BaseResource, - CloudError, - HealthCheckStepAttributes, - HealthCheckStepProperties, - Identity, - Message, - PrePostStep, - ProxyResource, - Resource, - ResourceOperation, - RestHealthCheck, - RestHealthCheckStepAttributes, - RestRequest, - RestRequestAuthentication, - RestResponse, - RestResponseRegex, - Rollout, - RolloutIdentityAuthentication, - RolloutOperationInfo, - RolloutRequest, - RolloutsCreateOrUpdateHeaders, - RolloutStep, - SasAuthentication, - Service, - ServiceProperties, - ServiceResource, - ServiceTopologyResource, - ServiceUnit, - ServiceUnitArtifacts, - ServiceUnitProperties, - ServiceUnitResource, - StepGroup, - StepOperationInfo, - StepProperties, - StepResource, - TrackedResource, - WaitStepAttributes, - WaitStepProperties -} from "../models/mappers"; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/models/serviceTopologiesMappers.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/models/serviceTopologiesMappers.ts deleted file mode 100644 index 756b213e1eb6..000000000000 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/models/serviceTopologiesMappers.ts +++ /dev/null @@ -1,52 +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 { - discriminators, - ApiKeyAuthentication, - ArtifactSource, - Authentication, - AzureEntityResource, - BaseResource, - CloudError, - HealthCheckStepAttributes, - HealthCheckStepProperties, - Identity, - Message, - PrePostStep, - ProxyResource, - Resource, - ResourceOperation, - RestHealthCheck, - RestHealthCheckStepAttributes, - RestRequest, - RestRequestAuthentication, - RestResponse, - RestResponseRegex, - Rollout, - RolloutIdentityAuthentication, - RolloutOperationInfo, - RolloutRequest, - RolloutStep, - SasAuthentication, - Service, - ServiceProperties, - ServiceResource, - ServiceTopologyResource, - ServiceUnit, - ServiceUnitArtifacts, - ServiceUnitProperties, - ServiceUnitResource, - StepGroup, - StepOperationInfo, - StepProperties, - StepResource, - TrackedResource, - WaitStepAttributes, - WaitStepProperties -} from "../models/mappers"; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/models/serviceUnitsMappers.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/models/serviceUnitsMappers.ts deleted file mode 100644 index 810be21eff1f..000000000000 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/models/serviceUnitsMappers.ts +++ /dev/null @@ -1,53 +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 { - discriminators, - ApiKeyAuthentication, - ArtifactSource, - Authentication, - AzureEntityResource, - BaseResource, - CloudError, - HealthCheckStepAttributes, - HealthCheckStepProperties, - Identity, - Message, - PrePostStep, - ProxyResource, - Resource, - ResourceOperation, - RestHealthCheck, - RestHealthCheckStepAttributes, - RestRequest, - RestRequestAuthentication, - RestResponse, - RestResponseRegex, - Rollout, - RolloutIdentityAuthentication, - RolloutOperationInfo, - RolloutRequest, - RolloutStep, - SasAuthentication, - Service, - ServiceProperties, - ServiceResource, - ServiceTopologyResource, - ServiceUnit, - ServiceUnitArtifacts, - ServiceUnitProperties, - ServiceUnitResource, - ServiceUnitsCreateOrUpdateHeaders, - StepGroup, - StepOperationInfo, - StepProperties, - StepResource, - TrackedResource, - WaitStepAttributes, - WaitStepProperties -} from "../models/mappers"; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/models/servicesMappers.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/models/servicesMappers.ts deleted file mode 100644 index 756b213e1eb6..000000000000 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/models/servicesMappers.ts +++ /dev/null @@ -1,52 +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 { - discriminators, - ApiKeyAuthentication, - ArtifactSource, - Authentication, - AzureEntityResource, - BaseResource, - CloudError, - HealthCheckStepAttributes, - HealthCheckStepProperties, - Identity, - Message, - PrePostStep, - ProxyResource, - Resource, - ResourceOperation, - RestHealthCheck, - RestHealthCheckStepAttributes, - RestRequest, - RestRequestAuthentication, - RestResponse, - RestResponseRegex, - Rollout, - RolloutIdentityAuthentication, - RolloutOperationInfo, - RolloutRequest, - RolloutStep, - SasAuthentication, - Service, - ServiceProperties, - ServiceResource, - ServiceTopologyResource, - ServiceUnit, - ServiceUnitArtifacts, - ServiceUnitProperties, - ServiceUnitResource, - StepGroup, - StepOperationInfo, - StepProperties, - StepResource, - TrackedResource, - WaitStepAttributes, - WaitStepProperties -} from "../models/mappers"; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/models/stepsMappers.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/models/stepsMappers.ts deleted file mode 100644 index 756b213e1eb6..000000000000 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/models/stepsMappers.ts +++ /dev/null @@ -1,52 +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 { - discriminators, - ApiKeyAuthentication, - ArtifactSource, - Authentication, - AzureEntityResource, - BaseResource, - CloudError, - HealthCheckStepAttributes, - HealthCheckStepProperties, - Identity, - Message, - PrePostStep, - ProxyResource, - Resource, - ResourceOperation, - RestHealthCheck, - RestHealthCheckStepAttributes, - RestRequest, - RestRequestAuthentication, - RestResponse, - RestResponseRegex, - Rollout, - RolloutIdentityAuthentication, - RolloutOperationInfo, - RolloutRequest, - RolloutStep, - SasAuthentication, - Service, - ServiceProperties, - ServiceResource, - ServiceTopologyResource, - ServiceUnit, - ServiceUnitArtifacts, - ServiceUnitProperties, - ServiceUnitResource, - StepGroup, - StepOperationInfo, - StepProperties, - StepResource, - TrackedResource, - WaitStepAttributes, - WaitStepProperties -} from "../models/mappers"; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/artifactSources.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/artifactSources.ts index ce948c089105..177659775796 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/artifactSources.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/artifactSources.ts @@ -1,180 +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/artifactSourcesMappers"; +import { ArtifactSources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureDeploymentManagerContext } from "../azureDeploymentManagerContext"; +import { AzureDeploymentManager } from "../azureDeploymentManager"; +import { + ArtifactSourcesCreateOrUpdateOptionalParams, + ArtifactSourcesCreateOrUpdateResponse, + ArtifactSourcesGetOptionalParams, + ArtifactSourcesGetResponse, + ArtifactSourcesDeleteOptionalParams, + ArtifactSourcesListOptionalParams, + ArtifactSourcesListResponse +} from "../models"; -/** Class representing a ArtifactSources. */ -export class ArtifactSources { - private readonly client: AzureDeploymentManagerContext; +/** Class containing ArtifactSources operations. */ +export class ArtifactSourcesImpl implements ArtifactSources { + private readonly client: AzureDeploymentManager; /** - * Create a ArtifactSources. - * @param {AzureDeploymentManagerContext} client Reference to the service client. + * Initialize a new instance of the class ArtifactSources class. + * @param client Reference to the service client */ - constructor(client: AzureDeploymentManagerContext) { + constructor(client: AzureDeploymentManager) { this.client = client; } /** * Synchronously creates a new artifact source or updates an existing artifact source. - * @summary Creates or updates an artifact source. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param artifactSourceName The name of the artifact source. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, artifactSourceName: string, options?: Models.ArtifactSourcesCreateOrUpdateOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param artifactSourceName The name of the artifact source. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, artifactSourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param artifactSourceName The name of the artifact source. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, artifactSourceName: string, options: Models.ArtifactSourcesCreateOrUpdateOptionalParams, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, artifactSourceName: string, options?: Models.ArtifactSourcesCreateOrUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + artifactSourceName: string, + options?: ArtifactSourcesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - artifactSourceName, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, artifactSourceName, options }, + createOrUpdateOperationSpec + ); } /** - * @summary Gets an artifact source. + * Gets an artifact source. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param artifactSourceName The name of the artifact source. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, artifactSourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param artifactSourceName The name of the artifact source. - * @param callback The callback - */ - get(resourceGroupName: string, artifactSourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param artifactSourceName The name of the artifact source. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, artifactSourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, artifactSourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + artifactSourceName: string, + options?: ArtifactSourcesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - artifactSourceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, artifactSourceName, options }, + getOperationSpec + ); } /** - * @summary Deletes an artifact source. + * Deletes an artifact source. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param artifactSourceName The name of the artifact source. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, artifactSourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param artifactSourceName The name of the artifact source. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, artifactSourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param artifactSourceName The name of the artifact source. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, artifactSourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, artifactSourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + artifactSourceName: string, + options?: ArtifactSourcesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - artifactSourceName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, artifactSourceName, options }, + deleteOperationSpec + ); } /** - * @summary Lists the artifact sources in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise - */ - list(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param callback The callback - */ - list(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** + * Lists the artifact sources in a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list( + resourceGroupName: string, + options?: ArtifactSourcesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/artifactSources/{artifactSourceName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/artifactSources/{artifactSourceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.artifactSourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: [ - "options", - "artifactSourceInfo" - ], - mapper: Mappers.ArtifactSource - }, responses: { 201: { bodyMapper: Mappers.ArtifactSource @@ -183,23 +114,22 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/artifactSources/{artifactSourceName}", + requestBody: Parameters.artifactSourceInfo, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.artifactSourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/artifactSources/{artifactSourceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ArtifactSource @@ -208,23 +138,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/artifactSources/{artifactSourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.artifactSourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/artifactSources/{artifactSourceName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -232,34 +159,26 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/artifactSources", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.artifactSourceName ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/artifactSources", + httpMethod: "GET", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArtifactSource" - } - } + element: { type: { name: "Composite", className: "ArtifactSource" } } } } }, @@ -267,5 +186,12 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/index.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/index.ts index 47ad7069f14a..37f8bb9e59b5 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/index.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * 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 "./serviceTopologies"; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/operations.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/operations.ts index 77d17ecb0bca..a3e2726b00f3 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/operations.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/operations.ts @@ -1,67 +1,49 @@ /* - * 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/operationsMappers"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureDeploymentManagerContext } from "../azureDeploymentManagerContext"; +import { AzureDeploymentManager } from "../azureDeploymentManager"; +import { + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: AzureDeploymentManagerContext; +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: AzureDeploymentManager; /** - * Create a Operations. - * @param {AzureDeploymentManagerContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: AzureDeploymentManagerContext) { + constructor(client: AzureDeploymentManager) { this.client = client; } /** - * @summary Lists the supported operations. - * @param [options] The optional parameters - * @returns Promise + * Lists the supported operations. + * @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 - }, - listOperationSpec, - callback) as Promise; + list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.DeploymentManager/operations", httpMethod: "GET", - path: "providers/Microsoft.DeploymentManager/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationsList @@ -70,5 +52,8 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/rollouts.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/rollouts.ts index 8d8027a3e50a..561cccb1420e 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/rollouts.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/rollouts.ts @@ -1,243 +1,258 @@ /* - * 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 msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/rolloutsMappers"; +import { Rollouts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureDeploymentManagerContext } from "../azureDeploymentManagerContext"; +import { AzureDeploymentManager } from "../azureDeploymentManager"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + RolloutsCreateOrUpdateOptionalParams, + RolloutsCreateOrUpdateResponse, + RolloutsGetOptionalParams, + RolloutsGetResponse, + RolloutsDeleteOptionalParams, + RolloutsCancelOptionalParams, + RolloutsCancelResponse, + RolloutsRestartOptionalParams, + RolloutsRestartResponse, + RolloutsListOptionalParams, + RolloutsListResponse +} from "../models"; -/** Class representing a Rollouts. */ -export class Rollouts { - private readonly client: AzureDeploymentManagerContext; +/** Class containing Rollouts operations. */ +export class RolloutsImpl implements Rollouts { + private readonly client: AzureDeploymentManager; /** - * Create a Rollouts. - * @param {AzureDeploymentManagerContext} client Reference to the service client. + * Initialize a new instance of the class Rollouts class. + * @param client Reference to the service client */ - constructor(client: AzureDeploymentManagerContext) { + constructor(client: AzureDeploymentManager) { this.client = client; } /** - * This is an asynchronous operation and can be polled to completion using the location header - * returned by this operation. - * @summary Creates or updates a rollout. + * This is an asynchronous operation and can be polled to completion using the location header returned + * by this operation. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rolloutName The rollout name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, rolloutName: string, options?: Models.RolloutsCreateOrUpdateOptionalParams): Promise { - return this.beginCreateOrUpdate(resourceGroupName,rolloutName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RolloutsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, rolloutName, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * @summary Gets detailed information of a rollout. + * This is an asynchronous operation and can be polled to completion using the location header returned + * by this operation. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rolloutName The rollout name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, rolloutName: string, options?: Models.RolloutsGetOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param rolloutName The rollout name. - * @param callback The callback - */ - get(resourceGroupName: string, rolloutName: string, callback: msRest.ServiceCallback): void; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + rolloutName, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets detailed information of a rollout. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rolloutName The rollout name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, rolloutName: string, options: Models.RolloutsGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, rolloutName: string, options?: Models.RolloutsGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - rolloutName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, rolloutName, options }, + getOperationSpec + ); } /** * Only rollouts in terminal state can be deleted. - * @summary Deletes a rollout resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param rolloutName The rollout name. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, rolloutName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param rolloutName The rollout name. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, rolloutName: string, callback: msRest.ServiceCallback): void; - /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rolloutName The rollout name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, rolloutName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, rolloutName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - rolloutName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, rolloutName, options }, + deleteOperationSpec + ); } /** * Only running rollouts can be canceled. - * @summary Stops a running rollout. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rolloutName The rollout name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - cancel(resourceGroupName: string, rolloutName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param rolloutName The rollout name. - * @param callback The callback - */ - cancel(resourceGroupName: string, rolloutName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param rolloutName The rollout name. - * @param options The optional parameters - * @param callback The callback - */ - cancel(resourceGroupName: string, rolloutName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - cancel(resourceGroupName: string, rolloutName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + cancel( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsCancelOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - rolloutName, - options - }, - cancelOperationSpec, - callback) as Promise; + { resourceGroupName, rolloutName, options }, + cancelOperationSpec + ); } /** * Only failed rollouts can be restarted. - * @summary Restarts a failed rollout and optionally skips all succeeded steps. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param rolloutName The rollout name. - * @param [options] The optional parameters - * @returns Promise - */ - restart(resourceGroupName: string, rolloutName: string, options?: Models.RolloutsRestartOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param rolloutName The rollout name. - * @param callback The callback - */ - restart(resourceGroupName: string, rolloutName: string, callback: msRest.ServiceCallback): void; - /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param rolloutName The rollout name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - restart(resourceGroupName: string, rolloutName: string, options: Models.RolloutsRestartOptionalParams, callback: msRest.ServiceCallback): void; - restart(resourceGroupName: string, rolloutName: string, options?: Models.RolloutsRestartOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + restart( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsRestartOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - rolloutName, - options - }, - restartOperationSpec, - callback) as Promise; + { resourceGroupName, rolloutName, options }, + restartOperationSpec + ); } /** - * @summary Lists the rollouts in a resource group. + * Lists the rollouts in a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param callback The callback - */ - list(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list( + resourceGroupName: string, + options?: RolloutsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listOperationSpec, - callback) as Promise; - } - - /** - * This is an asynchronous operation and can be polled to completion using the location header - * returned by this operation. - * @summary Creates or updates a rollout. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param rolloutName The rollout name. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(resourceGroupName: string, rolloutName: string, options?: Models.RolloutsBeginCreateOrUpdateOptionalParams): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - rolloutName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + { resourceGroupName, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.RolloutRequest, + headersMapper: Mappers.RolloutsCreateOrUpdateHeaders + }, + 201: { + bodyMapper: Mappers.RolloutRequest, + headersMapper: Mappers.RolloutsCreateOrUpdateHeaders + }, + 202: { + bodyMapper: Mappers.RolloutRequest, + headersMapper: Mappers.RolloutsCreateOrUpdateHeaders + }, + 204: { + bodyMapper: Mappers.RolloutRequest, + headersMapper: Mappers.RolloutsCreateOrUpdateHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.rolloutRequest, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.rolloutName ], - queryParameters: [ - Parameters.apiVersion, - Parameters.retryAttempt - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Rollout @@ -246,23 +261,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}", + queryParameters: [Parameters.apiVersion, Parameters.retryAttempt], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.rolloutName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -270,23 +282,20 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const cancelOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}/cancel", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.rolloutName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const cancelOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}/cancel", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.Rollout @@ -295,24 +304,20 @@ const cancelOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const restartOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}/restart", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.rolloutName ], - queryParameters: [ - Parameters.skipSucceeded, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const restartOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}/restart", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.Rollout @@ -321,34 +326,26 @@ const restartOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts", + queryParameters: [Parameters.apiVersion, Parameters.skipSucceeded], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.rolloutName ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts", + httpMethod: "GET", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", - element: { - type: { - name: "Composite", - className: "Rollout" - } - } + element: { type: { name: "Composite", className: "Rollout" } } } } }, @@ -356,38 +353,12 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.rolloutName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], - requestBody: { - parameterPath: [ - "options", - "rolloutRequest" - ], - mapper: Mappers.RolloutRequest - }, - responses: { - 201: { - bodyMapper: Mappers.RolloutRequest, - headersMapper: Mappers.RolloutsCreateOrUpdateHeaders - }, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/serviceTopologies.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/serviceTopologies.ts index b03fd4f8f1b5..02757821176f 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/serviceTopologies.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/serviceTopologies.ts @@ -1,184 +1,114 @@ /* - * 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/serviceTopologiesMappers"; +import { ServiceTopologies } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureDeploymentManagerContext } from "../azureDeploymentManagerContext"; +import { AzureDeploymentManager } from "../azureDeploymentManager"; +import { + ServiceTopologyResource, + ServiceTopologiesCreateOrUpdateOptionalParams, + ServiceTopologiesCreateOrUpdateResponse, + ServiceTopologiesGetOptionalParams, + ServiceTopologiesGetResponse, + ServiceTopologiesDeleteOptionalParams, + ServiceTopologiesListOptionalParams, + ServiceTopologiesListResponse +} from "../models"; -/** Class representing a ServiceTopologies. */ -export class ServiceTopologies { - private readonly client: AzureDeploymentManagerContext; +/** Class containing ServiceTopologies operations. */ +export class ServiceTopologiesImpl implements ServiceTopologies { + private readonly client: AzureDeploymentManager; /** - * Create a ServiceTopologies. - * @param {AzureDeploymentManagerContext} client Reference to the service client. + * Initialize a new instance of the class ServiceTopologies class. + * @param client Reference to the service client */ - constructor(client: AzureDeploymentManagerContext) { + constructor(client: AzureDeploymentManager) { this.client = client; } /** * Synchronously creates a new service topology or updates an existing service topology. - * @summary Creates or updates a service topology. - * @param serviceTopologyInfo Source topology object defines the resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(serviceTopologyInfo: Models.ServiceTopologyResource, resourceGroupName: string, serviceTopologyName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param serviceTopologyInfo Source topology object defines the resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . - * @param callback The callback - */ - createOrUpdate(serviceTopologyInfo: Models.ServiceTopologyResource, resourceGroupName: string, serviceTopologyName: string, callback: msRest.ServiceCallback): void; - /** * @param serviceTopologyInfo Source topology object defines the resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(serviceTopologyInfo: Models.ServiceTopologyResource, resourceGroupName: string, serviceTopologyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(serviceTopologyInfo: Models.ServiceTopologyResource, resourceGroupName: string, serviceTopologyName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + serviceTopologyName: string, + serviceTopologyInfo: ServiceTopologyResource, + options?: ServiceTopologiesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - serviceTopologyInfo, - resourceGroupName, - serviceTopologyName, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, serviceTopologyName, serviceTopologyInfo, options }, + createOrUpdateOperationSpec + ); } /** - * @summary Gets the service topology. + * Gets the service topology. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, serviceTopologyName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param callback The callback - */ - get(resourceGroupName: string, serviceTopologyName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, serviceTopologyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, serviceTopologyName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + serviceTopologyName: string, + options?: ServiceTopologiesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - serviceTopologyName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, serviceTopologyName, options }, + getOperationSpec + ); } /** - * @summary Deletes the service topology. + * Deletes the service topology. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, serviceTopologyName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, serviceTopologyName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, serviceTopologyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, serviceTopologyName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + serviceTopologyName: string, + options?: ServiceTopologiesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - serviceTopologyName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, serviceTopologyName, options }, + deleteOperationSpec + ); } /** - * @summary Lists the service topologies in the resource group. + * Lists the service topologies in the resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param callback The callback - */ - list(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list( + resourceGroupName: string, + options?: ServiceTopologiesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.serviceTopologyName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "serviceTopologyInfo", - mapper: { - ...Mappers.ServiceTopologyResource, - required: true - } - }, responses: { 201: { bodyMapper: Mappers.ServiceTopologyResource @@ -187,23 +117,22 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}", + requestBody: Parameters.serviceTopologyInfo, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.serviceTopologyName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ServiceTopologyResource @@ -212,23 +141,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.serviceTopologyName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -236,33 +162,27 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.serviceTopologyName ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies", + httpMethod: "GET", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", element: { - type: { - name: "Composite", - className: "ServiceTopologyResource" - } + type: { name: "Composite", className: "ServiceTopologyResource" } } } } @@ -271,5 +191,12 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/serviceUnits.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/serviceUnits.ts index c38f35dcb65e..c0999e53e347 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/serviceUnits.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/serviceUnits.ts @@ -1,117 +1,165 @@ /* - * 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 msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/serviceUnitsMappers"; +import { ServiceUnits } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureDeploymentManagerContext } from "../azureDeploymentManagerContext"; +import { AzureDeploymentManager } from "../azureDeploymentManager"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ServiceUnitResource, + ServiceUnitsCreateOrUpdateOptionalParams, + ServiceUnitsCreateOrUpdateResponse, + ServiceUnitsGetOptionalParams, + ServiceUnitsGetResponse, + ServiceUnitsDeleteOptionalParams, + ServiceUnitsListOptionalParams, + ServiceUnitsListResponse +} from "../models"; -/** Class representing a ServiceUnits. */ -export class ServiceUnits { - private readonly client: AzureDeploymentManagerContext; +/** Class containing ServiceUnits operations. */ +export class ServiceUnitsImpl implements ServiceUnits { + private readonly client: AzureDeploymentManager; /** - * Create a ServiceUnits. - * @param {AzureDeploymentManagerContext} client Reference to the service client. + * Initialize a new instance of the class ServiceUnits class. + * @param client Reference to the service client */ - constructor(client: AzureDeploymentManagerContext) { + constructor(client: AzureDeploymentManager) { this.client = client; } /** * This is an asynchronous operation and can be polled to completion using the operation resource * returned by this operation. - * @summary Creates or updates a service unit under the service in the service topology. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . * @param serviceName The name of the service resource. * @param serviceUnitName The name of the service unit resource. * @param serviceUnitInfo The service unit resource object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, serviceUnitInfo: Models.ServiceUnitResource, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,serviceTopologyName,serviceName,serviceUnitName,serviceUnitInfo,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } + async beginCreateOrUpdate( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + serviceUnitName: string, + serviceUnitInfo: ServiceUnitResource, + options?: ServiceUnitsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServiceUnitsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * @summary Gets the service unit. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param serviceUnitName The name of the service unit resource. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param serviceUnitName The name of the service unit resource. - * @param callback The callback - */ - get(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param serviceUnitName The name of the service unit resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + const lro = new LroImpl( + sendOperation, { resourceGroupName, serviceTopologyName, serviceName, serviceUnitName, + serviceUnitInfo, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * @summary Deletes the service unit. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param serviceUnitName The name of the service unit resource. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * This is an asynchronous operation and can be polled to completion using the operation resource + * returned by this operation. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . * @param serviceName The name of the service resource. * @param serviceUnitName The name of the service unit resource. - * @param callback The callback + * @param serviceUnitInfo The service unit resource object. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, callback: msRest.ServiceCallback): void; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + serviceUnitName: string, + serviceUnitInfo: ServiceUnitResource, + options?: ServiceUnitsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + serviceTopologyName, + serviceName, + serviceUnitName, + serviceUnitInfo, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets the service unit. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . * @param serviceName The name of the service resource. * @param serviceUnitName The name of the service unit resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + serviceUnitName: string, + options?: ServiceUnitsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -120,91 +168,102 @@ export class ServiceUnits { serviceUnitName, options }, - deleteMethodOperationSpec, - callback); + getOperationSpec + ); } /** - * @summary Lists the service units under a service in the service topology. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param [options] The optional parameters - * @returns Promise - */ - list(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param callback The callback - */ - list(resourceGroupName: string, serviceTopologyName: string, serviceName: string, callback: msRest.ServiceCallback): void; - /** + * Deletes the service unit. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . * @param serviceName The name of the service resource. - * @param options The optional parameters - * @param callback The callback + * @param serviceUnitName The name of the service unit resource. + * @param options The options parameters. */ - list(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + serviceUnitName: string, + options?: ServiceUnitsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, serviceTopologyName, serviceName, + serviceUnitName, options }, - listOperationSpec, - callback) as Promise; + deleteOperationSpec + ); } /** - * This is an asynchronous operation and can be polled to completion using the operation resource - * returned by this operation. - * @summary Creates or updates a service unit under the service in the service topology. + * Lists the service units under a service in the service topology. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . * @param serviceName The name of the service resource. - * @param serviceUnitName The name of the service unit resource. - * @param serviceUnitInfo The service unit resource object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceUnitName: string, serviceUnitInfo: Models.ServiceUnitResource, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - serviceTopologyName, - serviceName, - serviceUnitName, - serviceUnitInfo, - options - }, - beginCreateOrUpdateOperationSpec, - options); + list( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + options?: ServiceUnitsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceTopologyName, serviceName, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}/serviceUnits/{serviceUnitName}", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}/serviceUnits/{serviceUnitName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ServiceUnitResource, + headersMapper: Mappers.ServiceUnitsCreateOrUpdateHeaders + }, + 201: { + bodyMapper: Mappers.ServiceUnitResource, + headersMapper: Mappers.ServiceUnitsCreateOrUpdateHeaders + }, + 202: { + bodyMapper: Mappers.ServiceUnitResource, + headersMapper: Mappers.ServiceUnitsCreateOrUpdateHeaders + }, + 204: { + bodyMapper: Mappers.ServiceUnitResource, + headersMapper: Mappers.ServiceUnitsCreateOrUpdateHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.serviceUnitInfo, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.serviceTopologyName, Parameters.serviceName, Parameters.serviceUnitName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}/serviceUnits/{serviceUnitName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ServiceUnitResource @@ -213,25 +272,22 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}/serviceUnits/{serviceUnitName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.serviceTopologyName, Parameters.serviceName, Parameters.serviceUnitName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}/serviceUnits/{serviceUnitName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -239,35 +295,29 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}/serviceUnits", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.serviceTopologyName, - Parameters.serviceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.serviceName, + Parameters.serviceUnitName ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}/serviceUnits", + httpMethod: "GET", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", element: { - type: { - name: "Composite", - className: "ServiceUnitResource" - } + type: { name: "Composite", className: "ServiceUnitResource" } } } } @@ -276,40 +326,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}/serviceUnits/{serviceUnitName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.serviceTopologyName, - Parameters.serviceName, - Parameters.serviceUnitName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.serviceName ], - requestBody: { - parameterPath: "serviceUnitInfo", - mapper: { - ...Mappers.ServiceUnitResource, - required: true - } - }, - responses: { - 201: { - bodyMapper: Mappers.ServiceUnitResource, - headersMapper: Mappers.ServiceUnitsCreateOrUpdateHeaders - }, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/services.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/services.ts index f46d0036a0a0..dca68d921ff7 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/services.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/services.ts @@ -1,60 +1,54 @@ /* - * 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/servicesMappers"; +import { Services } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureDeploymentManagerContext } from "../azureDeploymentManagerContext"; +import { AzureDeploymentManager } from "../azureDeploymentManager"; +import { + ServiceResource, + ServicesCreateOrUpdateOptionalParams, + ServicesCreateOrUpdateResponse, + ServicesGetOptionalParams, + ServicesGetResponse, + ServicesDeleteOptionalParams, + ServicesListOptionalParams, + ServicesListResponse +} from "../models"; -/** Class representing a Services. */ -export class Services { - private readonly client: AzureDeploymentManagerContext; +/** Class containing Services operations. */ +export class ServicesImpl implements Services { + private readonly client: AzureDeploymentManager; /** - * Create a Services. - * @param {AzureDeploymentManagerContext} client Reference to the service client. + * Initialize a new instance of the class Services class. + * @param client Reference to the service client */ - constructor(client: AzureDeploymentManagerContext) { + constructor(client: AzureDeploymentManager) { this.client = client; } /** * Synchronously creates a new service or updates an existing service. - * @summary Creates or updates a service in the service topology. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . * @param serviceName The name of the service resource. * @param serviceInfo The service object - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceInfo: Models.ServiceResource, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param serviceInfo The service object - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceInfo: Models.ServiceResource, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param serviceInfo The service object - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceInfo: Models.ServiceResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serviceTopologyName: string, serviceName: string, serviceInfo: Models.ServiceResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + serviceInfo: ServiceResource, + options?: ServicesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -63,139 +57,72 @@ export class Services { serviceInfo, options }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); } /** - * @summary Gets the service. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Gets the service. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . * @param serviceName The name of the service resource. - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, serviceTopologyName: string, serviceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + options?: ServicesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - serviceTopologyName, - serviceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, serviceTopologyName, serviceName, options }, + getOperationSpec + ); } /** - * @summary Deletes the service. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Deletes the service. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . * @param serviceName The name of the service resource. - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, serviceTopologyName: string, serviceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param serviceName The name of the service resource. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, serviceTopologyName: string, serviceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + options?: ServicesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - serviceTopologyName, - serviceName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, serviceTopologyName, serviceName, options }, + deleteOperationSpec + ); } /** - * @summary Lists the services in the service topology. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param [options] The optional parameters - * @returns Promise - */ - list(resourceGroupName: string, serviceTopologyName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceTopologyName The name of the service topology . - * @param callback The callback - */ - list(resourceGroupName: string, serviceTopologyName: string, callback: msRest.ServiceCallback): void; - /** + * Lists the services in the service topology. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceTopologyName The name of the service topology . - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(resourceGroupName: string, serviceTopologyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, serviceTopologyName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list( + resourceGroupName: string, + serviceTopologyName: string, + options?: ServicesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - serviceTopologyName, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, serviceTopologyName, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.serviceTopologyName, - Parameters.serviceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "serviceInfo", - mapper: { - ...Mappers.ServiceResource, - required: true - } - }, responses: { 201: { bodyMapper: Mappers.ServiceResource @@ -204,24 +131,23 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}", + requestBody: Parameters.serviceInfo, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.serviceTopologyName, Parameters.serviceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ServiceResource @@ -230,24 +156,21 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.serviceTopologyName, Parameters.serviceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -255,35 +178,27 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.serviceTopologyName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.serviceTopologyName, + Parameters.serviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services", + httpMethod: "GET", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", - element: { - type: { - name: "Composite", - className: "ServiceResource" - } - } + element: { type: { name: "Composite", className: "ServiceResource" } } } } }, @@ -291,5 +206,13 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceTopologyName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/steps.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/steps.ts index 09a13375f8bc..4c142c912ed0 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/src/operations/steps.ts +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operations/steps.ts @@ -1,180 +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/stepsMappers"; +import { Steps } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureDeploymentManagerContext } from "../azureDeploymentManagerContext"; +import { AzureDeploymentManager } from "../azureDeploymentManager"; +import { + StepsCreateOrUpdateOptionalParams, + StepsCreateOrUpdateResponse, + StepsGetOptionalParams, + StepsGetResponse, + StepsDeleteOptionalParams, + StepsListOptionalParams, + StepsListResponse +} from "../models"; -/** Class representing a Steps. */ -export class Steps { - private readonly client: AzureDeploymentManagerContext; +/** Class containing Steps operations. */ +export class StepsImpl implements Steps { + private readonly client: AzureDeploymentManager; /** - * Create a Steps. - * @param {AzureDeploymentManagerContext} client Reference to the service client. + * Initialize a new instance of the class Steps class. + * @param client Reference to the service client */ - constructor(client: AzureDeploymentManagerContext) { + constructor(client: AzureDeploymentManager) { this.client = client; } /** * Synchronously creates a new step or updates an existing step. - * @summary Creates or updates a rollout step with the given step properties. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param stepName The name of the deployment step. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, stepName: string, options?: Models.StepsCreateOrUpdateOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param stepName The name of the deployment step. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, stepName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param stepName The name of the deployment step. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, stepName: string, options: Models.StepsCreateOrUpdateOptionalParams, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, stepName: string, options?: Models.StepsCreateOrUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + stepName: string, + options?: StepsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - stepName, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, stepName, options }, + createOrUpdateOperationSpec + ); } /** - * @summary Gets the step. + * Gets the step. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param stepName The name of the deployment step. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, stepName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param stepName The name of the deployment step. - * @param callback The callback - */ - get(resourceGroupName: string, stepName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param stepName The name of the deployment step. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, stepName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, stepName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + stepName: string, + options?: StepsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - stepName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, stepName, options }, + getOperationSpec + ); } /** - * @summary Deletes the step. + * Deletes the step. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param stepName The name of the deployment step. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, stepName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param stepName The name of the deployment step. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, stepName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param stepName The name of the deployment step. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, stepName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, stepName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + stepName: string, + options?: StepsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - stepName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, stepName, options }, + deleteOperationSpec + ); } /** - * @summary Lists the steps in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise - */ - list(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param callback The callback - */ - list(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** + * Lists the steps in a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list( + resourceGroupName: string, + options?: StepsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps/{stepName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps/{stepName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.stepName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: [ - "options", - "stepInfo" - ], - mapper: Mappers.StepResource - }, responses: { 201: { bodyMapper: Mappers.StepResource @@ -183,23 +114,22 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps/{stepName}", + requestBody: Parameters.stepInfo, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.stepName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps/{stepName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.StepResource @@ -208,23 +138,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps/{stepName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.stepName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps/{stepName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -232,34 +159,26 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.stepName ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps", + httpMethod: "GET", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", - element: { - type: { - name: "Composite", - className: "StepResource" - } - } + element: { type: { name: "Composite", className: "StepResource" } } } } }, @@ -267,5 +186,12 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/artifactSources.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/artifactSources.ts new file mode 100644 index 000000000000..c93de7d7a71c --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/artifactSources.ts @@ -0,0 +1,63 @@ +/* + * 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 { + ArtifactSourcesCreateOrUpdateOptionalParams, + ArtifactSourcesCreateOrUpdateResponse, + ArtifactSourcesGetOptionalParams, + ArtifactSourcesGetResponse, + ArtifactSourcesDeleteOptionalParams, + ArtifactSourcesListOptionalParams, + ArtifactSourcesListResponse +} from "../models"; + +/** Interface representing a ArtifactSources. */ +export interface ArtifactSources { + /** + * Synchronously creates a new artifact source or updates an existing artifact source. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param artifactSourceName The name of the artifact source. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + artifactSourceName: string, + options?: ArtifactSourcesCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets an artifact source. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param artifactSourceName The name of the artifact source. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + artifactSourceName: string, + options?: ArtifactSourcesGetOptionalParams + ): Promise; + /** + * Deletes an artifact source. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param artifactSourceName The name of the artifact source. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + artifactSourceName: string, + options?: ArtifactSourcesDeleteOptionalParams + ): Promise; + /** + * Lists the artifact sources in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + options?: ArtifactSourcesListOptionalParams + ): Promise; +} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/index.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..37f8bb9e59b5 --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/index.ts @@ -0,0 +1,15 @@ +/* + * 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 "./serviceTopologies"; +export * from "./services"; +export * from "./serviceUnits"; +export * from "./steps"; +export * from "./rollouts"; +export * from "./artifactSources"; +export * from "./operations"; diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/operations.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..ff1c9747f121 --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/operations.ts @@ -0,0 +1,21 @@ +/* + * 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 { + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; + +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists the supported operations. + * @param options The options parameters. + */ + list(options?: OperationsListOptionalParams): Promise; +} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/rollouts.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/rollouts.ts new file mode 100644 index 000000000000..4ac68026e18c --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/rollouts.ts @@ -0,0 +1,108 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + RolloutsCreateOrUpdateOptionalParams, + RolloutsCreateOrUpdateResponse, + RolloutsGetOptionalParams, + RolloutsGetResponse, + RolloutsDeleteOptionalParams, + RolloutsCancelOptionalParams, + RolloutsCancelResponse, + RolloutsRestartOptionalParams, + RolloutsRestartResponse, + RolloutsListOptionalParams, + RolloutsListResponse +} from "../models"; + +/** Interface representing a Rollouts. */ +export interface Rollouts { + /** + * This is an asynchronous operation and can be polled to completion using the location header returned + * by this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rolloutName The rollout name. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RolloutsCreateOrUpdateResponse + > + >; + /** + * This is an asynchronous operation and can be polled to completion using the location header returned + * by this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rolloutName The rollout name. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets detailed information of a rollout. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rolloutName The rollout name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsGetOptionalParams + ): Promise; + /** + * Only rollouts in terminal state can be deleted. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rolloutName The rollout name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsDeleteOptionalParams + ): Promise; + /** + * Only running rollouts can be canceled. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rolloutName The rollout name. + * @param options The options parameters. + */ + cancel( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsCancelOptionalParams + ): Promise; + /** + * Only failed rollouts can be restarted. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rolloutName The rollout name. + * @param options The options parameters. + */ + restart( + resourceGroupName: string, + rolloutName: string, + options?: RolloutsRestartOptionalParams + ): Promise; + /** + * Lists the rollouts in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + options?: RolloutsListOptionalParams + ): Promise; +} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/serviceTopologies.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/serviceTopologies.ts new file mode 100644 index 000000000000..975f32ab1956 --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/serviceTopologies.ts @@ -0,0 +1,66 @@ +/* + * 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 { + ServiceTopologyResource, + ServiceTopologiesCreateOrUpdateOptionalParams, + ServiceTopologiesCreateOrUpdateResponse, + ServiceTopologiesGetOptionalParams, + ServiceTopologiesGetResponse, + ServiceTopologiesDeleteOptionalParams, + ServiceTopologiesListOptionalParams, + ServiceTopologiesListResponse +} from "../models"; + +/** Interface representing a ServiceTopologies. */ +export interface ServiceTopologies { + /** + * Synchronously creates a new service topology or updates an existing service topology. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param serviceTopologyInfo Source topology object defines the resource. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceTopologyName: string, + serviceTopologyInfo: ServiceTopologyResource, + options?: ServiceTopologiesCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets the service topology. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceTopologyName: string, + options?: ServiceTopologiesGetOptionalParams + ): Promise; + /** + * Deletes the service topology. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceTopologyName: string, + options?: ServiceTopologiesDeleteOptionalParams + ): Promise; + /** + * Lists the service topologies in the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + options?: ServiceTopologiesListOptionalParams + ): Promise; +} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/serviceUnits.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/serviceUnits.ts new file mode 100644 index 000000000000..182dc9fe7b6e --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/serviceUnits.ts @@ -0,0 +1,107 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ServiceUnitResource, + ServiceUnitsCreateOrUpdateOptionalParams, + ServiceUnitsCreateOrUpdateResponse, + ServiceUnitsGetOptionalParams, + ServiceUnitsGetResponse, + ServiceUnitsDeleteOptionalParams, + ServiceUnitsListOptionalParams, + ServiceUnitsListResponse +} from "../models"; + +/** Interface representing a ServiceUnits. */ +export interface ServiceUnits { + /** + * This is an asynchronous operation and can be polled to completion using the operation resource + * returned by this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param serviceName The name of the service resource. + * @param serviceUnitName The name of the service unit resource. + * @param serviceUnitInfo The service unit resource object. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + serviceUnitName: string, + serviceUnitInfo: ServiceUnitResource, + options?: ServiceUnitsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServiceUnitsCreateOrUpdateResponse + > + >; + /** + * This is an asynchronous operation and can be polled to completion using the operation resource + * returned by this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param serviceName The name of the service resource. + * @param serviceUnitName The name of the service unit resource. + * @param serviceUnitInfo The service unit resource object. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + serviceUnitName: string, + serviceUnitInfo: ServiceUnitResource, + options?: ServiceUnitsCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets the service unit. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param serviceName The name of the service resource. + * @param serviceUnitName The name of the service unit resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + serviceUnitName: string, + options?: ServiceUnitsGetOptionalParams + ): Promise; + /** + * Deletes the service unit. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param serviceName The name of the service resource. + * @param serviceUnitName The name of the service unit resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + serviceUnitName: string, + options?: ServiceUnitsDeleteOptionalParams + ): Promise; + /** + * Lists the service units under a service in the service topology. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param serviceName The name of the service resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + options?: ServiceUnitsListOptionalParams + ): Promise; +} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/services.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/services.ts new file mode 100644 index 000000000000..747f2374be3a --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/services.ts @@ -0,0 +1,74 @@ +/* + * 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 { + ServiceResource, + ServicesCreateOrUpdateOptionalParams, + ServicesCreateOrUpdateResponse, + ServicesGetOptionalParams, + ServicesGetResponse, + ServicesDeleteOptionalParams, + ServicesListOptionalParams, + ServicesListResponse +} from "../models"; + +/** Interface representing a Services. */ +export interface Services { + /** + * Synchronously creates a new service or updates an existing service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param serviceName The name of the service resource. + * @param serviceInfo The service object + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + serviceInfo: ServiceResource, + options?: ServicesCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets the service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param serviceName The name of the service resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + options?: ServicesGetOptionalParams + ): Promise; + /** + * Deletes the service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param serviceName The name of the service resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceTopologyName: string, + serviceName: string, + options?: ServicesDeleteOptionalParams + ): Promise; + /** + * Lists the services in the service topology. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceTopologyName The name of the service topology . + * @param options The options parameters. + */ + list( + resourceGroupName: string, + serviceTopologyName: string, + options?: ServicesListOptionalParams + ): Promise; +} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/steps.ts b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/steps.ts new file mode 100644 index 000000000000..53b89e969a91 --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/src/operationsInterfaces/steps.ts @@ -0,0 +1,63 @@ +/* + * 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 { + StepsCreateOrUpdateOptionalParams, + StepsCreateOrUpdateResponse, + StepsGetOptionalParams, + StepsGetResponse, + StepsDeleteOptionalParams, + StepsListOptionalParams, + StepsListResponse +} from "../models"; + +/** Interface representing a Steps. */ +export interface Steps { + /** + * Synchronously creates a new step or updates an existing step. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param stepName The name of the deployment step. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + stepName: string, + options?: StepsCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets the step. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param stepName The name of the deployment step. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + stepName: string, + options?: StepsGetOptionalParams + ): Promise; + /** + * Deletes the step. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param stepName The name of the deployment step. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + stepName: string, + options?: StepsDeleteOptionalParams + ): Promise; + /** + * Lists the steps in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + options?: StepsListOptionalParams + ): Promise; +} diff --git a/sdk/deploymentmanager/arm-deploymentmanager/test/sampleTest.ts b/sdk/deploymentmanager/arm-deploymentmanager/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/deploymentmanager/arm-deploymentmanager/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/deploymentmanager/arm-deploymentmanager/tsconfig.json b/sdk/deploymentmanager/arm-deploymentmanager/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/deploymentmanager/arm-deploymentmanager/tsconfig.json +++ b/sdk/deploymentmanager/arm-deploymentmanager/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "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/deploymentmanager/ci.yml b/sdk/deploymentmanager/ci.yml new file mode 100644 index 000000000000..7f99096ce2db --- /dev/null +++ b/sdk/deploymentmanager/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/deploymentmanager/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/deploymentmanager/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: deploymentmanager + Artifacts: + - name: azure-arm-deploymentmanager + safeName: azurearmdeploymentmanager + \ No newline at end of file