diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..006e2e1bc71b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -41,6 +41,7 @@ specifiers: '@rush-temp/arm-hdinsight': file:./projects/arm-hdinsight.tgz '@rush-temp/arm-iothub': file:./projects/arm-iothub.tgz '@rush-temp/arm-keyvault': file:./projects/arm-keyvault.tgz + '@rush-temp/arm-labservices': file:./projects/arm-labservices.tgz '@rush-temp/arm-links': file:./projects/arm-links.tgz '@rush-temp/arm-loadtestservice': file:./projects/arm-loadtestservice.tgz '@rush-temp/arm-locks': file:./projects/arm-locks.tgz @@ -222,6 +223,7 @@ dependencies: '@rush-temp/arm-hdinsight': file:projects/arm-hdinsight.tgz '@rush-temp/arm-iothub': file:projects/arm-iothub.tgz '@rush-temp/arm-keyvault': file:projects/arm-keyvault.tgz + '@rush-temp/arm-labservices': file:projects/arm-labservices.tgz '@rush-temp/arm-links': file:projects/arm-links.tgz '@rush-temp/arm-loadtestservice': file:projects/arm-loadtestservice.tgz '@rush-temp/arm-locks': file:projects/arm-locks.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 @@ -8644,6 +8646,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-labservices.tgz: + resolution: {integrity: sha512-TDIH21tup+u8tIdkR3Yu88pFq/pb3gA87wyBizIPT+RPJ8oM4eoHC7bPRYyoEUBgJzCsEigP4leyUGB0Md5QKg==, tarball: file:projects/arm-labservices.tgz} + name: '@rush-temp/arm-labservices' + 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-links.tgz: resolution: {integrity: sha512-t3TXBd/Fxm80E+cWuS3tQiUdSUeaEtul7+exkY4rNj9ecjK93FsfYTQ4a5FpR2WcEecOKQYXLYBfz4JgODQlbw==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' @@ -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..489ddfcf4e7a 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-labservices", + "projectFolder": "sdk/labservices/arm-labservices", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/labservices/arm-labservices/CHANGELOG.md b/sdk/labservices/arm-labservices/CHANGELOG.md new file mode 100644 index 000000000000..2dfcc4e14c6d --- /dev/null +++ b/sdk/labservices/arm-labservices/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 3.0.0-beta.1 (2022-01-05) + +The package of @azure/arm-labservices is using our next generation design principles since version 3.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/labservices/arm-labservices/LICENSE.txt b/sdk/labservices/arm-labservices/LICENSE similarity index 96% rename from sdk/labservices/arm-labservices/LICENSE.txt rename to sdk/labservices/arm-labservices/LICENSE index b73b4a1293c3..5d1d36e0af80 100644 --- a/sdk/labservices/arm-labservices/LICENSE.txt +++ b/sdk/labservices/arm-labservices/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/labservices/arm-labservices/README.md b/sdk/labservices/arm-labservices/README.md index 7aeddfdeed99..50295f455c42 100644 --- a/sdk/labservices/arm-labservices/README.md +++ b/sdk/labservices/arm-labservices/README.md @@ -1,99 +1,98 @@ -## Azure ManagedLabsClient SDK for JavaScript +# Azure LabServices client library for JavaScript -This package contains an isomorphic SDK for ManagedLabsClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure LabServices client. + +REST API for managing Azure Lab Services images. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/labservices/arm-labservices) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-labservices) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-labservices?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 + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-labservices` package -### How to Install +Install the Azure LabServices client library for JavaScript with `npm`: ```bash npm install @azure/arm-labservices ``` -### How to use +### Create and authenticate a `LabServicesClient` -#### nodejs - Authentication, client creation and list providerOperations as an example written in TypeScript. +To create a client object to access the Azure LabServices API, you will need the `endpoint` of your Azure LabServices resource and a `credential`. The Azure LabServices client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure LabServices resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +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/ms-rest-nodeauth +npm install @azure/identity ``` -##### Sample code - -```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { ManagedLabsClient, ManagedLabsModels, ManagedLabsMappers } from "@azure/arm-labservices"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new ManagedLabsClient(creds, subscriptionId); - client.providerOperations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +You will also need to **register a new AAD application and grant access to Azure LabServices** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { LabServicesClient } = require("@azure/arm-labservices"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new LabServicesClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation and list providerOperations as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth +### 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). -```bash -npm install @azure/ms-rest-browserauth -``` +## Key concepts + +### LabServicesClient -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-labservices sample - - - - - - - - +`LabServicesClient` is the primary interface for developers using the Azure LabServices client library. Explore the methods on this client object to understand the different features of the Azure LabServices service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` -## Related projects +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Flabservices%2Farm-labservices%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/labservices/arm-labservices/_meta.json b/sdk/labservices/arm-labservices/_meta.json new file mode 100644 index 000000000000..eadcec9e913a --- /dev/null +++ b/sdk/labservices/arm-labservices/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "e8c6db17dc13a00155936dcaeacf4da0a1fabf77", + "readme": "specification/labservices/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/labservices/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/labservices/arm-labservices/api-extractor.json b/sdk/labservices/arm-labservices/api-extractor.json new file mode 100644 index 000000000000..2bb3933d7dc4 --- /dev/null +++ b/sdk/labservices/arm-labservices/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-labservices.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/labservices/arm-labservices/package.json b/sdk/labservices/arm-labservices/package.json index 9ee0301ddad0..68c6787d71e8 100644 --- a/sdk/labservices/arm-labservices/package.json +++ b/sdk/labservices/arm-labservices/package.json @@ -1,57 +1,91 @@ { "name": "@azure/arm-labservices", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "ManagedLabsClient Library with typescript type definitions for node.js and browser.", - "version": "1.0.0", + "description": "A generated SDK for LabServicesClient.", + "version": "3.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^1.3.1", - "@azure/ms-rest-js": "^1.2.6", - "tslib": "^1.9.3" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-labservices.js", - "module": "./esm/managedLabsClient.js", - "types": "./esm/managedLabsClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-labservices.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.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.4.9" + "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/labservices/arm-labservices", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/labservices/arm-labservices", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" - }, - "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-labservices.js.map'\" -o ./dist/arm-labservices.min.js ./dist/arm-labservices.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/labservices/arm-labservices/review/arm-labservices.api.md b/sdk/labservices/arm-labservices/review/arm-labservices.api.md new file mode 100644 index 000000000000..9e839e34772f --- /dev/null +++ b/sdk/labservices/arm-labservices/review/arm-labservices.api.md @@ -0,0 +1,1208 @@ +## API Report File for "@azure/arm-labservices" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type ActionType = string; + +// @public +export interface AutoShutdownProfile { + disconnectDelay?: string; + idleDelay?: string; + noConnectDelay?: string; + shutdownOnDisconnect?: EnableState; + shutdownOnIdle?: ShutdownOnIdleMode; + shutdownWhenNotConnected?: EnableState; +} + +// @public +export interface ConnectionProfile { + clientRdpAccess?: ConnectionType_2; + clientSshAccess?: ConnectionType_2; + webRdpAccess?: ConnectionType_2; + webSshAccess?: ConnectionType_2; +} + +// @public +type ConnectionType_2 = "Public" | "Private" | "None"; +export { ConnectionType_2 as ConnectionType } + +// @public +export type CreatedByType = string; + +// @public +export type CreateOption = "Image" | "TemplateVM"; + +// @public +export interface Credentials { + password?: string; + username: string; +} + +// @public +export type EnableState = "Enabled" | "Disabled"; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +type Image_2 = ProxyResource & { + readonly systemData?: SystemData; + enabledState?: EnableState; + readonly provisioningState?: ProvisioningState; + readonly displayName?: string; + readonly description?: string; + readonly iconUrl?: string; + readonly author?: string; + readonly osType?: OsType; + readonly plan?: string; + readonly termsStatus?: EnableState; + readonly offer?: string; + readonly publisher?: string; + readonly sku?: string; + readonly version?: string; + readonly sharedGalleryId?: string; + availableRegions?: string[]; + readonly osState?: OsState; +}; +export { Image_2 as Image } + +// @public +export type ImageProperties = ImageUpdateProperties & { + readonly provisioningState?: ProvisioningState; + readonly displayName?: string; + readonly description?: string; + readonly iconUrl?: string; + readonly author?: string; + readonly osType?: OsType; + readonly plan?: string; + readonly termsStatus?: EnableState; + readonly offer?: string; + readonly publisher?: string; + readonly sku?: string; + readonly version?: string; + readonly sharedGalleryId?: string; + availableRegions?: string[]; + readonly osState?: OsState; +}; + +// @public +export interface ImageReference { + readonly exactVersion?: string; + id?: string; + offer?: string; + publisher?: string; + sku?: string; + version?: string; +} + +// @public +export interface Images { + createOrUpdate(resourceGroupName: string, labPlanName: string, imageName: string, body: Image_2, options?: ImagesCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, labPlanName: string, imageName: string, options?: ImagesGetOptionalParams): Promise; + listByLabPlan(resourceGroupName: string, labPlanName: string, options?: ImagesListByLabPlanOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, labPlanName: string, imageName: string, body: ImageUpdate, options?: ImagesUpdateOptionalParams): Promise; +} + +// @public +export interface ImagesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ImagesCreateOrUpdateResponse = Image_2; + +// @public +export interface ImagesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ImagesGetResponse = Image_2; + +// @public +export interface ImagesListByLabPlanNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ImagesListByLabPlanNextResponse = PagedImages; + +// @public +export interface ImagesListByLabPlanOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ImagesListByLabPlanResponse = PagedImages; + +// @public +export interface ImagesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ImagesUpdateResponse = Image_2; + +// @public +export interface ImageUpdate { + enabledState?: EnableState; +} + +// @public +export interface ImageUpdateProperties { + enabledState?: EnableState; +} + +// @public +export type InvitationState = "NotSent" | "Sending" | "Sent" | "Failed"; + +// @public +export interface InviteBody { + text?: string; +} + +// @public +export enum KnownActionType { + // (undocumented) + Internal = "Internal" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownLabServicesSkuTier { + // (undocumented) + Premium = "Premium", + // (undocumented) + Standard = "Standard" +} + +// @public +export enum KnownOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user", + // (undocumented) + UserSystem = "user,system" +} + +// @public +export enum KnownRestrictionReasonCode { + // (undocumented) + NotAvailableForSubscription = "NotAvailableForSubscription", + // (undocumented) + QuotaId = "QuotaId" +} + +// @public +export enum KnownRestrictionType { + // (undocumented) + Location = "Location" +} + +// @public +export enum KnownScaleType { + Automatic = "Automatic", + Manual = "Manual", + None = "None" +} + +// @public +export enum KnownUsageUnit { + // (undocumented) + Count = "Count" +} + +// @public +export type Lab = TrackedResource & { + readonly systemData?: SystemData; + autoShutdownProfile?: AutoShutdownProfile; + connectionProfile?: ConnectionProfile; + virtualMachineProfile?: VirtualMachineProfile; + securityProfile?: SecurityProfile; + rosterProfile?: RosterProfile; + labPlanId?: string; + title?: string; + description?: string; + readonly provisioningState?: ProvisioningState; + networkProfile?: LabNetworkProfile; + readonly state?: LabState; +}; + +// @public +export interface LabNetworkProfile { + loadBalancerId?: string; + publicIpId?: string; + subnetId?: string; +} + +// @public +export type LabPlan = TrackedResource & { + readonly systemData?: SystemData; + defaultConnectionProfile?: ConnectionProfile; + defaultAutoShutdownProfile?: AutoShutdownProfile; + defaultNetworkProfile?: LabPlanNetworkProfile; + allowedRegions?: string[]; + sharedGalleryId?: string; + supportInfo?: SupportInfo; + linkedLmsInstance?: string; + readonly provisioningState?: ProvisioningState; +}; + +// @public +export interface LabPlanNetworkProfile { + subnetId?: string; +} + +// @public +export type LabPlanProperties = LabPlanUpdateProperties & { + readonly provisioningState?: ProvisioningState; +}; + +// @public +export interface LabPlans { + beginCreateOrUpdate(resourceGroupName: string, labPlanName: string, body: LabPlan, options?: LabPlansCreateOrUpdateOptionalParams): Promise, LabPlansCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, labPlanName: string, body: LabPlan, options?: LabPlansCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, labPlanName: string, options?: LabPlansDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, labPlanName: string, options?: LabPlansDeleteOptionalParams): Promise; + beginSaveImage(resourceGroupName: string, labPlanName: string, body: SaveImageBody, options?: LabPlansSaveImageOptionalParams): Promise, void>>; + beginSaveImageAndWait(resourceGroupName: string, labPlanName: string, body: SaveImageBody, options?: LabPlansSaveImageOptionalParams): Promise; + beginUpdate(resourceGroupName: string, labPlanName: string, body: LabPlanUpdate, options?: LabPlansUpdateOptionalParams): Promise, LabPlansUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, labPlanName: string, body: LabPlanUpdate, options?: LabPlansUpdateOptionalParams): Promise; + get(resourceGroupName: string, labPlanName: string, options?: LabPlansGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: LabPlansListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: LabPlansListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface LabPlansCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type LabPlansCreateOrUpdateResponse = LabPlan; + +// @public +export interface LabPlansDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface LabPlansGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LabPlansGetResponse = LabPlan; + +// @public +export interface LabPlansListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LabPlansListByResourceGroupNextResponse = PagedLabPlans; + +// @public +export interface LabPlansListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LabPlansListByResourceGroupResponse = PagedLabPlans; + +// @public +export interface LabPlansListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type LabPlansListBySubscriptionNextResponse = PagedLabPlans; + +// @public +export interface LabPlansListBySubscriptionOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type LabPlansListBySubscriptionResponse = PagedLabPlans; + +// @public +export interface LabPlansSaveImageOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface LabPlansUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type LabPlansUpdateResponse = LabPlan; + +// @public +export type LabPlanUpdate = TrackedResourceUpdate & { + defaultConnectionProfile?: ConnectionProfile; + defaultAutoShutdownProfile?: AutoShutdownProfile; + defaultNetworkProfile?: LabPlanNetworkProfile; + allowedRegions?: string[]; + sharedGalleryId?: string; + supportInfo?: SupportInfo; + linkedLmsInstance?: string; +}; + +// @public +export interface LabPlanUpdateProperties { + allowedRegions?: string[]; + defaultAutoShutdownProfile?: AutoShutdownProfile; + defaultConnectionProfile?: ConnectionProfile; + defaultNetworkProfile?: LabPlanNetworkProfile; + linkedLmsInstance?: string; + sharedGalleryId?: string; + supportInfo?: SupportInfo; +} + +// @public +export type LabProperties = LabUpdateProperties & { + readonly provisioningState?: ProvisioningState; + networkProfile?: LabNetworkProfile; + readonly state?: LabState; +}; + +// @public +export interface Labs { + beginCreateOrUpdate(resourceGroupName: string, labName: string, body: Lab, options?: LabsCreateOrUpdateOptionalParams): Promise, LabsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, labName: string, body: Lab, options?: LabsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, labName: string, options?: LabsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, labName: string, options?: LabsDeleteOptionalParams): Promise; + beginPublish(resourceGroupName: string, labName: string, options?: LabsPublishOptionalParams): Promise, void>>; + beginPublishAndWait(resourceGroupName: string, labName: string, options?: LabsPublishOptionalParams): Promise; + beginSyncGroup(resourceGroupName: string, labName: string, options?: LabsSyncGroupOptionalParams): Promise, void>>; + beginSyncGroupAndWait(resourceGroupName: string, labName: string, options?: LabsSyncGroupOptionalParams): Promise; + beginUpdate(resourceGroupName: string, labName: string, body: LabUpdate, options?: LabsUpdateOptionalParams): Promise, LabsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, labName: string, body: LabUpdate, options?: LabsUpdateOptionalParams): Promise; + get(resourceGroupName: string, labName: string, options?: LabsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: LabsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: LabsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface LabsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type LabsCreateOrUpdateResponse = Lab; + +// @public +export interface LabsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public (undocumented) +export class LabServicesClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: LabServicesClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + images: Images; + // (undocumented) + labPlans: LabPlans; + // (undocumented) + labs: Labs; + // (undocumented) + operationResults: OperationResults; + // (undocumented) + operations: Operations; + // (undocumented) + schedules: Schedules; + // (undocumented) + skus: Skus; + // (undocumented) + subscriptionId: string; + // (undocumented) + usages: Usages; + // (undocumented) + users: Users; + // (undocumented) + virtualMachines: VirtualMachines; +} + +// @public +export interface LabServicesClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface LabServicesSku { + readonly capabilities?: LabServicesSkuCapabilities[]; + capacity?: LabServicesSkuCapacity; + readonly costs?: LabServicesSkuCost[]; + readonly family?: string; + readonly locations?: string[]; + readonly name?: string; + readonly resourceType?: string; + readonly restrictions?: LabServicesSkuRestrictions[]; + readonly size?: string; + readonly tier?: LabServicesSkuTier; +} + +// @public +export interface LabServicesSkuCapabilities { + readonly name?: string; + readonly value?: string; +} + +// @public +export interface LabServicesSkuCapacity { + readonly default?: number; + readonly maximum?: number; + readonly minimum?: number; + readonly scaleType?: ScaleType; +} + +// @public +export interface LabServicesSkuCost { + readonly extendedUnit?: string; + readonly meterId?: string; + readonly quantity?: number; +} + +// @public +export interface LabServicesSkuRestrictions { + readonly reasonCode?: RestrictionReasonCode; + readonly type?: RestrictionType; + readonly values?: string[]; +} + +// @public +export type LabServicesSkuTier = string; + +// @public +export interface LabsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LabsGetResponse = Lab; + +// @public +export interface LabsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LabsListByResourceGroupNextResponse = PagedLabs; + +// @public +export interface LabsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LabsListByResourceGroupResponse = PagedLabs; + +// @public +export interface LabsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type LabsListBySubscriptionNextResponse = PagedLabs; + +// @public +export interface LabsListBySubscriptionOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type LabsListBySubscriptionResponse = PagedLabs; + +// @public +export interface LabsPublishOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface LabsSyncGroupOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type LabState = "Draft" | "Publishing" | "Scaling" | "Syncing" | "Published"; + +// @public +export interface LabsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type LabsUpdateResponse = Lab; + +// @public +export type LabUpdate = TrackedResourceUpdate & { + autoShutdownProfile?: AutoShutdownProfile; + connectionProfile?: ConnectionProfile; + virtualMachineProfile?: VirtualMachineProfile; + securityProfile?: SecurityProfile; + rosterProfile?: RosterProfile; + labPlanId?: string; + title?: string; + description?: string; +}; + +// @public +export interface LabUpdateProperties { + autoShutdownProfile?: AutoShutdownProfile; + connectionProfile?: ConnectionProfile; + description?: string; + labPlanId?: string; + rosterProfile?: RosterProfile; + securityProfile?: SecurityProfile; + title?: string; + virtualMachineProfile?: VirtualMachineProfile; +} + +// @public +export interface ListUsagesResult { + readonly nextLink?: string; + readonly value?: Usage[]; +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface OperationResult { + endTime?: Date; + error?: ErrorDetail; + readonly id?: string; + readonly name?: string; + percentComplete?: number; + startTime?: Date; + status: OperationStatus; +} + +// @public +export interface OperationResults { + get(operationResultId: string, options?: OperationResultsGetOptionalParams): Promise; +} + +// @public +export interface OperationResultsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationResultsGetResponse = OperationResult; + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type OperationStatus = "NotStarted" | "InProgress" | "Succeeded" | "Failed" | "Canceled"; + +// @public +export type Origin = string; + +// @public +export type OsState = "Generalized" | "Specialized"; + +// @public +export type OsType = "Windows" | "Linux"; + +// @public +export interface PagedImages { + readonly nextLink?: string; + readonly value?: Image_2[]; +} + +// @public +export interface PagedLabPlans { + readonly nextLink?: string; + readonly value?: LabPlan[]; +} + +// @public +export interface PagedLabs { + readonly nextLink?: string; + readonly value?: Lab[]; +} + +// @public +export interface PagedLabServicesSkus { + readonly nextLink?: string; + readonly value?: LabServicesSku[]; +} + +// @public +export interface PagedSchedules { + readonly nextLink?: string; + readonly value?: Schedule[]; +} + +// @public +export interface PagedUsers { + readonly nextLink?: string; + readonly value?: User[]; +} + +// @public +export interface PagedVirtualMachines { + readonly nextLink?: string; + readonly value?: VirtualMachine[]; +} + +// @public +export type ProvisioningState = "Creating" | "Updating" | "Deleting" | "Succeeded" | "Failed" | "Locked"; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export type RecurrenceFrequency = "Daily" | "Weekly"; + +// @public +export interface RecurrencePattern { + expirationDate: Date; + frequency: RecurrenceFrequency; + interval?: number; + weekDays?: WeekDay[]; +} + +// @public +export type RegistrationState = "Registered" | "NotRegistered"; + +// @public +export interface ResetPasswordBody { + password: string; + username: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type RestrictionReasonCode = string; + +// @public +export type RestrictionType = string; + +// @public +export interface RosterProfile { + activeDirectoryGroupId?: string; + lmsInstance?: string; + ltiClientId?: string; + ltiContextId?: string; + ltiRosterEndpoint?: string; +} + +// @public +export interface SaveImageBody { + labVirtualMachineId?: string; + name?: string; +} + +// @public +export type ScaleType = string; + +// @public +export type Schedule = ProxyResource & { + readonly systemData?: SystemData; + startAt?: Date; + stopAt?: Date; + recurrencePattern?: RecurrencePattern; + timeZoneId?: string; + notes?: string; + readonly provisioningState?: ProvisioningState; +}; + +// @public +export type ScheduleProperties = ScheduleUpdateProperties & { + readonly provisioningState?: ProvisioningState; +}; + +// @public +export interface Schedules { + beginDelete(resourceGroupName: string, labName: string, scheduleName: string, options?: SchedulesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, labName: string, scheduleName: string, options?: SchedulesDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, labName: string, scheduleName: string, body: Schedule, options?: SchedulesCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, labName: string, scheduleName: string, options?: SchedulesGetOptionalParams): Promise; + listByLab(resourceGroupName: string, labName: string, options?: SchedulesListByLabOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, labName: string, scheduleName: string, body: ScheduleUpdate, options?: SchedulesUpdateOptionalParams): Promise; +} + +// @public +export interface SchedulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SchedulesCreateOrUpdateResponse = Schedule; + +// @public +export interface SchedulesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SchedulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SchedulesGetResponse = Schedule; + +// @public +export interface SchedulesListByLabNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type SchedulesListByLabNextResponse = PagedSchedules; + +// @public +export interface SchedulesListByLabOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type SchedulesListByLabResponse = PagedSchedules; + +// @public +export interface SchedulesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SchedulesUpdateResponse = Schedule; + +// @public +export interface ScheduleUpdate { + notes?: string; + recurrencePattern?: RecurrencePattern; + startAt?: Date; + stopAt?: Date; + timeZoneId?: string; +} + +// @public +export interface ScheduleUpdateProperties { + notes?: string; + recurrencePattern?: RecurrencePattern; + startAt?: Date; + stopAt?: Date; + timeZoneId?: string; +} + +// @public +export interface SecurityProfile { + openAccess?: EnableState; + readonly registrationCode?: string; +} + +// @public +export type ShutdownOnIdleMode = "None" | "UserAbsence" | "LowUsage"; + +// @public +export interface Sku { + capacity?: number; + family?: string; + name: string; + size?: string; + tier?: SkuTier; +} + +// @public +export interface Skus { + list(options?: SkusListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SkusListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type SkusListNextResponse = PagedLabServicesSkus; + +// @public +export interface SkusListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type SkusListResponse = PagedLabServicesSkus; + +// @public +export type SkuTier = "Free" | "Basic" | "Standard" | "Premium"; + +// @public +export interface SupportInfo { + email?: string; + instructions?: string; + phone?: string; + url?: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// @public +export interface TrackedResourceUpdate { + tags?: string[]; +} + +// @public +export interface Usage { + currentValue?: number; + id?: string; + limit?: number; + name?: UsageName; + unit?: UsageUnit; +} + +// @public +export interface UsageName { + localizedValue?: string; + value?: string; +} + +// @public +export interface Usages { + listByLocation(location: string, options?: UsagesListByLocationOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface UsagesListByLocationNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type UsagesListByLocationNextResponse = ListUsagesResult; + +// @public +export interface UsagesListByLocationOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type UsagesListByLocationResponse = ListUsagesResult; + +// @public +export type UsageUnit = string; + +// @public +export type User = ProxyResource & { + readonly systemData?: SystemData; + additionalUsageQuota?: string; + readonly provisioningState?: ProvisioningState; + readonly displayName?: string; + email: string; + readonly registrationState?: RegistrationState; + readonly invitationState?: InvitationState; + readonly invitationSent?: Date; + readonly totalUsage?: string; +}; + +// @public +export type UserProperties = UserUpdateProperties & { + readonly provisioningState?: ProvisioningState; + readonly displayName?: string; + email: string; + readonly registrationState?: RegistrationState; + readonly invitationState?: InvitationState; + readonly invitationSent?: Date; + readonly totalUsage?: string; +}; + +// @public +export interface Users { + beginCreateOrUpdate(resourceGroupName: string, labName: string, userName: string, body: User, options?: UsersCreateOrUpdateOptionalParams): Promise, UsersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, labName: string, userName: string, body: User, options?: UsersCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, labName: string, userName: string, options?: UsersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, labName: string, userName: string, options?: UsersDeleteOptionalParams): Promise; + beginInvite(resourceGroupName: string, labName: string, userName: string, body: InviteBody, options?: UsersInviteOptionalParams): Promise, void>>; + beginInviteAndWait(resourceGroupName: string, labName: string, userName: string, body: InviteBody, options?: UsersInviteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, labName: string, userName: string, body: UserUpdate, options?: UsersUpdateOptionalParams): Promise, UsersUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, labName: string, userName: string, body: UserUpdate, options?: UsersUpdateOptionalParams): Promise; + get(resourceGroupName: string, labName: string, userName: string, options?: UsersGetOptionalParams): Promise; + listByLab(resourceGroupName: string, labName: string, options?: UsersListByLabOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface UsersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type UsersCreateOrUpdateResponse = User; + +// @public +export interface UsersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface UsersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type UsersGetResponse = User; + +// @public +export interface UsersInviteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface UsersListByLabNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type UsersListByLabNextResponse = PagedUsers; + +// @public +export interface UsersListByLabOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type UsersListByLabResponse = PagedUsers; + +// @public +export interface UsersUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type UsersUpdateResponse = User; + +// @public +export interface UserUpdate { + additionalUsageQuota?: string; +} + +// @public +export interface UserUpdateProperties { + additionalUsageQuota?: string; +} + +// @public +export type VirtualMachine = ProxyResource & { + readonly systemData?: SystemData; + readonly provisioningState?: ProvisioningState; + readonly state?: VirtualMachineState; + readonly connectionProfile?: VirtualMachineConnectionProfile; + readonly claimedByUserId?: string; + readonly vmType?: VirtualMachineType; +}; + +// @public +export interface VirtualMachineAdditionalCapabilities { + installGpuDrivers?: EnableState; +} + +// @public +export interface VirtualMachineConnectionProfile { + readonly adminUsername?: string; + readonly nonAdminUsername?: string; + readonly privateIpAddress?: string; + readonly rdpAuthority?: string; + readonly rdpInBrowserUrl?: string; + readonly sshAuthority?: string; + readonly sshInBrowserUrl?: string; +} + +// @public +export interface VirtualMachineProfile { + additionalCapabilities?: VirtualMachineAdditionalCapabilities; + adminUser: Credentials; + createOption: CreateOption; + imageReference: ImageReference; + nonAdminUser?: Credentials; + readonly osType?: OsType; + sku: Sku; + usageQuota: string; + useSharedPassword?: EnableState; +} + +// @public +export interface VirtualMachines { + beginRedeploy(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesRedeployOptionalParams): Promise, void>>; + beginRedeployAndWait(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesRedeployOptionalParams): Promise; + beginReimage(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesReimageOptionalParams): Promise, void>>; + beginReimageAndWait(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesReimageOptionalParams): Promise; + beginResetPassword(resourceGroupName: string, labName: string, virtualMachineName: string, body: ResetPasswordBody, options?: VirtualMachinesResetPasswordOptionalParams): Promise, void>>; + beginResetPasswordAndWait(resourceGroupName: string, labName: string, virtualMachineName: string, body: ResetPasswordBody, options?: VirtualMachinesResetPasswordOptionalParams): Promise; + beginStart(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise, void>>; + beginStartAndWait(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise; + beginStop(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise, void>>; + beginStopAndWait(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise; + get(resourceGroupName: string, labName: string, virtualMachineName: string, options?: VirtualMachinesGetOptionalParams): Promise; + listByLab(resourceGroupName: string, labName: string, options?: VirtualMachinesListByLabOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VirtualMachinesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesGetResponse = VirtualMachine; + +// @public +export interface VirtualMachinesListByLabNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type VirtualMachinesListByLabNextResponse = PagedVirtualMachines; + +// @public +export interface VirtualMachinesListByLabOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type VirtualMachinesListByLabResponse = PagedVirtualMachines; + +// @public +export interface VirtualMachinesRedeployOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachinesReimageOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachinesResetPasswordOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachinesStartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachinesStopOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachineState = "Stopped" | "Starting" | "Running" | "Stopping" | "ResettingPassword" | "Reimaging" | "Redeploying"; + +// @public +export type VirtualMachineType = "User" | "Template"; + +// @public +export type WeekDay = "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday"; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/labservices/arm-labservices/rollup.config.js b/sdk/labservices/arm-labservices/rollup.config.js index 33758796e69a..9be1955eb7f1 100644 --- a/sdk/labservices/arm-labservices/rollup.config.js +++ b/sdk/labservices/arm-labservices/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/managedLabsClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-labservices.js", - format: "umd", - name: "Azure.ArmLabservices", - 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({ module: true }), - 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/labservices/arm-labservices/src/index.ts b/sdk/labservices/arm-labservices/src/index.ts new file mode 100644 index 000000000000..d78de0ddcc6d --- /dev/null +++ b/sdk/labservices/arm-labservices/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { LabServicesClient } from "./labServicesClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/labservices/arm-labservices/src/labServicesClient.ts b/sdk/labservices/arm-labservices/src/labServicesClient.ts new file mode 100644 index 000000000000..0f2b3801a7b6 --- /dev/null +++ b/sdk/labservices/arm-labservices/src/labServicesClient.ts @@ -0,0 +1,115 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + ImagesImpl, + LabPlansImpl, + OperationsImpl, + LabsImpl, + OperationResultsImpl, + SchedulesImpl, + UsersImpl, + VirtualMachinesImpl, + UsagesImpl, + SkusImpl +} from "./operations"; +import { + Images, + LabPlans, + Operations, + Labs, + OperationResults, + Schedules, + Users, + VirtualMachines, + Usages, + Skus +} from "./operationsInterfaces"; +import { LabServicesClientOptionalParams } from "./models"; + +export class LabServicesClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the LabServicesClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: LabServicesClientOptionalParams + ) { + 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: LabServicesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-labservices/3.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + 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 || "2021-11-15-preview"; + this.images = new ImagesImpl(this); + this.labPlans = new LabPlansImpl(this); + this.operations = new OperationsImpl(this); + this.labs = new LabsImpl(this); + this.operationResults = new OperationResultsImpl(this); + this.schedules = new SchedulesImpl(this); + this.users = new UsersImpl(this); + this.virtualMachines = new VirtualMachinesImpl(this); + this.usages = new UsagesImpl(this); + this.skus = new SkusImpl(this); + } + + images: Images; + labPlans: LabPlans; + operations: Operations; + labs: Labs; + operationResults: OperationResults; + schedules: Schedules; + users: Users; + virtualMachines: VirtualMachines; + usages: Usages; + skus: Skus; +} diff --git a/sdk/labservices/arm-labservices/src/lroImpl.ts b/sdk/labservices/arm-labservices/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/labservices/arm-labservices/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/labservices/arm-labservices/src/managedLabsClient.ts b/sdk/labservices/arm-labservices/src/managedLabsClient.ts deleted file mode 100644 index 868f64b914bb..000000000000 --- a/sdk/labservices/arm-labservices/src/managedLabsClient.ts +++ /dev/null @@ -1,58 +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 msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { ManagedLabsClientContext } from "./managedLabsClientContext"; - - -class ManagedLabsClient extends ManagedLabsClientContext { - // Operation groups - providerOperations: operations.ProviderOperations; - globalUsers: operations.GlobalUsers; - labAccounts: operations.LabAccounts; - operations: operations.Operations; - galleryImages: operations.GalleryImages; - labs: operations.Labs; - environmentSettings: operations.EnvironmentSettings; - environments: operations.Environments; - users: operations.Users; - - /** - * Initializes a new instance of the ManagedLabsClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The subscription ID. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ManagedLabsClientOptions) { - super(credentials, subscriptionId, options); - this.providerOperations = new operations.ProviderOperations(this); - this.globalUsers = new operations.GlobalUsers(this); - this.labAccounts = new operations.LabAccounts(this); - this.operations = new operations.Operations(this); - this.galleryImages = new operations.GalleryImages(this); - this.labs = new operations.Labs(this); - this.environmentSettings = new operations.EnvironmentSettings(this); - this.environments = new operations.Environments(this); - this.users = new operations.Users(this); - } -} - -// Operation Specifications - -export { - ManagedLabsClient, - ManagedLabsClientContext, - Models as ManagedLabsModels, - Mappers as ManagedLabsMappers -}; -export * from "./operations"; diff --git a/sdk/labservices/arm-labservices/src/managedLabsClientContext.ts b/sdk/labservices/arm-labservices/src/managedLabsClientContext.ts deleted file mode 100644 index cc87576b4330..000000000000 --- a/sdk/labservices/arm-labservices/src/managedLabsClientContext.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-labservices"; -const packageVersion = "1.0.0"; - -export class ManagedLabsClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - apiVersion?: string; - subscriptionId: string; - - /** - * Initializes a new instance of the ManagedLabsClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The subscription ID. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ManagedLabsClientOptions) { - 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 = '2018-10-15'; - 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/labservices/arm-labservices/src/models/environmentSettingsMappers.ts b/sdk/labservices/arm-labservices/src/models/environmentSettingsMappers.ts deleted file mode 100644 index 31b5158a2a0f..000000000000 --- a/sdk/labservices/arm-labservices/src/models/environmentSettingsMappers.ts +++ /dev/null @@ -1,40 +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 { - BaseResource, - CloudError, - Environment, - EnvironmentFragment, - EnvironmentSetting, - EnvironmentSettingFragment, - EnvironmentSize, - GalleryImage, - GalleryImageFragment, - GalleryImageReference, - Lab, - LabAccount, - LabAccountFragment, - LabFragment, - LatestOperationResult, - NetworkInterface, - PublishPayload, - ReferenceVm, - ReferenceVmFragment, - Resource, - ResourceSet, - ResourceSetFragment, - ResourceSettings, - ResourceSettingsFragment, - ResponseWithContinuationEnvironmentSetting, - SizeConfigurationProperties, - SizeInfo, - User, - UserFragment, - VmStateDetails -} from "../models/mappers"; diff --git a/sdk/labservices/arm-labservices/src/models/environmentsMappers.ts b/sdk/labservices/arm-labservices/src/models/environmentsMappers.ts deleted file mode 100644 index e0c43ba75e80..000000000000 --- a/sdk/labservices/arm-labservices/src/models/environmentsMappers.ts +++ /dev/null @@ -1,40 +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 { - BaseResource, - CloudError, - Environment, - EnvironmentFragment, - EnvironmentSetting, - EnvironmentSettingFragment, - EnvironmentSize, - GalleryImage, - GalleryImageFragment, - GalleryImageReference, - Lab, - LabAccount, - LabAccountFragment, - LabFragment, - LatestOperationResult, - NetworkInterface, - ReferenceVm, - ReferenceVmFragment, - ResetPasswordPayload, - Resource, - ResourceSet, - ResourceSetFragment, - ResourceSettings, - ResourceSettingsFragment, - ResponseWithContinuationEnvironment, - SizeConfigurationProperties, - SizeInfo, - User, - UserFragment, - VmStateDetails -} from "../models/mappers"; diff --git a/sdk/labservices/arm-labservices/src/models/galleryImagesMappers.ts b/sdk/labservices/arm-labservices/src/models/galleryImagesMappers.ts deleted file mode 100644 index 111fe6ae3134..000000000000 --- a/sdk/labservices/arm-labservices/src/models/galleryImagesMappers.ts +++ /dev/null @@ -1,39 +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 { - BaseResource, - CloudError, - Environment, - EnvironmentFragment, - EnvironmentSetting, - EnvironmentSettingFragment, - EnvironmentSize, - GalleryImage, - GalleryImageFragment, - GalleryImageReference, - Lab, - LabAccount, - LabAccountFragment, - LabFragment, - LatestOperationResult, - NetworkInterface, - ReferenceVm, - ReferenceVmFragment, - Resource, - ResourceSet, - ResourceSetFragment, - ResourceSettings, - ResourceSettingsFragment, - ResponseWithContinuationGalleryImage, - SizeConfigurationProperties, - SizeInfo, - User, - UserFragment, - VmStateDetails -} from "../models/mappers"; diff --git a/sdk/labservices/arm-labservices/src/models/globalUsersMappers.ts b/sdk/labservices/arm-labservices/src/models/globalUsersMappers.ts deleted file mode 100644 index b7cfc29c9540..000000000000 --- a/sdk/labservices/arm-labservices/src/models/globalUsersMappers.ts +++ /dev/null @@ -1,29 +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 { - CloudError, - EnvironmentDetails, - EnvironmentOperationsPayload, - GetEnvironmentResponse, - GetPersonalPreferencesResponse, - LabDetails, - LatestOperationResult, - ListEnvironmentsPayload, - ListEnvironmentsResponse, - ListLabsResponse, - OperationBatchStatusPayload, - OperationBatchStatusResponse, - OperationBatchStatusResponseItem, - OperationStatusPayload, - OperationStatusResponse, - PersonalPreferencesOperationsPayload, - RegisterPayload, - ResetPasswordPayload, - VirtualMachineDetails -} from "../models/mappers"; diff --git a/sdk/labservices/arm-labservices/src/models/index.ts b/sdk/labservices/arm-labservices/src/models/index.ts index 14e20a4d1bbf..a7f6889c521a 100644 --- a/sdk/labservices/arm-labservices/src/models/index.ts +++ b/sdk/labservices/arm-labservices/src/models/index.ts @@ -1,2557 +1,1872 @@ /* - * 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 }; - -/** - * Payload for Add Users operation on a Lab. - */ -export interface AddUsersPayload { +/** Paged list of Lab services virtual machine images. */ +export interface PagedImages { + /** + * The array page of virtual machine images. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Image[]; /** - * List of user emails addresses to add to the lab. + * The link to get the next page of image results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - emailAddresses: string[]; + readonly nextLink?: string; } -/** - * Creation parameters for Reference Vm - */ -export interface ReferenceVmCreationParameters { +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Properties of an image resource update */ +export interface ImageUpdateProperties { + /** Is the image enabled */ + enabledState?: EnableState; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * The username of the virtual machine + * 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. */ - userName: string; + readonly id?: string; /** - * The password of the virtual machine. + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - password: string; + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; } -/** - * Represents resource specific settings - */ -export interface ResourceSettingCreationParameters { +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { /** - * The location where the virtual machine will live + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location?: string; + readonly code?: string; /** - * The name of the resource setting + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name?: string; + readonly message?: string; /** - * The resource id of the gallery image used for creating the virtual machine + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - galleryImageResourceId: string; + readonly target?: string; /** - * The size of the virtual machine. Possible values include: 'Basic', 'Standard', 'Performance' + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - size?: ManagedLabVmSize; + readonly details?: ErrorDetail[]; /** - * Creation parameters for Reference Vm + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - referenceVmCreationParameters: ReferenceVmCreationParameters; + readonly additionalInfo?: ErrorAdditionalInfo[]; } -/** - * Settings related to creating an environment setting - */ -export interface EnvironmentSettingCreationParameters { +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { /** - * The resource specific settings + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceSettingCreationParameters: ResourceSettingCreationParameters; -} - -/** - * Settings related to creating a lab - */ -export interface LabCreationParameters { + readonly type?: string; /** - * Maximum number of users allowed in the lab. + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - maxUsersInLab?: number; + readonly info?: Record; } -/** - * Properties for creating a managed lab and a default environment setting - */ -export interface CreateLabProperties { - /** - * Settings related to creating an environment setting - */ - environmentSettingCreationParameters?: EnvironmentSettingCreationParameters; - /** - * Settings related to creating a lab - */ - labCreationParameters: LabCreationParameters; - /** - * The name of the resource - */ - name: string; +/** Lab services virtual machine image for updates. */ +export interface ImageUpdate { + /** Is the image enabled */ + enabledState?: EnableState; +} + +/** Paged list of lab plans. */ +export interface PagedLabPlans { /** - * The location of the resource + * The array page of lab plans. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location?: string; + readonly value?: LabPlan[]; /** - * The tags of the resource. + * The link to get the next page of lab plan results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly nextLink?: string; } -/** - * Represents a VM and the setting Id it was created for. - */ -export interface ResourceSet { +/** Lab plan resource properties for updates */ +export interface LabPlanUpdateProperties { + /** The default lab connection profile. This can be changed on a lab resource and only provides a default profile. */ + defaultConnectionProfile?: ConnectionProfile; + /** The default lab shutdown profile. This can be changed on a lab resource and only provides a default profile. */ + defaultAutoShutdownProfile?: AutoShutdownProfile; + /** The lab plan network profile. To enforce lab network policies they must be defined here and cannot be changed when there are existing labs associated with this lab plan. */ + defaultNetworkProfile?: LabPlanNetworkProfile; + /** The allowed regions for the lab creator to use when creating labs using this lab plan. */ + allowedRegions?: string[]; + /** Resource ID of the Shared Image Gallery attached to this lab plan. When saving a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be made available to use when creating new labs. */ + sharedGalleryId?: string; + /** Support contact information and instructions for users of the lab plan. This information is displayed to lab owners and virtual machine users for all labs in the lab plan. */ + supportInfo?: SupportInfo; + /** Base Url of the lms instance this lab plan can link lab rosters against. */ + linkedLmsInstance?: string; +} + +/** Connection profile for how users connect to lab virtual machines. */ +export interface ConnectionProfile { + /** The enabled access level for Web Access over SSH. */ + webSshAccess?: ConnectionType; + /** The enabled access level for Web Access over RDP. */ + webRdpAccess?: ConnectionType; + /** The enabled access level for Client Access over SSH. */ + clientSshAccess?: ConnectionType; + /** The enabled access level for Client Access over RDP. */ + clientRdpAccess?: ConnectionType; +} + +/** Profile for how to handle shutting down virtual machines. */ +export interface AutoShutdownProfile { + /** Whether shutdown on disconnect is enabled */ + shutdownOnDisconnect?: EnableState; + /** Whether a VM will get shutdown when it hasn't been connected to after a period of time. */ + shutdownWhenNotConnected?: EnableState; + /** Whether a VM will get shutdown when it has idled for a period of time. */ + shutdownOnIdle?: ShutdownOnIdleMode; + /** The amount of time a VM will stay running after a user disconnects if this behavior is enabled. */ + disconnectDelay?: string; + /** The amount of time a VM will stay running before it is shutdown if no connection is made and this behavior is enabled. */ + noConnectDelay?: string; + /** The amount of time a VM will idle before it is shutdown if this behavior is enabled. */ + idleDelay?: string; +} + +/** Profile for how to handle networking for Lab Plans. */ +export interface LabPlanNetworkProfile { + /** The external subnet resource id */ + subnetId?: string; +} + +/** Support contact information and instructions. */ +export interface SupportInfo { + /** Support web address. */ + url?: string; + /** Support contact email address. */ + email?: string; + /** Support contact phone number. */ + phone?: string; + /** Support instructions. */ + instructions?: string; +} + +/** Base tracked resource type for all PATCH updates. */ +export interface TrackedResourceUpdate { + /** Resource tags. */ + tags?: string[]; +} + +/** Body for the save image POST */ +export interface SaveImageBody { + /** The name for the image we create. */ + name?: string; + /** The ID of the lab virtual machine you want to save an image from. */ + labVirtualMachineId?: string; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { /** - * VM resource Id for the environment + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. */ - vmResourceId?: string; + readonly value?: Operation[]; /** - * resourceSettingId for the environment + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceSettingId?: string; + readonly nextLink?: string; } -/** - * Network details of the environment - */ -export interface NetworkInterface { +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { /** - * PrivateIp address of the Compute VM - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly privateIpAddress?: string; + readonly name?: string; /** - * Connection information for Linux - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly sshAuthority?: string; + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; /** - * Connection information for Windows - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly rdpAuthority?: string; + readonly origin?: Origin; /** - * Username of the VM - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly username?: string; + readonly actionType?: ActionType; } -/** - * Details of the status of an operation. - */ -export interface LatestOperationResult { +/** Localized display information for this particular operation. */ +export interface OperationDisplay { /** - * The current status of the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: string; + readonly provider?: string; /** - * Error code on failure. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly errorCode?: string; + readonly resource?: string; /** - * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly errorMessage?: string; + readonly operation?: string; /** - * Request URI of the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly requestUri?: string; + readonly description?: string; +} + +/** Paged list of labs. */ +export interface PagedLabs { /** - * The HttpMethod - PUT/POST/DELETE for the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The array page of lab results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly httpMethod?: string; + readonly value?: Lab[]; /** - * The URL to use to check long-running operation status - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link to get the next page of image results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operationUrl?: string; + readonly nextLink?: string; } -/** - * An Azure resource. - */ -export interface Resource extends BaseResource { - /** - * The identifier of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; +/** Profile for how to handle networking for Labs. */ +export interface LabNetworkProfile { + /** The external subnet resource id */ + subnetId?: string; + /** The external load balancer resource id */ + loadBalancerId?: string; + /** The external public IP resource id */ + publicIpId?: string; +} + +/** Properties of a lab resource used for updates. */ +export interface LabUpdateProperties { + /** The resource auto shutdown configuration for the lab. This controls whether actions are taken on resources that are sitting idle. */ + autoShutdownProfile?: AutoShutdownProfile; + /** The connection profile for the lab. This controls settings such as web access to lab resources or whether RDP or SSH ports are open. */ + connectionProfile?: ConnectionProfile; + /** The profile used for creating lab virtual machines. */ + virtualMachineProfile?: VirtualMachineProfile; + /** The lab security profile. */ + securityProfile?: SecurityProfile; + /** The lab user list management profile. */ + rosterProfile?: RosterProfile; + /** The ID of the lab plan. Used during resource creation to provide defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides organization.. */ + labPlanId?: string; + /** The title of the lab. */ + title?: string; + /** The description of the lab. */ + description?: string; +} + +/** The base virtual machine configuration for a lab. */ +export interface VirtualMachineProfile { + /** Indicates what lab virtual machines are created from. */ + createOption: CreateOption; + /** The image configuration for lab virtual machines. */ + imageReference: ImageReference; + /** + * The OS type of the image + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly osType?: OsType; + /** The SKU for the lab. Defines the type of virtual machines used in the lab. */ + sku: Sku; + /** Additional VM capabilities. */ + additionalCapabilities?: VirtualMachineAdditionalCapabilities; + /** The initial quota alloted to each lab user. Must be a time span between 0 and 9999 hours. */ + usageQuota: string; + /** Enabling this option will use the same password for all user VMs. */ + useSharedPassword?: EnableState; + /** Credentials for the admin user on the VM. */ + adminUser: Credentials; + /** Credentials for the non-admin user on the VM, if one exists. */ + nonAdminUser?: Credentials; +} + +/** Image reference information. Used in the virtual machine profile. */ +export interface ImageReference { + /** Image resource ID */ + id?: string; + /** The image offer if applicable. */ + offer?: string; + /** The image publisher */ + publisher?: string; + /** The image SKU */ + sku?: string; + /** The image version specified on creation. */ + version?: string; /** - * The name of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The actual version of the image after use. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly exactVersion?: string; +} + +/** The resource model definition representing SKU */ +export interface Sku { + /** The name of the SKU. Ex - P3. It is typically a letter+number code */ + name: string; + /** This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. */ + tier?: SkuTier; + /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */ + size?: string; + /** If the service has different generations of hardware, for the same SKU, then that can be captured here. */ + family?: string; + /** If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. */ + capacity?: number; +} + +/** The additional capabilities for a lab VM. */ +export interface VirtualMachineAdditionalCapabilities { + /** Flag to pre-install dedicated GPU drivers. */ + installGpuDrivers?: EnableState; +} + +/** Credentials for a user on a lab VM. */ +export interface Credentials { + /** The username to use when signing in to lab VMs. */ + username: string; + /** The password for the user. This is required for the TemplateVM createOption. */ + password?: string; +} + +/** The lab security profile. */ +export interface SecurityProfile { /** - * The type of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The registration code for the lab. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly registrationCode?: string; + /** Whether any user or only specified users can register to a lab. */ + openAccess?: EnableState; +} + +/** The lab user list management profile. */ +export interface RosterProfile { + /** The AAD group ID which this lab roster is populated from. Having this set enables AAD sync mode. */ + activeDirectoryGroupId?: string; + /** The unique context identifier for the lab in the lms. */ + ltiContextId?: string; + /** The base URI identifying the lms instance. */ + lmsInstance?: string; + /** The unique id of the azure lab services tool in the lms. */ + ltiClientId?: string; + /** The uri of the names and roles service endpoint on the lms for the class attached to this lab. */ + ltiRosterEndpoint?: string; +} + +/** A long running operation result */ +export interface OperationResult { /** - * The location of the 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. */ - location?: string; + readonly id?: string; /** - * The tags of the resource. + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly name?: string; + /** The operation status */ + status: OperationStatus; + /** Start time */ + startTime?: Date; + /** End time */ + endTime?: Date; + /** Percent completion */ + percentComplete?: number; + /** The error for a failure if the operation failed. */ + error?: ErrorDetail; } -/** - * Represents an environment instance - */ -export interface Environment extends Resource { +/** Paged list of schedules. */ +export interface PagedSchedules { /** - * The set of a VM and the setting id it was created for + * The array page of schedule results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceSets?: ResourceSet; + readonly value?: Schedule[]; /** - * The AAD object Id of the user who has claimed the environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link to get the next page of schedule results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly claimedByUserObjectId?: string; - /** - * The user principal Id of the user who has claimed the environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** + readonly nextLink?: string; +} + +/** Schedule resource properties used for updates. */ +export interface ScheduleUpdateProperties { + /** When lab user virtual machines will be started. Timestamp offsets will be ignored and timeZoneId is used instead. */ + startAt?: Date; + /** When lab user virtual machines will be stopped. Timestamp offsets will be ignored and timeZoneId is used instead. */ + stopAt?: Date; + /** The recurrence pattern of the scheduled actions. */ + recurrencePattern?: RecurrencePattern; + /** The IANA timezone id for the schedule. */ + timeZoneId?: string; + /** Notes for this schedule. */ + notes?: string; +} + +/** Recurrence pattern of a lab schedule. */ +export interface RecurrencePattern { + /** The frequency of the recurrence. */ + frequency: RecurrenceFrequency; + /** The week days the schedule runs. Used for when the Frequency is set to Weekly. */ + weekDays?: WeekDay[]; + /** The interval to invoke the schedule on. For example, interval = 2 and RecurrenceFrequency.Daily will run every 2 days. When no interval is supplied, an interval of 1 is used. */ + interval?: number; + /** When the recurrence will expire. This date is inclusive. */ + expirationDate: Date; +} + +/** Schedule for automatically turning virtual machines in a lab on and off at specified times. Used for updates. */ +export interface ScheduleUpdate { + /** When lab user virtual machines will be started. Timestamp offsets will be ignored and timeZoneId is used instead. */ + startAt?: Date; + /** When lab user virtual machines will be stopped. Timestamp offsets will be ignored and timeZoneId is used instead. */ + stopAt?: Date; + /** The recurrence pattern of the scheduled actions. */ + recurrencePattern?: RecurrencePattern; + /** The IANA timezone id for the schedule. */ + timeZoneId?: string; + /** Notes for this schedule. */ + notes?: string; +} + +/** Paged list of users. */ +export interface PagedUsers { + /** + * The array page of user results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: User[]; + /** + * The link to get the next page of image results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly claimedByUserPrincipalId?: string; + readonly nextLink?: string; +} + +/** User resource properties used for updates. */ +export interface UserUpdateProperties { + /** The amount of usage quota time the user gets in addition to the lab usage quota. */ + additionalUsageQuota?: string; +} + +/** User of a lab that can register for and use virtual machines within the lab. Used for updates. */ +export interface UserUpdate { + /** The amount of usage quota time the user gets in addition to the lab usage quota. */ + additionalUsageQuota?: string; +} + +/** Body for a user invite request */ +export interface InviteBody { + /** Custom text for the invite email. */ + text?: string; +} + +/** Paged list of lab services virtual machines. */ +export interface PagedVirtualMachines { /** - * The name or email address of the user who has claimed the environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The array page of virtual machine results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly claimedByUserName?: string; + readonly value?: VirtualMachine[]; /** - * Is the environment claimed or not - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link to get the next page of virtual machine results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isClaimed?: boolean; + readonly nextLink?: string; +} + +/** The connection information for the virtual machine */ +export interface VirtualMachineConnectionProfile { /** - * Last known power state of the environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The private IP address of the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastKnownPowerState?: string; + readonly privateIpAddress?: string; /** - * Network details of the environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Port and host name separated by semicolon for connecting via SSH protocol to the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly networkInterface?: NetworkInterface; + readonly sshAuthority?: string; /** - * How long the environment has been used by a lab user - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * URL for connecting via SSH protocol to the virtual machine in browser. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalUsage?: string; + readonly sshInBrowserUrl?: string; /** - * When the password was last reset on the environment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Port and host name separated by semicolon for connecting via RDP protocol to the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly passwordLastReset?: Date; + readonly rdpAuthority?: string; /** - * The provisioning status of the resource. + * URL for connecting via RDP protocol to the virtual machine in browser. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provisioningState?: string; + readonly rdpInBrowserUrl?: string; /** - * The unique immutable identifier of a resource (Guid). + * The username used to log on to the virtual machine as admin. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - uniqueIdentifier?: string; + readonly adminUsername?: string; /** - * The details of the latest operation. ex: status, error - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The username used to log on to the virtual machine as non-admin, if one exists. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly latestOperationResult?: LatestOperationResult; + readonly nonAdminUsername?: string; } -/** - * Details of the backing virtual machine. - */ -export interface VirtualMachineDetails { - /** - * Provisioning state of the Dtl VM - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: string; - /** - * Connection information for Windows - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly rdpAuthority?: string; +/** Body of a reset password request. */ +export interface ResetPasswordBody { + /** The user whose password is being reset */ + username: string; + /** The password */ + password: string; +} + +/** List of Core Usages. */ +export interface ListUsagesResult { /** - * Connection information for Linux - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The array page of Usages. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly sshAuthority?: string; + readonly value?: Usage[]; /** - * PrivateIp address of the compute VM - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link to get the next page of Usage result. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly privateIpAddress?: string; + readonly nextLink?: string; +} + +/** The core usage details. */ +export interface Usage { + /** The current usage. */ + currentValue?: number; + /** The limit integer. */ + limit?: number; + /** The unit details. */ + unit?: UsageUnit; + /** The name. */ + name?: UsageName; + /** The fully qualified arm resource id. */ + id?: string; +} + +/** The Usage Names. */ +export interface UsageName { + /** The localized name of the resource. */ + localizedValue?: string; + /** The name of the resource. */ + value?: string; +} + +/** Paged list of lab services skus. */ +export interface PagedLabServicesSkus { /** - * Compute VM login user name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The array page of sku results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly userName?: string; + readonly value?: LabServicesSku[]; /** - * Last known compute power state captured in DTL - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The link to get the next page of sku results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastKnownPowerState?: string; + readonly nextLink?: string; } -/** - * This represents the details about a User's environment and its state. - */ -export interface EnvironmentDetails { +/** Azure Lab Services resource SKUs */ +export interface LabServicesSku { /** - * Name of the Environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The lab services resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly resourceType?: string; /** - * Description of the Environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly description?: string; + readonly name?: string; /** - * Resource Id of the environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The tier of the SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly tier?: LabServicesSkuTier; /** - * The provisioning state of the environment. This also includes LabIsFull and NotYetProvisioned - * status. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The SKU size. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly size?: string; /** - * Details of backing DTL virtual machine with compute and network details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The family of the SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly virtualMachineDetails?: VirtualMachineDetails; + readonly family?: string; + /** The scale out/in options of the SKU. */ + capacity?: LabServicesSkuCapacity; /** - * The details of the latest operation. ex: status, error - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The capabilities of the SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly latestOperationResult?: LatestOperationResult; + readonly capabilities?: LabServicesSkuCapabilities[]; /** - * Publishing state of the environment setting Possible values are Creating, Created, Failed - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * List of locations that are available for a size. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly environmentState?: string; + readonly locations?: string[]; /** - * How long the environment has been used by a lab user - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Metadata for retrieving price info of a lab services SKUs. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalUsage?: string; + readonly costs?: LabServicesSkuCost[]; /** - * When the password was last reset on the environment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Restrictions of a lab services SKUs. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly passwordLastReset?: Date; + readonly restrictions?: LabServicesSkuRestrictions[]; } -/** - * Represents a VM and the setting Id it was created for. - */ -export interface ResourceSetFragment { +/** The scale out/in options of the SKU. */ +export interface LabServicesSkuCapacity { /** - * VM resource Id for the environment + * The default capacity for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - vmResourceId?: string; - /** - * resourceSettingId for the environment - */ - resourceSettingId?: string; -} - -/** - * Represents an environment instance - */ -export interface EnvironmentFragment extends Resource { + readonly default?: number; /** - * The set of a VM and the setting id it was created for + * The lowest permitted capacity for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceSets?: ResourceSetFragment; + readonly minimum?: number; /** - * The provisioning status of the resource. + * The highest permitted capacity for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provisioningState?: string; + readonly maximum?: number; /** - * The unique immutable identifier of a resource (Guid). + * The localized name of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - uniqueIdentifier?: string; + readonly scaleType?: ScaleType; } -/** - * Represents payload for any Environment operations like get, start, stop, connect - */ -export interface EnvironmentOperationsPayload { +/** The array of capabilities of a lab services SKU. */ +export interface LabServicesSkuCapabilities { /** - * The resourceId of the environment + * The name of the capability for a SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - environmentId: string; -} - -/** - * Details about the state of the reference virtual machine. - */ -export interface VmStateDetails { + readonly name?: string; /** - * The RdpAuthority property is a server DNS host name or IP address followed by the service port - * number for RDP (Remote Desktop Protocol). - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The value of the capability for a SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly rdpAuthority?: string; + readonly value?: string; +} + +/** The array of costs of a lab services SKU. */ +export interface LabServicesSkuCost { /** - * The SshAuthority property is a server DNS host name or IP address followed by the service port - * number for SSH. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The meter id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly sshAuthority?: string; + readonly meterId?: string; /** - * The power state of the reference virtual machine. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The quantity of units charged. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly powerState?: string; + readonly quantity?: number; /** - * Last known compute power state captured in DTL - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The extended unit. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastKnownPowerState?: string; + readonly extendedUnit?: string; } -/** - * Details of a Reference Vm - */ -export interface ReferenceVm { - /** - * The username of the virtual machine - */ - userName: string; +/** The restriction details. */ +export interface LabServicesSkuRestrictions { /** - * The password of the virtual machine. This will be set to null in GET resource API + * The type of restriction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - password?: string; + readonly type?: RestrictionType; /** - * The state details for the reference virtual machine. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The values of the restriction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly vmStateDetails?: VmStateDetails; + readonly values?: string[]; /** - * VM resource Id for the environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The reason for the restriction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly vmResourceId?: string; + readonly reasonCode?: RestrictionReasonCode; } -/** - * Represents resource specific settings - */ -export interface ResourceSettings { +/** Properties of an image resource. */ +export type ImageProperties = ImageUpdateProperties & { /** - * The unique id of the resource setting - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current provisioning state of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; - /** - * The resource id of the gallery image used for creating the virtual machine - */ - galleryImageResourceId?: string; + readonly provisioningState?: ProvisioningState; /** - * The name of the image used to created the environment setting - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The image display name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly imageName?: string; + readonly displayName?: string; /** - * The size of the virtual machine. Possible values include: 'Basic', 'Standard', 'Performance' + * A description of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - size?: ManagedLabVmSize; + readonly description?: string; /** - * The translated compute cores of the virtual machine - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * URL of the image icon. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly cores?: number; + readonly iconUrl?: string; /** - * Details specific to Reference Vm + * The image author. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - referenceVm: ReferenceVm; -} - -/** - * Represents settings of an environment, from which environment instances would be created - */ -export interface EnvironmentSetting extends Resource { + readonly author?: string; /** - * Describes the readiness of this environment setting. Possible values include: 'Draft', - * 'Publishing', 'Published', 'PublishFailed', 'Scaling' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The OS Type of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly publishingState?: PublishingState; + readonly osType?: OsType; /** - * Describes the user's progress in configuring their environment setting. Possible values - * include: 'NotApplicable', 'Completed' + * The ID of marketplace plan associated with the image (optional). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - configurationState?: ConfigurationState; + readonly plan?: string; /** - * Describes the environment and its resource settings + * The status of image terms of use (enabled = accepted, disabled = not accepted). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; + readonly termsStatus?: EnableState; /** - * Brief title describing the environment and its resource settings + * The ID of an offer associated with the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - title?: string; + readonly offer?: string; /** - * The resource specific settings + * The ID of the publisher of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceSettings: ResourceSettings; + readonly publisher?: string; /** - * Time when the template VM was last changed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The image SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastChanged?: Date; + readonly sku?: string; /** - * Time when the template VM was last sent for publishing. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The image version. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastPublished?: Date; + readonly version?: string; /** - * The provisioning status of the resource. + * The ID for the image in the shared gallery. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provisioningState?: string; + readonly sharedGalleryId?: string; + /** The available regions of the image in the shared gallery. */ + availableRegions?: string[]; /** - * The unique immutable identifier of a resource (Guid). + * The OS State of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - uniqueIdentifier?: string; + readonly osState?: OsState; +}; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export type ProxyResource = Resource & {}; + +/** 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; +}; + +/** Lab plan resource properties */ +export type LabPlanProperties = LabPlanUpdateProperties & { /** - * The details of the latest operation. ex: status, error - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current provisioning state of the lab plan. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly latestOperationResult?: LatestOperationResult; -} + readonly provisioningState?: ProvisioningState; +}; -/** - * Details of a Reference Vm - */ -export interface ReferenceVmFragment { +/** Contains lab configuration and default settings. This variant is used for PATCH. */ +export type LabPlanUpdate = TrackedResourceUpdate & { + /** The default lab connection profile. This can be changed on a lab resource and only provides a default profile. */ + defaultConnectionProfile?: ConnectionProfile; + /** The default lab shutdown profile. This can be changed on a lab resource and only provides a default profile. */ + defaultAutoShutdownProfile?: AutoShutdownProfile; + /** The lab plan network profile. To enforce lab network policies they must be defined here and cannot be changed when there are existing labs associated with this lab plan. */ + defaultNetworkProfile?: LabPlanNetworkProfile; + /** The allowed regions for the lab creator to use when creating labs using this lab plan. */ + allowedRegions?: string[]; + /** Resource ID of the Shared Image Gallery attached to this lab plan. When saving a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be made available to use when creating new labs. */ + sharedGalleryId?: string; + /** Support contact information and instructions for users of the lab plan. This information is displayed to lab owners and virtual machine users for all labs in the lab plan. */ + supportInfo?: SupportInfo; + /** Base Url of the lms instance this lab plan can link lab rosters against. */ + linkedLmsInstance?: string; +}; + +/** The lab resource for updates. */ +export type LabUpdate = TrackedResourceUpdate & { + /** The resource auto shutdown configuration for the lab. This controls whether actions are taken on resources that are sitting idle. */ + autoShutdownProfile?: AutoShutdownProfile; + /** The connection profile for the lab. This controls settings such as web access to lab resources or whether RDP or SSH ports are open. */ + connectionProfile?: ConnectionProfile; + /** The profile used for creating lab virtual machines. */ + virtualMachineProfile?: VirtualMachineProfile; + /** The lab security profile. */ + securityProfile?: SecurityProfile; + /** The lab user list management profile. */ + rosterProfile?: RosterProfile; + /** The ID of the lab plan. Used during resource creation to provide defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides organization.. */ + labPlanId?: string; + /** The title of the lab. */ + title?: string; + /** The description of the lab. */ + description?: string; +}; + +/** Properties of a lab resource. */ +export type LabProperties = LabUpdateProperties & { /** - * The username of the virtual machine + * Current provisioning state of the lab. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - userName?: string; + readonly provisioningState?: ProvisioningState; + /** The network profile for the lab, typically applied via a lab plan. This profile cannot be modified once a lab has been created. */ + networkProfile?: LabNetworkProfile; /** - * The password of the virtual machine. This will be set to null in GET resource API + * The lab state. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - password?: string; -} + readonly state?: LabState; +}; -/** - * Represents resource specific settings - */ -export interface ResourceSettingsFragment { +/** Schedule resource properties */ +export type ScheduleProperties = ScheduleUpdateProperties & { /** - * The resource id of the gallery image used for creating the virtual machine + * Current provisioning state of the schedule. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - galleryImageResourceId?: string; + readonly provisioningState?: ProvisioningState; +}; + +/** User resource properties */ +export type UserProperties = UserUpdateProperties & { /** - * The size of the virtual machine. Possible values include: 'Basic', 'Standard', 'Performance' + * Current provisioning state of the user resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - size?: ManagedLabVmSize; + readonly provisioningState?: ProvisioningState; /** - * Details specific to Reference Vm + * Display name of the user, for example user's full name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - referenceVm?: ReferenceVmFragment; -} - -/** - * Represents settings of an environment, from which environment instances would be created - */ -export interface EnvironmentSettingFragment extends Resource { + readonly displayName?: string; + /** Email address of the user. */ + email: string; /** - * Describes the user's progress in configuring their environment setting. Possible values - * include: 'NotApplicable', 'Completed' + * State of the user's registration within the lab. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - configurationState?: ConfigurationState; + readonly registrationState?: RegistrationState; /** - * Describes the environment and its resource settings + * State of the invitation message for the user. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; + readonly invitationState?: InvitationState; /** - * Brief title describing the environment and its resource settings + * Date and time when the invitation message was sent to the user. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - title?: string; + readonly invitationSent?: Date; /** - * The resource specific settings + * How long the user has used their virtual machines in this lab. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceSettings?: ResourceSettingsFragment; + readonly totalUsage?: string; +}; + +/** Lab services virtual machine image */ +export type Image = ProxyResource & { /** - * The provisioning status of the resource. + * Metadata pertaining to creation and last modification of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provisioningState?: string; + readonly systemData?: SystemData; + /** Is the image enabled */ + enabledState?: EnableState; /** - * The unique immutable identifier of a resource (Guid). + * Current provisioning state of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - uniqueIdentifier?: string; -} - -/** - * Contains detailed information about a size - */ -export interface SizeInfo { + readonly provisioningState?: ProvisioningState; /** - * Represents the actual compute size, e.g. Standard_A2_v2. + * The image display name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - computeSize?: string; + readonly displayName?: string; /** - * The pay-as-you-go price per hour this size will cost. It does not include discounts and may - * not reflect the actual price the size will cost. + * A description of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - price?: number; + readonly description?: string; /** - * The number of cores a VM of this size has. + * URL of the image icon. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - numberOfCores?: number; + readonly iconUrl?: string; /** - * The amount of memory available (in GB). + * The image author. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - memory?: number; -} - -/** - * Represents a size category supported by this Lab Account (small, medium or large) - */ -export interface EnvironmentSize { + readonly author?: string; /** - * The size category. Possible values include: 'Basic', 'Standard', 'Performance' + * The OS Type of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name?: ManagedLabVmSize; + readonly osType?: OsType; /** - * Represents a set of compute sizes that can serve this given size type + * The ID of marketplace plan associated with the image (optional). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - vmSizes?: SizeInfo[]; + readonly plan?: string; /** - * The pay-as-you-go dollar price per hour this size will cost. It does not include discounts and - * may not reflect the actual price the size will cost. This is the maximum price of all prices - * within this tier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The status of image terms of use (enabled = accepted, disabled = not accepted). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly maxPrice?: number; + readonly termsStatus?: EnableState; /** - * The number of cores a VM of this size has. This is the minimum number of cores within this - * tier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ID of an offer associated with the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly minNumberOfCores?: number; + readonly offer?: string; /** - * The amount of memory available (in GB). This is the minimum amount of memory within this tier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ID of the publisher of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly minMemory?: number; -} - -/** - * Contains detailed information about a size - */ -export interface SizeInfoFragment { + readonly publisher?: string; /** - * Represents the actual compute size, e.g. Standard_A2_v2. + * The image SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - computeSize?: string; + readonly sku?: string; /** - * The pay-as-you-go price per hour this size will cost. It does not include discounts and may - * not reflect the actual price the size will cost. + * The image version. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - price?: number; + readonly version?: string; /** - * The number of cores a VM of this size has. + * The ID for the image in the shared gallery. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - numberOfCores?: number; + readonly sharedGalleryId?: string; + /** The available regions of the image in the shared gallery. */ + availableRegions?: string[]; /** - * The amount of memory available (in GB). + * The OS State of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - memory?: number; -} + readonly osState?: OsState; +}; -/** - * Represents a size category supported by this Lab Account (small, medium or large) - */ -export interface EnvironmentSizeFragment { +/** Schedule for automatically turning virtual machines in a lab on and off at specified times. */ +export type Schedule = ProxyResource & { /** - * The size category. Possible values include: 'Basic', 'Standard', 'Performance' + * Metadata pertaining to creation and last modification of the schedule. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name?: ManagedLabVmSize; + readonly systemData?: SystemData; + /** When lab user virtual machines will be started. Timestamp offsets will be ignored and timeZoneId is used instead. */ + startAt?: Date; + /** When lab user virtual machines will be stopped. Timestamp offsets will be ignored and timeZoneId is used instead. */ + stopAt?: Date; + /** The recurrence pattern of the scheduled actions. */ + recurrencePattern?: RecurrencePattern; + /** The IANA timezone id for the schedule. */ + timeZoneId?: string; + /** Notes for this schedule. */ + notes?: string; /** - * Represents a set of compute sizes that can serve this given size type + * Current provisioning state of the schedule. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - vmSizes?: SizeInfoFragment[]; -} + readonly provisioningState?: ProvisioningState; +}; -/** - * The reference information for an Azure Marketplace image. - */ -export interface GalleryImageReference { +/** User of a lab that can register for and use virtual machines within the lab. */ +export type User = ProxyResource & { /** - * The offer of the gallery image. + * Metadata pertaining to creation and last modification of the user resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - offer?: string; + readonly systemData?: SystemData; + /** The amount of usage quota time the user gets in addition to the lab usage quota. */ + additionalUsageQuota?: string; /** - * The publisher of the gallery image. + * Current provisioning state of the user resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - publisher?: string; + readonly provisioningState?: ProvisioningState; /** - * The SKU of the gallery image. + * Display name of the user, for example user's full name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sku?: string; + readonly displayName?: string; + /** Email address of the user. */ + email: string; /** - * The OS type of the gallery image. + * State of the user's registration within the lab. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - osType?: string; + readonly registrationState?: RegistrationState; /** - * The version of the gallery image. + * State of the invitation message for the user. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - version?: string; -} - -/** - * Represents an image from the Azure Marketplace - */ -export interface GalleryImage extends Resource { + readonly invitationState?: InvitationState; /** - * The author of the gallery image. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Date and time when the invitation message was sent to the user. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly author?: string; + readonly invitationSent?: Date; /** - * The creation date of the gallery image. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * How long the user has used their virtual machines in this lab. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdDate?: Date; + readonly totalUsage?: string; +}; + +/** A lab virtual machine resource. */ +export type VirtualMachine = ProxyResource & { /** - * The description of the gallery image. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * System data of the Lab virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly description?: string; + readonly systemData?: SystemData; /** - * The image reference of the gallery image. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current provisioning state of the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly imageReference?: GalleryImageReference; + readonly provisioningState?: ProvisioningState; /** - * The icon of the gallery image. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The current state of the virtual machine + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly icon?: string; + readonly state?: VirtualMachineState; /** - * Indicates whether this gallery image is enabled. + * Profile for information about connecting to the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - isEnabled?: boolean; + readonly connectionProfile?: VirtualMachineConnectionProfile; /** - * Indicates whether this gallery has been overridden for this lab account + * The lab user ID (not the PUID!) of who claimed the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - isOverride?: boolean; + readonly claimedByUserId?: string; /** - * The third party plan that applies to this image - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of this VM resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly planId?: string; + readonly vmType?: VirtualMachineType; +}; + +/** Lab Plans act as a permission container for creating labs via labs.azure.com. Additionally, they can provide a set of default configurations that will apply at the time of creating a lab, but these defaults can still be overwritten. */ +export type LabPlan = TrackedResource & { + /** + * Metadata pertaining to creation and last modification of the lab plan. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The default lab connection profile. This can be changed on a lab resource and only provides a default profile. */ + defaultConnectionProfile?: ConnectionProfile; + /** The default lab shutdown profile. This can be changed on a lab resource and only provides a default profile. */ + defaultAutoShutdownProfile?: AutoShutdownProfile; + /** The lab plan network profile. To enforce lab network policies they must be defined here and cannot be changed when there are existing labs associated with this lab plan. */ + defaultNetworkProfile?: LabPlanNetworkProfile; + /** The allowed regions for the lab creator to use when creating labs using this lab plan. */ + allowedRegions?: string[]; + /** Resource ID of the Shared Image Gallery attached to this lab plan. When saving a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be made available to use when creating new labs. */ + sharedGalleryId?: string; + /** Support contact information and instructions for users of the lab plan. This information is displayed to lab owners and virtual machine users for all labs in the lab plan. */ + supportInfo?: SupportInfo; + /** Base Url of the lms instance this lab plan can link lab rosters against. */ + linkedLmsInstance?: string; + /** + * Current provisioning state of the lab plan. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +}; + +/** The lab resource. */ +export type Lab = TrackedResource & { + /** + * Metadata pertaining to creation and last modification of the lab. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The resource auto shutdown configuration for the lab. This controls whether actions are taken on resources that are sitting idle. */ + autoShutdownProfile?: AutoShutdownProfile; + /** The connection profile for the lab. This controls settings such as web access to lab resources or whether RDP or SSH ports are open. */ + connectionProfile?: ConnectionProfile; + /** The profile used for creating lab virtual machines. */ + virtualMachineProfile?: VirtualMachineProfile; + /** The lab security profile. */ + securityProfile?: SecurityProfile; + /** The lab user list management profile. */ + rosterProfile?: RosterProfile; + /** The ID of the lab plan. Used during resource creation to provide defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides organization.. */ + labPlanId?: string; + /** The title of the lab. */ + title?: string; + /** The description of the lab. */ + description?: string; /** - * Indicates if the plan has been authorized for programmatic deployment. + * Current provisioning state of the lab. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - isPlanAuthorized?: boolean; + readonly provisioningState?: ProvisioningState; + /** The network profile for the lab, typically applied via a lab plan. This profile cannot be modified once a lab has been created. */ + networkProfile?: LabNetworkProfile; /** - * The provisioning status of the resource. + * The lab state. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provisioningState?: string; - /** - * The unique immutable identifier of a resource (Guid). - */ - uniqueIdentifier?: string; - /** - * The details of the latest operation. ex: status, error - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly latestOperationResult?: LatestOperationResult; -} - -/** - * Represents an image from the Azure Marketplace - */ -export interface GalleryImageFragment extends Resource { - /** - * Indicates whether this gallery image is enabled. - */ - isEnabled?: boolean; - /** - * Indicates whether this gallery has been overridden for this lab account - */ - isOverride?: boolean; - /** - * Indicates if the plan has been authorized for programmatic deployment. - */ - isPlanAuthorized?: boolean; - /** - * The provisioning status of the resource. - */ - provisioningState?: string; - /** - * The unique immutable identifier of a resource (Guid). - */ - uniqueIdentifier?: string; -} - -/** - * The reference information for an Azure Marketplace image. - */ -export interface GalleryImageReferenceFragment { - /** - * The offer of the gallery image. - */ - offer?: string; - /** - * The publisher of the gallery image. - */ - publisher?: string; - /** - * The SKU of the gallery image. - */ - sku?: string; - /** - * The OS type of the gallery image. - */ - osType?: string; - /** - * The version of the gallery image. - */ - version?: string; -} - -/** - * Represents the environments details - */ -export interface GetEnvironmentResponse { - /** - * Details of the environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly environment?: EnvironmentDetails; -} - -/** - * Represents the PersonalPreferences for the user - */ -export interface GetPersonalPreferencesResponse { - /** - * Id to be used by the cache orchestrator - */ - id?: string; - /** - * Array of favorite lab resource ids - */ - favoriteLabResourceIds?: string[]; -} - -/** - * Represents the size information - */ -export interface SizeAvailability { - /** - * The category of the size (Basic, Standard, Performance). Possible values include: 'Basic', - * 'Standard', 'Performance' - */ - sizeCategory?: ManagedLabVmSize; - /** - * Whether or not this size category is available - */ - isAvailable?: boolean; -} - -/** - * The availability information of sizes across regions - */ -export interface RegionalAvailability { - /** - * Corresponding region - */ - region?: string; - /** - * List of all the size information for the region - */ - sizeAvailabilities?: SizeAvailability[]; -} - -/** - * The response model from the GetRegionalAvailability action - */ -export interface GetRegionalAvailabilityResponse { - /** - * Availability information for different size categories per region - */ - regionalAvailability?: RegionalAvailability[]; -} - -/** - * Represents a lab. - */ -export interface Lab extends Resource { - /** - * Maximum number of users allowed in the lab. - */ - maxUsersInLab?: number; - /** - * Maximum value MaxUsersInLab can be set to, as specified by the service - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly userQuota?: number; - /** - * Invitation code that users can use to join a lab. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly invitationCode?: string; - /** - * Object id of the user that created the lab. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly createdByObjectId?: string; - /** - * Maximum duration a user can use an environment for in the lab. - */ - usageQuota?: string; - /** - * Lab user access mode (open to all vs. restricted to those listed on the lab). Possible values - * include: 'Restricted', 'Open' - */ - userAccessMode?: LabUserAccessMode; - /** - * Lab creator name - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly createdByUserPrincipalName?: string; - /** - * Creation date for the lab - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly createdDate?: Date; - /** - * The provisioning status of the resource. - */ - provisioningState?: string; - /** - * The unique immutable identifier of a resource (Guid). - */ - uniqueIdentifier?: string; - /** - * The details of the latest operation. ex: status, error - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly latestOperationResult?: LatestOperationResult; -} - -/** - * Represents the size configuration under the lab account - */ -export interface SizeConfigurationProperties { - /** - * Represents a list of size categories supported by this Lab Account (Small, Medium, Large) - */ - environmentSizes?: EnvironmentSize[]; -} - -/** - * Represents a lab account. - */ -export interface LabAccount extends Resource { - /** - * Represents the size configuration under the lab account - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly sizeConfiguration?: SizeConfigurationProperties; - /** - * Represents if region selection is enabled - */ - enabledRegionSelection?: boolean; - /** - * The provisioning status of the resource. - */ - provisioningState?: string; - /** - * The unique immutable identifier of a resource (Guid). - */ - uniqueIdentifier?: string; - /** - * The details of the latest operation. ex: status, error - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly latestOperationResult?: LatestOperationResult; -} - -/** - * Represents a lab account. - */ -export interface LabAccountFragment extends Resource { - /** - * Represents if region selection is enabled - */ - enabledRegionSelection?: boolean; - /** - * The provisioning status of the resource. - */ - provisioningState?: string; - /** - * The unique immutable identifier of a resource (Guid). - */ - uniqueIdentifier?: string; -} - -/** - * This represents the details about a lab that the User is in, and its state. - */ -export interface LabDetails { - /** - * Name of the lab - */ - name?: string; - /** - * The provisioning state of the lab. - */ - provisioningState?: string; - /** - * The Id of the lab. - */ - id?: string; - /** - * The maximum duration a user can use a VM in this lab. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly usageQuota?: string; -} - -/** - * Represents a lab. - */ -export interface LabFragment extends Resource { - /** - * Maximum number of users allowed in the lab. - */ - maxUsersInLab?: number; - /** - * Maximum duration a user can use an environment for in the lab. - */ - usageQuota?: string; - /** - * Lab user access mode (open to all vs. restricted to those listed on the lab). Possible values - * include: 'Restricted', 'Open' - */ - userAccessMode?: LabUserAccessMode; - /** - * The provisioning status of the resource. - */ - provisioningState?: string; - /** - * The unique immutable identifier of a resource (Guid). - */ - uniqueIdentifier?: string; -} - -/** - * Represents the payload to list environments owned by a user - */ -export interface ListEnvironmentsPayload { - /** - * The resource Id of the lab - */ - labId?: string; -} - -/** - * Represents the list of environments owned by a user - */ -export interface ListEnvironmentsResponse { - /** - * List of all the environments - */ - environments?: EnvironmentDetails[]; -} - -/** - * Lists the labs owned by a user - */ -export interface ListLabsResponse { - /** - * List of all the labs - */ - labs?: LabDetails[]; -} - -/** - * Payload to get the status of an operation - */ -export interface OperationBatchStatusPayload { - /** - * The operation url of long running operation - */ - urls: string[]; -} - -/** - * Represents the status of an operation that used the batch API. - */ -export interface OperationBatchStatusResponseItem { - /** - * status of the long running operation for an environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operationUrl?: string; - /** - * status of the long running operation for an environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: string; -} - -/** - * Status Details of the long running operation for an environment - */ -export interface OperationBatchStatusResponse { - /** - * Gets a collection of items that contain the operation url and status. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly items?: OperationBatchStatusResponseItem[]; -} - -/** - * Error details for the operation in case of a failure. - */ -export interface OperationError { - /** - * The error code of the operation error. - */ - code?: string; - /** - * The error message of the operation error. - */ - message?: string; -} - -/** - * The object that describes the operations - */ -export interface OperationMetadataDisplay { - /** - * Friendly name of the resource provider - */ - provider?: string; - /** - * Resource type on which the operation is performed. - */ - resource?: string; - /** - * Operation type: read, write, delete, listKeys/action, etc. - */ - operation?: string; - /** - * Friendly name of the operation - */ - description?: string; -} - -/** - * The REST API operation supported by ManagedLab ResourceProvider. - */ -export interface OperationMetadata { - /** - * Operation name: {provider}/{resource}/{operation} - */ - name?: string; - /** - * The object that describes the operations - */ - display?: OperationMetadataDisplay; -} - -/** - * An Operation Result - */ -export interface OperationResult { - /** - * The operation status. - */ - status?: string; - /** - * Error details for the operation in case of a failure. - */ - error?: OperationError; -} - -/** - * Payload to get the status of an operation - */ -export interface OperationStatusPayload { - /** - * The operation url of long running operation - */ - operationUrl: string; -} - -/** - * Status Details of the long running operation for an environment - */ -export interface OperationStatusResponse { - /** - * status of the long running operation for an environment - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: string; -} + readonly state?: LabState; +}; -/** - * Represents payload for any Environment operations like get, start, stop, connect - */ -export interface PersonalPreferencesOperationsPayload { - /** - * Resource Id of the lab account - */ - labAccountResourceId?: string; - /** - * Enum indicating if user is adding or removing a favorite lab. Possible values include: 'Add', - * 'Remove' - */ - addRemove?: AddRemove; - /** - * Resource Id of the lab to add/remove from the favorites list - */ - labResourceId?: string; +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" } /** - * Payload for Publish operation on EnvironmentSetting. + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** */ -export interface PublishPayload { - /** - * Whether to use existing VM custom image when publishing. - */ - useExistingImage?: boolean; -} +export type CreatedByType = string; -/** - * Represents payload for Register action. - */ -export interface RegisterPayload { - /** - * The registration code of the lab. - */ - registrationCode?: string; +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + User = "user", + System = "system", + UserSystem = "user,system" } /** - * Represents the payload for resetting passwords. + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** */ -export interface ResetPasswordPayload { - /** - * The resourceId of the environment - */ - environmentId: string; - /** - * The username for which the password will be reset. - */ - username?: string; - /** - * The password to assign to the user specified in - */ - password?: string; -} +export type Origin = string; -/** - * Represents the size configuration under the lab account - */ -export interface SizeConfigurationPropertiesFragment { - /** - * Represents a list of size categories supported by this Lab Account (Small, Medium, Large) - */ - environmentSizes?: EnvironmentSizeFragment[]; -} - -/** - * The User registered to a lab - */ -export interface User extends Resource { - /** - * The user email address, as it was specified during registration. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly email?: string; - /** - * The user family name, as it was specified during registration. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly familyName?: string; - /** - * The user given name, as it was specified during registration. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly givenName?: string; - /** - * The user tenant ID, as it was specified during registration. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly tenantId?: string; - /** - * How long the user has used his VMs in this lab - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly totalUsage?: string; - /** - * The provisioning status of the resource. - */ - provisioningState?: string; - /** - * The unique immutable identifier of a resource (Guid). - */ - uniqueIdentifier?: string; - /** - * The details of the latest operation. ex: status, error - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly latestOperationResult?: LatestOperationResult; +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + Internal = "Internal" } /** - * The User registered to a lab + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** */ -export interface UserFragment extends Resource { - /** - * The provisioning status of the resource. - */ - provisioningState?: string; - /** - * The unique immutable identifier of a resource (Guid). - */ - uniqueIdentifier?: string; -} +export type ActionType = string; -/** - * Optional Parameters. - */ -export interface GlobalUsersGetEnvironmentOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($expand=environment)' - */ - expand?: string; +/** Known values of {@link UsageUnit} that the service accepts. */ +export enum KnownUsageUnit { + Count = "Count" } /** - * Optional Parameters. - */ -export interface LabAccountsListBySubscriptionOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($expand=sizeConfiguration)' - */ - expand?: string; - /** - * The filter to apply to the operation. - */ + * Defines values for UsageUnit. \ + * {@link KnownUsageUnit} can be used interchangeably with UsageUnit, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Count** + */ +export type UsageUnit = string; + +/** Known values of {@link LabServicesSkuTier} that the service accepts. */ +export enum KnownLabServicesSkuTier { + Standard = "Standard", + Premium = "Premium" +} + +/** + * Defines values for LabServicesSkuTier. \ + * {@link KnownLabServicesSkuTier} can be used interchangeably with LabServicesSkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard** \ + * **Premium** + */ +export type LabServicesSkuTier = string; + +/** Known values of {@link ScaleType} that the service accepts. */ +export enum KnownScaleType { + /** The capacity is not adjustable in any way. */ + None = "None", + /** The user must manually scale this SKU in and out. */ + Manual = "Manual", + /** The user is permitted to scale this SKU in and out. */ + Automatic = "Automatic" +} + +/** + * Defines values for ScaleType. \ + * {@link KnownScaleType} can be used interchangeably with ScaleType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: The capacity is not adjustable in any way. \ + * **Manual**: The user must manually scale this SKU in and out. \ + * **Automatic**: The user is permitted to scale this SKU in and out. + */ +export type ScaleType = string; + +/** Known values of {@link RestrictionType} that the service accepts. */ +export enum KnownRestrictionType { + Location = "Location" +} + +/** + * Defines values for RestrictionType. \ + * {@link KnownRestrictionType} can be used interchangeably with RestrictionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Location** + */ +export type RestrictionType = string; + +/** Known values of {@link RestrictionReasonCode} that the service accepts. */ +export enum KnownRestrictionReasonCode { + QuotaId = "QuotaId", + NotAvailableForSubscription = "NotAvailableForSubscription" +} + +/** + * Defines values for RestrictionReasonCode. \ + * {@link KnownRestrictionReasonCode} can be used interchangeably with RestrictionReasonCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **QuotaId** \ + * **NotAvailableForSubscription** + */ +export type RestrictionReasonCode = string; +/** Defines values for ProvisioningState. */ +export type ProvisioningState = + | "Creating" + | "Updating" + | "Deleting" + | "Succeeded" + | "Failed" + | "Locked"; +/** Defines values for OsType. */ +export type OsType = "Windows" | "Linux"; +/** Defines values for EnableState. */ +export type EnableState = "Enabled" | "Disabled"; +/** Defines values for OsState. */ +export type OsState = "Generalized" | "Specialized"; +/** Defines values for ConnectionType. */ +export type ConnectionType = "Public" | "Private" | "None"; +/** Defines values for ShutdownOnIdleMode. */ +export type ShutdownOnIdleMode = "None" | "UserAbsence" | "LowUsage"; +/** Defines values for LabState. */ +export type LabState = + | "Draft" + | "Publishing" + | "Scaling" + | "Syncing" + | "Published"; +/** Defines values for CreateOption. */ +export type CreateOption = "Image" | "TemplateVM"; +/** Defines values for SkuTier. */ +export type SkuTier = "Free" | "Basic" | "Standard" | "Premium"; +/** Defines values for OperationStatus. */ +export type OperationStatus = + | "NotStarted" + | "InProgress" + | "Succeeded" + | "Failed" + | "Canceled"; +/** Defines values for RecurrenceFrequency. */ +export type RecurrenceFrequency = "Daily" | "Weekly"; +/** Defines values for WeekDay. */ +export type WeekDay = + | "Sunday" + | "Monday" + | "Tuesday" + | "Wednesday" + | "Thursday" + | "Friday" + | "Saturday"; +/** Defines values for RegistrationState. */ +export type RegistrationState = "Registered" | "NotRegistered"; +/** Defines values for InvitationState. */ +export type InvitationState = "NotSent" | "Sending" | "Sent" | "Failed"; +/** Defines values for VirtualMachineState. */ +export type VirtualMachineState = + | "Stopped" + | "Starting" + | "Running" + | "Stopping" + | "ResettingPassword" + | "Reimaging" + | "Redeploying"; +/** Defines values for VirtualMachineType. */ +export type VirtualMachineType = "User" | "Template"; + +/** Optional parameters. */ +export interface ImagesListByLabPlanOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ filter?: string; - /** - * The maximum number of resources to return from the operation. - */ - top?: number; - /** - * The ordering expression for the results, using OData notation. - */ - orderby?: string; } -/** - * Optional Parameters. - */ -export interface LabAccountsListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($expand=sizeConfiguration)' - */ - expand?: string; - /** - * The filter to apply to the operation. - */ - filter?: string; - /** - * The maximum number of resources to return from the operation. - */ - top?: number; - /** - * The ordering expression for the results, using OData notation. - */ - orderby?: string; -} +/** Contains response data for the listByLabPlan operation. */ +export type ImagesListByLabPlanResponse = PagedImages; -/** - * Optional Parameters. - */ -export interface LabAccountsGetOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($expand=sizeConfiguration)' - */ - expand?: string; -} +/** Optional parameters. */ +export interface ImagesGetOptionalParams extends coreClient.OperationOptions {} -/** - * Optional Parameters. - */ -export interface GalleryImagesListOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($select=author)' - */ - expand?: string; - /** - * The filter to apply to the operation. - */ - filter?: string; - /** - * The maximum number of resources to return from the operation. - */ - top?: number; - /** - * The ordering expression for the results, using OData notation. - */ - orderby?: string; -} +/** Contains response data for the get operation. */ +export type ImagesGetResponse = Image; -/** - * Optional Parameters. - */ -export interface GalleryImagesGetOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($select=author)' - */ - expand?: string; -} +/** Optional parameters. */ +export interface ImagesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Optional Parameters. - */ -export interface LabsListOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($select=maxUsersInLab)' - */ - expand?: string; - /** - * The filter to apply to the operation. - */ - filter?: string; - /** - * The maximum number of resources to return from the operation. - */ - top?: number; - /** - * The ordering expression for the results, using OData notation. - */ - orderby?: string; -} +/** Contains response data for the createOrUpdate operation. */ +export type ImagesCreateOrUpdateResponse = Image; -/** - * Optional Parameters. - */ -export interface LabsGetOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($select=maxUsersInLab)' - */ - expand?: string; -} +/** Optional parameters. */ +export interface ImagesUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Optional Parameters. - */ -export interface EnvironmentSettingsListOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($select=publishingState)' - */ - expand?: string; - /** - * The filter to apply to the operation. - */ - filter?: string; - /** - * The maximum number of resources to return from the operation. - */ - top?: number; - /** - * The ordering expression for the results, using OData notation. - */ - orderby?: string; -} - -/** - * Optional Parameters. - */ -export interface EnvironmentSettingsGetOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($select=publishingState)' - */ - expand?: string; -} - -/** - * Optional Parameters. - */ -export interface EnvironmentsListOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($expand=networkInterface)' - */ - expand?: string; - /** - * The filter to apply to the operation. - */ - filter?: string; - /** - * The maximum number of resources to return from the operation. - */ - top?: number; - /** - * The ordering expression for the results, using OData notation. - */ - orderby?: string; -} - -/** - * Optional Parameters. - */ -export interface EnvironmentsGetOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($expand=networkInterface)' - */ - expand?: string; -} +/** Contains response data for the update operation. */ +export type ImagesUpdateResponse = Image; -/** - * Optional Parameters. - */ -export interface UsersListOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($select=email)' - */ - expand?: string; - /** - * The filter to apply to the operation. - */ - filter?: string; - /** - * The maximum number of resources to return from the operation. - */ - top?: number; - /** - * The ordering expression for the results, using OData notation. - */ - orderby?: string; -} - -/** - * Optional Parameters. - */ -export interface UsersGetOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify the $expand query. Example: 'properties($select=email)' - */ - expand?: string; -} - -/** - * An interface representing ManagedLabsClientOptions. - */ -export interface ManagedLabsClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} - -/** - * @interface - * Result of the request to list REST API operations - * @extends Array - */ -export interface ProviderOperationResult extends Array { - /** - * URL to get the next set of operation list results if there are any. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * @interface - * The response of a list operation. - * @extends Array - */ -export interface ResponseWithContinuationLabAccount extends Array { - /** - * Link for next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * The response of a list operation. - * @extends Array - */ -export interface ResponseWithContinuationGalleryImage extends Array { - /** - * Link for next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * The response of a list operation. - * @extends Array - */ -export interface ResponseWithContinuationLab extends Array { - /** - * Link for next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * The response of a list operation. - * @extends Array - */ -export interface ResponseWithContinuationEnvironmentSetting extends Array { - /** - * Link for next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * The response of a list operation. - * @extends Array - */ -export interface ResponseWithContinuationEnvironment extends Array { - /** - * Link for next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * The response of a list operation. - * @extends Array - */ -export interface ResponseWithContinuationUser extends Array { - /** - * Link for next set of results. - */ - nextLink?: string; -} - -/** - * Defines values for ManagedLabVmSize. - * Possible values include: 'Basic', 'Standard', 'Performance' - * @readonly - * @enum {string} - */ -export type ManagedLabVmSize = 'Basic' | 'Standard' | 'Performance'; - -/** - * Defines values for PublishingState. - * Possible values include: 'Draft', 'Publishing', 'Published', 'PublishFailed', 'Scaling' - * @readonly - * @enum {string} - */ -export type PublishingState = 'Draft' | 'Publishing' | 'Published' | 'PublishFailed' | 'Scaling'; - -/** - * Defines values for ConfigurationState. - * Possible values include: 'NotApplicable', 'Completed' - * @readonly - * @enum {string} - */ -export type ConfigurationState = 'NotApplicable' | 'Completed'; - -/** - * Defines values for LabUserAccessMode. - * Possible values include: 'Restricted', 'Open' - * @readonly - * @enum {string} - */ -export type LabUserAccessMode = 'Restricted' | 'Open'; - -/** - * Defines values for AddRemove. - * Possible values include: 'Add', 'Remove' - * @readonly - * @enum {string} - */ -export type AddRemove = 'Add' | 'Remove'; - -/** - * Contains response data for the list operation. - */ -export type ProviderOperationsListResponse = ProviderOperationResult & { - /** - * 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: ProviderOperationResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type ProviderOperationsListNextResponse = ProviderOperationResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface ImagesListByLabPlanNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProviderOperationResult; - }; -}; +/** Contains response data for the listByLabPlanNext operation. */ +export type ImagesListByLabPlanNextResponse = PagedImages; -/** - * Contains response data for the getEnvironment operation. - */ -export type GlobalUsersGetEnvironmentResponse = GetEnvironmentResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabPlansListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: GetEnvironmentResponse; - }; -}; +/** Contains response data for the listBySubscription operation. */ +export type LabPlansListBySubscriptionResponse = PagedLabPlans; -/** - * Contains response data for the getOperationBatchStatus operation. - */ -export type GlobalUsersGetOperationBatchStatusResponse = OperationBatchStatusResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabPlansListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationBatchStatusResponse; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type LabPlansListByResourceGroupResponse = PagedLabPlans; -/** - * Contains response data for the getOperationStatus operation. - */ -export type GlobalUsersGetOperationStatusResponse = OperationStatusResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabPlansGetOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationStatusResponse; - }; -}; +/** Contains response data for the get operation. */ +export type LabPlansGetResponse = LabPlan; -/** - * Contains response data for the getPersonalPreferences operation. - */ -export type GlobalUsersGetPersonalPreferencesResponse = GetPersonalPreferencesResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabPlansCreateOrUpdateOptionalParams + 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: GetPersonalPreferencesResponse; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type LabPlansCreateOrUpdateResponse = LabPlan; -/** - * Contains response data for the listEnvironments operation. - */ -export type GlobalUsersListEnvironmentsResponse = ListEnvironmentsResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabPlansUpdateOptionalParams + 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ListEnvironmentsResponse; - }; -}; +/** Contains response data for the update operation. */ +export type LabPlansUpdateResponse = LabPlan; -/** - * Contains response data for the listLabs operation. - */ -export type GlobalUsersListLabsResponse = ListLabsResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabPlansDeleteOptionalParams + 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ListLabsResponse; - }; -}; +/** Optional parameters. */ +export interface LabPlansSaveImageOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listBySubscription operation. - */ -export type LabAccountsListBySubscriptionResponse = ResponseWithContinuationLabAccount & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabPlansListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationLabAccount; - }; -}; +/** Contains response data for the listBySubscriptionNext operation. */ +export type LabPlansListBySubscriptionNextResponse = PagedLabPlans; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type LabAccountsListByResourceGroupResponse = ResponseWithContinuationLabAccount & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabPlansListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationLabAccount; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type LabPlansListByResourceGroupNextResponse = PagedLabPlans; -/** - * Contains response data for the get operation. - */ -export type LabAccountsGetResponse = LabAccount & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: LabAccount; - }; -}; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; -/** - * Contains response data for the createOrUpdate operation. - */ -export type LabAccountsCreateOrUpdateResponse = LabAccount & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: LabAccount; - }; -}; +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; -/** - * Contains response data for the update operation. - */ -export type LabAccountsUpdateResponse = LabAccount & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabsListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: LabAccount; - }; -}; +/** Contains response data for the listBySubscription operation. */ +export type LabsListBySubscriptionResponse = PagedLabs; -/** - * Contains response data for the getRegionalAvailability operation. - */ -export type LabAccountsGetRegionalAvailabilityResponse = GetRegionalAvailabilityResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: GetRegionalAvailabilityResponse; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type LabsListByResourceGroupResponse = PagedLabs; -/** - * Contains response data for the listBySubscriptionNext operation. - */ -export type LabAccountsListBySubscriptionNextResponse = ResponseWithContinuationLabAccount & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabsGetOptionalParams extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationLabAccount; - }; -}; +/** Contains response data for the get operation. */ +export type LabsGetResponse = Lab; -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type LabAccountsListByResourceGroupNextResponse = ResponseWithContinuationLabAccount & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabsCreateOrUpdateOptionalParams + 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationLabAccount; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type LabsCreateOrUpdateResponse = Lab; -/** - * Contains response data for the get operation. - */ -export type OperationsGetResponse = OperationResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabsUpdateOptionalParams 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationResult; - }; -}; +/** Contains response data for the update operation. */ +export type LabsUpdateResponse = Lab; -/** - * Contains response data for the list operation. - */ -export type GalleryImagesListResponse = ResponseWithContinuationGalleryImage & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabsDeleteOptionalParams 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationGalleryImage; - }; -}; +/** Optional parameters. */ +export interface LabsPublishOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the get operation. - */ -export type GalleryImagesGetResponse = GalleryImage & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface LabsSyncGroupOptionalParams + 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: GalleryImage; - }; -}; +/** Optional parameters. */ +export interface LabsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type GalleryImagesCreateOrUpdateResponse = GalleryImage & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listBySubscriptionNext operation. */ +export type LabsListBySubscriptionNextResponse = PagedLabs; - /** - * The response body as parsed JSON or XML - */ - parsedBody: GalleryImage; - }; -}; +/** Optional parameters. */ +export interface LabsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type GalleryImagesUpdateResponse = GalleryImage & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByResourceGroupNext operation. */ +export type LabsListByResourceGroupNextResponse = PagedLabs; - /** - * The response body as parsed JSON or XML - */ - parsedBody: GalleryImage; - }; -}; +/** Optional parameters. */ +export interface OperationResultsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type GalleryImagesListNextResponse = ResponseWithContinuationGalleryImage & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type OperationResultsGetResponse = OperationResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationGalleryImage; - }; -}; +/** Optional parameters. */ +export interface SchedulesListByLabOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} -/** - * Contains response data for the list operation. - */ -export type LabsListResponse = ResponseWithContinuationLab & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByLab operation. */ +export type SchedulesListByLabResponse = PagedSchedules; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationLab; - }; -}; +/** Optional parameters. */ +export interface SchedulesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type LabsGetResponse = Lab & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type SchedulesGetResponse = Schedule; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Lab; - }; -}; +/** Optional parameters. */ +export interface SchedulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type LabsCreateOrUpdateResponse = Lab & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the createOrUpdate operation. */ +export type SchedulesCreateOrUpdateResponse = Schedule; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Lab; - }; -}; +/** Optional parameters. */ +export interface SchedulesUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type LabsUpdateResponse = Lab & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the update operation. */ +export type SchedulesUpdateResponse = Schedule; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Lab; - }; -}; +/** Optional parameters. */ +export interface SchedulesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listNext operation. - */ -export type LabsListNextResponse = ResponseWithContinuationLab & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface SchedulesListByLabNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationLab; - }; -}; +/** Contains response data for the listByLabNext operation. */ +export type SchedulesListByLabNextResponse = PagedSchedules; -/** - * Contains response data for the list operation. - */ -export type EnvironmentSettingsListResponse = ResponseWithContinuationEnvironmentSetting & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface UsersListByLabOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationEnvironmentSetting; - }; -}; +/** Contains response data for the listByLab operation. */ +export type UsersListByLabResponse = PagedUsers; -/** - * Contains response data for the get operation. - */ -export type EnvironmentSettingsGetResponse = EnvironmentSetting & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface UsersGetOptionalParams extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: EnvironmentSetting; - }; -}; +/** Contains response data for the get operation. */ +export type UsersGetResponse = User; -/** - * Contains response data for the createOrUpdate operation. - */ -export type EnvironmentSettingsCreateOrUpdateResponse = EnvironmentSetting & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface UsersCreateOrUpdateOptionalParams + 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: EnvironmentSetting; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type UsersCreateOrUpdateResponse = User; -/** - * Contains response data for the update operation. - */ -export type EnvironmentSettingsUpdateResponse = EnvironmentSetting & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface UsersUpdateOptionalParams 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: EnvironmentSetting; - }; -}; +/** Contains response data for the update operation. */ +export type UsersUpdateResponse = User; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type EnvironmentSettingsBeginCreateOrUpdateResponse = EnvironmentSetting & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface UsersDeleteOptionalParams 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: EnvironmentSetting; - }; -}; +/** Optional parameters. */ +export interface UsersInviteOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listNext operation. - */ -export type EnvironmentSettingsListNextResponse = ResponseWithContinuationEnvironmentSetting & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface UsersListByLabNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationEnvironmentSetting; - }; -}; +/** Contains response data for the listByLabNext operation. */ +export type UsersListByLabNextResponse = PagedUsers; -/** - * Contains response data for the list operation. - */ -export type EnvironmentsListResponse = ResponseWithContinuationEnvironment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface VirtualMachinesListByLabOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationEnvironment; - }; -}; +/** Contains response data for the listByLab operation. */ +export type VirtualMachinesListByLabResponse = PagedVirtualMachines; -/** - * Contains response data for the get operation. - */ -export type EnvironmentsGetResponse = Environment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface VirtualMachinesGetOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: Environment; - }; -}; +/** Contains response data for the get operation. */ +export type VirtualMachinesGetResponse = VirtualMachine; -/** - * Contains response data for the createOrUpdate operation. - */ -export type EnvironmentsCreateOrUpdateResponse = Environment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface VirtualMachinesStartOptionalParams + 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: Environment; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesStopOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the update operation. - */ -export type EnvironmentsUpdateResponse = Environment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface VirtualMachinesReimageOptionalParams + 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: Environment; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesRedeployOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listNext operation. - */ -export type EnvironmentsListNextResponse = ResponseWithContinuationEnvironment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface VirtualMachinesResetPasswordOptionalParams + 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationEnvironment; - }; -}; +/** Optional parameters. */ +export interface VirtualMachinesListByLabNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} -/** - * Contains response data for the list operation. - */ -export type UsersListResponse = ResponseWithContinuationUser & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByLabNext operation. */ +export type VirtualMachinesListByLabNextResponse = PagedVirtualMachines; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationUser; - }; -}; +/** Optional parameters. */ +export interface UsagesListByLocationOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} -/** - * Contains response data for the get operation. - */ -export type UsersGetResponse = User & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByLocation operation. */ +export type UsagesListByLocationResponse = ListUsagesResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: User; - }; -}; +/** Optional parameters. */ +export interface UsagesListByLocationNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type UsersCreateOrUpdateResponse = User & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByLocationNext operation. */ +export type UsagesListByLocationNextResponse = ListUsagesResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: User; - }; -}; +/** Optional parameters. */ +export interface SkusListOptionalParams extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} -/** - * Contains response data for the update operation. - */ -export type UsersUpdateResponse = User & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the list operation. */ +export type SkusListResponse = PagedLabServicesSkus; - /** - * The response body as parsed JSON or XML - */ - parsedBody: User; - }; -}; +/** Optional parameters. */ +export interface SkusListNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply to the operation. */ + filter?: string; +} -/** - * Contains response data for the listNext operation. - */ -export type UsersListNextResponse = ResponseWithContinuationUser & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listNext operation. */ +export type SkusListNextResponse = PagedLabServicesSkus; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResponseWithContinuationUser; - }; -}; +/** Optional parameters. */ +export interface LabServicesClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/labservices/arm-labservices/src/models/labAccountsMappers.ts b/sdk/labservices/arm-labservices/src/models/labAccountsMappers.ts deleted file mode 100644 index 52e28b9dc8cb..000000000000 --- a/sdk/labservices/arm-labservices/src/models/labAccountsMappers.ts +++ /dev/null @@ -1,47 +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 { - BaseResource, - CloudError, - CreateLabProperties, - Environment, - EnvironmentFragment, - EnvironmentSetting, - EnvironmentSettingCreationParameters, - EnvironmentSettingFragment, - EnvironmentSize, - GalleryImage, - GalleryImageFragment, - GalleryImageReference, - GetRegionalAvailabilityResponse, - Lab, - LabAccount, - LabAccountFragment, - LabCreationParameters, - LabFragment, - LatestOperationResult, - NetworkInterface, - ReferenceVm, - ReferenceVmCreationParameters, - ReferenceVmFragment, - RegionalAvailability, - Resource, - ResourceSet, - ResourceSetFragment, - ResourceSettingCreationParameters, - ResourceSettings, - ResourceSettingsFragment, - ResponseWithContinuationLabAccount, - SizeAvailability, - SizeConfigurationProperties, - SizeInfo, - User, - UserFragment, - VmStateDetails -} from "../models/mappers"; diff --git a/sdk/labservices/arm-labservices/src/models/labsMappers.ts b/sdk/labservices/arm-labservices/src/models/labsMappers.ts deleted file mode 100644 index 002177ba4a9b..000000000000 --- a/sdk/labservices/arm-labservices/src/models/labsMappers.ts +++ /dev/null @@ -1,40 +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 { - AddUsersPayload, - BaseResource, - CloudError, - Environment, - EnvironmentFragment, - EnvironmentSetting, - EnvironmentSettingFragment, - EnvironmentSize, - GalleryImage, - GalleryImageFragment, - GalleryImageReference, - Lab, - LabAccount, - LabAccountFragment, - LabFragment, - LatestOperationResult, - NetworkInterface, - ReferenceVm, - ReferenceVmFragment, - Resource, - ResourceSet, - ResourceSetFragment, - ResourceSettings, - ResourceSettingsFragment, - ResponseWithContinuationLab, - SizeConfigurationProperties, - SizeInfo, - User, - UserFragment, - VmStateDetails -} from "../models/mappers"; diff --git a/sdk/labservices/arm-labservices/src/models/mappers.ts b/sdk/labservices/arm-labservices/src/models/mappers.ts index 69719c5f97b8..405deaff5b92 100644 --- a/sdk/labservices/arm-labservices/src/models/mappers.ts +++ b/sdk/labservices/arm-labservices/src/models/mappers.ts @@ -1,55 +1,34 @@ /* - * 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 AddUsersPayload: msRest.CompositeMapper = { - serializedName: "AddUsersPayload", +export const PagedImages: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AddUsersPayload", + className: "PagedImages", modelProperties: { - emailAddresses: { - required: true, - serializedName: "emailAddresses", + value: { + serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "Image" } } } - } - } - } -}; - -export const ReferenceVmCreationParameters: msRest.CompositeMapper = { - serializedName: "ReferenceVmCreationParameters", - type: { - name: "Composite", - className: "ReferenceVmCreationParameters", - modelProperties: { - userName: { - required: true, - serializedName: "userName", - type: { - name: "String" - } }, - password: { - required: true, - serializedName: "password", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -58,558 +37,492 @@ export const ReferenceVmCreationParameters: msRest.CompositeMapper = { } }; -export const ResourceSettingCreationParameters: msRest.CompositeMapper = { - serializedName: "ResourceSettingCreationParameters", +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceSettingCreationParameters", + className: "SystemData", modelProperties: { - location: { - serializedName: "location", + createdBy: { + serializedName: "createdBy", type: { name: "String" } }, - name: { - serializedName: "name", + createdByType: { + serializedName: "createdByType", type: { name: "String" } }, - galleryImageResourceId: { - required: true, - serializedName: "galleryImageResourceId", + createdAt: { + serializedName: "createdAt", type: { - name: "String" + name: "DateTime" } }, - size: { - serializedName: "size", + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { name: "String" } }, - referenceVmCreationParameters: { - required: true, - serializedName: "referenceVmCreationParameters", + lastModifiedByType: { + serializedName: "lastModifiedByType", type: { - name: "Composite", - className: "ReferenceVmCreationParameters" + name: "String" } - } - } - } -}; - -export const EnvironmentSettingCreationParameters: msRest.CompositeMapper = { - serializedName: "EnvironmentSettingCreationParameters", - type: { - name: "Composite", - className: "EnvironmentSettingCreationParameters", - modelProperties: { - resourceSettingCreationParameters: { - required: true, - serializedName: "resourceSettingCreationParameters", + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", type: { - name: "Composite", - className: "ResourceSettingCreationParameters" + name: "DateTime" } } } } }; -export const LabCreationParameters: msRest.CompositeMapper = { - serializedName: "LabCreationParameters", +export const ImageUpdateProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LabCreationParameters", + className: "ImageUpdateProperties", modelProperties: { - maxUsersInLab: { - serializedName: "maxUsersInLab", + enabledState: { + serializedName: "enabledState", type: { - name: "Number" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } } } } }; -export const CreateLabProperties: msRest.CompositeMapper = { - serializedName: "CreateLabProperties", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CreateLabProperties", + className: "Resource", modelProperties: { - environmentSettingCreationParameters: { - serializedName: "environmentSettingCreationParameters", - type: { - name: "Composite", - className: "EnvironmentSettingCreationParameters" - } - }, - labCreationParameters: { - required: true, - serializedName: "labCreationParameters", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Composite", - className: "LabCreationParameters" + name: "String" } }, name: { - required: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, - location: { - serializedName: "location", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } } } } }; -export const ResourceSet: msRest.CompositeMapper = { - serializedName: "ResourceSet", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceSet", + className: "ErrorResponse", modelProperties: { - vmResourceId: { - serializedName: "vmResourceId", - type: { - name: "String" - } - }, - resourceSettingId: { - serializedName: "resourceSettingId", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "ErrorDetail" } } } } }; -export const NetworkInterface: msRest.CompositeMapper = { - serializedName: "NetworkInterface", +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkInterface", + className: "ErrorDetail", modelProperties: { - privateIpAddress: { + code: { + serializedName: "code", readOnly: true, - serializedName: "privateIpAddress", type: { name: "String" } }, - sshAuthority: { + message: { + serializedName: "message", readOnly: true, - serializedName: "sshAuthority", type: { name: "String" } }, - rdpAuthority: { + target: { + serializedName: "target", readOnly: true, - serializedName: "rdpAuthority", type: { name: "String" } }, - username: { + details: { + serializedName: "details", readOnly: true, - serializedName: "username", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } } } } } }; -export const LatestOperationResult: msRest.CompositeMapper = { - serializedName: "LatestOperationResult", +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LatestOperationResult", + className: "ErrorAdditionalInfo", modelProperties: { - status: { - readOnly: true, - serializedName: "status", - type: { - name: "String" - } - }, - errorCode: { - readOnly: true, - serializedName: "errorCode", - type: { - name: "String" - } - }, - errorMessage: { - readOnly: true, - serializedName: "errorMessage", - type: { - name: "String" - } - }, - requestUri: { - readOnly: true, - serializedName: "requestUri", - type: { - name: "String" - } - }, - httpMethod: { + type: { + serializedName: "type", readOnly: true, - serializedName: "httpMethod", type: { name: "String" } }, - operationUrl: { + info: { + serializedName: "info", readOnly: true, - serializedName: "operationUrl", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const ImageUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ImageUpdate", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + enabledState: { + serializedName: "properties.enabledState", type: { - name: "String" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } - }, - name: { + } + } + } +}; + +export const PagedLabPlans: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PagedLabPlans", + modelProperties: { + value: { + serializedName: "value", readOnly: true, - serializedName: "name", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LabPlan" + } + } } }, - type: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "type", type: { name: "String" } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } } } } }; -export const Environment: msRest.CompositeMapper = { - serializedName: "Environment", +export const LabPlanUpdateProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Environment", + className: "LabPlanUpdateProperties", modelProperties: { - ...Resource.type.modelProperties, - resourceSets: { - serializedName: "properties.resourceSets", + defaultConnectionProfile: { + serializedName: "defaultConnectionProfile", type: { name: "Composite", - className: "ResourceSet" - } - }, - claimedByUserObjectId: { - readOnly: true, - serializedName: "properties.claimedByUserObjectId", - type: { - name: "String" + className: "ConnectionProfile" } }, - claimedByUserPrincipalId: { - readOnly: true, - serializedName: "properties.claimedByUserPrincipalId", + defaultAutoShutdownProfile: { + serializedName: "defaultAutoShutdownProfile", type: { - name: "String" + name: "Composite", + className: "AutoShutdownProfile" } }, - claimedByUserName: { - readOnly: true, - serializedName: "properties.claimedByUserName", + defaultNetworkProfile: { + serializedName: "defaultNetworkProfile", type: { - name: "String" + name: "Composite", + className: "LabPlanNetworkProfile" } }, - isClaimed: { - readOnly: true, - serializedName: "properties.isClaimed", + allowedRegions: { + serializedName: "allowedRegions", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - lastKnownPowerState: { - readOnly: true, - serializedName: "properties.lastKnownPowerState", + sharedGalleryId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "sharedGalleryId", type: { name: "String" } }, - networkInterface: { - readOnly: true, - serializedName: "properties.networkInterface", + supportInfo: { + serializedName: "supportInfo", type: { name: "Composite", - className: "NetworkInterface" + className: "SupportInfo" } }, - totalUsage: { - readOnly: true, - serializedName: "properties.totalUsage", + linkedLmsInstance: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "linkedLmsInstance", type: { - name: "TimeSpan" + name: "String" } - }, - passwordLastReset: { - readOnly: true, - serializedName: "properties.passwordLastReset", + } + } + } +}; + +export const ConnectionProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectionProfile", + modelProperties: { + webSshAccess: { + serializedName: "webSshAccess", type: { - name: "DateTime" + name: "Enum", + allowedValues: ["Public", "Private", "None"] } }, - provisioningState: { - serializedName: "properties.provisioningState", + webRdpAccess: { + serializedName: "webRdpAccess", type: { - name: "String" + name: "Enum", + allowedValues: ["Public", "Private", "None"] } }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", + clientSshAccess: { + serializedName: "clientSshAccess", type: { - name: "String" + name: "Enum", + allowedValues: ["Public", "Private", "None"] } }, - latestOperationResult: { - readOnly: true, - serializedName: "properties.latestOperationResult", + clientRdpAccess: { + serializedName: "clientRdpAccess", type: { - name: "Composite", - className: "LatestOperationResult" + name: "Enum", + allowedValues: ["Public", "Private", "None"] } } } } }; -export const VirtualMachineDetails: msRest.CompositeMapper = { - serializedName: "VirtualMachineDetails", +export const AutoShutdownProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VirtualMachineDetails", + className: "AutoShutdownProfile", modelProperties: { - provisioningState: { - readOnly: true, - serializedName: "provisioningState", + shutdownOnDisconnect: { + serializedName: "shutdownOnDisconnect", type: { - name: "String" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } }, - rdpAuthority: { - readOnly: true, - serializedName: "rdpAuthority", + shutdownWhenNotConnected: { + serializedName: "shutdownWhenNotConnected", type: { - name: "String" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } }, - sshAuthority: { - readOnly: true, - serializedName: "sshAuthority", + shutdownOnIdle: { + serializedName: "shutdownOnIdle", type: { - name: "String" + name: "Enum", + allowedValues: ["None", "UserAbsence", "LowUsage"] } }, - privateIpAddress: { - readOnly: true, - serializedName: "privateIpAddress", + disconnectDelay: { + serializedName: "disconnectDelay", type: { - name: "String" + name: "TimeSpan" } }, - userName: { - readOnly: true, - serializedName: "userName", + noConnectDelay: { + serializedName: "noConnectDelay", type: { - name: "String" + name: "TimeSpan" } }, - lastKnownPowerState: { - readOnly: true, - serializedName: "lastKnownPowerState", + idleDelay: { + serializedName: "idleDelay", type: { - name: "String" + name: "TimeSpan" } } } } }; -export const EnvironmentDetails: msRest.CompositeMapper = { - serializedName: "EnvironmentDetails", +export const LabPlanNetworkProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentDetails", + className: "LabPlanNetworkProfile", modelProperties: { - name: { - readOnly: true, - serializedName: "name", + subnetId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "subnetId", type: { name: "String" } - }, - description: { - readOnly: true, - serializedName: "description", + } + } + } +}; + +export const SupportInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SupportInfo", + modelProperties: { + url: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "url", type: { name: "String" } }, - id: { - readOnly: true, - serializedName: "id", + email: { + constraints: { + MaxLength: 254, + MinLength: 6 + }, + serializedName: "email", type: { name: "String" } }, - provisioningState: { - readOnly: true, - serializedName: "provisioningState", + phone: { + constraints: { + MaxLength: 31, + MinLength: 1 + }, + serializedName: "phone", type: { name: "String" } }, - virtualMachineDetails: { - readOnly: true, - serializedName: "virtualMachineDetails", - type: { - name: "Composite", - className: "VirtualMachineDetails" - } - }, - latestOperationResult: { - readOnly: true, - serializedName: "latestOperationResult", - type: { - name: "Composite", - className: "LatestOperationResult" - } - }, - environmentState: { - readOnly: true, - serializedName: "environmentState", + instructions: { + serializedName: "instructions", type: { name: "String" } - }, - totalUsage: { - readOnly: true, - serializedName: "totalUsage", - type: { - name: "TimeSpan" - } - }, - passwordLastReset: { - readOnly: true, - serializedName: "passwordLastReset", - type: { - name: "DateTime" - } } } } }; -export const ResourceSetFragment: msRest.CompositeMapper = { - serializedName: "ResourceSetFragment", +export const TrackedResourceUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceSetFragment", + className: "TrackedResourceUpdate", modelProperties: { - vmResourceId: { - serializedName: "vmResourceId", - type: { - name: "String" - } - }, - resourceSettingId: { - serializedName: "resourceSettingId", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const EnvironmentFragment: msRest.CompositeMapper = { - serializedName: "EnvironmentFragment", +export const SaveImageBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentFragment", + className: "SaveImageBody", modelProperties: { - ...Resource.type.modelProperties, - resourceSets: { - serializedName: "properties.resourceSets", - type: { - name: "Composite", - className: "ResourceSetFragment" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", + name: { + serializedName: "name", type: { name: "String" } }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", + labVirtualMachineId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "labVirtualMachineId", type: { name: "String" } @@ -618,15 +531,27 @@ export const EnvironmentFragment: msRest.CompositeMapper = { } }; -export const EnvironmentOperationsPayload: msRest.CompositeMapper = { - serializedName: "EnvironmentOperationsPayload", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentOperationsPayload", + className: "OperationListResult", modelProperties: { - environmentId: { - required: true, - serializedName: "environmentId", + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -635,36 +560,42 @@ export const EnvironmentOperationsPayload: msRest.CompositeMapper = { } }; -export const VmStateDetails: msRest.CompositeMapper = { - serializedName: "VmStateDetails", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VmStateDetails", + className: "Operation", modelProperties: { - rdpAuthority: { + name: { + serializedName: "name", readOnly: true, - serializedName: "rdpAuthority", type: { name: "String" } }, - sshAuthority: { + isDataAction: { + serializedName: "isDataAction", readOnly: true, - serializedName: "sshAuthority", type: { - name: "String" + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" } }, - powerState: { + origin: { + serializedName: "origin", readOnly: true, - serializedName: "powerState", type: { name: "String" } }, - lastKnownPowerState: { + actionType: { + serializedName: "actionType", readOnly: true, - serializedName: "lastKnownPowerState", type: { name: "String" } @@ -673,36 +604,35 @@ export const VmStateDetails: msRest.CompositeMapper = { } }; -export const ReferenceVm: msRest.CompositeMapper = { - serializedName: "ReferenceVm", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ReferenceVm", + className: "OperationDisplay", modelProperties: { - userName: { - required: true, - serializedName: "userName", + provider: { + serializedName: "provider", + readOnly: true, type: { name: "String" } }, - password: { - serializedName: "password", + resource: { + serializedName: "resource", + readOnly: true, type: { name: "String" } }, - vmStateDetails: { + operation: { + serializedName: "operation", readOnly: true, - serializedName: "vmStateDetails", type: { - name: "Composite", - className: "VmStateDetails" + name: "String" } }, - vmResourceId: { + description: { + serializedName: "description", readOnly: true, - serializedName: "vmResourceId", type: { name: "String" } @@ -711,226 +641,260 @@ export const ReferenceVm: msRest.CompositeMapper = { } }; -export const ResourceSettings: msRest.CompositeMapper = { - serializedName: "ResourceSettings", +export const PagedLabs: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceSettings", + className: "PagedLabs", modelProperties: { - id: { + value: { + serializedName: "value", readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - galleryImageResourceId: { - serializedName: "galleryImageResourceId", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Lab" + } + } } }, - imageName: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "imageName", - type: { - name: "String" - } - }, - size: { - serializedName: "size", type: { name: "String" } - }, - cores: { - readOnly: true, - serializedName: "cores", - type: { - name: "Number" - } - }, - referenceVm: { - required: true, - serializedName: "referenceVm", - type: { - name: "Composite", - className: "ReferenceVm" - } } } } }; -export const EnvironmentSetting: msRest.CompositeMapper = { - serializedName: "EnvironmentSetting", +export const LabNetworkProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentSetting", + className: "LabNetworkProfile", modelProperties: { - ...Resource.type.modelProperties, - publishingState: { - readOnly: true, - serializedName: "properties.publishingState", + subnetId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "subnetId", type: { name: "String" } }, - configurationState: { - serializedName: "properties.configurationState", + loadBalancerId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "loadBalancerId", type: { name: "String" } }, - description: { - serializedName: "properties.description", + publicIpId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "publicIpId", type: { name: "String" } + } + } + } +}; + +export const LabUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LabUpdateProperties", + modelProperties: { + autoShutdownProfile: { + serializedName: "autoShutdownProfile", + type: { + name: "Composite", + className: "AutoShutdownProfile" + } }, - title: { - serializedName: "properties.title", + connectionProfile: { + serializedName: "connectionProfile", type: { - name: "String" + name: "Composite", + className: "ConnectionProfile" } }, - resourceSettings: { - required: true, - serializedName: "properties.resourceSettings", + virtualMachineProfile: { + serializedName: "virtualMachineProfile", type: { name: "Composite", - className: "ResourceSettings" + className: "VirtualMachineProfile" } }, - lastChanged: { - readOnly: true, - serializedName: "properties.lastChanged", + securityProfile: { + serializedName: "securityProfile", type: { - name: "DateTime" + name: "Composite", + className: "SecurityProfile" } }, - lastPublished: { - readOnly: true, - serializedName: "properties.lastPublished", + rosterProfile: { + serializedName: "rosterProfile", type: { - name: "DateTime" + name: "Composite", + className: "RosterProfile" } }, - provisioningState: { - serializedName: "properties.provisioningState", + labPlanId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "labPlanId", type: { name: "String" } }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", + title: { + constraints: { + MaxLength: 120, + MinLength: 1 + }, + serializedName: "title", type: { name: "String" } }, - latestOperationResult: { - readOnly: true, - serializedName: "properties.latestOperationResult", + description: { + serializedName: "description", type: { - name: "Composite", - className: "LatestOperationResult" + name: "String" } } } } }; -export const ReferenceVmFragment: msRest.CompositeMapper = { - serializedName: "ReferenceVmFragment", +export const VirtualMachineProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ReferenceVmFragment", + className: "VirtualMachineProfile", modelProperties: { - userName: { - serializedName: "userName", + createOption: { + serializedName: "createOption", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Image", "TemplateVM"] } }, - password: { - serializedName: "password", + imageReference: { + serializedName: "imageReference", type: { - name: "String" + name: "Composite", + className: "ImageReference" } - } - } - } -}; - -export const ResourceSettingsFragment: msRest.CompositeMapper = { - serializedName: "ResourceSettingsFragment", - type: { - name: "Composite", - className: "ResourceSettingsFragment", - modelProperties: { - galleryImageResourceId: { - serializedName: "galleryImageResourceId", + }, + osType: { + serializedName: "osType", + readOnly: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Windows", "Linux"] } }, - size: { - serializedName: "size", + sku: { + serializedName: "sku", type: { - name: "String" + name: "Composite", + className: "Sku" + } + }, + additionalCapabilities: { + serializedName: "additionalCapabilities", + type: { + name: "Composite", + className: "VirtualMachineAdditionalCapabilities" + } + }, + usageQuota: { + serializedName: "usageQuota", + required: true, + type: { + name: "TimeSpan" + } + }, + useSharedPassword: { + serializedName: "useSharedPassword", + type: { + name: "Enum", + allowedValues: ["Enabled", "Disabled"] + } + }, + adminUser: { + serializedName: "adminUser", + type: { + name: "Composite", + className: "Credentials" } }, - referenceVm: { - serializedName: "referenceVm", + nonAdminUser: { + serializedName: "nonAdminUser", type: { name: "Composite", - className: "ReferenceVmFragment" + className: "Credentials" } } } } }; -export const EnvironmentSettingFragment: msRest.CompositeMapper = { - serializedName: "EnvironmentSettingFragment", +export const ImageReference: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentSettingFragment", + className: "ImageReference", modelProperties: { - ...Resource.type.modelProperties, - configurationState: { - serializedName: "properties.configurationState", + id: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "id", type: { name: "String" } }, - description: { - serializedName: "properties.description", + offer: { + serializedName: "offer", type: { name: "String" } }, - title: { - serializedName: "properties.title", + publisher: { + serializedName: "publisher", type: { name: "String" } }, - resourceSettings: { - serializedName: "properties.resourceSettings", + sku: { + serializedName: "sku", type: { - name: "Composite", - className: "ResourceSettingsFragment" + name: "String" } }, - provisioningState: { - serializedName: "properties.provisioningState", + version: { + serializedName: "version", type: { name: "String" } }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", + exactVersion: { + serializedName: "exactVersion", + readOnly: true, type: { name: "String" } @@ -939,32 +903,39 @@ export const EnvironmentSettingFragment: msRest.CompositeMapper = { } }; -export const SizeInfo: msRest.CompositeMapper = { - serializedName: "SizeInfo", +export const Sku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SizeInfo", + className: "Sku", modelProperties: { - computeSize: { - serializedName: "computeSize", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - price: { - serializedName: "price", + tier: { + serializedName: "tier", type: { - name: "Number" + name: "Enum", + allowedValues: ["Free", "Basic", "Standard", "Premium"] } }, - numberOfCores: { - serializedName: "numberOfCores", + size: { + serializedName: "size", type: { - name: "Number" + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" } }, - memory: { - serializedName: "memory", + capacity: { + serializedName: "capacity", type: { name: "Number" } @@ -973,149 +944,98 @@ export const SizeInfo: msRest.CompositeMapper = { } }; -export const EnvironmentSize: msRest.CompositeMapper = { - serializedName: "EnvironmentSize", +export const VirtualMachineAdditionalCapabilities: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentSize", + className: "VirtualMachineAdditionalCapabilities", modelProperties: { - name: { - serializedName: "name", + installGpuDrivers: { + serializedName: "installGpuDrivers", type: { - name: "String" - } - }, - vmSizes: { - serializedName: "vmSizes", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SizeInfo" - } - } - } - }, - maxPrice: { - readOnly: true, - serializedName: "maxPrice", - type: { - name: "Number" - } - }, - minNumberOfCores: { - readOnly: true, - serializedName: "minNumberOfCores", - type: { - name: "Number" - } - }, - minMemory: { - readOnly: true, - serializedName: "minMemory", - type: { - name: "Number" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } } } } }; -export const SizeInfoFragment: msRest.CompositeMapper = { - serializedName: "SizeInfoFragment", +export const Credentials: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SizeInfoFragment", + className: "Credentials", modelProperties: { - computeSize: { - serializedName: "computeSize", + username: { + serializedName: "username", + required: true, type: { name: "String" } }, - price: { - serializedName: "price", - type: { - name: "Number" - } - }, - numberOfCores: { - serializedName: "numberOfCores", - type: { - name: "Number" - } - }, - memory: { - serializedName: "memory", + password: { + serializedName: "password", type: { - name: "Number" + name: "String" } } } } }; -export const EnvironmentSizeFragment: msRest.CompositeMapper = { - serializedName: "EnvironmentSizeFragment", +export const SecurityProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnvironmentSizeFragment", + className: "SecurityProfile", modelProperties: { - name: { - serializedName: "name", + registrationCode: { + serializedName: "registrationCode", + readOnly: true, type: { name: "String" } }, - vmSizes: { - serializedName: "vmSizes", + openAccess: { + serializedName: "openAccess", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SizeInfoFragment" - } - } + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } } } } }; -export const GalleryImageReference: msRest.CompositeMapper = { - serializedName: "GalleryImageReference", +export const RosterProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GalleryImageReference", + className: "RosterProfile", modelProperties: { - offer: { - serializedName: "offer", + activeDirectoryGroupId: { + serializedName: "activeDirectoryGroupId", type: { name: "String" } }, - publisher: { - serializedName: "publisher", + ltiContextId: { + serializedName: "ltiContextId", type: { name: "String" } }, - sku: { - serializedName: "sku", + lmsInstance: { + serializedName: "lmsInstance", type: { name: "String" } }, - osType: { - serializedName: "osType", + ltiClientId: { + serializedName: "ltiClientId", type: { name: "String" } }, - version: { - serializedName: "version", + ltiRosterEndpoint: { + serializedName: "ltiRosterEndpoint", type: { name: "String" } @@ -1124,171 +1044,235 @@ export const GalleryImageReference: msRest.CompositeMapper = { } }; -export const GalleryImage: msRest.CompositeMapper = { - serializedName: "GalleryImage", +export const OperationResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GalleryImage", + className: "OperationResult", modelProperties: { - ...Resource.type.modelProperties, - author: { + id: { + serializedName: "id", readOnly: true, - serializedName: "properties.author", type: { name: "String" } }, - createdDate: { + name: { + serializedName: "name", readOnly: true, - serializedName: "properties.createdDate", type: { - name: "DateTime" + name: "String" } }, - description: { - readOnly: true, - serializedName: "properties.description", + status: { + serializedName: "status", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: [ + "NotStarted", + "InProgress", + "Succeeded", + "Failed", + "Canceled" + ] } }, - imageReference: { - readOnly: true, - serializedName: "properties.imageReference", + startTime: { + serializedName: "startTime", type: { - name: "Composite", - className: "GalleryImageReference" + name: "DateTime" } }, - icon: { - readOnly: true, - serializedName: "properties.icon", + endTime: { + serializedName: "endTime", type: { - name: "String" + name: "DateTime" } }, - isEnabled: { - serializedName: "properties.isEnabled", + percentComplete: { + serializedName: "percentComplete", type: { - name: "Boolean" + name: "Number" } }, - isOverride: { - serializedName: "properties.isOverride", + error: { + serializedName: "error", type: { - name: "Boolean" + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const PagedSchedules: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PagedSchedules", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Schedule" + } + } } }, - planId: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "properties.planId", type: { name: "String" } + } + } + } +}; + +export const ScheduleUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScheduleUpdateProperties", + modelProperties: { + startAt: { + serializedName: "startAt", + type: { + name: "DateTime" + } }, - isPlanAuthorized: { - serializedName: "properties.isPlanAuthorized", + stopAt: { + serializedName: "stopAt", type: { - name: "Boolean" + name: "DateTime" } }, - provisioningState: { - serializedName: "properties.provisioningState", + recurrencePattern: { + serializedName: "recurrencePattern", type: { - name: "String" + name: "Composite", + className: "RecurrencePattern" } }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", + timeZoneId: { + constraints: { + MaxLength: 50 + }, + serializedName: "timeZoneId", type: { name: "String" } }, - latestOperationResult: { - readOnly: true, - serializedName: "properties.latestOperationResult", + notes: { + constraints: { + MaxLength: 1000 + }, + serializedName: "notes", type: { - name: "Composite", - className: "LatestOperationResult" + name: "String" } } } } }; -export const GalleryImageFragment: msRest.CompositeMapper = { - serializedName: "GalleryImageFragment", +export const RecurrencePattern: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GalleryImageFragment", + className: "RecurrencePattern", modelProperties: { - ...Resource.type.modelProperties, - isEnabled: { - serializedName: "properties.isEnabled", - type: { - name: "Boolean" - } - }, - isOverride: { - serializedName: "properties.isOverride", + frequency: { + serializedName: "frequency", + required: true, type: { - name: "Boolean" + name: "Enum", + allowedValues: ["Daily", "Weekly"] } }, - isPlanAuthorized: { - serializedName: "properties.isPlanAuthorized", + weekDays: { + serializedName: "weekDays", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ] + } + } } }, - provisioningState: { - serializedName: "properties.provisioningState", + interval: { + constraints: { + InclusiveMaximum: 365, + InclusiveMinimum: 1 + }, + serializedName: "interval", type: { - name: "String" + name: "Number" } }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", + expirationDate: { + serializedName: "expirationDate", + required: true, type: { - name: "String" + name: "Date" } } } } }; -export const GalleryImageReferenceFragment: msRest.CompositeMapper = { - serializedName: "GalleryImageReferenceFragment", +export const ScheduleUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GalleryImageReferenceFragment", + className: "ScheduleUpdate", modelProperties: { - offer: { - serializedName: "offer", + startAt: { + serializedName: "properties.startAt", type: { - name: "String" + name: "DateTime" } }, - publisher: { - serializedName: "publisher", + stopAt: { + serializedName: "properties.stopAt", type: { - name: "String" + name: "DateTime" } }, - sku: { - serializedName: "sku", + recurrencePattern: { + serializedName: "properties.recurrencePattern", type: { - name: "String" + name: "Composite", + className: "RecurrencePattern" } }, - osType: { - serializedName: "osType", + timeZoneId: { + constraints: { + MaxLength: 50 + }, + serializedName: "properties.timeZoneId", type: { name: "String" } }, - version: { - serializedName: "version", + notes: { + constraints: { + MaxLength: 1000 + }, + serializedName: "properties.notes", type: { name: "String" } @@ -1297,295 +1281,259 @@ export const GalleryImageReferenceFragment: msRest.CompositeMapper = { } }; -export const GetEnvironmentResponse: msRest.CompositeMapper = { - serializedName: "GetEnvironmentResponse", +export const PagedUsers: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GetEnvironmentResponse", + className: "PagedUsers", modelProperties: { - environment: { + value: { + serializedName: "value", readOnly: true, - serializedName: "environment", type: { - name: "Composite", - className: "EnvironmentDetails" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "User" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" } } } } }; -export const GetPersonalPreferencesResponse: msRest.CompositeMapper = { - serializedName: "GetPersonalPreferencesResponse", +export const UserUpdateProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GetPersonalPreferencesResponse", + className: "UserUpdateProperties", modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - favoriteLabResourceIds: { - serializedName: "favoriteLabResourceIds", + additionalUsageQuota: { + serializedName: "additionalUsageQuota", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "TimeSpan" } } } } }; -export const SizeAvailability: msRest.CompositeMapper = { - serializedName: "SizeAvailability", +export const UserUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SizeAvailability", + className: "UserUpdate", modelProperties: { - sizeCategory: { - serializedName: "sizeCategory", - type: { - name: "String" - } - }, - isAvailable: { - serializedName: "isAvailable", + additionalUsageQuota: { + serializedName: "properties.additionalUsageQuota", type: { - name: "Boolean" + name: "TimeSpan" } } } } }; -export const RegionalAvailability: msRest.CompositeMapper = { - serializedName: "RegionalAvailability", +export const InviteBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RegionalAvailability", + className: "InviteBody", modelProperties: { - region: { - serializedName: "region", + text: { + serializedName: "text", type: { name: "String" } - }, - sizeAvailabilities: { - serializedName: "sizeAvailabilities", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SizeAvailability" - } - } - } } } } }; -export const GetRegionalAvailabilityResponse: msRest.CompositeMapper = { - serializedName: "GetRegionalAvailabilityResponse", +export const PagedVirtualMachines: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GetRegionalAvailabilityResponse", + className: "PagedVirtualMachines", modelProperties: { - regionalAvailability: { - serializedName: "regionalAvailability", + value: { + serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "RegionalAvailability" + className: "VirtualMachine" } } } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } } } } }; -export const Lab: msRest.CompositeMapper = { - serializedName: "Lab", +export const VirtualMachineConnectionProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Lab", + className: "VirtualMachineConnectionProfile", modelProperties: { - ...Resource.type.modelProperties, - maxUsersInLab: { - serializedName: "properties.maxUsersInLab", - type: { - name: "Number" - } - }, - userQuota: { - readOnly: true, - serializedName: "properties.userQuota", - type: { - name: "Number" - } - }, - invitationCode: { + privateIpAddress: { + serializedName: "privateIpAddress", readOnly: true, - serializedName: "properties.invitationCode", type: { name: "String" } }, - createdByObjectId: { + sshAuthority: { + serializedName: "sshAuthority", readOnly: true, - serializedName: "properties.createdByObjectId", type: { name: "String" } }, - usageQuota: { - serializedName: "properties.usageQuota", - type: { - name: "TimeSpan" - } - }, - userAccessMode: { - serializedName: "properties.userAccessMode", + sshInBrowserUrl: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "sshInBrowserUrl", + readOnly: true, type: { name: "String" } }, - createdByUserPrincipalName: { + rdpAuthority: { + serializedName: "rdpAuthority", readOnly: true, - serializedName: "properties.createdByUserPrincipalName", type: { name: "String" } }, - createdDate: { + rdpInBrowserUrl: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "rdpInBrowserUrl", readOnly: true, - serializedName: "properties.createdDate", - type: { - name: "DateTime" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", type: { name: "String" } }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", + adminUsername: { + serializedName: "adminUsername", + readOnly: true, type: { name: "String" } }, - latestOperationResult: { + nonAdminUsername: { + serializedName: "nonAdminUsername", readOnly: true, - serializedName: "properties.latestOperationResult", type: { - name: "Composite", - className: "LatestOperationResult" + name: "String" } } } } }; -export const SizeConfigurationProperties: msRest.CompositeMapper = { - serializedName: "SizeConfigurationProperties", +export const ResetPasswordBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SizeConfigurationProperties", + className: "ResetPasswordBody", modelProperties: { - environmentSizes: { - serializedName: "environmentSizes", + username: { + serializedName: "username", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EnvironmentSize" - } - } + name: "String" + } + }, + password: { + serializedName: "password", + required: true, + type: { + name: "String" } } } } }; -export const LabAccount: msRest.CompositeMapper = { - serializedName: "LabAccount", +export const ListUsagesResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LabAccount", + className: "ListUsagesResult", modelProperties: { - ...Resource.type.modelProperties, - sizeConfiguration: { + value: { + serializedName: "value", readOnly: true, - serializedName: "properties.sizeConfiguration", - type: { - name: "Composite", - className: "SizeConfigurationProperties" - } - }, - enabledRegionSelection: { - serializedName: "properties.enabledRegionSelection", - type: { - name: "Boolean" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - type: { - name: "String" - } - }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Usage" + } + } } }, - latestOperationResult: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "properties.latestOperationResult", type: { - name: "Composite", - className: "LatestOperationResult" + name: "String" } } } } }; -export const LabAccountFragment: msRest.CompositeMapper = { - serializedName: "LabAccountFragment", +export const Usage: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LabAccountFragment", + className: "Usage", modelProperties: { - ...Resource.type.modelProperties, - enabledRegionSelection: { - serializedName: "properties.enabledRegionSelection", + currentValue: { + serializedName: "currentValue", type: { - name: "Boolean" + name: "Number" } }, - provisioningState: { - serializedName: "properties.provisioningState", + limit: { + serializedName: "limit", + type: { + name: "Number" + } + }, + unit: { + serializedName: "unit", type: { name: "String" } }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", + name: { + serializedName: "name", + type: { + name: "Composite", + className: "UsageName" + } + }, + id: { + serializedName: "id", type: { name: "String" } @@ -1594,203 +1542,150 @@ export const LabAccountFragment: msRest.CompositeMapper = { } }; -export const LabDetails: msRest.CompositeMapper = { - serializedName: "LabDetails", +export const UsageName: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LabDetails", + className: "UsageName", modelProperties: { - name: { - serializedName: "name", + localizedValue: { + serializedName: "localizedValue", type: { name: "String" } }, - provisioningState: { - serializedName: "provisioningState", + value: { + serializedName: "value", type: { name: "String" } - }, - id: { - serializedName: "id", + } + } + } +}; + +export const PagedLabServicesSkus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PagedLabServicesSkus", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LabServicesSku" + } + } } }, - usageQuota: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "usageQuota", type: { - name: "TimeSpan" + name: "String" } } } } }; -export const LabFragment: msRest.CompositeMapper = { - serializedName: "LabFragment", +export const LabServicesSku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LabFragment", + className: "LabServicesSku", modelProperties: { - ...Resource.type.modelProperties, - maxUsersInLab: { - serializedName: "properties.maxUsersInLab", + resourceType: { + serializedName: "resourceType", + readOnly: true, type: { - name: "Number" + name: "String" } }, - usageQuota: { - serializedName: "properties.usageQuota", + name: { + serializedName: "name", + readOnly: true, type: { - name: "TimeSpan" + name: "String" } }, - userAccessMode: { - serializedName: "properties.userAccessMode", + tier: { + serializedName: "tier", + readOnly: true, type: { name: "String" } }, - provisioningState: { - serializedName: "properties.provisioningState", + size: { + serializedName: "size", + readOnly: true, type: { name: "String" } }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", + family: { + serializedName: "family", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const ListEnvironmentsPayload: msRest.CompositeMapper = { - serializedName: "ListEnvironmentsPayload", - type: { - name: "Composite", - className: "ListEnvironmentsPayload", - modelProperties: { - labId: { - serializedName: "labId", + }, + capacity: { + serializedName: "capacity", type: { - name: "String" + name: "Composite", + className: "LabServicesSkuCapacity" } - } - } - } -}; - -export const ListEnvironmentsResponse: msRest.CompositeMapper = { - serializedName: "ListEnvironmentsResponse", - type: { - name: "Composite", - className: "ListEnvironmentsResponse", - modelProperties: { - environments: { - serializedName: "environments", + }, + capabilities: { + serializedName: "capabilities", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "EnvironmentDetails" + className: "LabServicesSkuCapabilities" } } } - } - } - } -}; - -export const ListLabsResponse: msRest.CompositeMapper = { - serializedName: "ListLabsResponse", - type: { - name: "Composite", - className: "ListLabsResponse", - modelProperties: { - labs: { - serializedName: "labs", + }, + locations: { + serializedName: "locations", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "LabDetails" + name: "String" } } } - } - } - } -}; - -export const OperationBatchStatusPayload: msRest.CompositeMapper = { - serializedName: "OperationBatchStatusPayload", - type: { - name: "Composite", - className: "OperationBatchStatusPayload", - modelProperties: { - urls: { - required: true, - serializedName: "urls", + }, + costs: { + serializedName: "costs", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "LabServicesSkuCost" } } } - } - } - } -}; - -export const OperationBatchStatusResponseItem: msRest.CompositeMapper = { - serializedName: "OperationBatchStatusResponseItem", - type: { - name: "Composite", - className: "OperationBatchStatusResponseItem", - modelProperties: { - operationUrl: { - readOnly: true, - serializedName: "operationUrl", - type: { - name: "String" - } }, - status: { - readOnly: true, - serializedName: "status", - type: { - name: "String" - } - } - } - } -}; - -export const OperationBatchStatusResponse: msRest.CompositeMapper = { - serializedName: "OperationBatchStatusResponse", - type: { - name: "Composite", - className: "OperationBatchStatusResponse", - modelProperties: { - items: { + restrictions: { + serializedName: "restrictions", readOnly: true, - serializedName: "items", type: { name: "Sequence", element: { type: { name: "Composite", - className: "OperationBatchStatusResponseItem" + className: "LabServicesSkuRestrictions" } } } @@ -1799,54 +1694,35 @@ export const OperationBatchStatusResponse: msRest.CompositeMapper = { } }; -export const OperationError: msRest.CompositeMapper = { - serializedName: "OperationError", - type: { - name: "Composite", - className: "OperationError", - modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, - message: { - serializedName: "message", - type: { - name: "String" - } - } - } - } -}; - -export const OperationMetadataDisplay: msRest.CompositeMapper = { - serializedName: "OperationMetadataDisplay", +export const LabServicesSkuCapacity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationMetadataDisplay", + className: "LabServicesSkuCapacity", modelProperties: { - provider: { - serializedName: "provider", + default: { + serializedName: "default", + readOnly: true, type: { - name: "String" + name: "Number" } }, - resource: { - serializedName: "resource", + minimum: { + serializedName: "minimum", + readOnly: true, type: { - name: "String" + name: "Number" } }, - operation: { - serializedName: "operation", + maximum: { + serializedName: "maximum", + readOnly: true, type: { - name: "String" + name: "Number" } }, - description: { - serializedName: "description", + scaleType: { + serializedName: "scaleType", + readOnly: true, type: { name: "String" } @@ -1855,61 +1731,51 @@ export const OperationMetadataDisplay: msRest.CompositeMapper = { } }; -export const OperationMetadata: msRest.CompositeMapper = { - serializedName: "OperationMetadata", +export const LabServicesSkuCapabilities: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationMetadata", + className: "LabServicesSkuCapabilities", modelProperties: { name: { serializedName: "name", + readOnly: true, type: { name: "String" } }, - display: { - serializedName: "display", + value: { + serializedName: "value", + readOnly: true, type: { - name: "Composite", - className: "OperationMetadataDisplay" + name: "String" } } } } }; -export const OperationResult: msRest.CompositeMapper = { - serializedName: "OperationResult", +export const LabServicesSkuCost: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationResult", + className: "LabServicesSkuCost", modelProperties: { - status: { - serializedName: "status", + meterId: { + serializedName: "meterId", + readOnly: true, type: { name: "String" } }, - error: { - serializedName: "error", + quantity: { + serializedName: "quantity", + readOnly: true, type: { - name: "Composite", - className: "OperationError" + name: "Number" } - } - } - } -}; - -export const OperationStatusPayload: msRest.CompositeMapper = { - serializedName: "OperationStatusPayload", - type: { - name: "Composite", - className: "OperationStatusPayload", - modelProperties: { - operationUrl: { - required: true, - serializedName: "operationUrl", + }, + extendedUnit: { + serializedName: "extendedUnit", + readOnly: true, type: { name: "String" } @@ -1918,15 +1784,33 @@ export const OperationStatusPayload: msRest.CompositeMapper = { } }; -export const OperationStatusResponse: msRest.CompositeMapper = { - serializedName: "OperationStatusResponse", +export const LabServicesSkuRestrictions: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationStatusResponse", + className: "LabServicesSkuRestrictions", modelProperties: { - status: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + values: { + serializedName: "values", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + reasonCode: { + serializedName: "reasonCode", readOnly: true, - serializedName: "status", type: { name: "String" } @@ -1935,198 +1819,166 @@ export const OperationStatusResponse: msRest.CompositeMapper = { } }; -export const PersonalPreferencesOperationsPayload: msRest.CompositeMapper = { - serializedName: "PersonalPreferencesOperationsPayload", +export const ImageProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PersonalPreferencesOperationsPayload", + className: "ImageProperties", modelProperties: { - labAccountResourceId: { - serializedName: "labAccountResourceId", - type: { - name: "String" + ...ImageUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Locked" + ] } }, - addRemove: { - serializedName: "addRemove", + displayName: { + serializedName: "displayName", + readOnly: true, type: { name: "String" } }, - labResourceId: { - serializedName: "labResourceId", + description: { + serializedName: "description", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const PublishPayload: msRest.CompositeMapper = { - serializedName: "PublishPayload", - type: { - name: "Composite", - className: "PublishPayload", - modelProperties: { - useExistingImage: { - serializedName: "useExistingImage", - type: { - name: "Boolean" - } - } - } - } -}; - -export const RegisterPayload: msRest.CompositeMapper = { - serializedName: "RegisterPayload", - type: { - name: "Composite", - className: "RegisterPayload", - modelProperties: { - registrationCode: { - serializedName: "registrationCode", + }, + iconUrl: { + serializedName: "iconUrl", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const ResetPasswordPayload: msRest.CompositeMapper = { - serializedName: "ResetPasswordPayload", - type: { - name: "Composite", - className: "ResetPasswordPayload", - modelProperties: { - environmentId: { - required: true, - serializedName: "environmentId", + }, + author: { + serializedName: "author", + readOnly: true, type: { name: "String" } }, - username: { - serializedName: "username", + osType: { + serializedName: "osType", + readOnly: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Windows", "Linux"] } }, - password: { - serializedName: "password", + plan: { + serializedName: "plan", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const SizeConfigurationPropertiesFragment: msRest.CompositeMapper = { - serializedName: "SizeConfigurationPropertiesFragment", - type: { - name: "Composite", - className: "SizeConfigurationPropertiesFragment", - modelProperties: { - environmentSizes: { - serializedName: "environmentSizes", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EnvironmentSizeFragment" - } - } - } - } - } - } -}; - -export const User: msRest.CompositeMapper = { - serializedName: "User", - type: { - name: "Composite", - className: "User", - modelProperties: { - ...Resource.type.modelProperties, - email: { + }, + termsStatus: { + serializedName: "termsStatus", readOnly: true, - serializedName: "properties.email", type: { - name: "String" + name: "Enum", + allowedValues: ["Enabled", "Disabled"] } }, - familyName: { + offer: { + serializedName: "offer", readOnly: true, - serializedName: "properties.familyName", type: { name: "String" } }, - givenName: { + publisher: { + serializedName: "publisher", readOnly: true, - serializedName: "properties.givenName", type: { name: "String" } }, - tenantId: { + sku: { + serializedName: "sku", readOnly: true, - serializedName: "properties.tenantId", type: { name: "String" } }, - totalUsage: { + version: { + serializedName: "version", readOnly: true, - serializedName: "properties.totalUsage", type: { - name: "TimeSpan" + name: "String" } }, - provisioningState: { - serializedName: "properties.provisioningState", + sharedGalleryId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "sharedGalleryId", + readOnly: true, type: { name: "String" } }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", + availableRegions: { + serializedName: "availableRegions", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - latestOperationResult: { + osState: { + serializedName: "osState", readOnly: true, - serializedName: "properties.latestOperationResult", type: { - name: "Composite", - className: "LatestOperationResult" + name: "Enum", + allowedValues: ["Generalized", "Specialized"] } } } } }; -export const UserFragment: msRest.CompositeMapper = { - serializedName: "UserFragment", +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UserFragment", + className: "TrackedResource", modelProperties: { ...Resource.type.modelProperties, - provisioningState: { - serializedName: "properties.provisioningState", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - uniqueIdentifier: { - serializedName: "properties.uniqueIdentifier", + location: { + serializedName: "location", + required: true, type: { name: "String" } @@ -2135,83 +1987,92 @@ export const UserFragment: msRest.CompositeMapper = { } }; -export const ProviderOperationResult: msRest.CompositeMapper = { - serializedName: "ProviderOperationResult", +export const LabPlanProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProviderOperationResult", + className: "LabPlanProperties", modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationMetadata" - } - } - } - }, - nextLink: { + ...LabPlanUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", readOnly: true, - serializedName: "nextLink", type: { - name: "String" + name: "Enum", + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Locked" + ] } } } } }; -export const ResponseWithContinuationLabAccount: msRest.CompositeMapper = { - serializedName: "ResponseWithContinuation_LabAccount_", +export const LabPlanUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResponseWithContinuationLabAccount", + className: "LabPlanUpdate", modelProperties: { - value: { - serializedName: "", + ...TrackedResourceUpdate.type.modelProperties, + defaultConnectionProfile: { + serializedName: "properties.defaultConnectionProfile", + type: { + name: "Composite", + className: "ConnectionProfile" + } + }, + defaultAutoShutdownProfile: { + serializedName: "properties.defaultAutoShutdownProfile", + type: { + name: "Composite", + className: "AutoShutdownProfile" + } + }, + defaultNetworkProfile: { + serializedName: "properties.defaultNetworkProfile", + type: { + name: "Composite", + className: "LabPlanNetworkProfile" + } + }, + allowedRegions: { + serializedName: "properties.allowedRegions", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "LabAccount" + name: "String" } } } }, - nextLink: { - serializedName: "nextLink", + sharedGalleryId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "properties.sharedGalleryId", type: { name: "String" } - } - } - } -}; - -export const ResponseWithContinuationGalleryImage: msRest.CompositeMapper = { - serializedName: "ResponseWithContinuation_GalleryImage_", - type: { - name: "Composite", - className: "ResponseWithContinuationGalleryImage", - modelProperties: { - value: { - serializedName: "", + }, + supportInfo: { + serializedName: "properties.supportInfo", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryImage" - } - } + name: "Composite", + className: "SupportInfo" } }, - nextLink: { - serializedName: "nextLink", + linkedLmsInstance: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "properties.linkedLmsInstance", type: { name: "String" } @@ -2220,26 +2081,69 @@ export const ResponseWithContinuationGalleryImage: msRest.CompositeMapper = { } }; -export const ResponseWithContinuationLab: msRest.CompositeMapper = { - serializedName: "ResponseWithContinuation_Lab_", +export const LabUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResponseWithContinuationLab", + className: "LabUpdate", modelProperties: { - value: { - serializedName: "", + ...TrackedResourceUpdate.type.modelProperties, + autoShutdownProfile: { + serializedName: "properties.autoShutdownProfile", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Lab" - } - } + name: "Composite", + className: "AutoShutdownProfile" } }, - nextLink: { - serializedName: "nextLink", + connectionProfile: { + serializedName: "properties.connectionProfile", + type: { + name: "Composite", + className: "ConnectionProfile" + } + }, + virtualMachineProfile: { + serializedName: "properties.virtualMachineProfile", + type: { + name: "Composite", + className: "VirtualMachineProfile" + } + }, + securityProfile: { + serializedName: "properties.securityProfile", + type: { + name: "Composite", + className: "SecurityProfile" + } + }, + rosterProfile: { + serializedName: "properties.rosterProfile", + type: { + name: "Composite", + className: "RosterProfile" + } + }, + labPlanId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "properties.labPlanId", + type: { + name: "String" + } + }, + title: { + constraints: { + MaxLength: 120, + MinLength: 1 + }, + serializedName: "properties.title", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", type: { name: "String" } @@ -2248,85 +2152,723 @@ export const ResponseWithContinuationLab: msRest.CompositeMapper = { } }; -export const ResponseWithContinuationEnvironmentSetting: msRest.CompositeMapper = { - serializedName: "ResponseWithContinuation_EnvironmentSetting_", +export const LabProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResponseWithContinuationEnvironmentSetting", + className: "LabProperties", modelProperties: { - value: { - serializedName: "", + ...LabUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EnvironmentSetting" - } - } + name: "Enum", + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Locked" + ] } }, - nextLink: { - serializedName: "nextLink", + networkProfile: { + serializedName: "networkProfile", type: { - name: "String" + name: "Composite", + className: "LabNetworkProfile" + } + }, + state: { + serializedName: "state", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Draft", + "Publishing", + "Scaling", + "Syncing", + "Published" + ] } } } } }; -export const ResponseWithContinuationEnvironment: msRest.CompositeMapper = { - serializedName: "ResponseWithContinuation_Environment_", +export const ScheduleProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResponseWithContinuationEnvironment", + className: "ScheduleProperties", modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Environment" - } - } - } - }, - nextLink: { - serializedName: "nextLink", + ...ScheduleUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, type: { - name: "String" + name: "Enum", + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Locked" + ] } } } } }; -export const ResponseWithContinuationUser: msRest.CompositeMapper = { - serializedName: "ResponseWithContinuation_User_", +export const UserProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResponseWithContinuationUser", + className: "UserProperties", modelProperties: { - value: { - serializedName: "", + ...UserUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "User" - } - } + name: "Enum", + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Locked" + ] } }, - nextLink: { - serializedName: "nextLink", + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String" + } + }, + email: { + constraints: { + MaxLength: 254, + MinLength: 6 + }, + serializedName: "email", + required: true, + type: { + name: "String" + } + }, + registrationState: { + serializedName: "registrationState", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Registered", "NotRegistered"] + } + }, + invitationState: { + serializedName: "invitationState", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["NotSent", "Sending", "Sent", "Failed"] + } + }, + invitationSent: { + serializedName: "invitationSent", + readOnly: true, + type: { + name: "DateTime" + } + }, + totalUsage: { + serializedName: "totalUsage", + readOnly: true, + type: { + name: "TimeSpan" + } + } + } + } +}; + +export const Image: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Image", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + enabledState: { + serializedName: "properties.enabledState", + type: { + name: "Enum", + allowedValues: ["Enabled", "Disabled"] + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Locked" + ] + } + }, + displayName: { + serializedName: "properties.displayName", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + iconUrl: { + serializedName: "properties.iconUrl", + readOnly: true, + type: { + name: "String" + } + }, + author: { + serializedName: "properties.author", + readOnly: true, + type: { + name: "String" + } + }, + osType: { + serializedName: "properties.osType", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Windows", "Linux"] + } + }, + plan: { + serializedName: "properties.plan", + readOnly: true, + type: { + name: "String" + } + }, + termsStatus: { + serializedName: "properties.termsStatus", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Enabled", "Disabled"] + } + }, + offer: { + serializedName: "properties.offer", + readOnly: true, + type: { + name: "String" + } + }, + publisher: { + serializedName: "properties.publisher", + readOnly: true, + type: { + name: "String" + } + }, + sku: { + serializedName: "properties.sku", + readOnly: true, + type: { + name: "String" + } + }, + version: { + serializedName: "properties.version", + readOnly: true, + type: { + name: "String" + } + }, + sharedGalleryId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "properties.sharedGalleryId", + readOnly: true, + type: { + name: "String" + } + }, + availableRegions: { + serializedName: "properties.availableRegions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + osState: { + serializedName: "properties.osState", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Generalized", "Specialized"] + } + } + } + } +}; + +export const Schedule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Schedule", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + startAt: { + serializedName: "properties.startAt", + type: { + name: "DateTime" + } + }, + stopAt: { + serializedName: "properties.stopAt", + type: { + name: "DateTime" + } + }, + recurrencePattern: { + serializedName: "properties.recurrencePattern", + type: { + name: "Composite", + className: "RecurrencePattern" + } + }, + timeZoneId: { + constraints: { + MaxLength: 50 + }, + serializedName: "properties.timeZoneId", + type: { + name: "String" + } + }, + notes: { + constraints: { + MaxLength: 1000 + }, + serializedName: "properties.notes", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Locked" + ] + } + } + } + } +}; + +export const User: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "User", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + additionalUsageQuota: { + serializedName: "properties.additionalUsageQuota", + type: { + name: "TimeSpan" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Locked" + ] + } + }, + displayName: { + serializedName: "properties.displayName", + readOnly: true, + type: { + name: "String" + } + }, + email: { + constraints: { + MaxLength: 254, + MinLength: 6 + }, + serializedName: "properties.email", + required: true, + type: { + name: "String" + } + }, + registrationState: { + serializedName: "properties.registrationState", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Registered", "NotRegistered"] + } + }, + invitationState: { + serializedName: "properties.invitationState", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["NotSent", "Sending", "Sent", "Failed"] + } + }, + invitationSent: { + serializedName: "properties.invitationSent", + readOnly: true, + type: { + name: "DateTime" + } + }, + totalUsage: { + serializedName: "properties.totalUsage", + readOnly: true, + type: { + name: "TimeSpan" + } + } + } + } +}; + +export const VirtualMachine: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachine", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Locked" + ] + } + }, + state: { + serializedName: "properties.state", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Stopped", + "Starting", + "Running", + "Stopping", + "ResettingPassword", + "Reimaging", + "Redeploying" + ] + } + }, + connectionProfile: { + serializedName: "properties.connectionProfile", + type: { + name: "Composite", + className: "VirtualMachineConnectionProfile" + } + }, + claimedByUserId: { + serializedName: "properties.claimedByUserId", + readOnly: true, type: { name: "String" } + }, + vmType: { + serializedName: "properties.vmType", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["User", "Template"] + } + } + } + } +}; + +export const LabPlan: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LabPlan", + modelProperties: { + ...TrackedResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + defaultConnectionProfile: { + serializedName: "properties.defaultConnectionProfile", + type: { + name: "Composite", + className: "ConnectionProfile" + } + }, + defaultAutoShutdownProfile: { + serializedName: "properties.defaultAutoShutdownProfile", + type: { + name: "Composite", + className: "AutoShutdownProfile" + } + }, + defaultNetworkProfile: { + serializedName: "properties.defaultNetworkProfile", + type: { + name: "Composite", + className: "LabPlanNetworkProfile" + } + }, + allowedRegions: { + serializedName: "properties.allowedRegions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + sharedGalleryId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "properties.sharedGalleryId", + type: { + name: "String" + } + }, + supportInfo: { + serializedName: "properties.supportInfo", + type: { + name: "Composite", + className: "SupportInfo" + } + }, + linkedLmsInstance: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "properties.linkedLmsInstance", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Locked" + ] + } + } + } + } +}; + +export const Lab: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Lab", + modelProperties: { + ...TrackedResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + autoShutdownProfile: { + serializedName: "properties.autoShutdownProfile", + type: { + name: "Composite", + className: "AutoShutdownProfile" + } + }, + connectionProfile: { + serializedName: "properties.connectionProfile", + type: { + name: "Composite", + className: "ConnectionProfile" + } + }, + virtualMachineProfile: { + serializedName: "properties.virtualMachineProfile", + type: { + name: "Composite", + className: "VirtualMachineProfile" + } + }, + securityProfile: { + serializedName: "properties.securityProfile", + type: { + name: "Composite", + className: "SecurityProfile" + } + }, + rosterProfile: { + serializedName: "properties.rosterProfile", + type: { + name: "Composite", + className: "RosterProfile" + } + }, + labPlanId: { + constraints: { + MaxLength: 2000, + MinLength: 3 + }, + serializedName: "properties.labPlanId", + type: { + name: "String" + } + }, + title: { + constraints: { + MaxLength: 120, + MinLength: 1 + }, + serializedName: "properties.title", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Locked" + ] + } + }, + networkProfile: { + serializedName: "properties.networkProfile", + type: { + name: "Composite", + className: "LabNetworkProfile" + } + }, + state: { + serializedName: "properties.state", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Draft", + "Publishing", + "Scaling", + "Syncing", + "Published" + ] + } } } } diff --git a/sdk/labservices/arm-labservices/src/models/operationsMappers.ts b/sdk/labservices/arm-labservices/src/models/operationsMappers.ts deleted file mode 100644 index 2ea848782dbd..000000000000 --- a/sdk/labservices/arm-labservices/src/models/operationsMappers.ts +++ /dev/null @@ -1,13 +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 { - CloudError, - OperationError, - OperationResult -} from "../models/mappers"; diff --git a/sdk/labservices/arm-labservices/src/models/parameters.ts b/sdk/labservices/arm-labservices/src/models/parameters.ts index 741ed96caa31..7f39d5155b1e 100644 --- a/sdk/labservices/arm-labservices/src/models/parameters.ts +++ b/sdk/labservices/arm-labservices/src/models/parameters.ts @@ -1,190 +1,316 @@ /* - * 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 { + Image as ImageMapper, + ImageUpdate as ImageUpdateMapper, + LabPlan as LabPlanMapper, + LabPlanUpdate as LabPlanUpdateMapper, + SaveImageBody as SaveImageBodyMapper, + Lab as LabMapper, + LabUpdate as LabUpdateMapper, + Schedule as ScheduleMapper, + ScheduleUpdate as ScheduleUpdateMapper, + User as UserMapper, + UserUpdate as UserUpdateMapper, + InviteBody as InviteBodyMapper, + ResetPasswordBody as ResetPasswordBodyMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "api-version", - defaultValue: '2018-10-15', type: { name: "String" } - } + }, + skipEncoding: true }; -export const environmentName: msRest.OperationURLParameter = { - parameterPath: "environmentName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "environmentName", + defaultValue: "2021-11-15-preview", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const environmentSettingName: msRest.OperationURLParameter = { - parameterPath: "environmentSettingName", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", required: true, - serializedName: "environmentSettingName", - type: { - name: "String" - } - } -}; -export const expand: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "expand" - ], - mapper: { - serializedName: "$expand", type: { name: "String" } } }; -export const filter: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "filter" - ], + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { - serializedName: "$filter", + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const galleryImageName: msRest.OperationURLParameter = { - parameterPath: "galleryImageName", + +export const labPlanName: OperationURLParameter = { + parameterPath: "labPlanName", mapper: { + constraints: { + MaxLength: 100, + MinLength: 1 + }, + serializedName: "labPlanName", required: true, - serializedName: "galleryImageName", type: { name: "String" } } }; -export const labAccountName: msRest.OperationURLParameter = { - parameterPath: "labAccountName", + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], mapper: { - required: true, - serializedName: "labAccountName", + serializedName: "$filter", type: { name: "String" } } }; -export const labName: msRest.OperationURLParameter = { - parameterPath: "labName", + +export const imageName: OperationURLParameter = { + parameterPath: "imageName", mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\\\._\\\\(\\\\)]+$"), + MaxLength: 100, + MinLength: 1 + }, + serializedName: "imageName", required: true, - serializedName: "labName", type: { name: "String" } } }; -export const locationName: msRest.OperationURLParameter = { - parameterPath: "locationName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "locationName", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const body: OperationParameter = { + parameterPath: "body", + mapper: ImageMapper +}; + +export const body1: OperationParameter = { + parameterPath: "body", + mapper: ImageUpdateMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { - required: true, serializedName: "nextLink", + required: true, type: { name: "String" } }, skipEncoding: true }; -export const operationName: msRest.OperationURLParameter = { - parameterPath: "operationName", + +export const body2: OperationParameter = { + parameterPath: "body", + mapper: LabPlanMapper +}; + +export const body3: OperationParameter = { + parameterPath: "body", + mapper: LabPlanUpdateMapper +}; + +export const body4: OperationParameter = { + parameterPath: "body", + mapper: SaveImageBodyMapper +}; + +export const labName: OperationURLParameter = { + parameterPath: "labName", mapper: { + constraints: { + MaxLength: 100, + MinLength: 1 + }, + serializedName: "labName", required: true, - serializedName: "operationName", type: { name: "String" } } }; -export const orderby: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "orderby" - ], + +export const body5: OperationParameter = { + parameterPath: "body", + mapper: LabMapper +}; + +export const body6: OperationParameter = { + parameterPath: "body", + mapper: LabUpdateMapper +}; + +export const operationResultId: OperationURLParameter = { + parameterPath: "operationResultId", mapper: { - serializedName: "$orderby", + constraints: { + Pattern: new RegExp("^[-\\w\\\\._\\\\(\\\\)]+$"), + MaxLength: 100, + MinLength: 1 + }, + serializedName: "operationResultId", + required: true, type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const scheduleName: OperationURLParameter = { + parameterPath: "scheduleName", mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\\\._\\\\(\\\\)]+$"), + MaxLength: 100, + MinLength: 1 + }, + serializedName: "scheduleName", required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const body7: OperationParameter = { + parameterPath: "body", + mapper: ScheduleMapper +}; + +export const body8: OperationParameter = { + parameterPath: "body", + mapper: ScheduleUpdateMapper +}; + +export const userName: OperationURLParameter = { + parameterPath: "userName", mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\\\._\\\\(\\\\)]+$"), + MaxLength: 100, + MinLength: 1 + }, + serializedName: "userName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; -export const top: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "top" - ], + +export const body9: OperationParameter = { + parameterPath: "body", + mapper: UserMapper +}; + +export const body10: OperationParameter = { + parameterPath: "body", + mapper: UserUpdateMapper +}; + +export const body11: OperationParameter = { + parameterPath: "body", + mapper: InviteBodyMapper +}; + +export const virtualMachineName: OperationURLParameter = { + parameterPath: "virtualMachineName", mapper: { - serializedName: "$top", + constraints: { + Pattern: new RegExp("^[-\\w\\\\._\\\\(\\\\)]+$"), + MaxLength: 100, + MinLength: 1 + }, + serializedName: "virtualMachineName", + required: true, type: { - name: "Number" + name: "String" } } }; -export const userName: msRest.OperationURLParameter = { - parameterPath: "userName", + +export const body12: OperationParameter = { + parameterPath: "body", + mapper: ResetPasswordBodyMapper +}; + +export const location: OperationURLParameter = { + parameterPath: "location", mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\._]+$"), + MaxLength: 100, + MinLength: 1 + }, + serializedName: "location", required: true, - serializedName: "userName", type: { name: "String" } diff --git a/sdk/labservices/arm-labservices/src/models/providerOperationsMappers.ts b/sdk/labservices/arm-labservices/src/models/providerOperationsMappers.ts deleted file mode 100644 index 0e3a2c313781..000000000000 --- a/sdk/labservices/arm-labservices/src/models/providerOperationsMappers.ts +++ /dev/null @@ -1,14 +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 { - CloudError, - OperationMetadata, - OperationMetadataDisplay, - ProviderOperationResult -} from "../models/mappers"; diff --git a/sdk/labservices/arm-labservices/src/models/usersMappers.ts b/sdk/labservices/arm-labservices/src/models/usersMappers.ts deleted file mode 100644 index c0e823467f0f..000000000000 --- a/sdk/labservices/arm-labservices/src/models/usersMappers.ts +++ /dev/null @@ -1,39 +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 { - BaseResource, - CloudError, - Environment, - EnvironmentFragment, - EnvironmentSetting, - EnvironmentSettingFragment, - EnvironmentSize, - GalleryImage, - GalleryImageFragment, - GalleryImageReference, - Lab, - LabAccount, - LabAccountFragment, - LabFragment, - LatestOperationResult, - NetworkInterface, - ReferenceVm, - ReferenceVmFragment, - Resource, - ResourceSet, - ResourceSetFragment, - ResourceSettings, - ResourceSettingsFragment, - ResponseWithContinuationUser, - SizeConfigurationProperties, - SizeInfo, - User, - UserFragment, - VmStateDetails -} from "../models/mappers"; diff --git a/sdk/labservices/arm-labservices/src/operations/environmentSettings.ts b/sdk/labservices/arm-labservices/src/operations/environmentSettings.ts deleted file mode 100644 index 9909699599b4..000000000000 --- a/sdk/labservices/arm-labservices/src/operations/environmentSettings.ts +++ /dev/null @@ -1,705 +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 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/environmentSettingsMappers"; -import * as Parameters from "../models/parameters"; -import { ManagedLabsClientContext } from "../managedLabsClientContext"; - -/** Class representing a EnvironmentSettings. */ -export class EnvironmentSettings { - private readonly client: ManagedLabsClientContext; - - /** - * Create a EnvironmentSettings. - * @param {ManagedLabsClientContext} client Reference to the service client. - */ - constructor(client: ManagedLabsClientContext) { - this.client = client; - } - - /** - * List environment setting in a given lab. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param [options] The optional parameters - * @returns Promise - */ - list(resourceGroupName: string, labAccountName: string, labName: string, options?: Models.EnvironmentSettingsListOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param callback The callback - */ - list(resourceGroupName: string, labAccountName: string, labName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, labAccountName: string, labName: string, options: Models.EnvironmentSettingsListOptionalParams, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, labAccountName: string, labName: string, options?: Models.EnvironmentSettingsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - options - }, - listOperationSpec, - callback) as Promise; - } - - /** - * Get environment setting - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: Models.EnvironmentSettingsGetOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param callback The callback - */ - get(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options: Models.EnvironmentSettingsGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: Models.EnvironmentSettingsGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment - * instances would be created - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentSetting: Models.EnvironmentSetting, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,labAccountName,labName,environmentSettingName,environmentSetting,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } - - /** - * Delete environment setting. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,labAccountName,labName,environmentSettingName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Modify properties of environment setting. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment - * instances would be created - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentSetting: Models.EnvironmentSettingFragment, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment - * instances would be created - * @param callback The callback - */ - update(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentSetting: Models.EnvironmentSettingFragment, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment - * instances would be created - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentSetting: Models.EnvironmentSettingFragment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentSetting: Models.EnvironmentSettingFragment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentSetting, - options - }, - updateOperationSpec, - callback) as Promise; - } - - /** - * Claims a random environment for a user in an environment settings - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param [options] The optional parameters - * @returns Promise - */ - claimAny(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param callback The callback - */ - claimAny(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param options The optional parameters - * @param callback The callback - */ - claimAny(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - claimAny(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - options - }, - claimAnyOperationSpec, - callback); - } - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of - * the lab/environment setting. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @param [options] The optional parameters - * @returns Promise - */ - publish(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, publishPayload: Models.PublishPayload, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @param callback The callback - */ - publish(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, publishPayload: Models.PublishPayload, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @param options The optional parameters - * @param callback The callback - */ - publish(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, publishPayload: Models.PublishPayload, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - publish(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, publishPayload: Models.PublishPayload, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - publishPayload, - options - }, - publishOperationSpec, - callback); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while - * to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param [options] The optional parameters - * @returns Promise - */ - start(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginStart(resourceGroupName,labAccountName,labName,environmentSettingName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while - * to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param [options] The optional parameters - * @returns Promise - */ - stop(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginStop(resourceGroupName,labAccountName,labName,environmentSettingName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment - * instances would be created - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentSetting: Models.EnvironmentSetting, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentSetting, - options - }, - beginCreateOrUpdateOperationSpec, - options); - } - - /** - * Delete environment setting. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteMethod(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - options - }, - beginDeleteMethodOperationSpec, - options); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while - * to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param [options] The optional parameters - * @returns Promise - */ - beginStart(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - options - }, - beginStartOperationSpec, - options); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while - * to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param [options] The optional parameters - * @returns Promise - */ - beginStop(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - options - }, - beginStopOperationSpec, - options); - } - - /** - * List environment setting in a given lab. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName - ], - queryParameters: [ - Parameters.expand, - Parameters.filter, - Parameters.top, - Parameters.orderby, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResponseWithContinuationEnvironmentSetting - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName - ], - queryParameters: [ - Parameters.expand, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.EnvironmentSetting - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "environmentSetting", - mapper: { - ...Mappers.EnvironmentSettingFragment, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.EnvironmentSetting - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const claimAnyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/claimAny", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const publishOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/publish", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "publishPayload", - mapper: { - ...Mappers.PublishPayload, - required: true - } - }, - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "environmentSetting", - mapper: { - ...Mappers.EnvironmentSetting, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.EnvironmentSetting - }, - 201: { - bodyMapper: Mappers.EnvironmentSetting - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginStartOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/start", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginStopOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/stop", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResponseWithContinuationEnvironmentSetting - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/labservices/arm-labservices/src/operations/environments.ts b/sdk/labservices/arm-labservices/src/operations/environments.ts deleted file mode 100644 index 3bd7120e3321..000000000000 --- a/sdk/labservices/arm-labservices/src/operations/environments.ts +++ /dev/null @@ -1,741 +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 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/environmentsMappers"; -import * as Parameters from "../models/parameters"; -import { ManagedLabsClientContext } from "../managedLabsClientContext"; - -/** Class representing a Environments. */ -export class Environments { - private readonly client: ManagedLabsClientContext; - - /** - * Create a Environments. - * @param {ManagedLabsClientContext} client Reference to the service client. - */ - constructor(client: ManagedLabsClientContext) { - this.client = client; - } - - /** - * List environments in a given environment setting. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param [options] The optional parameters - * @returns Promise - */ - list(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: Models.EnvironmentsListOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param callback The callback - */ - list(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options: Models.EnvironmentsListOptionalParams, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, options?: Models.EnvironmentsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - options - }, - listOperationSpec, - callback) as Promise; - } - - /** - * Get environment - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options?: Models.EnvironmentsGetOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param callback The callback - */ - get(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options: Models.EnvironmentsGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options?: Models.EnvironmentsGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Create or replace an existing Environment. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, environment: Models.Environment, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, environment: Models.Environment, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, environment: Models.Environment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, environment: Models.Environment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - environment, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; - } - - /** - * Delete environment. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,labAccountName,labName,environmentSettingName,environmentName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Modify properties of environments. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, environment: Models.EnvironmentFragment, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance - * @param callback The callback - */ - update(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, environment: Models.EnvironmentFragment, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, environment: Models.EnvironmentFragment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, environment: Models.EnvironmentFragment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - environment, - options - }, - updateOperationSpec, - callback) as Promise; - } - - /** - * Claims the environment and assigns it to the user - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param [options] The optional parameters - * @returns Promise - */ - claim(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param callback The callback - */ - claim(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param options The optional parameters - * @param callback The callback - */ - claim(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - claim(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - options - }, - claimOperationSpec, - callback); - } - - /** - * Resets the user password on an environment This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param [options] The optional parameters - * @returns Promise - */ - resetPassword(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, resetPasswordPayload: Models.ResetPasswordPayload, options?: msRest.RequestOptionsBase): Promise { - return this.beginResetPassword(resourceGroupName,labAccountName,labName,environmentSettingName,environmentName,resetPasswordPayload,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take - * a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param [options] The optional parameters - * @returns Promise - */ - start(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginStart(resourceGroupName,labAccountName,labName,environmentSettingName,environmentName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a - * while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param [options] The optional parameters - * @returns Promise - */ - stop(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginStop(resourceGroupName,labAccountName,labName,environmentSettingName,environmentName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Delete environment. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteMethod(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - options - }, - beginDeleteMethodOperationSpec, - options); - } - - /** - * Resets the user password on an environment This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param [options] The optional parameters - * @returns Promise - */ - beginResetPassword(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, resetPasswordPayload: Models.ResetPasswordPayload, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload, - options - }, - beginResetPasswordOperationSpec, - options); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take - * a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param [options] The optional parameters - * @returns Promise - */ - beginStart(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - options - }, - beginStartOperationSpec, - options); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a - * while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param [options] The optional parameters - * @returns Promise - */ - beginStop(resourceGroupName: string, labAccountName: string, labName: string, environmentSettingName: string, environmentName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - options - }, - beginStopOperationSpec, - options); - } - - /** - * List environments in a given environment setting. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName - ], - queryParameters: [ - Parameters.expand, - Parameters.filter, - Parameters.top, - Parameters.orderby, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResponseWithContinuationEnvironment - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName, - Parameters.environmentName - ], - queryParameters: [ - Parameters.expand, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.Environment - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName, - Parameters.environmentName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "environment", - mapper: { - ...Mappers.Environment, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.Environment - }, - 201: { - bodyMapper: Mappers.Environment - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName, - Parameters.environmentName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "environment", - mapper: { - ...Mappers.EnvironmentFragment, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.Environment - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const claimOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/claim", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName, - Parameters.environmentName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName, - Parameters.environmentName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginResetPasswordOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/resetPassword", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName, - Parameters.environmentName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "resetPasswordPayload", - mapper: { - ...Mappers.ResetPasswordPayload, - required: true - } - }, - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginStartOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/start", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName, - Parameters.environmentName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginStopOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/stop", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName, - Parameters.environmentSettingName, - Parameters.environmentName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResponseWithContinuationEnvironment - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/labservices/arm-labservices/src/operations/galleryImages.ts b/sdk/labservices/arm-labservices/src/operations/galleryImages.ts deleted file mode 100644 index 159c602d4e15..000000000000 --- a/sdk/labservices/arm-labservices/src/operations/galleryImages.ts +++ /dev/null @@ -1,413 +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 msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/galleryImagesMappers"; -import * as Parameters from "../models/parameters"; -import { ManagedLabsClientContext } from "../managedLabsClientContext"; - -/** Class representing a GalleryImages. */ -export class GalleryImages { - private readonly client: ManagedLabsClientContext; - - /** - * Create a GalleryImages. - * @param {ManagedLabsClientContext} client Reference to the service client. - */ - constructor(client: ManagedLabsClientContext) { - this.client = client; - } - - /** - * List gallery images in a given lab account. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param [options] The optional parameters - * @returns Promise - */ - list(resourceGroupName: string, labAccountName: string, options?: Models.GalleryImagesListOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param callback The callback - */ - list(resourceGroupName: string, labAccountName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, labAccountName: string, options: Models.GalleryImagesListOptionalParams, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, labAccountName: string, options?: Models.GalleryImagesListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - options - }, - listOperationSpec, - callback) as Promise; - } - - /** - * Get gallery image - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, labAccountName: string, galleryImageName: string, options?: Models.GalleryImagesGetOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param callback The callback - */ - get(resourceGroupName: string, labAccountName: string, galleryImageName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, labAccountName: string, galleryImageName: string, options: Models.GalleryImagesGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, labAccountName: string, galleryImageName: string, options?: Models.GalleryImagesGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - galleryImageName, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Create or replace an existing Gallery Image. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, galleryImageName: string, galleryImage: Models.GalleryImage, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, galleryImageName: string, galleryImage: Models.GalleryImage, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, galleryImageName: string, galleryImage: Models.GalleryImage, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, labAccountName: string, galleryImageName: string, galleryImage: Models.GalleryImage, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - galleryImageName, - galleryImage, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; - } - - /** - * Delete gallery image. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, labAccountName: string, galleryImageName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, labAccountName: string, galleryImageName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, labAccountName: string, galleryImageName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, labAccountName: string, galleryImageName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - galleryImageName, - options - }, - deleteMethodOperationSpec, - callback); - } - - /** - * Modify properties of gallery images. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, labAccountName: string, galleryImageName: string, galleryImage: Models.GalleryImageFragment, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace - * @param callback The callback - */ - update(resourceGroupName: string, labAccountName: string, galleryImageName: string, galleryImage: Models.GalleryImageFragment, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, labAccountName: string, galleryImageName: string, galleryImage: Models.GalleryImageFragment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, labAccountName: string, galleryImageName: string, galleryImage: Models.GalleryImageFragment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - galleryImageName, - galleryImage, - options - }, - updateOperationSpec, - callback) as Promise; - } - - /** - * List gallery images in a given lab account. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName - ], - queryParameters: [ - Parameters.expand, - Parameters.filter, - Parameters.top, - Parameters.orderby, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResponseWithContinuationGalleryImage - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.galleryImageName - ], - queryParameters: [ - Parameters.expand, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.GalleryImage - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.galleryImageName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "galleryImage", - mapper: { - ...Mappers.GalleryImage, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.GalleryImage - }, - 201: { - bodyMapper: Mappers.GalleryImage - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.galleryImageName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.galleryImageName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "galleryImage", - mapper: { - ...Mappers.GalleryImageFragment, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.GalleryImage - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResponseWithContinuationGalleryImage - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/labservices/arm-labservices/src/operations/globalUsers.ts b/sdk/labservices/arm-labservices/src/operations/globalUsers.ts deleted file mode 100644 index c0b05b1b6dac..000000000000 --- a/sdk/labservices/arm-labservices/src/operations/globalUsers.ts +++ /dev/null @@ -1,644 +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 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/globalUsersMappers"; -import * as Parameters from "../models/parameters"; -import { ManagedLabsClientContext } from "../managedLabsClientContext"; - -/** Class representing a GlobalUsers. */ -export class GlobalUsers { - private readonly client: ManagedLabsClientContext; - - /** - * Create a GlobalUsers. - * @param {ManagedLabsClientContext} client Reference to the service client. - */ - constructor(client: ManagedLabsClientContext) { - this.client = client; - } - - /** - * Gets the virtual machine details - * @param userName The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, - * start, stop, connect - * @param [options] The optional parameters - * @returns Promise - */ - getEnvironment(userName: string, environmentOperationsPayload: Models.EnvironmentOperationsPayload, options?: Models.GlobalUsersGetEnvironmentOptionalParams): Promise; - /** - * @param userName The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, - * start, stop, connect - * @param callback The callback - */ - getEnvironment(userName: string, environmentOperationsPayload: Models.EnvironmentOperationsPayload, callback: msRest.ServiceCallback): void; - /** - * @param userName The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, - * start, stop, connect - * @param options The optional parameters - * @param callback The callback - */ - getEnvironment(userName: string, environmentOperationsPayload: Models.EnvironmentOperationsPayload, options: Models.GlobalUsersGetEnvironmentOptionalParams, callback: msRest.ServiceCallback): void; - getEnvironment(userName: string, environmentOperationsPayload: Models.EnvironmentOperationsPayload, options?: Models.GlobalUsersGetEnvironmentOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - userName, - environmentOperationsPayload, - options - }, - getEnvironmentOperationSpec, - callback) as Promise; - } - - /** - * Get batch operation status - * @param userName The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation - * @param [options] The optional parameters - * @returns Promise - */ - getOperationBatchStatus(userName: string, operationBatchStatusPayload: Models.OperationBatchStatusPayload, options?: msRest.RequestOptionsBase): Promise; - /** - * @param userName The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation - * @param callback The callback - */ - getOperationBatchStatus(userName: string, operationBatchStatusPayload: Models.OperationBatchStatusPayload, callback: msRest.ServiceCallback): void; - /** - * @param userName The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation - * @param options The optional parameters - * @param callback The callback - */ - getOperationBatchStatus(userName: string, operationBatchStatusPayload: Models.OperationBatchStatusPayload, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getOperationBatchStatus(userName: string, operationBatchStatusPayload: Models.OperationBatchStatusPayload, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - userName, - operationBatchStatusPayload, - options - }, - getOperationBatchStatusOperationSpec, - callback) as Promise; - } - - /** - * Gets the status of long running operation - * @param userName The name of the user. - * @param operationStatusPayload Payload to get the status of an operation - * @param [options] The optional parameters - * @returns Promise - */ - getOperationStatus(userName: string, operationStatusPayload: Models.OperationStatusPayload, options?: msRest.RequestOptionsBase): Promise; - /** - * @param userName The name of the user. - * @param operationStatusPayload Payload to get the status of an operation - * @param callback The callback - */ - getOperationStatus(userName: string, operationStatusPayload: Models.OperationStatusPayload, callback: msRest.ServiceCallback): void; - /** - * @param userName The name of the user. - * @param operationStatusPayload Payload to get the status of an operation - * @param options The optional parameters - * @param callback The callback - */ - getOperationStatus(userName: string, operationStatusPayload: Models.OperationStatusPayload, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getOperationStatus(userName: string, operationStatusPayload: Models.OperationStatusPayload, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - userName, - operationStatusPayload, - options - }, - getOperationStatusOperationSpec, - callback) as Promise; - } - - /** - * Get personal preferences for a user - * @param userName The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations - * like get, start, stop, connect - * @param [options] The optional parameters - * @returns Promise - */ - getPersonalPreferences(userName: string, personalPreferencesOperationsPayload: Models.PersonalPreferencesOperationsPayload, options?: msRest.RequestOptionsBase): Promise; - /** - * @param userName The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations - * like get, start, stop, connect - * @param callback The callback - */ - getPersonalPreferences(userName: string, personalPreferencesOperationsPayload: Models.PersonalPreferencesOperationsPayload, callback: msRest.ServiceCallback): void; - /** - * @param userName The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations - * like get, start, stop, connect - * @param options The optional parameters - * @param callback The callback - */ - getPersonalPreferences(userName: string, personalPreferencesOperationsPayload: Models.PersonalPreferencesOperationsPayload, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getPersonalPreferences(userName: string, personalPreferencesOperationsPayload: Models.PersonalPreferencesOperationsPayload, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - userName, - personalPreferencesOperationsPayload, - options - }, - getPersonalPreferencesOperationSpec, - callback) as Promise; - } - - /** - * List Environments for the user - * @param userName The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user - * @param [options] The optional parameters - * @returns Promise - */ - listEnvironments(userName: string, listEnvironmentsPayload: Models.ListEnvironmentsPayload, options?: msRest.RequestOptionsBase): Promise; - /** - * @param userName The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user - * @param callback The callback - */ - listEnvironments(userName: string, listEnvironmentsPayload: Models.ListEnvironmentsPayload, callback: msRest.ServiceCallback): void; - /** - * @param userName The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user - * @param options The optional parameters - * @param callback The callback - */ - listEnvironments(userName: string, listEnvironmentsPayload: Models.ListEnvironmentsPayload, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listEnvironments(userName: string, listEnvironmentsPayload: Models.ListEnvironmentsPayload, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - userName, - listEnvironmentsPayload, - options - }, - listEnvironmentsOperationSpec, - callback) as Promise; - } - - /** - * List labs for the user. - * @param userName The name of the user. - * @param [options] The optional parameters - * @returns Promise - */ - listLabs(userName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param userName The name of the user. - * @param callback The callback - */ - listLabs(userName: string, callback: msRest.ServiceCallback): void; - /** - * @param userName The name of the user. - * @param options The optional parameters - * @param callback The callback - */ - listLabs(userName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listLabs(userName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - userName, - options - }, - listLabsOperationSpec, - callback) as Promise; - } - - /** - * Register a user to a managed lab - * @param userName The name of the user. - * @param registerPayload Represents payload for Register action. - * @param [options] The optional parameters - * @returns Promise - */ - register(userName: string, registerPayload: Models.RegisterPayload, options?: msRest.RequestOptionsBase): Promise; - /** - * @param userName The name of the user. - * @param registerPayload Represents payload for Register action. - * @param callback The callback - */ - register(userName: string, registerPayload: Models.RegisterPayload, callback: msRest.ServiceCallback): void; - /** - * @param userName The name of the user. - * @param registerPayload Represents payload for Register action. - * @param options The optional parameters - * @param callback The callback - */ - register(userName: string, registerPayload: Models.RegisterPayload, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - register(userName: string, registerPayload: Models.RegisterPayload, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - userName, - registerPayload, - options - }, - registerOperationSpec, - callback); - } - - /** - * Resets the user password on an environment This operation can take a while to complete - * @param userName The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param [options] The optional parameters - * @returns Promise - */ - resetPassword(userName: string, resetPasswordPayload: Models.ResetPasswordPayload, options?: msRest.RequestOptionsBase): Promise { - return this.beginResetPassword(userName,resetPasswordPayload,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take - * a while to complete - * @param userName The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, - * start, stop, connect - * @param [options] The optional parameters - * @returns Promise - */ - startEnvironment(userName: string, environmentOperationsPayload: Models.EnvironmentOperationsPayload, options?: msRest.RequestOptionsBase): Promise { - return this.beginStartEnvironment(userName,environmentOperationsPayload,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a - * while to complete - * @param userName The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, - * start, stop, connect - * @param [options] The optional parameters - * @returns Promise - */ - stopEnvironment(userName: string, environmentOperationsPayload: Models.EnvironmentOperationsPayload, options?: msRest.RequestOptionsBase): Promise { - return this.beginStopEnvironment(userName,environmentOperationsPayload,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Resets the user password on an environment This operation can take a while to complete - * @param userName The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param [options] The optional parameters - * @returns Promise - */ - beginResetPassword(userName: string, resetPasswordPayload: Models.ResetPasswordPayload, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - userName, - resetPasswordPayload, - options - }, - beginResetPasswordOperationSpec, - options); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take - * a while to complete - * @param userName The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, - * start, stop, connect - * @param [options] The optional parameters - * @returns Promise - */ - beginStartEnvironment(userName: string, environmentOperationsPayload: Models.EnvironmentOperationsPayload, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - userName, - environmentOperationsPayload, - options - }, - beginStartEnvironmentOperationSpec, - options); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a - * while to complete - * @param userName The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, - * start, stop, connect - * @param [options] The optional parameters - * @returns Promise - */ - beginStopEnvironment(userName: string, environmentOperationsPayload: Models.EnvironmentOperationsPayload, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - userName, - environmentOperationsPayload, - options - }, - beginStopEnvironmentOperationSpec, - options); - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getEnvironmentOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.LabServices/users/{userName}/getEnvironment", - urlParameters: [ - Parameters.userName - ], - queryParameters: [ - Parameters.expand, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "environmentOperationsPayload", - mapper: { - ...Mappers.EnvironmentOperationsPayload, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.GetEnvironmentResponse - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getOperationBatchStatusOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.LabServices/users/{userName}/getOperationBatchStatus", - urlParameters: [ - Parameters.userName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "operationBatchStatusPayload", - mapper: { - ...Mappers.OperationBatchStatusPayload, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.OperationBatchStatusResponse - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getOperationStatusOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.LabServices/users/{userName}/getOperationStatus", - urlParameters: [ - Parameters.userName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "operationStatusPayload", - mapper: { - ...Mappers.OperationStatusPayload, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.OperationStatusResponse - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getPersonalPreferencesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.LabServices/users/{userName}/getPersonalPreferences", - urlParameters: [ - Parameters.userName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "personalPreferencesOperationsPayload", - mapper: { - ...Mappers.PersonalPreferencesOperationsPayload, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.GetPersonalPreferencesResponse - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listEnvironmentsOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.LabServices/users/{userName}/listEnvironments", - urlParameters: [ - Parameters.userName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "listEnvironmentsPayload", - mapper: { - ...Mappers.ListEnvironmentsPayload, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.ListEnvironmentsResponse - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listLabsOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.LabServices/users/{userName}/listLabs", - urlParameters: [ - Parameters.userName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ListLabsResponse - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const registerOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.LabServices/users/{userName}/register", - urlParameters: [ - Parameters.userName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "registerPayload", - mapper: { - ...Mappers.RegisterPayload, - required: true - } - }, - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginResetPasswordOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.LabServices/users/{userName}/resetPassword", - urlParameters: [ - Parameters.userName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "resetPasswordPayload", - mapper: { - ...Mappers.ResetPasswordPayload, - required: true - } - }, - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginStartEnvironmentOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.LabServices/users/{userName}/startEnvironment", - urlParameters: [ - Parameters.userName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "environmentOperationsPayload", - mapper: { - ...Mappers.EnvironmentOperationsPayload, - required: true - } - }, - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginStopEnvironmentOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.LabServices/users/{userName}/stopEnvironment", - urlParameters: [ - Parameters.userName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "environmentOperationsPayload", - mapper: { - ...Mappers.EnvironmentOperationsPayload, - required: true - } - }, - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/labservices/arm-labservices/src/operations/images.ts b/sdk/labservices/arm-labservices/src/operations/images.ts new file mode 100644 index 000000000000..1b8a6a01fa95 --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operations/images.ts @@ -0,0 +1,336 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Images } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { LabServicesClient } from "../labServicesClient"; +import { + Image, + ImagesListByLabPlanNextOptionalParams, + ImagesListByLabPlanOptionalParams, + ImagesListByLabPlanResponse, + ImagesGetOptionalParams, + ImagesGetResponse, + ImagesCreateOrUpdateOptionalParams, + ImagesCreateOrUpdateResponse, + ImageUpdate, + ImagesUpdateOptionalParams, + ImagesUpdateResponse, + ImagesListByLabPlanNextResponse +} from "../models"; + +/// +/** Class containing Images operations. */ +export class ImagesImpl implements Images { + private readonly client: LabServicesClient; + + /** + * Initialize a new instance of the class Images class. + * @param client Reference to the service client + */ + constructor(client: LabServicesClient) { + this.client = client; + } + + /** + * Gets all images from galleries attached to a lab plan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param options The options parameters. + */ + public listByLabPlan( + resourceGroupName: string, + labPlanName: string, + options?: ImagesListByLabPlanOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByLabPlanPagingAll( + resourceGroupName, + labPlanName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByLabPlanPagingPage( + resourceGroupName, + labPlanName, + options + ); + } + }; + } + + private async *listByLabPlanPagingPage( + resourceGroupName: string, + labPlanName: string, + options?: ImagesListByLabPlanOptionalParams + ): AsyncIterableIterator { + let result = await this._listByLabPlan( + resourceGroupName, + labPlanName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByLabPlanNext( + resourceGroupName, + labPlanName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByLabPlanPagingAll( + resourceGroupName: string, + labPlanName: string, + options?: ImagesListByLabPlanOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByLabPlanPagingPage( + resourceGroupName, + labPlanName, + options + )) { + yield* page; + } + } + + /** + * Gets all images from galleries attached to a lab plan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param options The options parameters. + */ + private _listByLabPlan( + resourceGroupName: string, + labPlanName: string, + options?: ImagesListByLabPlanOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labPlanName, options }, + listByLabPlanOperationSpec + ); + } + + /** + * Gets an image resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param imageName The image name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + labPlanName: string, + imageName: string, + options?: ImagesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labPlanName, imageName, options }, + getOperationSpec + ); + } + + /** + * Updates an image resource via PUT. Creating new resources via PUT will not function. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + labPlanName: string, + imageName: string, + body: Image, + options?: ImagesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labPlanName, imageName, body, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Updates an image resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + labPlanName: string, + imageName: string, + body: ImageUpdate, + options?: ImagesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labPlanName, imageName, body, options }, + updateOperationSpec + ); + } + + /** + * ListByLabPlanNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param nextLink The nextLink from the previous successful call to the ListByLabPlan method. + * @param options The options parameters. + */ + private _listByLabPlanNext( + resourceGroupName: string, + labPlanName: string, + nextLink: string, + options?: ImagesListByLabPlanNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labPlanName, nextLink, options }, + listByLabPlanNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByLabPlanOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}/images", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedImages + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labPlanName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}/images/{imageName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Image + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labPlanName, + Parameters.imageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}/images/{imageName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Image + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labPlanName, + Parameters.imageName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}/images/{imageName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Image + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labPlanName, + Parameters.imageName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByLabPlanNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedImages + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labPlanName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/labservices/arm-labservices/src/operations/index.ts b/sdk/labservices/arm-labservices/src/operations/index.ts index 26e4c8332ff5..e32c28d4ddba 100644 --- a/sdk/labservices/arm-labservices/src/operations/index.ts +++ b/sdk/labservices/arm-labservices/src/operations/index.ts @@ -1,19 +1,18 @@ /* - * 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 "./providerOperations"; -export * from "./globalUsers"; -export * from "./labAccounts"; +export * from "./images"; +export * from "./labPlans"; export * from "./operations"; -export * from "./galleryImages"; export * from "./labs"; -export * from "./environmentSettings"; -export * from "./environments"; +export * from "./operationResults"; +export * from "./schedules"; export * from "./users"; +export * from "./virtualMachines"; +export * from "./usages"; +export * from "./skus"; diff --git a/sdk/labservices/arm-labservices/src/operations/labAccounts.ts b/sdk/labservices/arm-labservices/src/operations/labAccounts.ts deleted file mode 100644 index 100c9feb2eda..000000000000 --- a/sdk/labservices/arm-labservices/src/operations/labAccounts.ts +++ /dev/null @@ -1,613 +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 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/labAccountsMappers"; -import * as Parameters from "../models/parameters"; -import { ManagedLabsClientContext } from "../managedLabsClientContext"; - -/** Class representing a LabAccounts. */ -export class LabAccounts { - private readonly client: ManagedLabsClientContext; - - /** - * Create a LabAccounts. - * @param {ManagedLabsClientContext} client Reference to the service client. - */ - constructor(client: ManagedLabsClientContext) { - this.client = client; - } - - /** - * List lab accounts in a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscription(options?: Models.LabAccountsListBySubscriptionOptionalParams): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listBySubscription(options: Models.LabAccountsListBySubscriptionOptionalParams, callback: msRest.ServiceCallback): void; - listBySubscription(options?: Models.LabAccountsListBySubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listBySubscriptionOperationSpec, - callback) as Promise; - } - - /** - * List lab accounts in a resource group. - * @param resourceGroupName The name of the resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: Models.LabAccountsListByResourceGroupOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: Models.LabAccountsListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: Models.LabAccountsListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; - } - - /** - * Get lab account - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, labAccountName: string, options?: Models.LabAccountsGetOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param callback The callback - */ - get(resourceGroupName: string, labAccountName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, labAccountName: string, options: Models.LabAccountsGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, labAccountName: string, options?: Models.LabAccountsGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Create or replace an existing Lab Account. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labAccount: Models.LabAccount, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labAccount: Models.LabAccount, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labAccount: Models.LabAccount, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, labAccountName: string, labAccount: Models.LabAccount, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labAccount, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; - } - - /** - * Delete lab account. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, labAccountName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,labAccountName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Modify properties of lab accounts. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, labAccountName: string, labAccount: Models.LabAccountFragment, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. - * @param callback The callback - */ - update(resourceGroupName: string, labAccountName: string, labAccount: Models.LabAccountFragment, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, labAccountName: string, labAccount: Models.LabAccountFragment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, labAccountName: string, labAccount: Models.LabAccountFragment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labAccount, - options - }, - updateOperationSpec, - callback) as Promise; - } - - /** - * Create a lab in a lab account. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment - * setting - * @param [options] The optional parameters - * @returns Promise - */ - createLab(resourceGroupName: string, labAccountName: string, createLabProperties: Models.CreateLabProperties, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment - * setting - * @param callback The callback - */ - createLab(resourceGroupName: string, labAccountName: string, createLabProperties: Models.CreateLabProperties, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment - * setting - * @param options The optional parameters - * @param callback The callback - */ - createLab(resourceGroupName: string, labAccountName: string, createLabProperties: Models.CreateLabProperties, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createLab(resourceGroupName: string, labAccountName: string, createLabProperties: Models.CreateLabProperties, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - createLabProperties, - options - }, - createLabOperationSpec, - callback); - } - - /** - * Get regional availability information for each size category configured under a lab account - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param [options] The optional parameters - * @returns Promise - */ - getRegionalAvailability(resourceGroupName: string, labAccountName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param callback The callback - */ - getRegionalAvailability(resourceGroupName: string, labAccountName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param options The optional parameters - * @param callback The callback - */ - getRegionalAvailability(resourceGroupName: string, labAccountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getRegionalAvailability(resourceGroupName: string, labAccountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - options - }, - getRegionalAvailabilityOperationSpec, - callback) as Promise; - } - - /** - * Delete lab account. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteMethod(resourceGroupName: string, labAccountName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - labAccountName, - options - }, - beginDeleteMethodOperationSpec, - options); - } - - /** - * List lab accounts in a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listBySubscriptionNextOperationSpec, - callback) as Promise; - } - - /** - * List lab accounts in a resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listBySubscriptionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labaccounts", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.expand, - Parameters.filter, - Parameters.top, - Parameters.orderby, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResponseWithContinuationLabAccount - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.expand, - Parameters.filter, - Parameters.top, - Parameters.orderby, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResponseWithContinuationLabAccount - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName - ], - queryParameters: [ - Parameters.expand, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.LabAccount - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "labAccount", - mapper: { - ...Mappers.LabAccount, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.LabAccount - }, - 201: { - bodyMapper: Mappers.LabAccount - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "labAccount", - mapper: { - ...Mappers.LabAccountFragment, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.LabAccount - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const createLabOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/createLab", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "createLabProperties", - mapper: { - ...Mappers.CreateLabProperties, - required: true - } - }, - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getRegionalAvailabilityOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/getRegionalAvailability", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.GetRegionalAvailabilityResponse - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResponseWithContinuationLabAccount - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResponseWithContinuationLabAccount - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/labservices/arm-labservices/src/operations/labPlans.ts b/sdk/labservices/arm-labservices/src/operations/labPlans.ts new file mode 100644 index 000000000000..c5e83f640e7c --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operations/labPlans.ts @@ -0,0 +1,801 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { LabPlans } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { LabServicesClient } from "../labServicesClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + LabPlan, + LabPlansListBySubscriptionNextOptionalParams, + LabPlansListBySubscriptionOptionalParams, + LabPlansListByResourceGroupNextOptionalParams, + LabPlansListByResourceGroupOptionalParams, + LabPlansListBySubscriptionResponse, + LabPlansListByResourceGroupResponse, + LabPlansGetOptionalParams, + LabPlansGetResponse, + LabPlansCreateOrUpdateOptionalParams, + LabPlansCreateOrUpdateResponse, + LabPlanUpdate, + LabPlansUpdateOptionalParams, + LabPlansUpdateResponse, + LabPlansDeleteOptionalParams, + SaveImageBody, + LabPlansSaveImageOptionalParams, + LabPlansListBySubscriptionNextResponse, + LabPlansListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing LabPlans operations. */ +export class LabPlansImpl implements LabPlans { + private readonly client: LabServicesClient; + + /** + * Initialize a new instance of the class LabPlans class. + * @param client Reference to the service client + */ + constructor(client: LabServicesClient) { + this.client = client; + } + + /** + * Returns a list of all lab plans within a subscription + * @param options The options parameters. + */ + public listBySubscription( + options?: LabPlansListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: LabPlansListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: LabPlansListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Returns a list of all lab plans for a subscription and resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: LabPlansListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: LabPlansListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: LabPlansListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Returns a list of all lab plans within a subscription + * @param options The options parameters. + */ + private _listBySubscription( + options?: LabPlansListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Returns a list of all lab plans for a subscription and resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: LabPlansListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Retrieves the properties of a Lab Plan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + labPlanName: string, + options?: LabPlansGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labPlanName, options }, + getOperationSpec + ); + } + + /** + * Operation to create or update a Lab Plan resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + labPlanName: string, + body: LabPlan, + options?: LabPlansCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + LabPlansCreateOrUpdateResponse + > + > { + 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, labPlanName, body, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "original-uri" + }); + } + + /** + * Operation to create or update a Lab Plan resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + labPlanName: string, + body: LabPlan, + options?: LabPlansCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + labPlanName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Operation to update a Lab Plan resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + labPlanName: string, + body: LabPlanUpdate, + options?: LabPlansUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + LabPlansUpdateResponse + > + > { + 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, labPlanName, body, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Operation to update a Lab Plan resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + labPlanName: string, + body: LabPlanUpdate, + options?: LabPlansUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + labPlanName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a + * lab plan, nor does it delete shared images added to a gallery via the lab plan permission container. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + labPlanName: string, + options?: LabPlansDeleteOptionalParams + ): Promise, void>> { + 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, labPlanName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a + * lab plan, nor does it delete shared images added to a gallery via the lab plan permission container. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + labPlanName: string, + options?: LabPlansDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + labPlanName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Saves an image from a lab VM to the attached shared image gallery. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + async beginSaveImage( + resourceGroupName: string, + labPlanName: string, + body: SaveImageBody, + options?: LabPlansSaveImageOptionalParams + ): Promise, void>> { + 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, labPlanName, body, options }, + saveImageOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Saves an image from a lab VM to the attached shared image gallery. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + async beginSaveImageAndWait( + resourceGroupName: string, + labPlanName: string, + body: SaveImageBody, + options?: LabPlansSaveImageOptionalParams + ): Promise { + const poller = await this.beginSaveImage( + resourceGroupName, + labPlanName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: LabPlansListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: LabPlansListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labPlans", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedLabPlans + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedLabPlans + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LabPlan + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labPlanName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.LabPlan + }, + 201: { + bodyMapper: Mappers.LabPlan + }, + 202: { + bodyMapper: Mappers.LabPlan + }, + 204: { + bodyMapper: Mappers.LabPlan + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labPlanName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.LabPlan + }, + 201: { + bodyMapper: Mappers.LabPlan + }, + 202: { + bodyMapper: Mappers.LabPlan + }, + 204: { + bodyMapper: Mappers.LabPlan + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labPlanName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labPlanName + ], + headerParameters: [Parameters.accept], + serializer +}; +const saveImageOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}/saveImage", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labPlanName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedLabPlans + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedLabPlans + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/labservices/arm-labservices/src/operations/labs.ts b/sdk/labservices/arm-labservices/src/operations/labs.ts index dd3bb4748e15..a810388d6a34 100644 --- a/sdk/labservices/arm-labservices/src/operations/labs.ts +++ b/sdk/labservices/arm-labservices/src/operations/labs.ts @@ -1,398 +1,717 @@ /* - * 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/labsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Labs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ManagedLabsClientContext } from "../managedLabsClientContext"; +import { LabServicesClient } from "../labServicesClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Lab, + LabsListBySubscriptionNextOptionalParams, + LabsListBySubscriptionOptionalParams, + LabsListByResourceGroupNextOptionalParams, + LabsListByResourceGroupOptionalParams, + LabsListBySubscriptionResponse, + LabsListByResourceGroupResponse, + LabsGetOptionalParams, + LabsGetResponse, + LabsCreateOrUpdateOptionalParams, + LabsCreateOrUpdateResponse, + LabUpdate, + LabsUpdateOptionalParams, + LabsUpdateResponse, + LabsDeleteOptionalParams, + LabsPublishOptionalParams, + LabsSyncGroupOptionalParams, + LabsListBySubscriptionNextResponse, + LabsListByResourceGroupNextResponse +} from "../models"; -/** Class representing a Labs. */ -export class Labs { - private readonly client: ManagedLabsClientContext; +/// +/** Class containing Labs operations. */ +export class LabsImpl implements Labs { + private readonly client: LabServicesClient; /** - * Create a Labs. - * @param {ManagedLabsClientContext} client Reference to the service client. + * Initialize a new instance of the class Labs class. + * @param client Reference to the service client */ - constructor(client: ManagedLabsClientContext) { + constructor(client: LabServicesClient) { this.client = client; } /** - * List labs in a given lab account. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param [options] The optional parameters - * @returns Promise + * Returns a list of all labs for a subscription. + * @param options The options parameters. */ - list(resourceGroupName: string, labAccountName: string, options?: Models.LabsListOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param callback The callback - */ - list(resourceGroupName: string, labAccountName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, labAccountName: string, options: Models.LabsListOptionalParams, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, labAccountName: string, options?: Models.LabsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - options + public listBySubscription( + options?: LabsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: LabsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: LabsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } } /** - * Get lab - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, labAccountName: string, labName: string, options?: Models.LabsGetOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param callback The callback - */ - get(resourceGroupName: string, labAccountName: string, labName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param options The optional parameters - * @param callback The callback + * Returns a list of all labs in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - get(resourceGroupName: string, labAccountName: string, labName: string, options: Models.LabsGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, labAccountName: string, labName: string, options?: Models.LabsGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByResourceGroup( + resourceGroupName: string, + options?: LabsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: LabsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, - labAccountName, - labName, + continuationToken, options - }, - getOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: LabsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Create or replace an existing Lab. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, lab: Models.Lab, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, lab: Models.Lab, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. - * @param options The optional parameters - * @param callback The callback + * Returns a list of all labs for a subscription. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, lab: Models.Lab, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, lab: Models.Lab, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscription( + options?: LabsListBySubscriptionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - lab, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { options }, + listBySubscriptionOperationSpec + ); } /** - * Delete lab. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param [options] The optional parameters - * @returns Promise + * Returns a list of all labs in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, labAccountName: string, labName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,labAccountName,labName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private _listByResourceGroup( + resourceGroupName: string, + options?: LabsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** - * Modify properties of labs. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. - * @param [options] The optional parameters - * @returns Promise + * Returns the properties of a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. */ - update(resourceGroupName: string, labAccountName: string, labName: string, lab: Models.LabFragment, options?: msRest.RequestOptionsBase): Promise; + get( + resourceGroupName: string, + labName: string, + options?: LabsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labName, options }, + getOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. - * @param callback The callback + * Operation to create or update a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. */ - update(resourceGroupName: string, labAccountName: string, labName: string, lab: Models.LabFragment, callback: msRest.ServiceCallback): void; + async beginCreateOrUpdate( + resourceGroupName: string, + labName: string, + body: Lab, + options?: LabsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + LabsCreateOrUpdateResponse + > + > { + 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, labName, body, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "original-uri" + }); + } + /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. - * @param options The optional parameters - * @param callback The callback + * Operation to create or update a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. */ - update(resourceGroupName: string, labAccountName: string, labName: string, lab: Models.LabFragment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, labAccountName: string, labName: string, lab: Models.LabFragment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - lab, - options - }, - updateOperationSpec, - callback) as Promise; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + labName: string, + body: Lab, + options?: LabsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + labName, + body, + options + ); + return poller.pollUntilDone(); } /** - * Add users to a lab - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. - * @param [options] The optional parameters - * @returns Promise + * Operation to update a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. */ - addUsers(resourceGroupName: string, labAccountName: string, labName: string, addUsersPayload: Models.AddUsersPayload, options?: msRest.RequestOptionsBase): Promise; + async beginUpdate( + resourceGroupName: string, + labName: string, + body: LabUpdate, + options?: LabsUpdateOptionalParams + ): Promise< + PollerLike, LabsUpdateResponse> + > { + 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, labName, body, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. - * @param callback The callback + * Operation to update a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. */ - addUsers(resourceGroupName: string, labAccountName: string, labName: string, addUsersPayload: Models.AddUsersPayload, callback: msRest.ServiceCallback): void; + async beginUpdateAndWait( + resourceGroupName: string, + labName: string, + body: LabUpdate, + options?: LabsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + labName, + body, + options + ); + return poller.pollUntilDone(); + } + /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. - * @param options The optional parameters - * @param callback The callback + * Operation to delete a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. */ - addUsers(resourceGroupName: string, labAccountName: string, labName: string, addUsersPayload: Models.AddUsersPayload, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - addUsers(resourceGroupName: string, labAccountName: string, labName: string, addUsersPayload: Models.AddUsersPayload, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - addUsersPayload, - options - }, - addUsersOperationSpec, - callback); + async beginDelete( + resourceGroupName: string, + labName: string, + options?: LabsDeleteOptionalParams + ): Promise, void>> { + 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, labName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); } /** - * Register to managed lab. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param [options] The optional parameters - * @returns Promise + * Operation to delete a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. */ - register(resourceGroupName: string, labAccountName: string, labName: string, options?: msRest.RequestOptionsBase): Promise; + async beginDeleteAndWait( + resourceGroupName: string, + labName: string, + options?: LabsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(resourceGroupName, labName, options); + return poller.pollUntilDone(); + } + /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param callback The callback + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. */ - register(resourceGroupName: string, labAccountName: string, labName: string, callback: msRest.ServiceCallback): void; + async beginPublish( + resourceGroupName: string, + labName: string, + options?: LabsPublishOptionalParams + ): Promise, void>> { + 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, labName, options }, + publishOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param options The optional parameters - * @param callback The callback + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. */ - register(resourceGroupName: string, labAccountName: string, labName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - register(resourceGroupName: string, labAccountName: string, labName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - options - }, - registerOperationSpec, - callback); + async beginPublishAndWait( + resourceGroupName: string, + labName: string, + options?: LabsPublishOptionalParams + ): Promise { + const poller = await this.beginPublish(resourceGroupName, labName, options); + return poller.pollUntilDone(); } /** - * Delete lab. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param [options] The optional parameters - * @returns Promise + * Action used to manually kick off an AAD group sync job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, labAccountName: string, labName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - labAccountName, - labName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginSyncGroup( + resourceGroupName: string, + labName: string, + options?: LabsSyncGroupOptionalParams + ): Promise, void>> { + 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, labName, options }, + syncGroupOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); } /** - * List labs in a given lab account. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * Action used to manually kick off an AAD group sync job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + async beginSyncGroupAndWait( + resourceGroupName: string, + labName: string, + options?: LabsSyncGroupOptionalParams + ): Promise { + const poller = await this.beginSyncGroup( + resourceGroupName, + labName, + options + ); + return poller.pollUntilDone(); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _listBySubscriptionNext( + nextLink: string, + options?: LabsListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: LabsListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labs", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName - ], - queryParameters: [ - Parameters.expand, - Parameters.filter, - Parameters.top, - Parameters.orderby, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.ResponseWithContinuationLab + bodyMapper: Mappers.PagedLabs }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}", + responses: { + 200: { + bodyMapper: Mappers.PagedLabs + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.labAccountName, - Parameters.labName - ], - queryParameters: [ - Parameters.expand, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Lab }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.labAccountName, Parameters.labName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "lab", - mapper: { - ...Mappers.Lab, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Lab @@ -400,143 +719,168 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.Lab }, + 202: { + bodyMapper: Mappers.Lab + }, + 204: { + bodyMapper: Mappers.Lab + }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}", + requestBody: Parameters.body5, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.labAccountName, Parameters.labName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "lab", - mapper: { - ...Mappers.LabFragment, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.Lab }, + 201: { + bodyMapper: Mappers.Lab + }, + 202: { + bodyMapper: Mappers.Lab + }, + 204: { + bodyMapper: Mappers.Lab + }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const addUsersOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/addUsers", + requestBody: Parameters.body6, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.labAccountName, Parameters.labName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "addUsersPayload", - mapper: { - ...Mappers.AddUsersPayload, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const registerOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/register", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.labAccountName, Parameters.labName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const publishOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/publish", + httpMethod: "POST", responses: { 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.labAccountName, Parameters.labName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const syncGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/syncGroup", + httpMethod: "POST", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedLabs + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResponseWithContinuationLab + bodyMapper: Mappers.PagedLabs }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/labservices/arm-labservices/src/operations/operationResults.ts b/sdk/labservices/arm-labservices/src/operations/operationResults.ts new file mode 100644 index 000000000000..8005198a8c3a --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operations/operationResults.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { OperationResults } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { LabServicesClient } from "../labServicesClient"; +import { + OperationResultsGetOptionalParams, + OperationResultsGetResponse +} from "../models"; + +/** Class containing OperationResults operations. */ +export class OperationResultsImpl implements OperationResults { + private readonly client: LabServicesClient; + + /** + * Initialize a new instance of the class OperationResults class. + * @param client Reference to the service client + */ + constructor(client: LabServicesClient) { + this.client = client; + } + + /** + * Returns an azure operation result. + * @param operationResultId The operation result ID / name. + * @param options The options parameters. + */ + get( + operationResultId: string, + options?: OperationResultsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { operationResultId, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/operationResults/{operationResultId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationResult + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.operationResultId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/labservices/arm-labservices/src/operations/operations.ts b/sdk/labservices/arm-labservices/src/operations/operations.ts index 3b36d72f6699..3b273e46df15 100644 --- a/sdk/labservices/arm-labservices/src/operations/operations.ts +++ b/sdk/labservices/arm-labservices/src/operations/operations.ts @@ -1,87 +1,137 @@ /* - * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ManagedLabsClientContext } from "../managedLabsClientContext"; +import { LabServicesClient } from "../labServicesClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: ManagedLabsClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: LabServicesClient; /** - * Create a Operations. - * @param {ManagedLabsClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: ManagedLabsClientContext) { + constructor(client: LabServicesClient) { this.client = client; } /** - * Get operation - * @param locationName The name of the location. - * @param operationName The name of the operation. - * @param [options] The optional parameters - * @returns Promise + * Returns a list of all operations. + * @param options The options parameters. */ - get(locationName: string, operationName: string, options?: msRest.RequestOptionsBase): Promise; + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** - * @param locationName The name of the location. - * @param operationName The name of the operation. - * @param callback The callback + * Returns a list of all operations. + * @param options The options parameters. */ - get(locationName: string, operationName: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param locationName The name of the location. - * @param operationName The name of the operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - get(locationName: string, operationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(locationName: string, operationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - locationName, - operationName, - options - }, - getOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.LabServices/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.LabServices/locations/{locationName}/operations/{operationName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.locationName, - Parameters.operationName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.OperationResult + bodyMapper: Mappers.OperationListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/labservices/arm-labservices/src/operations/providerOperations.ts b/sdk/labservices/arm-labservices/src/operations/providerOperations.ts deleted file mode 100644 index a05ca2cf6a02..000000000000 --- a/sdk/labservices/arm-labservices/src/operations/providerOperations.ts +++ /dev/null @@ -1,123 +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 msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/providerOperationsMappers"; -import * as Parameters from "../models/parameters"; -import { ManagedLabsClientContext } from "../managedLabsClientContext"; - -/** Class representing a ProviderOperations. */ -export class ProviderOperations { - private readonly client: ManagedLabsClientContext; - - /** - * Create a ProviderOperations. - * @param {ManagedLabsClientContext} client Reference to the service client. - */ - constructor(client: ManagedLabsClientContext) { - this.client = client; - } - - /** - * Result of the request to list REST API operations - * @param [options] The optional parameters - * @returns Promise - */ - 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; - } - - /** - * Result of the request to list REST API operations - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "providers/Microsoft.LabServices/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ProviderOperationResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ProviderOperationResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/labservices/arm-labservices/src/operations/schedules.ts b/sdk/labservices/arm-labservices/src/operations/schedules.ts new file mode 100644 index 000000000000..b3d9035d67fa --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operations/schedules.ts @@ -0,0 +1,447 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Schedules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { LabServicesClient } from "../labServicesClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Schedule, + SchedulesListByLabNextOptionalParams, + SchedulesListByLabOptionalParams, + SchedulesListByLabResponse, + SchedulesGetOptionalParams, + SchedulesGetResponse, + SchedulesCreateOrUpdateOptionalParams, + SchedulesCreateOrUpdateResponse, + ScheduleUpdate, + SchedulesUpdateOptionalParams, + SchedulesUpdateResponse, + SchedulesDeleteOptionalParams, + SchedulesListByLabNextResponse +} from "../models"; + +/// +/** Class containing Schedules operations. */ +export class SchedulesImpl implements Schedules { + private readonly client: LabServicesClient; + + /** + * Initialize a new instance of the class Schedules class. + * @param client Reference to the service client + */ + constructor(client: LabServicesClient) { + this.client = client; + } + + /** + * Returns a list of all schedules for a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + public listByLab( + resourceGroupName: string, + labName: string, + options?: SchedulesListByLabOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByLabPagingAll(resourceGroupName, labName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByLabPagingPage(resourceGroupName, labName, options); + } + }; + } + + private async *listByLabPagingPage( + resourceGroupName: string, + labName: string, + options?: SchedulesListByLabOptionalParams + ): AsyncIterableIterator { + let result = await this._listByLab(resourceGroupName, labName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByLabNext( + resourceGroupName, + labName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByLabPagingAll( + resourceGroupName: string, + labName: string, + options?: SchedulesListByLabOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByLabPagingPage( + resourceGroupName, + labName, + options + )) { + yield* page; + } + } + + /** + * Returns a list of all schedules for a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + private _listByLab( + resourceGroupName: string, + labName: string, + options?: SchedulesListByLabOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labName, options }, + listByLabOperationSpec + ); + } + + /** + * Returns the properties of a lab Schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used + * in resource URIs. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + labName: string, + scheduleName: string, + options?: SchedulesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labName, scheduleName, options }, + getOperationSpec + ); + } + + /** + * Operation to create or update a lab schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + labName: string, + scheduleName: string, + body: Schedule, + options?: SchedulesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labName, scheduleName, body, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Operation to update a lab schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + labName: string, + scheduleName: string, + body: ScheduleUpdate, + options?: SchedulesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labName, scheduleName, body, options }, + updateOperationSpec + ); + } + + /** + * Operation to delete a schedule resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used + * in resource URIs. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + labName: string, + scheduleName: string, + options?: SchedulesDeleteOptionalParams + ): Promise, void>> { + 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, labName, scheduleName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Operation to delete a schedule resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used + * in resource URIs. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + labName: string, + scheduleName: string, + options?: SchedulesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + labName, + scheduleName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByLabNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param nextLink The nextLink from the previous successful call to the ListByLab method. + * @param options The options parameters. + */ + private _listByLabNext( + resourceGroupName: string, + labName: string, + nextLink: string, + options?: SchedulesListByLabNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labName, nextLink, options }, + listByLabNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByLabOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/schedules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedSchedules + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/schedules/{scheduleName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Schedule + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName, + Parameters.scheduleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/schedules/{scheduleName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Schedule + }, + 201: { + bodyMapper: Mappers.Schedule + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName, + Parameters.scheduleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/schedules/{scheduleName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Schedule + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body8, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName, + Parameters.scheduleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/schedules/{scheduleName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName, + Parameters.scheduleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByLabNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedSchedules + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.labName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/labservices/arm-labservices/src/operations/skus.ts b/sdk/labservices/arm-labservices/src/operations/skus.ts new file mode 100644 index 000000000000..513dc16b2637 --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operations/skus.ts @@ -0,0 +1,139 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Skus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { LabServicesClient } from "../labServicesClient"; +import { + LabServicesSku, + SkusListNextOptionalParams, + SkusListOptionalParams, + SkusListResponse, + SkusListNextResponse +} from "../models"; + +/// +/** Class containing Skus operations. */ +export class SkusImpl implements Skus { + private readonly client: LabServicesClient; + + /** + * Initialize a new instance of the class Skus class. + * @param client Reference to the service client + */ + constructor(client: LabServicesClient) { + this.client = client; + } + + /** + * Returns a list of all the Azure Lab Services resource SKUs. + * @param options The options parameters. + */ + public list( + options?: SkusListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: SkusListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: SkusListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Returns a list of all the Azure Lab Services resource SKUs. + * @param options The options parameters. + */ + private _list(options?: SkusListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: SkusListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/skus", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedLabServicesSkus + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedLabServicesSkus + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/labservices/arm-labservices/src/operations/usages.ts b/sdk/labservices/arm-labservices/src/operations/usages.ts new file mode 100644 index 000000000000..807f0d18c36d --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operations/usages.ts @@ -0,0 +1,162 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Usages } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { LabServicesClient } from "../labServicesClient"; +import { + Usage, + UsagesListByLocationNextOptionalParams, + UsagesListByLocationOptionalParams, + UsagesListByLocationResponse, + UsagesListByLocationNextResponse +} from "../models"; + +/// +/** Class containing Usages operations. */ +export class UsagesImpl implements Usages { + private readonly client: LabServicesClient; + + /** + * Initialize a new instance of the class Usages class. + * @param client Reference to the service client + */ + constructor(client: LabServicesClient) { + this.client = client; + } + + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * @param location The location name. + * @param options The options parameters. + */ + public listByLocation( + location: string, + options?: UsagesListByLocationOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByLocationPagingAll(location, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByLocationPagingPage(location, options); + } + }; + } + + private async *listByLocationPagingPage( + location: string, + options?: UsagesListByLocationOptionalParams + ): AsyncIterableIterator { + let result = await this._listByLocation(location, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByLocationNext( + location, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByLocationPagingAll( + location: string, + options?: UsagesListByLocationOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByLocationPagingPage(location, options)) { + yield* page; + } + } + + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * @param location The location name. + * @param options The options parameters. + */ + private _listByLocation( + location: string, + options?: UsagesListByLocationOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + listByLocationOperationSpec + ); + } + + /** + * ListByLocationNext + * @param location The location name. + * @param nextLink The nextLink from the previous successful call to the ListByLocation method. + * @param options The options parameters. + */ + private _listByLocationNext( + location: string, + nextLink: string, + options?: UsagesListByLocationNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, nextLink, options }, + listByLocationNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByLocationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/locations/{location}/usages", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListUsagesResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByLocationNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListUsagesResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/labservices/arm-labservices/src/operations/users.ts b/sdk/labservices/arm-labservices/src/operations/users.ts index 26a244f6129e..afd2e58a9cd5 100644 --- a/sdk/labservices/arm-labservices/src/operations/users.ts +++ b/sdk/labservices/arm-labservices/src/operations/users.ts @@ -1,344 +1,637 @@ /* - * 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/usersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Users } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ManagedLabsClientContext } from "../managedLabsClientContext"; +import { LabServicesClient } from "../labServicesClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + User, + UsersListByLabNextOptionalParams, + UsersListByLabOptionalParams, + UsersListByLabResponse, + UsersGetOptionalParams, + UsersGetResponse, + UsersCreateOrUpdateOptionalParams, + UsersCreateOrUpdateResponse, + UserUpdate, + UsersUpdateOptionalParams, + UsersUpdateResponse, + UsersDeleteOptionalParams, + InviteBody, + UsersInviteOptionalParams, + UsersListByLabNextResponse +} from "../models"; -/** Class representing a Users. */ -export class Users { - private readonly client: ManagedLabsClientContext; +/// +/** Class containing Users operations. */ +export class UsersImpl implements Users { + private readonly client: LabServicesClient; /** - * Create a Users. - * @param {ManagedLabsClientContext} client Reference to the service client. + * Initialize a new instance of the class Users class. + * @param client Reference to the service client */ - constructor(client: ManagedLabsClientContext) { + constructor(client: LabServicesClient) { this.client = client; } /** - * List users in a given lab. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param [options] The optional parameters - * @returns Promise + * Returns a list of all users for a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. */ - list(resourceGroupName: string, labAccountName: string, labName: string, options?: Models.UsersListOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param callback The callback - */ - list(resourceGroupName: string, labAccountName: string, labName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, labAccountName: string, labName: string, options: Models.UsersListOptionalParams, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, labAccountName: string, labName: string, options?: Models.UsersListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - options + public listByLab( + resourceGroupName: string, + labName: string, + options?: UsersListByLabOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByLabPagingAll(resourceGroupName, labName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listByLabPagingPage(resourceGroupName, labName, options); + } + }; } - /** - * Get user - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param userName The name of the user. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, labAccountName: string, labName: string, userName: string, options?: Models.UsersGetOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param userName The name of the user. - * @param callback The callback - */ - get(resourceGroupName: string, labAccountName: string, labName: string, userName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param userName The name of the user. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, labAccountName: string, labName: string, userName: string, options: Models.UsersGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, labAccountName: string, labName: string, userName: string, options?: Models.UsersGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + private async *listByLabPagingPage( + resourceGroupName: string, + labName: string, + options?: UsersListByLabOptionalParams + ): AsyncIterableIterator { + let result = await this._listByLab(resourceGroupName, labName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByLabNext( resourceGroupName, - labAccountName, labName, - userName, + continuationToken, options - }, - getOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByLabPagingAll( + resourceGroupName: string, + labName: string, + options?: UsersListByLabOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByLabPagingPage( + resourceGroupName, + labName, + options + )) { + yield* page; + } } /** - * Create or replace an existing User. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param userName The name of the user. - * @param user The User registered to a lab - * @param [options] The optional parameters - * @returns Promise + * Returns a list of all users for a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, userName: string, user: Models.User, options?: msRest.RequestOptionsBase): Promise; + private _listByLab( + resourceGroupName: string, + labName: string, + options?: UsersListByLabOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labName, options }, + listByLabOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param userName The name of the user. - * @param user The User registered to a lab - * @param callback The callback + * Returns the properties of a lab user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, userName: string, user: Models.User, callback: msRest.ServiceCallback): void; + get( + resourceGroupName: string, + labName: string, + userName: string, + options?: UsersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labName, userName, options }, + getOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param userName The name of the user. - * @param user The User registered to a lab - * @param options The optional parameters - * @param callback The callback + * Operation to create or update a lab user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, userName: string, user: Models.User, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, labAccountName: string, labName: string, userName: string, user: Models.User, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - userName, - user, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + async beginCreateOrUpdate( + resourceGroupName: string, + labName: string, + userName: string, + body: User, + options?: UsersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + UsersCreateOrUpdateResponse + > + > { + 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, labName, userName, body, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "original-uri" + }); } /** - * Delete user. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param userName The name of the user. - * @param [options] The optional parameters - * @returns Promise + * Operation to create or update a lab user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, labAccountName: string, labName: string, userName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,labAccountName,labName,userName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + labName: string, + userName: string, + body: User, + options?: UsersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + labName, + userName, + body, + options + ); + return poller.pollUntilDone(); } /** - * Modify properties of users. - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param userName The name of the user. - * @param user The User registered to a lab - * @param [options] The optional parameters - * @returns Promise + * Operation to update a lab user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. */ - update(resourceGroupName: string, labAccountName: string, labName: string, userName: string, user: Models.UserFragment, options?: msRest.RequestOptionsBase): Promise; + async beginUpdate( + resourceGroupName: string, + labName: string, + userName: string, + body: UserUpdate, + options?: UsersUpdateOptionalParams + ): Promise< + PollerLike, UsersUpdateResponse> + > { + 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, labName, userName, body, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param userName The name of the user. - * @param user The User registered to a lab - * @param callback The callback + * Operation to update a lab user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. */ - update(resourceGroupName: string, labAccountName: string, labName: string, userName: string, user: Models.UserFragment, callback: msRest.ServiceCallback): void; + async beginUpdateAndWait( + resourceGroupName: string, + labName: string, + userName: string, + body: UserUpdate, + options?: UsersUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + labName, + userName, + body, + options + ); + return poller.pollUntilDone(); + } + /** - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param userName The name of the user. - * @param user The User registered to a lab - * @param options The optional parameters - * @param callback The callback + * Operation to delete a user resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param options The options parameters. */ - update(resourceGroupName: string, labAccountName: string, labName: string, userName: string, user: Models.UserFragment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, labAccountName: string, labName: string, userName: string, user: Models.UserFragment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - labAccountName, - labName, - userName, - user, - options - }, - updateOperationSpec, - callback) as Promise; + async beginDelete( + resourceGroupName: string, + labName: string, + userName: string, + options?: UsersDeleteOptionalParams + ): Promise, void>> { + 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, labName, userName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); } /** - * Delete user. This operation can take a while to complete - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param userName The name of the user. - * @param [options] The optional parameters - * @returns Promise + * Operation to delete a user resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, labAccountName: string, labName: string, userName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - labAccountName, - labName, - userName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + resourceGroupName: string, + labName: string, + userName: string, + options?: UsersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + labName, + userName, + options + ); + return poller.pollUntilDone(); } /** - * List users in a given lab. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * Operation to invite a user to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + async beginInvite( + resourceGroupName: string, + labName: string, + userName: string, + body: InviteBody, + options?: UsersInviteOptionalParams + ): Promise, void>> { + 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, labName, userName, body, options }, + inviteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * Operation to invite a user to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + async beginInviteAndWait( + resourceGroupName: string, + labName: string, + userName: string, + body: InviteBody, + options?: UsersInviteOptionalParams + ): Promise { + const poller = await this.beginInvite( + resourceGroupName, + labName, + userName, + body, + options + ); + return poller.pollUntilDone(); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByLabNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param nextLink The nextLink from the previous successful call to the ListByLab method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByLabNext( + resourceGroupName: string, + labName: string, + nextLink: string, + options?: UsersListByLabNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { resourceGroupName, labName, nextLink, options }, + listByLabNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByLabOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users", + responses: { + 200: { + bodyMapper: Mappers.PagedUsers + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.labAccountName, Parameters.labName ], - queryParameters: [ - Parameters.expand, - Parameters.filter, - Parameters.top, - Parameters.orderby, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users/{userName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResponseWithContinuationUser + bodyMapper: Mappers.User }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.labAccountName, Parameters.labName, Parameters.userName ], - queryParameters: [ - Parameters.expand, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users/{userName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.User }, + 201: { + bodyMapper: Mappers.User + }, + 202: { + bodyMapper: Mappers.User + }, + 204: { + bodyMapper: Mappers.User + }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}", + requestBody: Parameters.body9, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.labAccountName, Parameters.labName, Parameters.userName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "user", - mapper: { - ...Mappers.User, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users/{userName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.User @@ -346,90 +639,98 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.User }, + 202: { + bodyMapper: Mappers.User + }, + 204: { + bodyMapper: Mappers.User + }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}", + requestBody: Parameters.body10, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.labAccountName, Parameters.labName, Parameters.userName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "user", - mapper: { - ...Mappers.UserFragment, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users/{userName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.User - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.labAccountName, Parameters.labName, Parameters.userName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const inviteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users/{userName}/invite", + httpMethod: "POST", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.body11, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName, + Parameters.userName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByLabNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResponseWithContinuationUser + bodyMapper: Mappers.PagedUsers }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.labName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/labservices/arm-labservices/src/operations/virtualMachines.ts b/sdk/labservices/arm-labservices/src/operations/virtualMachines.ts new file mode 100644 index 000000000000..f1c8862b46f8 --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operations/virtualMachines.ts @@ -0,0 +1,815 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { VirtualMachines } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { LabServicesClient } from "../labServicesClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + VirtualMachine, + VirtualMachinesListByLabNextOptionalParams, + VirtualMachinesListByLabOptionalParams, + VirtualMachinesListByLabResponse, + VirtualMachinesGetOptionalParams, + VirtualMachinesGetResponse, + VirtualMachinesStartOptionalParams, + VirtualMachinesStopOptionalParams, + VirtualMachinesReimageOptionalParams, + VirtualMachinesRedeployOptionalParams, + ResetPasswordBody, + VirtualMachinesResetPasswordOptionalParams, + VirtualMachinesListByLabNextResponse +} from "../models"; + +/// +/** Class containing VirtualMachines operations. */ +export class VirtualMachinesImpl implements VirtualMachines { + private readonly client: LabServicesClient; + + /** + * Initialize a new instance of the class VirtualMachines class. + * @param client Reference to the service client + */ + constructor(client: LabServicesClient) { + this.client = client; + } + + /** + * Returns a list of all virtual machines for a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + public listByLab( + resourceGroupName: string, + labName: string, + options?: VirtualMachinesListByLabOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByLabPagingAll(resourceGroupName, labName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByLabPagingPage(resourceGroupName, labName, options); + } + }; + } + + private async *listByLabPagingPage( + resourceGroupName: string, + labName: string, + options?: VirtualMachinesListByLabOptionalParams + ): AsyncIterableIterator { + let result = await this._listByLab(resourceGroupName, labName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByLabNext( + resourceGroupName, + labName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByLabPagingAll( + resourceGroupName: string, + labName: string, + options?: VirtualMachinesListByLabOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByLabPagingPage( + resourceGroupName, + labName, + options + )) { + yield* page; + } + } + + /** + * Returns a list of all virtual machines for a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + private _listByLab( + resourceGroupName: string, + labName: string, + options?: VirtualMachinesListByLabOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labName, options }, + listByLabOperationSpec + ); + } + + /** + * Returns the properties for a lab virtual machine. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labName, virtualMachineName, options }, + getOperationSpec + ); + } + + /** + * Action to start a lab virtual machine. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + async beginStart( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise, void>> { + 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, labName, virtualMachineName, options }, + startOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Action to start a lab virtual machine. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + async beginStartAndWait( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise { + const poller = await this.beginStart( + resourceGroupName, + labName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Action to stop a lab virtual machine. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + async beginStop( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): Promise, void>> { + 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, labName, virtualMachineName, options }, + stopOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Action to stop a lab virtual machine. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + async beginStopAndWait( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): Promise { + const poller = await this.beginStop( + resourceGroupName, + labName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest + * published snapshot of the reference environment of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + async beginReimage( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesReimageOptionalParams + ): Promise, void>> { + 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, labName, virtualMachineName, options }, + reimageOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest + * published snapshot of the reference environment of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + async beginReimageAndWait( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesReimageOptionalParams + ): Promise { + const poller = await this.beginReimage( + resourceGroupName, + labName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting + * connectivity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + async beginRedeploy( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesRedeployOptionalParams + ): Promise, void>> { + 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, labName, virtualMachineName, options }, + redeployOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting + * connectivity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + async beginRedeployAndWait( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesRedeployOptionalParams + ): Promise { + const poller = await this.beginRedeploy( + resourceGroupName, + labName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Resets a lab virtual machine password. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + async beginResetPassword( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + body: ResetPasswordBody, + options?: VirtualMachinesResetPasswordOptionalParams + ): Promise, void>> { + 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, labName, virtualMachineName, body, options }, + resetPasswordOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Resets a lab virtual machine password. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + async beginResetPasswordAndWait( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + body: ResetPasswordBody, + options?: VirtualMachinesResetPasswordOptionalParams + ): Promise { + const poller = await this.beginResetPassword( + resourceGroupName, + labName, + virtualMachineName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByLabNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param nextLink The nextLink from the previous successful call to the ListByLab method. + * @param options The options parameters. + */ + private _listByLabNext( + resourceGroupName: string, + labName: string, + nextLink: string, + options?: VirtualMachinesListByLabNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, labName, nextLink, options }, + listByLabNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByLabOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedVirtualMachines + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachine + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const startOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/start", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const stopOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/stop", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const reimageOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/reimage", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const redeployOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/redeploy", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const resetPasswordOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/resetPassword", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body12, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.labName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByLabNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PagedVirtualMachines + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.labName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/images.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/images.ts new file mode 100644 index 000000000000..979299fb2475 --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/images.ts @@ -0,0 +1,83 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Image, + ImagesListByLabPlanOptionalParams, + ImagesGetOptionalParams, + ImagesGetResponse, + ImagesCreateOrUpdateOptionalParams, + ImagesCreateOrUpdateResponse, + ImageUpdate, + ImagesUpdateOptionalParams, + ImagesUpdateResponse +} from "../models"; + +/// +/** Interface representing a Images. */ +export interface Images { + /** + * Gets all images from galleries attached to a lab plan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param options The options parameters. + */ + listByLabPlan( + resourceGroupName: string, + labPlanName: string, + options?: ImagesListByLabPlanOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an image resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param imageName The image name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + labPlanName: string, + imageName: string, + options?: ImagesGetOptionalParams + ): Promise; + /** + * Updates an image resource via PUT. Creating new resources via PUT will not function. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + labPlanName: string, + imageName: string, + body: Image, + options?: ImagesCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates an image resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + labPlanName: string, + imageName: string, + body: ImageUpdate, + options?: ImagesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/index.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..e32c28d4ddba --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./images"; +export * from "./labPlans"; +export * from "./operations"; +export * from "./labs"; +export * from "./operationResults"; +export * from "./schedules"; +export * from "./users"; +export * from "./virtualMachines"; +export * from "./usages"; +export * from "./skus"; diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/labPlans.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/labPlans.ts new file mode 100644 index 000000000000..a65c8d59d97d --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/labPlans.ts @@ -0,0 +1,178 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + LabPlan, + LabPlansListBySubscriptionOptionalParams, + LabPlansListByResourceGroupOptionalParams, + LabPlansGetOptionalParams, + LabPlansGetResponse, + LabPlansCreateOrUpdateOptionalParams, + LabPlansCreateOrUpdateResponse, + LabPlanUpdate, + LabPlansUpdateOptionalParams, + LabPlansUpdateResponse, + LabPlansDeleteOptionalParams, + SaveImageBody, + LabPlansSaveImageOptionalParams +} from "../models"; + +/// +/** Interface representing a LabPlans. */ +export interface LabPlans { + /** + * Returns a list of all lab plans within a subscription + * @param options The options parameters. + */ + listBySubscription( + options?: LabPlansListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns a list of all lab plans for a subscription and resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: LabPlansListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves the properties of a Lab Plan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + labPlanName: string, + options?: LabPlansGetOptionalParams + ): Promise; + /** + * Operation to create or update a Lab Plan resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + labPlanName: string, + body: LabPlan, + options?: LabPlansCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + LabPlansCreateOrUpdateResponse + > + >; + /** + * Operation to create or update a Lab Plan resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + labPlanName: string, + body: LabPlan, + options?: LabPlansCreateOrUpdateOptionalParams + ): Promise; + /** + * Operation to update a Lab Plan resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + labPlanName: string, + body: LabPlanUpdate, + options?: LabPlansUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + LabPlansUpdateResponse + > + >; + /** + * Operation to update a Lab Plan resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + labPlanName: string, + body: LabPlanUpdate, + options?: LabPlansUpdateOptionalParams + ): Promise; + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a + * lab plan, nor does it delete shared images added to a gallery via the lab plan permission container. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + labPlanName: string, + options?: LabPlansDeleteOptionalParams + ): Promise, void>>; + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a + * lab plan, nor does it delete shared images added to a gallery via the lab plan permission container. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + labPlanName: string, + options?: LabPlansDeleteOptionalParams + ): Promise; + /** + * Saves an image from a lab VM to the attached shared image gallery. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + beginSaveImage( + resourceGroupName: string, + labPlanName: string, + body: SaveImageBody, + options?: LabPlansSaveImageOptionalParams + ): Promise, void>>; + /** + * Saves an image from a lab VM to the attached shared image gallery. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource + * group. Used in resource URIs and in UI. + * @param body The request body. + * @param options The options parameters. + */ + beginSaveImageAndWait( + resourceGroupName: string, + labPlanName: string, + body: SaveImageBody, + options?: LabPlansSaveImageOptionalParams + ): Promise; +} diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/labs.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/labs.ts new file mode 100644 index 000000000000..16ca4e0f0a83 --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/labs.ts @@ -0,0 +1,193 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Lab, + LabsListBySubscriptionOptionalParams, + LabsListByResourceGroupOptionalParams, + LabsGetOptionalParams, + LabsGetResponse, + LabsCreateOrUpdateOptionalParams, + LabsCreateOrUpdateResponse, + LabUpdate, + LabsUpdateOptionalParams, + LabsUpdateResponse, + LabsDeleteOptionalParams, + LabsPublishOptionalParams, + LabsSyncGroupOptionalParams +} from "../models"; + +/// +/** Interface representing a Labs. */ +export interface Labs { + /** + * Returns a list of all labs for a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: LabsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns a list of all labs in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: LabsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + labName: string, + options?: LabsGetOptionalParams + ): Promise; + /** + * Operation to create or update a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + labName: string, + body: Lab, + options?: LabsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + LabsCreateOrUpdateResponse + > + >; + /** + * Operation to create or update a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + labName: string, + body: Lab, + options?: LabsCreateOrUpdateOptionalParams + ): Promise; + /** + * Operation to update a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + labName: string, + body: LabUpdate, + options?: LabsUpdateOptionalParams + ): Promise< + PollerLike, LabsUpdateResponse> + >; + /** + * Operation to update a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + labName: string, + body: LabUpdate, + options?: LabsUpdateOptionalParams + ): Promise; + /** + * Operation to delete a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + labName: string, + options?: LabsDeleteOptionalParams + ): Promise, void>>; + /** + * Operation to delete a lab resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + labName: string, + options?: LabsDeleteOptionalParams + ): Promise; + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + beginPublish( + resourceGroupName: string, + labName: string, + options?: LabsPublishOptionalParams + ): Promise, void>>; + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + beginPublishAndWait( + resourceGroupName: string, + labName: string, + options?: LabsPublishOptionalParams + ): Promise; + /** + * Action used to manually kick off an AAD group sync job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + beginSyncGroup( + resourceGroupName: string, + labName: string, + options?: LabsSyncGroupOptionalParams + ): Promise, void>>; + /** + * Action used to manually kick off an AAD group sync job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + beginSyncGroupAndWait( + resourceGroupName: string, + labName: string, + options?: LabsSyncGroupOptionalParams + ): Promise; +} diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/operationResults.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/operationResults.ts new file mode 100644 index 000000000000..1df498a50b76 --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/operationResults.ts @@ -0,0 +1,25 @@ +/* + * 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 { + OperationResultsGetOptionalParams, + OperationResultsGetResponse +} from "../models"; + +/** Interface representing a OperationResults. */ +export interface OperationResults { + /** + * Returns an azure operation result. + * @param operationResultId The operation result ID / name. + * @param options The options parameters. + */ + get( + operationResultId: string, + options?: OperationResultsGetOptionalParams + ): Promise; +} diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/operations.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..f34138486b5d --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Returns a list of all operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/schedules.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/schedules.ts new file mode 100644 index 000000000000..6602b445f512 --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/schedules.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Schedule, + SchedulesListByLabOptionalParams, + SchedulesGetOptionalParams, + SchedulesGetResponse, + SchedulesCreateOrUpdateOptionalParams, + SchedulesCreateOrUpdateResponse, + ScheduleUpdate, + SchedulesUpdateOptionalParams, + SchedulesUpdateResponse, + SchedulesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Schedules. */ +export interface Schedules { + /** + * Returns a list of all schedules for a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + listByLab( + resourceGroupName: string, + labName: string, + options?: SchedulesListByLabOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of a lab Schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used + * in resource URIs. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + labName: string, + scheduleName: string, + options?: SchedulesGetOptionalParams + ): Promise; + /** + * Operation to create or update a lab schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + labName: string, + scheduleName: string, + body: Schedule, + options?: SchedulesCreateOrUpdateOptionalParams + ): Promise; + /** + * Operation to update a lab schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used + * in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + labName: string, + scheduleName: string, + body: ScheduleUpdate, + options?: SchedulesUpdateOptionalParams + ): Promise; + /** + * Operation to delete a schedule resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used + * in resource URIs. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + labName: string, + scheduleName: string, + options?: SchedulesDeleteOptionalParams + ): Promise, void>>; + /** + * Operation to delete a schedule resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used + * in resource URIs. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + labName: string, + scheduleName: string, + options?: SchedulesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/skus.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/skus.ts new file mode 100644 index 000000000000..9a3e9aad0244 --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/skus.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { LabServicesSku, SkusListOptionalParams } from "../models"; + +/// +/** Interface representing a Skus. */ +export interface Skus { + /** + * Returns a list of all the Azure Lab Services resource SKUs. + * @param options The options parameters. + */ + list( + options?: SkusListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/usages.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/usages.ts new file mode 100644 index 000000000000..327936d7d7c5 --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/usages.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Usage, UsagesListByLocationOptionalParams } from "../models"; + +/// +/** Interface representing a Usages. */ +export interface Usages { + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * @param location The location name. + * @param options The options parameters. + */ + listByLocation( + location: string, + options?: UsagesListByLocationOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/users.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/users.ts new file mode 100644 index 000000000000..96ab7ae755dd --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/users.ts @@ -0,0 +1,195 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + User, + UsersListByLabOptionalParams, + UsersGetOptionalParams, + UsersGetResponse, + UsersCreateOrUpdateOptionalParams, + UsersCreateOrUpdateResponse, + UserUpdate, + UsersUpdateOptionalParams, + UsersUpdateResponse, + UsersDeleteOptionalParams, + InviteBody, + UsersInviteOptionalParams +} from "../models"; + +/// +/** Interface representing a Users. */ +export interface Users { + /** + * Returns a list of all users for a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + listByLab( + resourceGroupName: string, + labName: string, + options?: UsersListByLabOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties of a lab user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + labName: string, + userName: string, + options?: UsersGetOptionalParams + ): Promise; + /** + * Operation to create or update a lab user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + labName: string, + userName: string, + body: User, + options?: UsersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + UsersCreateOrUpdateResponse + > + >; + /** + * Operation to create or update a lab user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + labName: string, + userName: string, + body: User, + options?: UsersCreateOrUpdateOptionalParams + ): Promise; + /** + * Operation to update a lab user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + labName: string, + userName: string, + body: UserUpdate, + options?: UsersUpdateOptionalParams + ): Promise< + PollerLike, UsersUpdateResponse> + >; + /** + * Operation to update a lab user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + labName: string, + userName: string, + body: UserUpdate, + options?: UsersUpdateOptionalParams + ): Promise; + /** + * Operation to delete a user resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + labName: string, + userName: string, + options?: UsersDeleteOptionalParams + ): Promise, void>>; + /** + * Operation to delete a user resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + labName: string, + userName: string, + options?: UsersDeleteOptionalParams + ): Promise; + /** + * Operation to invite a user to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginInvite( + resourceGroupName: string, + labName: string, + userName: string, + body: InviteBody, + options?: UsersInviteOptionalParams + ): Promise, void>>; + /** + * Operation to invite a user to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param userName The name of the user that uniquely identifies it within containing lab. Used in + * resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginInviteAndWait( + resourceGroupName: string, + labName: string, + userName: string, + body: InviteBody, + options?: UsersInviteOptionalParams + ): Promise; +} diff --git a/sdk/labservices/arm-labservices/src/operationsInterfaces/virtualMachines.ts b/sdk/labservices/arm-labservices/src/operationsInterfaces/virtualMachines.ts new file mode 100644 index 000000000000..828fcda370fe --- /dev/null +++ b/sdk/labservices/arm-labservices/src/operationsInterfaces/virtualMachines.ts @@ -0,0 +1,212 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + VirtualMachine, + VirtualMachinesListByLabOptionalParams, + VirtualMachinesGetOptionalParams, + VirtualMachinesGetResponse, + VirtualMachinesStartOptionalParams, + VirtualMachinesStopOptionalParams, + VirtualMachinesReimageOptionalParams, + VirtualMachinesRedeployOptionalParams, + ResetPasswordBody, + VirtualMachinesResetPasswordOptionalParams +} from "../models"; + +/// +/** Interface representing a VirtualMachines. */ +export interface VirtualMachines { + /** + * Returns a list of all virtual machines for a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param options The options parameters. + */ + listByLab( + resourceGroupName: string, + labName: string, + options?: VirtualMachinesListByLabOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the properties for a lab virtual machine. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesGetOptionalParams + ): Promise; + /** + * Action to start a lab virtual machine. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + beginStart( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise, void>>; + /** + * Action to start a lab virtual machine. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + beginStartAndWait( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise; + /** + * Action to stop a lab virtual machine. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + beginStop( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): Promise, void>>; + /** + * Action to stop a lab virtual machine. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + beginStopAndWait( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): Promise; + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest + * published snapshot of the reference environment of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + beginReimage( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesReimageOptionalParams + ): Promise, void>>; + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest + * published snapshot of the reference environment of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + beginReimageAndWait( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesReimageOptionalParams + ): Promise; + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting + * connectivity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + beginRedeploy( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesRedeployOptionalParams + ): Promise, void>>; + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting + * connectivity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param options The options parameters. + */ + beginRedeployAndWait( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + options?: VirtualMachinesRedeployOptionalParams + ): Promise; + /** + * Resets a lab virtual machine password. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginResetPassword( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + body: ResetPasswordBody, + options?: VirtualMachinesResetPasswordOptionalParams + ): Promise, void>>; + /** + * Resets a lab virtual machine password. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used + * in resource URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the + * containing lab. Used in resource URIs. + * @param body The request body. + * @param options The options parameters. + */ + beginResetPasswordAndWait( + resourceGroupName: string, + labName: string, + virtualMachineName: string, + body: ResetPasswordBody, + options?: VirtualMachinesResetPasswordOptionalParams + ): Promise; +} diff --git a/sdk/labservices/arm-labservices/test/sampleTest.ts b/sdk/labservices/arm-labservices/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/labservices/arm-labservices/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/labservices/arm-labservices/tsconfig.json b/sdk/labservices/arm-labservices/tsconfig.json index 87bbf5b5fa49..6e3251194117 100644 --- a/sdk/labservices/arm-labservices/tsconfig.json +++ b/sdk/labservices/arm-labservices/tsconfig.json @@ -3,17 +3,17 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/labservices/ci.yml b/sdk/labservices/ci.yml new file mode 100644 index 000000000000..c7a744bc5271 --- /dev/null +++ b/sdk/labservices/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/labservices/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/labservices/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: labservices + Artifacts: + - name: azure-arm-labservices + safeName: azurearmlabservices + \ No newline at end of file