diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..8f55f18d7d1b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -23,6 +23,7 @@ specifiers: '@rush-temp/arm-cdn': file:./projects/arm-cdn.tgz '@rush-temp/arm-changeanalysis': file:./projects/arm-changeanalysis.tgz '@rush-temp/arm-cognitiveservices': file:./projects/arm-cognitiveservices.tgz + '@rush-temp/arm-communication': file:./projects/arm-communication.tgz '@rush-temp/arm-compute': file:./projects/arm-compute.tgz '@rush-temp/arm-consumption': file:./projects/arm-consumption.tgz '@rush-temp/arm-containerinstance': file:./projects/arm-containerinstance.tgz @@ -204,6 +205,7 @@ dependencies: '@rush-temp/arm-cdn': file:projects/arm-cdn.tgz '@rush-temp/arm-changeanalysis': file:projects/arm-changeanalysis.tgz '@rush-temp/arm-cognitiveservices': file:projects/arm-cognitiveservices.tgz + '@rush-temp/arm-communication': file:projects/arm-communication.tgz '@rush-temp/arm-compute': file:projects/arm-compute.tgz '@rush-temp/arm-consumption': file:projects/arm-consumption.tgz '@rush-temp/arm-containerinstance': file:projects/arm-containerinstance.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 @@ -8269,6 +8271,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-communication.tgz: + resolution: {integrity: sha512-ey0KF76WOY3EWT1lfVsD2F2UjW973Du8mxTdDFAyjmX3ifgXfHdNljvJjQNS9aDJx0aWIv4QanT8i+45OAtMhQ==, tarball: file:projects/arm-communication.tgz} + name: '@rush-temp/arm-communication' + 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-compute.tgz: resolution: {integrity: sha512-zk0xILY5nmiZpZZiPD05eJEXDKOzYLSQO7j5lE9SFmtEQg7Toc5DfoXXEvpCCOx0AqmCDj9G0V9g3eXUn+d8pg==, tarball: file:projects/arm-compute.tgz} name: '@rush-temp/arm-compute' @@ -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..b7b69bec04eb 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-communication", + "projectFolder": "sdk/communication/arm-communication", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/communication/arm-communication/CHANGELOG.md b/sdk/communication/arm-communication/CHANGELOG.md new file mode 100644 index 000000000000..c15a8ced715d --- /dev/null +++ b/sdk/communication/arm-communication/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 3.0.0 (2022-01-05) + +The package of @azure/arm-communication is using our next generation design principles since version 3.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/communication/arm-communication/LICENSE.txt b/sdk/communication/arm-communication/LICENSE similarity index 96% rename from sdk/communication/arm-communication/LICENSE.txt rename to sdk/communication/arm-communication/LICENSE index 2d3163745319..5d1d36e0af80 100644 --- a/sdk/communication/arm-communication/LICENSE.txt +++ b/sdk/communication/arm-communication/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 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/communication/arm-communication/README.md b/sdk/communication/arm-communication/README.md index 15ddebb729bf..146dd3ea83ae 100644 --- a/sdk/communication/arm-communication/README.md +++ b/sdk/communication/arm-communication/README.md @@ -1,109 +1,98 @@ -## Azure CommunicationServiceManagementClient SDK for JavaScript +# Azure CommunicationServiceManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for CommunicationServiceManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure CommunicationServiceManagement client. + +REST API for Azure Communication Services + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/communication/arm-communication) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-communication) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-communication) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-communication` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-communication` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure CommunicationServiceManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-communication @azure/identity +npm install @azure/arm-communication ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `CommunicationServiceManagementClient` -### How to use +To create a client object to access the Azure CommunicationServiceManagement API, you will need the `endpoint` of your Azure CommunicationServiceManagement resource and a `credential`. The Azure CommunicationServiceManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure CommunicationServiceManagement resource in the [Azure Portal][azure_portal]. -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure CommunicationServiceManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Sample code +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { CommunicationServiceManagementClient } = require("@azure/arm-communication"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new CommunicationServiceManagementClient(creds, subscriptionId); - -client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new CommunicationServiceManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and list operations as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-communication sample - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### CommunicationServiceManagementClient + +`CommunicationServiceManagementClient` is the primary interface for developers using the Azure CommunicationServiceManagement client library. Explore the methods on this client object to understand the different features of the Azure CommunicationServiceManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Farm-communication%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/communication/arm-communication/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/communication/arm-communication/_meta.json b/sdk/communication/arm-communication/_meta.json new file mode 100644 index 000000000000..f0fab73b8186 --- /dev/null +++ b/sdk/communication/arm-communication/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "754938e4cb9416358b02dcc11f444adf14b3b7b6", + "readme": "specification/communication/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/communication/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/communication/arm-communication/api-extractor.json b/sdk/communication/arm-communication/api-extractor.json new file mode 100644 index 000000000000..5216b8e6a2dc --- /dev/null +++ b/sdk/communication/arm-communication/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-communication.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/communication/arm-communication/package.json b/sdk/communication/arm-communication/package.json index fa5034a17b65..3a1469330554 100644 --- a/sdk/communication/arm-communication/package.json +++ b/sdk/communication/arm-communication/package.json @@ -1,58 +1,91 @@ { "name": "@azure/arm-communication", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "CommunicationServiceManagementClient Library with typescript type definitions for node.js and browser.", - "version": "2.1.0", + "description": "A generated SDK for CommunicationServiceManagementClient.", + "version": "3.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-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-communication.js", - "module": "./esm/communicationServiceManagementClient.js", - "types": "./esm/communicationServiceManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-communication.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/communication/arm-communication", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-communication.js.map'\" -o ./dist/arm-communication.min.js ./dist/arm-communication.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/communication/arm-communication/review/arm-communication.api.md b/sdk/communication/arm-communication/review/arm-communication.api.md new file mode 100644 index 000000000000..ae1302d8dddf --- /dev/null +++ b/sdk/communication/arm-communication/review/arm-communication.api.md @@ -0,0 +1,363 @@ +## API Report File for "@azure/arm-communication" + +> 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 CommunicationService { + beginCreateOrUpdate(resourceGroupName: string, communicationServiceName: string, options?: CommunicationServiceCreateOrUpdateOptionalParams): Promise, CommunicationServiceCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, communicationServiceName: string, options?: CommunicationServiceCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, communicationServiceName: string, options?: CommunicationServiceDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, communicationServiceName: string, options?: CommunicationServiceDeleteOptionalParams): Promise; + checkNameAvailability(options?: CommunicationServiceCheckNameAvailabilityOptionalParams): Promise; + get(resourceGroupName: string, communicationServiceName: string, options?: CommunicationServiceGetOptionalParams): Promise; + linkNotificationHub(resourceGroupName: string, communicationServiceName: string, options?: CommunicationServiceLinkNotificationHubOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: CommunicationServiceListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: CommunicationServiceListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, communicationServiceName: string, options?: CommunicationServiceListKeysOptionalParams): Promise; + regenerateKey(resourceGroupName: string, communicationServiceName: string, parameters: RegenerateKeyParameters, options?: CommunicationServiceRegenerateKeyOptionalParams): Promise; + update(resourceGroupName: string, communicationServiceName: string, options?: CommunicationServiceUpdateOptionalParams): Promise; +} + +// @public +export interface CommunicationServiceCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { + nameAvailabilityParameters?: NameAvailabilityParameters; +} + +// @public +export type CommunicationServiceCheckNameAvailabilityResponse = NameAvailability; + +// @public +export interface CommunicationServiceCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface CommunicationServiceCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: CommunicationServiceResource; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CommunicationServiceCreateOrUpdateResponse = CommunicationServiceResource; + +// @public +export interface CommunicationServiceDeleteHeaders { + location?: string; +} + +// @public +export interface CommunicationServiceDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CommunicationServiceGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunicationServiceGetResponse = CommunicationServiceResource; + +// @public +export interface CommunicationServiceKeys { + primaryConnectionString?: string; + primaryKey?: string; + secondaryConnectionString?: string; + secondaryKey?: string; +} + +// @public +export interface CommunicationServiceLinkNotificationHubOptionalParams extends coreClient.OperationOptions { + linkNotificationHubParameters?: LinkNotificationHubParameters; +} + +// @public +export type CommunicationServiceLinkNotificationHubResponse = LinkedNotificationHub; + +// @public +export interface CommunicationServiceListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunicationServiceListByResourceGroupNextResponse = CommunicationServiceResourceList; + +// @public +export interface CommunicationServiceListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunicationServiceListByResourceGroupResponse = CommunicationServiceResourceList; + +// @public +export interface CommunicationServiceListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunicationServiceListBySubscriptionNextResponse = CommunicationServiceResourceList; + +// @public +export interface CommunicationServiceListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunicationServiceListBySubscriptionResponse = CommunicationServiceResourceList; + +// @public +export interface CommunicationServiceListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunicationServiceListKeysResponse = CommunicationServiceKeys; + +// @public (undocumented) +export class CommunicationServiceManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: CommunicationServiceManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + communicationService: CommunicationService; + // (undocumented) + operations: Operations; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface CommunicationServiceManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface CommunicationServiceRegenerateKeyOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunicationServiceRegenerateKeyResponse = CommunicationServiceKeys; + +// @public +export type CommunicationServiceResource = Resource & LocationResource & TaggedResource & { + readonly systemData?: SystemData; + readonly provisioningState?: ProvisioningState; + readonly hostName?: string; + dataLocation?: string; + readonly notificationHubId?: string; + readonly version?: string; + readonly immutableResourceId?: string; +}; + +// @public +export interface CommunicationServiceResourceList { + nextLink?: string; + value?: CommunicationServiceResource[]; +} + +// @public +export interface CommunicationServiceUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: CommunicationServiceResource; +} + +// @public +export type CommunicationServiceUpdateResponse = CommunicationServiceResource; + +// @public +export type CreatedByType = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +type KeyType_2 = "Primary" | "Secondary"; +export { KeyType_2 as KeyType } + +// @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 KnownOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user", + // (undocumented) + UserSystem = "user,system" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Moving = "Moving", + // (undocumented) + Running = "Running", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Unknown = "Unknown", + // (undocumented) + Updating = "Updating" +} + +// @public +export interface LinkedNotificationHub { + resourceId?: string; +} + +// @public +export interface LinkNotificationHubParameters { + connectionString: string; + resourceId: string; +} + +// @public +export interface LocationResource { + location?: string; +} + +// @public +export interface NameAvailability { + message?: string; + nameAvailable?: boolean; + reason?: string; +} + +// @public +export interface NameAvailabilityParameters { + name: string; + type: string; +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + +// @public +export type ProvisioningState = string; + +// @public +export interface RegenerateKeyParameters { + keyType?: KeyType_2; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TaggedResource { + tags?: { + [propertyName: string]: string; + }; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/communication/arm-communication/rollup.config.js b/sdk/communication/arm-communication/rollup.config.js index 118440bec6df..9be1955eb7f1 100644 --- a/sdk/communication/arm-communication/rollup.config.js +++ b/sdk/communication/arm-communication/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; -import sourcemaps from "rollup-plugin-sourcemaps"; - -/** - * @type {rollup.RollupFileOptions} - */ -const config = { - input: "./esm/communicationServiceManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-communication.js", - format: "umd", - name: "Azure.ArmCommunication", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" - }, - banner: `/* +/* * 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. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * 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/**"] + }, + 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/communication/arm-communication/src/communicationServiceManagementClient.ts b/sdk/communication/arm-communication/src/communicationServiceManagementClient.ts index fc437ea41185..0ed9da946211 100644 --- a/sdk/communication/arm-communication/src/communicationServiceManagementClient.ts +++ b/sdk/communication/arm-communication/src/communicationServiceManagementClient.ts @@ -3,49 +3,75 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { CommunicationServiceManagementClientContext } from "./communicationServiceManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { OperationsImpl, CommunicationServiceImpl } from "./operations"; +import { Operations, CommunicationService } from "./operationsInterfaces"; +import { CommunicationServiceManagementClientOptionalParams } from "./models"; - -class CommunicationServiceManagementClient extends CommunicationServiceManagementClientContext { - // Operation groups - operations: operations.Operations; - communicationService: operations.CommunicationService; - operationStatuses: operations.OperationStatuses; +export class CommunicationServiceManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the CommunicationServiceManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId The ID of the target subscription. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.CommunicationServiceManagementClientOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.communicationService = new operations.CommunicationService(this); - this.operationStatuses = new operations.OperationStatuses(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: CommunicationServiceManagementClientOptionalParams + ) { + 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: CommunicationServiceManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-communication/3.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - CommunicationServiceManagementClient, - CommunicationServiceManagementClientContext, - Models as CommunicationServiceManagementModels, - Mappers as CommunicationServiceManagementMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2020-08-20"; + this.operations = new OperationsImpl(this); + this.communicationService = new CommunicationServiceImpl(this); + } + + operations: Operations; + communicationService: CommunicationService; +} diff --git a/sdk/communication/arm-communication/src/communicationServiceManagementClientContext.ts b/sdk/communication/arm-communication/src/communicationServiceManagementClientContext.ts deleted file mode 100644 index ff2a71850cb3..000000000000 --- a/sdk/communication/arm-communication/src/communicationServiceManagementClientContext.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-communication"; -const packageVersion = "2.1.0"; - -export class CommunicationServiceManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the CommunicationServiceManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId The ID of the target subscription. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.CommunicationServiceManagementClientOptions) { - 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 = '2020-08-20'; - 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/communication/arm-communication/src/models/operationsMappers.ts b/sdk/communication/arm-communication/src/index.ts similarity index 52% rename from sdk/communication/arm-communication/src/models/operationsMappers.ts rename to sdk/communication/arm-communication/src/index.ts index fddc3077d64b..1a3df00fa48f 100644 --- a/sdk/communication/arm-communication/src/models/operationsMappers.ts +++ b/sdk/communication/arm-communication/src/index.ts @@ -6,11 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export { - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; +/// +export * from "./models"; +export { CommunicationServiceManagementClient } from "./communicationServiceManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/communication/arm-communication/src/lroImpl.ts b/sdk/communication/arm-communication/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/communication/arm-communication/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/communication/arm-communication/src/models/communicationServiceMappers.ts b/sdk/communication/arm-communication/src/models/communicationServiceMappers.ts deleted file mode 100644 index c1300c2aab84..000000000000 --- a/sdk/communication/arm-communication/src/models/communicationServiceMappers.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CommunicationServiceCreateOrUpdateHeaders, - CommunicationServiceDeleteHeaders, - CommunicationServiceKeys, - CommunicationServiceResource, - CommunicationServiceResourceList, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - LinkedNotificationHub, - LinkNotificationHubParameters, - NameAvailability, - NameAvailabilityParameters, - RegenerateKeyParameters, - SystemData -} from "../models/mappers"; diff --git a/sdk/communication/arm-communication/src/models/index.ts b/sdk/communication/arm-communication/src/models/index.ts index ee60ae75365c..4aea003fef93 100644 --- a/sdk/communication/arm-communication/src/models/index.ts +++ b/sdk/communication/arm-communication/src/models/index.ts @@ -6,886 +6,486 @@ * 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 }; - -/** - * Data POST-ed to the nameAvailability action - */ -export interface NameAvailabilityParameters { +/** 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 { /** - * The resource type. Should be always "Microsoft.Communication/CommunicationServices". + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. */ - type: string; + readonly value?: Operation[]; /** - * The CommunicationService name to validate. e.g."my-CommunicationService-name-here" + * 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. */ - name: string; + readonly nextLink?: string; } -/** - * Result of the request to check name availability. It contains a flag and possible reason of - * failure. - */ -export interface NameAvailability { - /** - * Indicates whether the name is available or not. - */ - nameAvailable?: boolean; +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { /** - * The reason of the availability. Required if name is not available. + * 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. */ - reason?: string; + readonly name?: string; /** - * The message of the operation. + * 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. */ - message?: string; -} - -/** - * Description of an Azure Notification Hub to link to the communication service - */ -export interface LinkNotificationHubParameters { + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; /** - * The resource ID of the notification hub + * 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. */ - resourceId: string; + readonly origin?: Origin; /** - * Connection string for the notification hub + * 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. */ - connectionString: string; + readonly actionType?: ActionType; } -/** - * A notification hub that has been linked to the communication service - */ -export interface LinkedNotificationHub { +/** Localized display information for this particular operation. */ +export interface OperationDisplay { /** - * The resource ID of the notification hub + * 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. */ - resourceId?: string; -} - -/** - * The resource management error additional info. - */ -export interface ErrorAdditionalInfo { + readonly provider?: string; /** - * The additional info type. - * **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 type?: string; + readonly resource?: string; /** - * The additional info. - * **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 info?: any; + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; } -/** - * The error detail. - */ +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ export interface ErrorDetail { /** * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly code?: string; /** * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly message?: string; /** * The error target. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly target?: string; /** * The error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly details?: ErrorDetail[]; /** * The error additional info. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly additionalInfo?: ErrorAdditionalInfo[]; } -/** - * Common error response for all Azure Resource Manager APIs to return error details for failed - * operations. (This also follows the OData error response format.). - * @summary Error response - */ -export interface ErrorResponse { - /** - * The error object. - */ - error?: ErrorDetail; -} - -/** - * The current status of an async operation - */ -export interface OperationStatus { - /** - * Fully qualified ID for the operation status. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Provisioning state of the resource. Possible values include: 'Succeeded', 'Failed', - * 'Canceled', 'Creating', 'Deleting', 'Moving' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: Status; - /** - * The start time of the operation - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly startTime?: Date; +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { /** - * The end time of the operation - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly endTime?: Date; + readonly type?: string; /** - * Percent of the operation that is complete - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly percentComplete?: number; + readonly info?: Record; +} + +/** Data POST-ed to the nameAvailability action */ +export interface NameAvailabilityParameters { + /** The resource type. Should be always "Microsoft.Communication/CommunicationServices". */ + type: string; + /** The CommunicationService name to validate. e.g."my-CommunicationService-name-here" */ + name: string; +} + +/** Result of the request to check name availability. It contains a flag and possible reason of failure. */ +export interface NameAvailability { + /** Indicates whether the name is available or not. */ + nameAvailable?: boolean; + /** The reason of the availability. Required if name is not available. */ + reason?: string; + /** The message of the operation. */ + message?: string; +} + +/** Description of an Azure Notification Hub to link to the communication service */ +export interface LinkNotificationHubParameters { + /** The resource ID of the notification hub */ + resourceId: string; + /** Connection string for the notification hub */ + connectionString: string; +} + +/** A notification hub that has been linked to the communication service */ +export interface LinkedNotificationHub { + /** The resource ID of the notification hub */ + resourceId?: string; +} + +/** Object that includes an array of CommunicationServices and a possible link for next set. */ +export interface CommunicationServiceResourceList { + /** List of CommunicationService */ + value?: CommunicationServiceResource[]; /** - * The error object. + * The URL the client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. */ - error?: ErrorDetail; + nextLink?: string; } -/** - * Metadata pertaining to creation and last modification of the resource. - */ +/** Metadata pertaining to creation and last modification of the resource. */ export interface SystemData { - /** - * The identity that created the resource. - */ + /** The identity that created the resource. */ createdBy?: string; - /** - * The type of identity that created the resource. Possible values include: 'User', - * 'Application', 'ManagedIdentity', 'Key' - */ + /** The type of identity that created the resource. */ createdByType?: CreatedByType; - /** - * The timestamp of resource creation (UTC). - */ + /** The timestamp of resource creation (UTC). */ createdAt?: Date; - /** - * The identity that last modified the resource. - */ + /** The identity that last modified the resource. */ lastModifiedBy?: string; - /** - * The type of identity that last modified the resource. Possible values include: 'User', - * 'Application', 'ManagedIdentity', 'Key' - */ + /** The type of identity that last modified the resource. */ lastModifiedByType?: CreatedByType; - /** - * The timestamp of resource last modification (UTC) - */ + /** The timestamp of resource last modification (UTC) */ lastModifiedAt?: Date; } -/** - * A class representing a CommunicationService resource. - */ -export interface CommunicationServiceResource { +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * Fully qualified resource ID for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * The name of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - * "Microsoft.Storage/storageAccounts" - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** - * The Azure location where the CommunicationService is running. - */ - location?: string; - /** - * Tags of the service which is a list of key value pairs that describe the resource. - */ - tags?: { [propertyName: string]: string }; - /** - * Provisioning state of the resource. Possible values include: 'Unknown', 'Succeeded', 'Failed', - * 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: ProvisioningState; - /** - * FQDN of the CommunicationService instance. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly hostName?: string; - /** - * The location where the communication service stores its data at rest. - */ - dataLocation: string; - /** - * Resource ID of an Azure Notification Hub linked to this resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly notificationHubId?: string; - /** - * Version of the CommunicationService resource. Probably you need the same or higher version of - * client SDKs. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly version?: string; - /** - * The immutable resource Id of the communication service. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly immutableResourceId?: string; - systemData?: SystemData; } -/** - * An ARM resource with its own location (not a global or an inherited location). - */ +/** An ARM resource with its own location (not a global or an inherited location). */ export interface LocationResource { - /** - * The Azure location where the CommunicationService is running. - */ + /** The Azure location where the CommunicationService is running. */ location?: string; } -/** - * An ARM resource with that can accept tags - */ +/** An ARM resource with that can accept tags */ export interface TaggedResource { - /** - * Tags of the service which is a list of key value pairs that describe the resource. - */ + /** Tags of the service which is a list of key value pairs that describe the resource. */ tags?: { [propertyName: string]: string }; } -/** - * A class representing the access keys of a CommunicationService. - */ +/** A class representing the access keys of a CommunicationService. */ export interface CommunicationServiceKeys { - /** - * The primary access key. - */ + /** The primary access key. */ primaryKey?: string; - /** - * The secondary access key. - */ + /** The secondary access key. */ secondaryKey?: string; - /** - * CommunicationService connection string constructed via the primaryKey - */ + /** CommunicationService connection string constructed via the primaryKey */ primaryConnectionString?: string; - /** - * CommunicationService connection string constructed via the secondaryKey - */ + /** CommunicationService connection string constructed via the secondaryKey */ secondaryConnectionString?: string; } -/** - * Parameters describes the request to regenerate access keys - */ +/** Parameters describes the request to regenerate access keys */ export interface RegenerateKeyParameters { - /** - * The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible - * values include: 'Primary', 'Secondary' - */ + /** The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). */ keyType?: KeyType; } -/** - * Common fields that are returned in the response for all Azure Resource Manager resources - * @summary Resource - */ -export interface Resource extends BaseResource { - /** - * Fully qualified resource ID for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The name of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - 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; -} - -/** - * The resource model definition for a Azure Resource Manager proxy resource. It will not have tags - * and a location - * @summary Proxy Resource - */ -export interface ProxyResource extends Resource { +/** A class representing a CommunicationService resource. */ +export type CommunicationServiceResource = Resource & + LocationResource & + TaggedResource & { + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * FQDN of the CommunicationService instance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hostName?: string; + /** The location where the communication service stores its data at rest. */ + dataLocation?: string; + /** + * Resource ID of an Azure Notification Hub linked to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly notificationHubId?: string; + /** + * Version of the CommunicationService resource. Probably you need the same or higher version of client SDKs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly version?: string; + /** + * The immutable resource Id of the communication service. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly immutableResourceId?: string; + }; + +/** Defines headers for CommunicationService_createOrUpdate operation. */ +export interface CommunicationServiceCreateOrUpdateHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; } -/** - * The resource model definition for an Azure Resource Manager tracked top level resource which has - * 'tags' and a 'location' - * @summary Tracked Resource - */ -export interface TrackedResource extends Resource { - /** - * Resource tags. - */ - tags?: { [propertyName: string]: string }; - /** - * The geo-location where the resource lives - */ - location: string; +/** Defines headers for CommunicationService_delete operation. */ +export interface CommunicationServiceDeleteHeaders { + /** URL to query for status of the operation. */ + location?: string; } -/** - * The resource model definition for an Azure Resource Manager resource with an etag. - * @summary Entity Resource - */ -export interface AzureEntityResource extends Resource { - /** - * Resource Etag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly etag?: string; +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + User = "user", + System = "system", + UserSystem = "user,system" } /** - * Localized display information for this particular operation. + * 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 OperationDisplay { - /** - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring - * Insights" or "Microsoft Compute". - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provider?: string; - /** - * The localized friendly name of the resource type related to this operation. E.g. "Virtual - * Machines" or "Job Schedule Collections". - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resource?: string; - /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create - * or Update Virtual Machine", "Restart Virtual Machine". - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operation?: string; - /** - * The short, localized friendly description of the operation; suitable for tool tips and - * detailed views. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly description?: string; -} +export type Origin = string; -/** - * Details of a REST API operation, returned from the Resource Provider Operations API - * @summary REST API Operation - */ -export interface Operation { - /** - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and - * "false" for ARM/control-plane operations. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly isDataAction?: boolean; - /** - * Localized display information for this particular operation. - */ - display?: OperationDisplay; - /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - * logs UX. Default value is "user,system". Possible values include: 'user', 'system', - * 'user,system' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly origin?: Origin; - /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * Possible values include: 'Internal' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly actionType?: ActionType; +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + Internal = "Internal" } /** - * Optional Parameters. - */ -export interface CommunicationServiceCheckNameAvailabilityOptionalParams extends msRest.RequestOptionsBase { - /** - * Parameters supplied to the operation. - */ - nameAvailabilityParameters?: NameAvailabilityParameters; + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Unknown = "Unknown", + Succeeded = "Succeeded", + Failed = "Failed", + Canceled = "Canceled", + Running = "Running", + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Moving = "Moving" } /** - * Optional Parameters. - */ -export interface CommunicationServiceLinkNotificationHubOptionalParams extends msRest.RequestOptionsBase { - /** - * Parameters supplied to the operation. - */ - linkNotificationHubParameters?: LinkNotificationHubParameters; + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Running** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Moving** + */ +export type ProvisioningState = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" } /** - * Optional Parameters. + * 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 CommunicationServiceUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * Parameters for the update operation - */ - parameters?: CommunicationServiceResource; -} +export type CreatedByType = string; +/** Defines values for KeyType. */ +export type KeyType = "Primary" | "Secondary"; -/** - * Optional Parameters. - */ -export interface CommunicationServiceCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * Parameters for the create or update operation - */ - parameters?: CommunicationServiceResource; -} +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Optional Parameters. - */ -export interface CommunicationServiceBeginCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * Parameters for the create or update operation - */ - parameters?: CommunicationServiceResource; -} +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; -/** - * An interface representing CommunicationServiceManagementClientOptions. - */ -export interface CommunicationServiceManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines headers for CreateOrUpdate operation. - */ -export interface CommunicationServiceCreateOrUpdateHeaders { - /** - * URL to query for status of the operation. - */ - azureAsyncOperation: string; -} +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; -/** - * Defines headers for Delete operation. - */ -export interface CommunicationServiceDeleteHeaders { - /** - * URL to query for status of the operation. - */ - location: string; +/** Optional parameters. */ +export interface CommunicationServiceCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the operation. */ + nameAvailabilityParameters?: NameAvailabilityParameters; } -/** - * @interface - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link - * to get the next set of results. - * @extends Array - */ -export interface OperationListResult 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; -} +/** Contains response data for the checkNameAvailability operation. */ +export type CommunicationServiceCheckNameAvailabilityResponse = NameAvailability; -/** - * @interface - * Object that includes an array of CommunicationServices and a possible link for next set. - * @extends Array - */ -export interface CommunicationServiceResourceList extends Array { - /** - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - */ - nextLink?: string; +/** Optional parameters. */ +export interface CommunicationServiceLinkNotificationHubOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the operation. */ + linkNotificationHubParameters?: LinkNotificationHubParameters; } -/** - * Defines values for Status. - * Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Creating', 'Deleting', 'Moving' - * @readonly - * @enum {string} - */ -export type Status = 'Succeeded' | 'Failed' | 'Canceled' | 'Creating' | 'Deleting' | 'Moving'; +/** Contains response data for the linkNotificationHub operation. */ +export type CommunicationServiceLinkNotificationHubResponse = LinkedNotificationHub; -/** - * Defines values for ProvisioningState. - * Possible values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', - * 'Updating', 'Deleting', 'Moving' - * @readonly - * @enum {string} - */ -export type ProvisioningState = 'Unknown' | 'Succeeded' | 'Failed' | 'Canceled' | 'Running' | 'Creating' | 'Updating' | 'Deleting' | 'Moving'; +/** Optional parameters. */ +export interface CommunicationServiceListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for CreatedByType. - * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' - * @readonly - * @enum {string} - */ -export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; +/** Contains response data for the listBySubscription operation. */ +export type CommunicationServiceListBySubscriptionResponse = CommunicationServiceResourceList; -/** - * Defines values for KeyType. - * Possible values include: 'Primary', 'Secondary' - * @readonly - * @enum {string} - */ -export type KeyType = 'Primary' | 'Secondary'; +/** Optional parameters. */ +export interface CommunicationServiceListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for Origin. - * Possible values include: 'user', 'system', 'user,system' - * @readonly - * @enum {string} - */ -export type Origin = 'user' | 'system' | 'user,system'; +/** Contains response data for the listByResourceGroup operation. */ +export type CommunicationServiceListByResourceGroupResponse = CommunicationServiceResourceList; -/** - * Defines values for ActionType. - * Possible values include: 'Internal' - * @readonly - * @enum {string} - */ -export type ActionType = 'Internal'; +/** Optional parameters. */ +export interface CommunicationServiceUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters for the update operation */ + parameters?: CommunicationServiceResource; +} -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { - /** - * 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: OperationListResult; - }; -}; +/** Contains response data for the update operation. */ +export type CommunicationServiceUpdateResponse = CommunicationServiceResource; -/** - * Contains response data for the listNext operation. - */ -export type OperationsListNextResponse = OperationListResult & { - /** - * 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: OperationListResult; - }; -}; +/** Optional parameters. */ +export interface CommunicationServiceGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the checkNameAvailability operation. - */ -export type CommunicationServiceCheckNameAvailabilityResponse = NameAvailability & { - /** - * 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: NameAvailability; - }; -}; +/** Contains response data for the get operation. */ +export type CommunicationServiceGetResponse = CommunicationServiceResource; -/** - * Contains response data for the linkNotificationHub operation. - */ -export type CommunicationServiceLinkNotificationHubResponse = LinkedNotificationHub & { - /** - * 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: LinkedNotificationHub; - }; -}; +/** Optional parameters. */ +export interface CommunicationServiceCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters for the create or update operation */ + parameters?: CommunicationServiceResource; + /** 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 CommunicationServiceListBySubscriptionResponse = CommunicationServiceResourceList & { - /** - * 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: CommunicationServiceResourceList; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type CommunicationServiceCreateOrUpdateResponse = CommunicationServiceResource; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type CommunicationServiceListByResourceGroupResponse = CommunicationServiceResourceList & { - /** - * 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: CommunicationServiceResourceList; - }; -}; +/** Optional parameters. */ +export interface CommunicationServiceDeleteOptionalParams + 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 CommunicationServiceUpdateResponse = CommunicationServiceResource & { - /** - * 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: CommunicationServiceResource; - }; -}; +/** Optional parameters. */ +export interface CommunicationServiceListKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type CommunicationServiceGetResponse = CommunicationServiceResource & { - /** - * 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: CommunicationServiceResource; - }; -}; +/** Contains response data for the listKeys operation. */ +export type CommunicationServiceListKeysResponse = CommunicationServiceKeys; -/** - * Contains response data for the createOrUpdate operation. - */ -export type CommunicationServiceCreateOrUpdateResponse = CommunicationServiceResource & CommunicationServiceCreateOrUpdateHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CommunicationServiceCreateOrUpdateHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CommunicationServiceResource; - }; -}; +/** Optional parameters. */ +export interface CommunicationServiceRegenerateKeyOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the deleteMethod operation. - */ -export type CommunicationServiceDeleteResponse = CommunicationServiceDeleteHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CommunicationServiceDeleteHeaders; - }; -}; +/** Contains response data for the regenerateKey operation. */ +export type CommunicationServiceRegenerateKeyResponse = CommunicationServiceKeys; -/** - * Contains response data for the listKeys operation. - */ -export type CommunicationServiceListKeysResponse = CommunicationServiceKeys & { - /** - * 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: CommunicationServiceKeys; - }; -}; +/** Optional parameters. */ +export interface CommunicationServiceListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the regenerateKey operation. - */ -export type CommunicationServiceRegenerateKeyResponse = CommunicationServiceKeys & { - /** - * 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: CommunicationServiceKeys; - }; -}; +/** Contains response data for the listBySubscriptionNext operation. */ +export type CommunicationServiceListBySubscriptionNextResponse = CommunicationServiceResourceList; -/** - * Contains response data for the listBySubscriptionNext operation. - */ -export type CommunicationServiceListBySubscriptionNextResponse = CommunicationServiceResourceList & { - /** - * 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: CommunicationServiceResourceList; - }; -}; +/** Optional parameters. */ +export interface CommunicationServiceListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type CommunicationServiceListByResourceGroupNextResponse = CommunicationServiceResourceList & { - /** - * 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: CommunicationServiceResourceList; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type CommunicationServiceListByResourceGroupNextResponse = CommunicationServiceResourceList; -/** - * Contains response data for the get operation. - */ -export type OperationStatusesGetResponse = OperationStatus & { - /** - * 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: OperationStatus; - }; -}; +/** Optional parameters. */ +export interface CommunicationServiceManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/communication/arm-communication/src/models/mappers.ts b/sdk/communication/arm-communication/src/models/mappers.ts index dbb0e5741bb2..0bca628499cd 100644 --- a/sdk/communication/arm-communication/src/models/mappers.ts +++ b/sdk/communication/arm-communication/src/models/mappers.ts @@ -6,28 +6,29 @@ * 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 NameAvailabilityParameters: msRest.CompositeMapper = { - serializedName: "NameAvailabilityParameters", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NameAvailabilityParameters", + className: "OperationListResult", modelProperties: { - type: { - required: true, - serializedName: "type", + value: { + serializedName: "value", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } } }, - name: { - required: true, - serializedName: "name", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -36,26 +37,42 @@ export const NameAvailabilityParameters: msRest.CompositeMapper = { } }; -export const NameAvailability: msRest.CompositeMapper = { - serializedName: "NameAvailability", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NameAvailability", + className: "Operation", modelProperties: { - nameAvailable: { - serializedName: "nameAvailable", + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, type: { name: "Boolean" } }, - reason: { - serializedName: "reason", + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, type: { name: "String" } }, - message: { - serializedName: "message", + actionType: { + serializedName: "actionType", + readOnly: true, type: { name: "String" } @@ -64,38 +81,35 @@ export const NameAvailability: msRest.CompositeMapper = { } }; -export const LinkNotificationHubParameters: msRest.CompositeMapper = { - serializedName: "LinkNotificationHubParameters", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LinkNotificationHubParameters", + className: "OperationDisplay", modelProperties: { - resourceId: { - required: true, - serializedName: "resourceId", + provider: { + serializedName: "provider", + readOnly: true, type: { name: "String" } }, - connectionString: { - required: true, - serializedName: "connectionString", + resource: { + serializedName: "resource", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const LinkedNotificationHub: msRest.CompositeMapper = { - serializedName: "LinkedNotificationHub", - type: { - name: "Composite", - className: "LinkedNotificationHub", - modelProperties: { - resourceId: { - serializedName: "resourceId", + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, type: { name: "String" } @@ -104,60 +118,51 @@ export const LinkedNotificationHub: msRest.CompositeMapper = { } }; -export const ErrorAdditionalInfo: msRest.CompositeMapper = { - serializedName: "ErrorAdditionalInfo", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorAdditionalInfo", + className: "ErrorResponse", modelProperties: { - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } - }, - info: { - readOnly: true, - serializedName: "info", + error: { + serializedName: "error", type: { - name: "Object" + name: "Composite", + className: "ErrorDetail" } } } } }; -export const ErrorDetail: msRest.CompositeMapper = { - serializedName: "ErrorDetail", +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", className: "ErrorDetail", modelProperties: { code: { - readOnly: true, serializedName: "code", + readOnly: true, type: { name: "String" } }, message: { - readOnly: true, serializedName: "message", + readOnly: true, type: { name: "String" } }, target: { - readOnly: true, serializedName: "target", + readOnly: true, type: { name: "String" } }, details: { - readOnly: true, serializedName: "details", + readOnly: true, type: { name: "Sequence", element: { @@ -169,8 +174,8 @@ export const ErrorDetail: msRest.CompositeMapper = { } }, additionalInfo: { - readOnly: true, serializedName: "additionalInfo", + readOnly: true, type: { name: "Sequence", element: { @@ -185,81 +190,146 @@ export const ErrorDetail: msRest.CompositeMapper = { } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "ErrorAdditionalInfo", modelProperties: { - error: { - serializedName: "error", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Composite", - className: "ErrorDetail" + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } } } } } }; -export const OperationStatus: msRest.CompositeMapper = { - serializedName: "OperationStatus", +export const NameAvailabilityParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationStatus", + className: "NameAvailabilityParameters", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + type: { + serializedName: "type", + required: true, type: { name: "String" } }, - status: { - readOnly: true, - serializedName: "status", + name: { + serializedName: "name", + required: true, type: { name: "String" } + } + } + } +}; + +export const NameAvailability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NameAvailability", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + type: { + name: "Boolean" + } }, - startTime: { - readOnly: true, - serializedName: "startTime", + reason: { + serializedName: "reason", type: { - name: "DateTime" + name: "String" } }, - endTime: { - readOnly: true, - serializedName: "endTime", + message: { + serializedName: "message", type: { - name: "DateTime" + name: "String" + } + } + } + } +}; + +export const LinkNotificationHubParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkNotificationHubParameters", + modelProperties: { + resourceId: { + serializedName: "resourceId", + required: true, + type: { + name: "String" } }, - percentComplete: { - readOnly: true, - serializedName: "percentComplete", - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 0 - }, + connectionString: { + serializedName: "connectionString", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const LinkedNotificationHub: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkedNotificationHub", + modelProperties: { + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + } + } + } +}; + +export const CommunicationServiceResourceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunicationServiceResourceList", + modelProperties: { + value: { + serializedName: "value", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CommunicationServiceResource" + } + } } }, - error: { - serializedName: "error.error", + nextLink: { + serializedName: "nextLink", type: { - name: "Composite", - className: "ErrorDetail" + name: "String" } } } } }; -export const SystemData: msRest.CompositeMapper = { - serializedName: "systemData", +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", className: "SystemData", @@ -304,105 +374,37 @@ export const SystemData: msRest.CompositeMapper = { } }; -export const CommunicationServiceResource: msRest.CompositeMapper = { - serializedName: "CommunicationServiceResource", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CommunicationServiceResource", + className: "Resource", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", - type: { - name: "String" - } - }, - hostName: { - readOnly: true, - serializedName: "properties.hostName", - type: { - name: "String" - } - }, - dataLocation: { - required: true, - serializedName: "properties.dataLocation", - type: { - name: "String" - } - }, - notificationHubId: { - readOnly: true, - serializedName: "properties.notificationHubId", - type: { - name: "String" - } - }, - version: { - readOnly: true, - serializedName: "properties.version", - type: { - name: "String" - } - }, - immutableResourceId: { readOnly: true, - serializedName: "properties.immutableResourceId", type: { name: "String" } - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } } } } }; -export const LocationResource: msRest.CompositeMapper = { - serializedName: "LocationResource", +export const LocationResource: coreClient.CompositeMapper = { type: { name: "Composite", className: "LocationResource", @@ -417,8 +419,7 @@ export const LocationResource: msRest.CompositeMapper = { } }; -export const TaggedResource: msRest.CompositeMapper = { - serializedName: "TaggedResource", +export const TaggedResource: coreClient.CompositeMapper = { type: { name: "Composite", className: "TaggedResource", @@ -427,19 +428,14 @@ export const TaggedResource: msRest.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } } } } }; -export const CommunicationServiceKeys: msRest.CompositeMapper = { - serializedName: "CommunicationServiceKeys", +export const CommunicationServiceKeys: coreClient.CompositeMapper = { type: { name: "Composite", className: "CommunicationServiceKeys", @@ -472,8 +468,7 @@ export const CommunicationServiceKeys: msRest.CompositeMapper = { } }; -export const RegenerateKeyParameters: msRest.CompositeMapper = { - serializedName: "RegenerateKeyParameters", +export const RegenerateKeyParameters: coreClient.CompositeMapper = { type: { name: "Composite", className: "RegenerateKeyParameters", @@ -482,180 +477,65 @@ export const RegenerateKeyParameters: msRest.CompositeMapper = { serializedName: "keyType", type: { name: "Enum", - allowedValues: [ - "Primary", - "Secondary" - ] - } - } - } - } -}; - -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" + allowedValues: ["Primary", "Secondary"] } } } } }; -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties - } - } -}; - -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const CommunicationServiceResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "CommunicationServiceResource", modelProperties: { ...Resource.type.modelProperties, - tags: { - serializedName: "tags", + ...LocationResource.type.modelProperties, + ...TaggedResource.type.modelProperties, + systemData: { + serializedName: "systemData", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Composite", + className: "SystemData" } }, - location: { - required: true, - serializedName: "location", - type: { - name: "String" - } - } - } - } -}; - -export const AzureEntityResource: msRest.CompositeMapper = { - serializedName: "AzureEntityResource", - type: { - name: "Composite", - className: "AzureEntityResource", - modelProperties: { - ...Resource.type.modelProperties, - etag: { - readOnly: true, - serializedName: "etag", - type: { - name: "String" - } - } - } - } -}; - -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { + provisioningState: { + serializedName: "properties.provisioningState", readOnly: true, - serializedName: "provider", type: { name: "String" } }, - resource: { + hostName: { + serializedName: "properties.hostName", readOnly: true, - serializedName: "resource", type: { name: "String" } }, - operation: { - readOnly: true, - serializedName: "operation", + dataLocation: { + serializedName: "properties.dataLocation", type: { name: "String" } }, - description: { - readOnly: true, - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; - -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { + notificationHubId: { + serializedName: "properties.notificationHubId", readOnly: true, - serializedName: "name", type: { name: "String" } }, - isDataAction: { - readOnly: true, - serializedName: "isDataAction", - type: { - name: "Boolean" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay" - } - }, - origin: { + version: { + serializedName: "properties.version", readOnly: true, - serializedName: "origin", type: { name: "String" } }, - actionType: { + immutableResourceId: { + serializedName: "properties.immutableResourceId", readOnly: true, - serializedName: "actionType", type: { name: "String" } @@ -664,8 +544,7 @@ export const Operation: msRest.CompositeMapper = { } }; -export const CommunicationServiceCreateOrUpdateHeaders: msRest.CompositeMapper = { - serializedName: "communicationservice-createorupdate-headers", +export const CommunicationServiceCreateOrUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CommunicationServiceCreateOrUpdateHeaders", @@ -680,8 +559,7 @@ export const CommunicationServiceCreateOrUpdateHeaders: msRest.CompositeMapper = } }; -export const CommunicationServiceDeleteHeaders: msRest.CompositeMapper = { - serializedName: "communicationservice-delete-headers", +export const CommunicationServiceDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CommunicationServiceDeleteHeaders", @@ -695,61 +573,3 @@ export const CommunicationServiceDeleteHeaders: msRest.CompositeMapper = { } } }; - -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - readOnly: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } - } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const CommunicationServiceResourceList: msRest.CompositeMapper = { - serializedName: "CommunicationServiceResourceList", - type: { - name: "Composite", - className: "CommunicationServiceResourceList", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CommunicationServiceResource" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; diff --git a/sdk/communication/arm-communication/src/models/parameters.ts b/sdk/communication/arm-communication/src/models/parameters.ts index 62053a006974..d2e2980bdb50 100644 --- a/sdk/communication/arm-communication/src/models/parameters.ts +++ b/sdk/communication/arm-communication/src/models/parameters.ts @@ -3,106 +3,142 @@ * 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 { + NameAvailabilityParameters as NameAvailabilityParametersMapper, + LinkNotificationHubParameters as LinkNotificationHubParametersMapper, + CommunicationServiceResource as CommunicationServiceResourceMapper, + RegenerateKeyParameters as RegenerateKeyParametersMapper +} 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", - constraints: { - MinLength: 1 - }, type: { name: "String" } - } + }, + skipEncoding: true }; -export const communicationServiceName: msRest.OperationURLParameter = { - parameterPath: "communicationServiceName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "communicationServiceName", - constraints: { - MaxLength: 63, - MinLength: 1, - Pattern: /^[-\w]+$/ - }, + defaultValue: "2020-08-20", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const location: msRest.OperationURLParameter = { - parameterPath: "location", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - serializedName: "location", type: { name: "String" } - } + }, + skipEncoding: true }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "nextLink", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } - }, - skipEncoding: true + } }; -export const operationId: msRest.OperationURLParameter = { - parameterPath: "operationId", + +export const nameAvailabilityParameters: OperationParameter = { + parameterPath: ["options", "nameAvailabilityParameters"], + mapper: NameAvailabilityParametersMapper +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", required: true, - serializedName: "operationId", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { + +export const linkNotificationHubParameters: OperationParameter = { + parameterPath: ["options", "linkNotificationHubParameters"], + mapper: LinkNotificationHubParametersMapper +}; + +export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { - required: true, - serializedName: "resourceGroupName", constraints: { MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const communicationServiceName: OperationURLParameter = { + parameterPath: "communicationServiceName", mapper: { - required: true, - serializedName: "subscriptionId", constraints: { + Pattern: new RegExp("^[-\\w]+$"), + MaxLength: 63, MinLength: 1 }, + serializedName: "communicationServiceName", + required: true, type: { name: "String" } } }; + +export const parameters: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: CommunicationServiceResourceMapper +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: RegenerateKeyParametersMapper +}; diff --git a/sdk/communication/arm-communication/src/operations/communicationService.ts b/sdk/communication/arm-communication/src/operations/communicationService.ts index 3ea8425c09f5..b875738078d9 100644 --- a/sdk/communication/arm-communication/src/operations/communicationService.ts +++ b/sdk/communication/arm-communication/src/operations/communicationService.ts @@ -3,422 +3,488 @@ * 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/communicationServiceMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { CommunicationService } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { CommunicationServiceManagementClientContext } from "../communicationServiceManagementClientContext"; +import { CommunicationServiceManagementClient } from "../communicationServiceManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + CommunicationServiceResource, + CommunicationServiceListBySubscriptionNextOptionalParams, + CommunicationServiceListBySubscriptionOptionalParams, + CommunicationServiceListByResourceGroupNextOptionalParams, + CommunicationServiceListByResourceGroupOptionalParams, + CommunicationServiceCheckNameAvailabilityOptionalParams, + CommunicationServiceCheckNameAvailabilityResponse, + CommunicationServiceLinkNotificationHubOptionalParams, + CommunicationServiceLinkNotificationHubResponse, + CommunicationServiceListBySubscriptionResponse, + CommunicationServiceListByResourceGroupResponse, + CommunicationServiceUpdateOptionalParams, + CommunicationServiceUpdateResponse, + CommunicationServiceGetOptionalParams, + CommunicationServiceGetResponse, + CommunicationServiceCreateOrUpdateOptionalParams, + CommunicationServiceCreateOrUpdateResponse, + CommunicationServiceDeleteOptionalParams, + CommunicationServiceListKeysOptionalParams, + CommunicationServiceListKeysResponse, + RegenerateKeyParameters, + CommunicationServiceRegenerateKeyOptionalParams, + CommunicationServiceRegenerateKeyResponse, + CommunicationServiceListBySubscriptionNextResponse, + CommunicationServiceListByResourceGroupNextResponse +} from "../models"; -/** Class representing a CommunicationService. */ -export class CommunicationService { - private readonly client: CommunicationServiceManagementClientContext; +/// +/** Class containing CommunicationService operations. */ +export class CommunicationServiceImpl implements CommunicationService { + private readonly client: CommunicationServiceManagementClient; /** - * Create a CommunicationService. - * @param {CommunicationServiceManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class CommunicationService class. + * @param client Reference to the service client */ - constructor(client: CommunicationServiceManagementClientContext) { + constructor(client: CommunicationServiceManagementClient) { this.client = client; } /** - * Checks that the CommunicationService name is valid and is not already in use. - * @summary Check Name Availability - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailability(options?: Models.CommunicationServiceCheckNameAvailabilityOptionalParams): Promise; - /** - * @param callback The callback - */ - checkNameAvailability(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - checkNameAvailability(options: Models.CommunicationServiceCheckNameAvailabilityOptionalParams, callback: msRest.ServiceCallback): void; - checkNameAvailability(options?: Models.CommunicationServiceCheckNameAvailabilityOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + * Handles requests to list all resources in a subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: CommunicationServiceListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: CommunicationServiceListBySubscriptionOptionalParams + ): 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?: CommunicationServiceListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } } /** - * Links an Azure Notification Hub to this communication service. - * @summary Link Notification Hub + * Handles requests to list all resources in a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationServiceName The name of the CommunicationService resource. - * @param [options] The optional parameters - * @returns Promise - */ - linkNotificationHub(resourceGroupName: string, communicationServiceName: string, options?: Models.CommunicationServiceLinkNotificationHubOptionalParams): Promise; + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: CommunicationServiceListByResourceGroupOptionalParams + ): 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?: CommunicationServiceListByResourceGroupOptionalParams + ): 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?: CommunicationServiceListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationServiceName The name of the CommunicationService resource. - * @param callback The callback + * Checks that the CommunicationService name is valid and is not already in use. + * @param options The options parameters. */ - linkNotificationHub(resourceGroupName: string, communicationServiceName: string, callback: msRest.ServiceCallback): void; + checkNameAvailability( + options?: CommunicationServiceCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + checkNameAvailabilityOperationSpec + ); + } + /** + * Links an Azure Notification Hub to this communication service. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationServiceName The name of the CommunicationService resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - linkNotificationHub(resourceGroupName: string, communicationServiceName: string, options: Models.CommunicationServiceLinkNotificationHubOptionalParams, callback: msRest.ServiceCallback): void; - linkNotificationHub(resourceGroupName: string, communicationServiceName: string, options?: Models.CommunicationServiceLinkNotificationHubOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + linkNotificationHub( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceLinkNotificationHubOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - communicationServiceName, - options - }, - linkNotificationHubOperationSpec, - callback) as Promise; + { resourceGroupName, communicationServiceName, options }, + linkNotificationHubOperationSpec + ); } /** * Handles requests to list all resources in a subscription. - * @summary List By Subscription - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscription(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscription( + options?: CommunicationServiceListBySubscriptionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listBySubscriptionOperationSpec, - callback) as Promise; + { options }, + listBySubscriptionOperationSpec + ); } /** * Handles requests to list all resources in a resource group. - * @summary List By Resource Group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param callback The callback + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: CommunicationServiceListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** * Operation to update an existing CommunicationService. - * @summary Update - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationServiceName The name of the CommunicationService resource. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, communicationServiceName: string, options?: Models.CommunicationServiceUpdateOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationServiceName The name of the CommunicationService resource. - * @param callback The callback - */ - update(resourceGroupName: string, communicationServiceName: string, callback: msRest.ServiceCallback): void; - /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationServiceName The name of the CommunicationService resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, communicationServiceName: string, options: Models.CommunicationServiceUpdateOptionalParams, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, communicationServiceName: string, options?: Models.CommunicationServiceUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - communicationServiceName, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, communicationServiceName, options }, + updateOperationSpec + ); } /** * Get the CommunicationService and its properties. - * @summary Get * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationServiceName The name of the CommunicationService resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, communicationServiceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationServiceName The name of the CommunicationService resource. - * @param callback The callback - */ - get(resourceGroupName: string, communicationServiceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationServiceName The name of the CommunicationService resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, communicationServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, communicationServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - communicationServiceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, communicationServiceName, options }, + getOperationSpec + ); } /** * Create a new CommunicationService or update an existing CommunicationService. - * @summary Create Or Update * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationServiceName The name of the CommunicationService resource. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, communicationServiceName: string, options?: Models.CommunicationServiceCreateOrUpdateOptionalParams): Promise { - return this.beginCreateOrUpdate(resourceGroupName,communicationServiceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CommunicationServiceCreateOrUpdateResponse + > + > { + 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, communicationServiceName, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Operation to delete a CommunicationService. - * @summary Delete + * Create a new CommunicationService or update an existing CommunicationService. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationServiceName The name of the CommunicationService resource. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, communicationServiceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,communicationServiceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + communicationServiceName, + options + ); + return poller.pollUntilDone(); } /** - * Get the access keys of the CommunicationService resource. - * @summary List Keys - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationServiceName The name of the CommunicationService resource. - * @param [options] The optional parameters - * @returns Promise - */ - listKeys(resourceGroupName: string, communicationServiceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationServiceName The name of the CommunicationService resource. - * @param callback The callback - */ - listKeys(resourceGroupName: string, communicationServiceName: string, callback: msRest.ServiceCallback): void; - /** + * Operation to delete a CommunicationService. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationServiceName The name of the CommunicationService resource. - * @param options The optional parameters - * @param callback The callback - */ - listKeys(resourceGroupName: string, communicationServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeys(resourceGroupName: string, communicationServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - communicationServiceName, - options - }, - listKeysOperationSpec, - callback) as Promise; + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceDeleteOptionalParams + ): 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, communicationServiceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); } /** - * Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at - * the same time. - * @summary Regenerate Key - * @param parameters Parameter that describes the Regenerate Key Operation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationServiceName The name of the CommunicationService resource. - * @param [options] The optional parameters - * @returns Promise - */ - regenerateKey(parameters: Models.RegenerateKeyParameters, resourceGroupName: string, communicationServiceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param parameters Parameter that describes the Regenerate Key Operation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param communicationServiceName The name of the CommunicationService resource. - * @param callback The callback - */ - regenerateKey(parameters: Models.RegenerateKeyParameters, resourceGroupName: string, communicationServiceName: string, callback: msRest.ServiceCallback): void; - /** - * @param parameters Parameter that describes the Regenerate Key Operation. + * Operation to delete a CommunicationService. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationServiceName The name of the CommunicationService resource. - * @param options The optional parameters - * @param callback The callback - */ - regenerateKey(parameters: Models.RegenerateKeyParameters, resourceGroupName: string, communicationServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - regenerateKey(parameters: Models.RegenerateKeyParameters, resourceGroupName: string, communicationServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - parameters, - resourceGroupName, - communicationServiceName, - options - }, - regenerateKeyOperationSpec, - callback) as Promise; + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + communicationServiceName, + options + ); + return poller.pollUntilDone(); } /** - * Create a new CommunicationService or update an existing CommunicationService. - * @summary Create Or Update + * Get the access keys of the CommunicationService resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationServiceName The name of the CommunicationService resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(resourceGroupName: string, communicationServiceName: string, options?: Models.CommunicationServiceBeginCreateOrUpdateOptionalParams): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - communicationServiceName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + listKeys( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceListKeysOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, communicationServiceName, options }, + listKeysOperationSpec + ); } /** - * Operation to delete a CommunicationService. - * @summary Delete + * Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at the + * same time. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param communicationServiceName The name of the CommunicationService resource. - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteMethod(resourceGroupName: string, communicationServiceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - communicationServiceName, - options - }, - beginDeleteMethodOperationSpec, - options); + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param options The options parameters. + */ + regenerateKey( + resourceGroupName: string, + communicationServiceName: string, + parameters: RegenerateKeyParameters, + options?: CommunicationServiceRegenerateKeyOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, communicationServiceName, parameters, options }, + regenerateKeyOperationSpec + ); } /** - * Handles requests to list all resources in a subscription. - * @summary List By Subscription - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - 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 { + private _listBySubscriptionNext( + nextLink: string, + options?: CommunicationServiceListBySubscriptionNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listBySubscriptionNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); } /** - * Handles requests to list all resources in a resource group. - * @summary List By 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 { + * 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?: CommunicationServiceListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Communication/checkNameAvailability", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Communication/checkNameAvailability", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: [ - "options", - "nameAvailabilityParameters" - ], - mapper: Mappers.NameAvailabilityParameters - }, responses: { 200: { bodyMapper: Mappers.NameAvailability @@ -427,53 +493,58 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.nameAvailabilityParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const linkNotificationHubOperationSpec: msRest.OperationSpec = { +const linkNotificationHubOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/linkNotificationHub", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/linkNotificationHub", + responses: { + 200: { + bodyMapper: Mappers.LinkedNotificationHub + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.linkNotificationHubParameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.communicationServiceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: [ - "options", - "linkNotificationHubParameters" - ], - mapper: Mappers.LinkNotificationHubParameters - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Communication/communicationServices", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.LinkedNotificationHub + bodyMapper: Mappers.CommunicationServiceResourceList }, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listBySubscriptionOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Communication/communicationServices", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.CommunicationServiceResourceList @@ -482,54 +553,43 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.CommunicationServiceResourceList + bodyMapper: Mappers.CommunicationServiceResource }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.communicationServiceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: [ - "options", - "parameters" - ], - mapper: Mappers.CommunicationServiceResource - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.CommunicationServiceResource @@ -538,80 +598,76 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.communicationServiceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.CommunicationServiceResource }, + 201: { + bodyMapper: Mappers.CommunicationServiceResource + }, + 202: { + bodyMapper: Mappers.CommunicationServiceResource + }, + 204: { + bodyMapper: Mappers.CommunicationServiceResource + }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/listKeys", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.communicationServiceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.CommunicationServiceKeys - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const regenerateKeyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/regenerateKey", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.communicationServiceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RegenerateKeyParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/listKeys", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.CommunicationServiceKeys @@ -620,92 +676,43 @@ const regenerateKeyOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.communicationServiceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: [ - "options", - "parameters" - ], - mapper: Mappers.CommunicationServiceResource - }, + headerParameters: [Parameters.accept], + serializer +}; +const regenerateKeyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/regenerateKey", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.CommunicationServiceResource, - headersMapper: Mappers.CommunicationServiceCreateOrUpdateHeaders - }, - 201: { - bodyMapper: Mappers.CommunicationServiceResource, - headersMapper: Mappers.CommunicationServiceCreateOrUpdateHeaders + bodyMapper: Mappers.CommunicationServiceKeys }, default: { - bodyMapper: Mappers.ErrorResponse, - headersMapper: Mappers.CommunicationServiceCreateOrUpdateHeaders + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}", + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.communicationServiceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - headersMapper: Mappers.CommunicationServiceDeleteHeaders - }, - 202: { - headersMapper: Mappers.CommunicationServiceDeleteHeaders - }, - 204: { - headersMapper: Mappers.CommunicationServiceDeleteHeaders - }, - default: { - bodyMapper: Mappers.ErrorResponse, - headersMapper: Mappers.CommunicationServiceDeleteHeaders - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.CommunicationServiceResourceList @@ -714,22 +721,18 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.CommunicationServiceResourceList @@ -738,5 +741,13 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/communication/arm-communication/src/operations/index.ts b/sdk/communication/arm-communication/src/operations/index.ts index 652d14e1890c..82af3b9e64aa 100644 --- a/sdk/communication/arm-communication/src/operations/index.ts +++ b/sdk/communication/arm-communication/src/operations/index.ts @@ -3,10 +3,8 @@ * 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 "./operations"; export * from "./communicationService"; -export * from "./operationStatuses"; diff --git a/sdk/communication/arm-communication/src/operations/operationStatuses.ts b/sdk/communication/arm-communication/src/operations/operationStatuses.ts deleted file mode 100644 index 07144b6d785e..000000000000 --- a/sdk/communication/arm-communication/src/operations/operationStatuses.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationStatusesMappers"; -import * as Parameters from "../models/parameters"; -import { CommunicationServiceManagementClientContext } from "../communicationServiceManagementClientContext"; - -/** Class representing a OperationStatuses. */ -export class OperationStatuses { - private readonly client: CommunicationServiceManagementClientContext; - - /** - * Create a OperationStatuses. - * @param {CommunicationServiceManagementClientContext} client Reference to the service client. - */ - constructor(client: CommunicationServiceManagementClientContext) { - this.client = client; - } - - /** - * Gets the current status of an async operation. - * @summary Get Operation Status - * @param location The Azure region - * @param operationId The ID of an ongoing async operation - * @param [options] The optional parameters - * @returns Promise - */ - get(location: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param location The Azure region - * @param operationId The ID of an ongoing async operation - * @param callback The callback - */ - get(location: string, operationId: string, callback: msRest.ServiceCallback): void; - /** - * @param location The Azure region - * @param operationId The ID of an ongoing async operation - * @param options The optional parameters - * @param callback The callback - */ - get(location: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(location: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - location, - operationId, - options - }, - getOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "providers/Microsoft.Communication/locations/{location}/operationStatuses/{operationId}", - urlParameters: [ - Parameters.location, - Parameters.operationId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.OperationStatus - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; diff --git a/sdk/communication/arm-communication/src/operations/operations.ts b/sdk/communication/arm-communication/src/operations/operations.ts index 1326fe816a69..21735ee76e9d 100644 --- a/sdk/communication/arm-communication/src/operations/operations.ts +++ b/sdk/communication/arm-communication/src/operations/operations.ts @@ -3,94 +3,109 @@ * 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 { CommunicationServiceManagementClientContext } from "../communicationServiceManagementClientContext"; +import { CommunicationServiceManagementClient } from "../communicationServiceManagementClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: CommunicationServiceManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: CommunicationServiceManagementClient; /** - * Create a Operations. - * @param {CommunicationServiceManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: CommunicationServiceManagementClientContext) { + constructor(client: CommunicationServiceManagementClient) { this.client = client; } /** * Lists all of the available REST API operations of the Microsoft.Communication provider. - * @summary List Operations - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: 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; + } } /** * Lists all of the available REST API operations of the Microsoft.Communication provider. - * @summary List Operations - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Communication/operations", httpMethod: "GET", - path: "providers/Microsoft.Communication/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -99,22 +114,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -123,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/communication/arm-communication/src/operationsInterfaces/communicationService.ts b/sdk/communication/arm-communication/src/operationsInterfaces/communicationService.ts new file mode 100644 index 000000000000..bb023c631fab --- /dev/null +++ b/sdk/communication/arm-communication/src/operationsInterfaces/communicationService.ts @@ -0,0 +1,166 @@ +/* + * 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 { + CommunicationServiceResource, + CommunicationServiceListBySubscriptionOptionalParams, + CommunicationServiceListByResourceGroupOptionalParams, + CommunicationServiceCheckNameAvailabilityOptionalParams, + CommunicationServiceCheckNameAvailabilityResponse, + CommunicationServiceLinkNotificationHubOptionalParams, + CommunicationServiceLinkNotificationHubResponse, + CommunicationServiceUpdateOptionalParams, + CommunicationServiceUpdateResponse, + CommunicationServiceGetOptionalParams, + CommunicationServiceGetResponse, + CommunicationServiceCreateOrUpdateOptionalParams, + CommunicationServiceCreateOrUpdateResponse, + CommunicationServiceDeleteOptionalParams, + CommunicationServiceListKeysOptionalParams, + CommunicationServiceListKeysResponse, + RegenerateKeyParameters, + CommunicationServiceRegenerateKeyOptionalParams, + CommunicationServiceRegenerateKeyResponse +} from "../models"; + +/// +/** Interface representing a CommunicationService. */ +export interface CommunicationService { + /** + * Handles requests to list all resources in a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: CommunicationServiceListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Handles requests to list all resources 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?: CommunicationServiceListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Checks that the CommunicationService name is valid and is not already in use. + * @param options The options parameters. + */ + checkNameAvailability( + options?: CommunicationServiceCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Links an Azure Notification Hub to this communication service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communicationServiceName The name of the CommunicationService resource. + * @param options The options parameters. + */ + linkNotificationHub( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceLinkNotificationHubOptionalParams + ): Promise; + /** + * Operation to update an existing CommunicationService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communicationServiceName The name of the CommunicationService resource. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceUpdateOptionalParams + ): Promise; + /** + * Get the CommunicationService and its properties. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communicationServiceName The name of the CommunicationService resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceGetOptionalParams + ): Promise; + /** + * Create a new CommunicationService or update an existing CommunicationService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communicationServiceName The name of the CommunicationService resource. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CommunicationServiceCreateOrUpdateResponse + > + >; + /** + * Create a new CommunicationService or update an existing CommunicationService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communicationServiceName The name of the CommunicationService resource. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceCreateOrUpdateOptionalParams + ): Promise; + /** + * Operation to delete a CommunicationService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communicationServiceName The name of the CommunicationService resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceDeleteOptionalParams + ): Promise, void>>; + /** + * Operation to delete a CommunicationService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communicationServiceName The name of the CommunicationService resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceDeleteOptionalParams + ): Promise; + /** + * Get the access keys of the CommunicationService resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communicationServiceName The name of the CommunicationService resource. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + communicationServiceName: string, + options?: CommunicationServiceListKeysOptionalParams + ): Promise; + /** + * Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at the + * same time. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communicationServiceName The name of the CommunicationService resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param options The options parameters. + */ + regenerateKey( + resourceGroupName: string, + communicationServiceName: string, + parameters: RegenerateKeyParameters, + options?: CommunicationServiceRegenerateKeyOptionalParams + ): Promise; +} diff --git a/sdk/communication/arm-communication/src/models/operationStatusesMappers.ts b/sdk/communication/arm-communication/src/operationsInterfaces/index.ts similarity index 67% rename from sdk/communication/arm-communication/src/models/operationStatusesMappers.ts rename to sdk/communication/arm-communication/src/operationsInterfaces/index.ts index f0219f9c237e..82af3b9e64aa 100644 --- a/sdk/communication/arm-communication/src/models/operationStatusesMappers.ts +++ b/sdk/communication/arm-communication/src/operationsInterfaces/index.ts @@ -6,9 +6,5 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export { - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - OperationStatus -} from "../models/mappers"; +export * from "./operations"; +export * from "./communicationService"; diff --git a/sdk/communication/arm-communication/src/operationsInterfaces/operations.ts b/sdk/communication/arm-communication/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..8a720ca69440 --- /dev/null +++ b/sdk/communication/arm-communication/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 { + /** + * Lists all of the available REST API operations of the Microsoft.Communication provider. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/communication/arm-communication/test/sampleTest.ts b/sdk/communication/arm-communication/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/communication/arm-communication/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/communication/arm-communication/tsconfig.json b/sdk/communication/arm-communication/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/communication/arm-communication/tsconfig.json +++ b/sdk/communication/arm-communication/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/communication/ci.yml b/sdk/communication/ci.yml index 584a3e0f0406..31f56a79898e 100644 --- a/sdk/communication/ci.yml +++ b/sdk/communication/ci.yml @@ -1,5 +1,3 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - trigger: branches: include: @@ -9,7 +7,6 @@ trigger: paths: include: - sdk/communication/ - pr: branches: include: @@ -17,10 +14,11 @@ pr: - feature/* - release/* - hotfix/* + exclude: + - feature/v4 paths: include: - sdk/communication/ - extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -40,3 +38,5 @@ extends: safeName: azurecommunicationnetworktraversal - name: azure-tools-communication-short-codes safeName: azuretoolscommunicationshortcodes + - name: azure-arm-communication + safeName: azurearmcommunication