From 1210f8641fd491f590dac4f0042a6b6e32d358d6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 07:33:05 +0000 Subject: [PATCH] CodeGen from PR 17000 in Azure/azure-rest-api-specs [Go] Track2 modify readme.go.md 9 (#17000) * [Go] Track2 modify readme.go.md 9 * fix --- common/config/rush/pnpm-lock.yaml | 131 +- rush.json | 5 + sdk/support/arm-support/CHANGELOG.md | 11 + sdk/support/arm-support/LICENSE | 21 + sdk/support/arm-support/README.md | 143 +- sdk/support/arm-support/_meta.json | 7 + sdk/support/arm-support/api-extractor.json | 18 + sdk/support/arm-support/package.json | 94 +- .../arm-support/review/arm-support.api.md | 459 ++++++ sdk/support/arm-support/rollup.config.js | 211 ++- sdk/support/arm-support/src/index.ts | 12 + sdk/support/arm-support/src/lroImpl.ts | 34 + .../arm-support/src/microsoftSupport.ts | 119 +- .../src/microsoftSupportContext.ts | 62 - .../src/models/communicationsMappers.ts | 25 - sdk/support/arm-support/src/models/index.ts | 1257 ++++++----------- sdk/support/arm-support/src/models/mappers.ts | 836 ++++++----- .../src/models/operationsMappers.ts | 16 - .../arm-support/src/models/parameters.ts | 153 +- .../models/problemClassificationsMappers.ts | 15 - .../arm-support/src/models/servicesMappers.ts | 15 - .../src/models/supportTicketsMappers.ts | 27 - .../src/operations/communications.ts | 491 ++++--- .../arm-support/src/operations/index.ts | 8 +- .../arm-support/src/operations/operations.ts | 108 +- .../src/operations/problemClassifications.ts | 190 +-- .../arm-support/src/operations/services.ts | 176 +-- .../src/operations/supportTickets.ts | 586 ++++---- .../operationsInterfaces/communications.ts | 94 ++ .../src/operationsInterfaces/index.ts | 13 + .../src/operationsInterfaces/operations.ts | 22 + .../problemClassifications.ts | 43 + .../src/operationsInterfaces/services.ts | 42 + .../operationsInterfaces/supportTickets.ts | 137 ++ sdk/support/arm-support/test/sampleTest.ts | 48 + sdk/support/arm-support/tsconfig.json | 6 +- sdk/support/ci.yml | 29 + 37 files changed, 3248 insertions(+), 2416 deletions(-) create mode 100644 sdk/support/arm-support/CHANGELOG.md create mode 100644 sdk/support/arm-support/LICENSE create mode 100644 sdk/support/arm-support/_meta.json create mode 100644 sdk/support/arm-support/api-extractor.json create mode 100644 sdk/support/arm-support/review/arm-support.api.md create mode 100644 sdk/support/arm-support/src/index.ts create mode 100644 sdk/support/arm-support/src/lroImpl.ts delete mode 100644 sdk/support/arm-support/src/microsoftSupportContext.ts delete mode 100644 sdk/support/arm-support/src/models/communicationsMappers.ts delete mode 100644 sdk/support/arm-support/src/models/operationsMappers.ts delete mode 100644 sdk/support/arm-support/src/models/problemClassificationsMappers.ts delete mode 100644 sdk/support/arm-support/src/models/servicesMappers.ts delete mode 100644 sdk/support/arm-support/src/models/supportTicketsMappers.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/communications.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/index.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/operations.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/problemClassifications.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/services.ts create mode 100644 sdk/support/arm-support/src/operationsInterfaces/supportTickets.ts create mode 100644 sdk/support/arm-support/test/sampleTest.ts create mode 100644 sdk/support/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..bedbf9849eb3 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -76,6 +76,7 @@ specifiers: '@rush-temp/arm-storage': file:./projects/arm-storage.tgz '@rush-temp/arm-streamanalytics': file:./projects/arm-streamanalytics.tgz '@rush-temp/arm-subscriptions': file:./projects/arm-subscriptions.tgz + '@rush-temp/arm-support': file:./projects/arm-support.tgz '@rush-temp/arm-templatespecs': file:./projects/arm-templatespecs.tgz '@rush-temp/arm-videoanalyzer': file:./projects/arm-videoanalyzer.tgz '@rush-temp/arm-webpubsub': file:./projects/arm-webpubsub.tgz @@ -257,6 +258,7 @@ dependencies: '@rush-temp/arm-storage': file:projects/arm-storage.tgz '@rush-temp/arm-streamanalytics': file:projects/arm-streamanalytics.tgz '@rush-temp/arm-subscriptions': file:projects/arm-subscriptions.tgz + '@rush-temp/arm-support': file:projects/arm-support.tgz '@rush-temp/arm-templatespecs': file:projects/arm-templatespecs.tgz '@rush-temp/arm-videoanalyzer': file:projects/arm-videoanalyzer.tgz '@rush-temp/arm-webpubsub': file:projects/arm-webpubsub.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 @@ -9381,6 +9383,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-support.tgz: + resolution: {integrity: sha512-BNtQ0kPmpgXPldXvFivoyhy+3J2qlwKm3rCnassrZ0P/X+cYRrxCEB3+Ia7PTi9Q01Gg9zfgv7d56uLCfOY6lw==, tarball: file:projects/arm-support.tgz} + name: '@rush-temp/arm-support' + 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-templatespecs.tgz: resolution: {integrity: sha512-PsUhG3/DdSL17PowykaRCmgY50iuzawFwrM+wyKMoxzhOY/W4saWMWRz+ggnc8OyaAX19fZuTq56vOZrQyb9Qw==, tarball: file:projects/arm-templatespecs.tgz} name: '@rush-temp/arm-templatespecs' @@ -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..6f692e89e11e 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-support", + "projectFolder": "sdk/support/arm-support", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/support/arm-support/CHANGELOG.md b/sdk/support/arm-support/CHANGELOG.md new file mode 100644 index 000000000000..d0becf40af4f --- /dev/null +++ b/sdk/support/arm-support/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-01-05) + +The package of @azure/arm-support is using our next generation design principles since version 2.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/support/arm-support/LICENSE b/sdk/support/arm-support/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/support/arm-support/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +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. \ No newline at end of file diff --git a/sdk/support/arm-support/README.md b/sdk/support/arm-support/README.md index 098fd7677fa1..23a8e52be59f 100644 --- a/sdk/support/arm-support/README.md +++ b/sdk/support/arm-support/README.md @@ -1,99 +1,98 @@ -## Azure MicrosoftSupport SDK for JavaScript +# Azure Service client library for JavaScript -This package contains an isomorphic SDK for MicrosoftSupport. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +Microsoft Azure Support Resource Provider. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/support/arm-support) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-support) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-support) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-support` package -### How to Install +Install the Azure Service client library for JavaScript with `npm`: ```bash npm install @azure/arm-support ``` -### How to use +### Create and authenticate a `MicrosoftSupport` -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" +npm install @azure/identity ``` -##### Sample code - -```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { MicrosoftSupport, MicrosoftSupportModels, MicrosoftSupportMappers } from "@azure/arm-support"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new MicrosoftSupport(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +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 { MicrosoftSupport } = require("@azure/arm-support"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new MicrosoftSupport(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). -```bash -npm install @azure/ms-rest-browserauth -``` +## Key concepts -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-support sample - - - - - - - - +### MicrosoftSupport + +`MicrosoftSupport` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fsupport%2Farm-support%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/support/arm-support/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/support/arm-support/_meta.json b/sdk/support/arm-support/_meta.json new file mode 100644 index 000000000000..17982d61063a --- /dev/null +++ b/sdk/support/arm-support/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "2ab4371edba33c23e8d680ed2bf6f98705b5cadb", + "readme": "specification/support/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/support/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/support/arm-support/api-extractor.json b/sdk/support/arm-support/api-extractor.json new file mode 100644 index 000000000000..a53949664cec --- /dev/null +++ b/sdk/support/arm-support/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-support.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/support/arm-support/package.json b/sdk/support/arm-support/package.json index 275ea5195a21..30aeb6283b17 100644 --- a/sdk/support/arm-support/package.json +++ b/sdk/support/arm-support/package.json @@ -1,57 +1,91 @@ { "name": "@azure/arm-support", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "MicrosoftSupport Library with typescript type definitions for node.js and browser.", - "version": "1.0.0", + "description": "A generated SDK for MicrosoftSupport.", + "version": "2.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.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-support.js", - "module": "./esm/microsoftSupport.js", - "types": "./esm/microsoftSupport.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-support.d.ts", "devDependencies": { - "typescript": "^3.5.3", - "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/support/arm-support", "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-support.js.map'\" -o ./dist/arm-support.min.js ./dist/arm-support.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/support/arm-support/review/arm-support.api.md b/sdk/support/arm-support/review/arm-support.api.md new file mode 100644 index 000000000000..be1293044bb1 --- /dev/null +++ b/sdk/support/arm-support/review/arm-support.api.md @@ -0,0 +1,459 @@ +## API Report File for "@azure/arm-support" + +> 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 interface CheckNameAvailabilityInput { + name: string; + type: Type; +} + +// @public +export interface CheckNameAvailabilityOutput { + readonly message?: string; + readonly nameAvailable?: boolean; + readonly reason?: string; +} + +// @public +export interface CommunicationDetails { + body?: string; + readonly communicationDirection?: CommunicationDirection; + readonly communicationType?: CommunicationType; + readonly createdDate?: Date; + readonly id?: string; + readonly name?: string; + sender?: string; + subject?: string; + readonly type?: string; +} + +// @public +export type CommunicationDirection = string; + +// @public +export interface Communications { + beginCreate(supportTicketName: string, communicationName: string, createCommunicationParameters: CommunicationDetails, options?: CommunicationsCreateOptionalParams): Promise, CommunicationsCreateResponse>>; + beginCreateAndWait(supportTicketName: string, communicationName: string, createCommunicationParameters: CommunicationDetails, options?: CommunicationsCreateOptionalParams): Promise; + checkNameAvailability(supportTicketName: string, checkNameAvailabilityInput: CheckNameAvailabilityInput, options?: CommunicationsCheckNameAvailabilityOptionalParams): Promise; + get(supportTicketName: string, communicationName: string, options?: CommunicationsGetOptionalParams): Promise; + list(supportTicketName: string, options?: CommunicationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CommunicationsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunicationsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput; + +// @public +export interface CommunicationsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CommunicationsCreateResponse = CommunicationDetails; + +// @public +export interface CommunicationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunicationsGetResponse = CommunicationDetails; + +// @public +export interface CommunicationsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type CommunicationsListNextResponse = CommunicationsListResult; + +// @public +export interface CommunicationsListOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type CommunicationsListResponse = CommunicationsListResult; + +// @public +export interface CommunicationsListResult { + nextLink?: string; + value?: CommunicationDetails[]; +} + +// @public +export type CommunicationType = string; + +// @public +export interface ContactProfile { + additionalEmailAddresses?: string[]; + country: string; + firstName: string; + lastName: string; + phoneNumber?: string; + preferredContactMethod: PreferredContactMethod; + preferredSupportLanguage: string; + preferredTimeZone: string; + primaryEmailAddress: string; +} + +// @public +export interface ExceptionResponse { + error?: ServiceError; +} + +// @public +export enum KnownCommunicationDirection { + // (undocumented) + Inbound = "inbound", + // (undocumented) + Outbound = "outbound" +} + +// @public +export enum KnownCommunicationType { + // (undocumented) + Phone = "phone", + // (undocumented) + Web = "web" +} + +// @public +export enum KnownPreferredContactMethod { + // (undocumented) + Email = "email", + // (undocumented) + Phone = "phone" +} + +// @public +export enum KnownSeverityLevel { + // (undocumented) + Critical = "critical", + // (undocumented) + Highestcriticalimpact = "highestcriticalimpact", + // (undocumented) + Minimal = "minimal", + // (undocumented) + Moderate = "moderate" +} + +// @public +export enum KnownStatus { + // (undocumented) + Closed = "closed", + // (undocumented) + Open = "open" +} + +// @public (undocumented) +export class MicrosoftSupport extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftSupportOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + communications: Communications; + // (undocumented) + operations: Operations; + // (undocumented) + problemClassifications: ProblemClassifications; + // (undocumented) + services: Services; + // (undocumented) + subscriptionId: string; + // (undocumented) + supportTickets: SupportTickets; +} + +// @public +export interface MicrosoftSupportOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface Operation { + display?: OperationDisplay; + readonly name?: string; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationsListResult; + +// @public +export interface OperationsListResult { + value?: Operation[]; +} + +// @public +export type PreferredContactMethod = string; + +// @public +export interface ProblemClassification { + displayName?: string; + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ProblemClassifications { + get(serviceName: string, problemClassificationName: string, options?: ProblemClassificationsGetOptionalParams): Promise; + list(serviceName: string, options?: ProblemClassificationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ProblemClassificationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProblemClassificationsGetResponse = ProblemClassification; + +// @public +export interface ProblemClassificationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProblemClassificationsListResponse = ProblemClassificationsListResult; + +// @public +export interface ProblemClassificationsListResult { + value?: ProblemClassification[]; +} + +// @public +export interface QuotaChangeRequest { + payload?: string; + region?: string; +} + +// @public +export interface QuotaTicketDetails { + quotaChangeRequests?: QuotaChangeRequest[]; + quotaChangeRequestSubType?: string; + quotaChangeRequestVersion?: string; +} + +// @public +export interface Service { + displayName?: string; + readonly id?: string; + readonly name?: string; + resourceTypes?: string[]; + readonly type?: string; +} + +// @public +export interface ServiceError { + code?: string; + readonly details?: ServiceErrorDetail[]; + message?: string; + target?: string; +} + +// @public +export interface ServiceErrorDetail { + readonly code?: string; + readonly message?: string; + target?: string; +} + +// @public +export interface ServiceLevelAgreement { + readonly expirationTime?: Date; + readonly slaMinutes?: number; + readonly startTime?: Date; +} + +// @public +export interface Services { + get(serviceName: string, options?: ServicesGetOptionalParams): Promise; + list(options?: ServicesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ServicesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesGetResponse = Service; + +// @public +export interface ServicesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesListResponse = ServicesListResult; + +// @public +export interface ServicesListResult { + value?: Service[]; +} + +// @public +export type SeverityLevel = string; + +// @public +export type Status = string; + +// @public +export interface SupportEngineer { + readonly emailAddress?: string; +} + +// @public +export interface SupportTicketDetails { + contactDetails?: ContactProfile; + readonly createdDate?: Date; + description?: string; + readonly enrollmentId?: string; + readonly id?: string; + readonly modifiedDate?: Date; + readonly name?: string; + readonly problemClassificationDisplayName?: string; + problemClassificationId?: string; + problemStartTime?: Date; + quotaTicketDetails?: QuotaTicketDetails; + require24X7Response?: boolean; + readonly serviceDisplayName?: string; + serviceId?: string; + serviceLevelAgreement?: ServiceLevelAgreement; + severity?: SeverityLevel; + readonly status?: string; + supportEngineer?: SupportEngineer; + readonly supportPlanType?: string; + supportTicketId?: string; + technicalTicketDetails?: TechnicalTicketDetails; + title?: string; + readonly type?: string; +} + +// @public +export interface SupportTickets { + beginCreate(supportTicketName: string, createSupportTicketParameters: SupportTicketDetails, options?: SupportTicketsCreateOptionalParams): Promise, SupportTicketsCreateResponse>>; + beginCreateAndWait(supportTicketName: string, createSupportTicketParameters: SupportTicketDetails, options?: SupportTicketsCreateOptionalParams): Promise; + checkNameAvailability(checkNameAvailabilityInput: CheckNameAvailabilityInput, options?: SupportTicketsCheckNameAvailabilityOptionalParams): Promise; + get(supportTicketName: string, options?: SupportTicketsGetOptionalParams): Promise; + list(options?: SupportTicketsListOptionalParams): PagedAsyncIterableIterator; + update(supportTicketName: string, updateSupportTicket: UpdateSupportTicket, options?: SupportTicketsUpdateOptionalParams): Promise; +} + +// @public +export interface SupportTicketsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SupportTicketsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput; + +// @public +export interface SupportTicketsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SupportTicketsCreateResponse = SupportTicketDetails; + +// @public +export interface SupportTicketsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SupportTicketsGetResponse = SupportTicketDetails; + +// @public +export interface SupportTicketsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type SupportTicketsListNextResponse = SupportTicketsListResult; + +// @public +export interface SupportTicketsListOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type SupportTicketsListResponse = SupportTicketsListResult; + +// @public +export interface SupportTicketsListResult { + nextLink?: string; + value?: SupportTicketDetails[]; +} + +// @public +export interface SupportTicketsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SupportTicketsUpdateResponse = SupportTicketDetails; + +// @public +export interface TechnicalTicketDetails { + resourceId?: string; +} + +// @public +export type Type = "Microsoft.Support/supportTickets" | "Microsoft.Support/communications"; + +// @public +export interface UpdateContactProfile { + additionalEmailAddresses?: string[]; + country?: string; + firstName?: string; + lastName?: string; + phoneNumber?: string; + preferredContactMethod?: PreferredContactMethod; + preferredSupportLanguage?: string; + preferredTimeZone?: string; + primaryEmailAddress?: string; +} + +// @public +export interface UpdateSupportTicket { + contactDetails?: UpdateContactProfile; + severity?: SeverityLevel; + status?: Status; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/support/arm-support/rollup.config.js b/sdk/support/arm-support/rollup.config.js index d1cdb7454709..9be1955eb7f1 100644 --- a/sdk/support/arm-support/rollup.config.js +++ b/sdk/support/arm-support/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/microsoftSupport.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-support.js", - format: "umd", - name: "Azure.ArmSupport", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/support/arm-support/src/index.ts b/sdk/support/arm-support/src/index.ts new file mode 100644 index 000000000000..4338b89000eb --- /dev/null +++ b/sdk/support/arm-support/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { MicrosoftSupport } from "./microsoftSupport"; +export * from "./operationsInterfaces"; diff --git a/sdk/support/arm-support/src/lroImpl.ts b/sdk/support/arm-support/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/support/arm-support/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/support/arm-support/src/microsoftSupport.ts b/sdk/support/arm-support/src/microsoftSupport.ts index 4b52aeb0dd1e..5d87d19647cc 100644 --- a/sdk/support/arm-support/src/microsoftSupport.ts +++ b/sdk/support/arm-support/src/microsoftSupport.ts @@ -1,50 +1,95 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { MicrosoftSupportContext } from "./microsoftSupportContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + ServicesImpl, + ProblemClassificationsImpl, + SupportTicketsImpl, + CommunicationsImpl +} from "./operations"; +import { + Operations, + Services, + ProblemClassifications, + SupportTickets, + Communications +} from "./operationsInterfaces"; +import { MicrosoftSupportOptionalParams } from "./models"; - -class MicrosoftSupport extends MicrosoftSupportContext { - // Operation groups - operations: operations.Operations; - services: operations.Services; - problemClassifications: operations.ProblemClassifications; - supportTickets: operations.SupportTickets; - communications: operations.Communications; +export class MicrosoftSupport extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the MicrosoftSupport class. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Azure subscription Id. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MicrosoftSupportOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.services = new operations.Services(this); - this.problemClassifications = new operations.ProblemClassifications(this); - this.supportTickets = new operations.SupportTickets(this); - this.communications = new operations.Communications(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: MicrosoftSupportOptionalParams + ) { + 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: MicrosoftSupportOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-support/2.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - MicrosoftSupport, - MicrosoftSupportContext, - Models as MicrosoftSupportModels, - Mappers as MicrosoftSupportMappers -}; -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-04-01"; + this.operations = new OperationsImpl(this); + this.services = new ServicesImpl(this); + this.problemClassifications = new ProblemClassificationsImpl(this); + this.supportTickets = new SupportTicketsImpl(this); + this.communications = new CommunicationsImpl(this); + } + + operations: Operations; + services: Services; + problemClassifications: ProblemClassifications; + supportTickets: SupportTickets; + communications: Communications; +} diff --git a/sdk/support/arm-support/src/microsoftSupportContext.ts b/sdk/support/arm-support/src/microsoftSupportContext.ts deleted file mode 100644 index 2ba89d1d59f5..000000000000 --- a/sdk/support/arm-support/src/microsoftSupportContext.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-support"; -const packageVersion = "1.0.0"; - -export class MicrosoftSupportContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the MicrosoftSupport class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId Azure subscription Id. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MicrosoftSupportOptions) { - 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-04-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - 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/support/arm-support/src/models/communicationsMappers.ts b/sdk/support/arm-support/src/models/communicationsMappers.ts deleted file mode 100644 index 1fe4bc2a7c5a..000000000000 --- a/sdk/support/arm-support/src/models/communicationsMappers.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CheckNameAvailabilityInput, - CheckNameAvailabilityOutput, - CommunicationDetails, - CommunicationsListResult, - ContactProfile, - ExceptionResponse, - QuotaChangeRequest, - QuotaTicketDetails, - ServiceError, - ServiceErrorDetail, - ServiceLevelAgreement, - SupportEngineer, - SupportTicketDetails, - TechnicalTicketDetails -} from "../models/mappers"; diff --git a/sdk/support/arm-support/src/models/index.ts b/sdk/support/arm-support/src/models/index.ts index 0a2c2da2c521..b2ab9bb31503 100644 --- a/sdk/support/arm-support/src/models/index.ts +++ b/sdk/support/arm-support/src/models/index.ts @@ -1,1050 +1,653 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +/** The list of operations supported by Microsoft Support resource provider. */ +export interface OperationsListResult { + /** The list of operations supported by Microsoft Support resource provider. */ + value?: Operation[]; +} -/** - * The object that describes the operation. - */ +/** The operation supported by Microsoft Support resource provider. */ +export interface Operation { + /** + * Operation name: {provider}/{resource}/{operation}. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** The object that describes the operation. */ + display?: OperationDisplay; +} + +/** The object that describes the operation. */ export interface OperationDisplay { /** * The description of the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly description?: string; /** * The action that users can perform, based on their permission level. - * **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 operation?: string; /** * Service provider: Microsoft Support. - * **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 provider?: string; /** * Resource on which the operation is performed. - * **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 resource?: string; } -/** - * The operation supported by Microsoft Support resource provider. - */ -export interface Operation { +/** The API error. */ +export interface ExceptionResponse { + /** The API error details. */ + error?: ServiceError; +} + +/** The API error details. */ +export interface ServiceError { + /** The error code. */ + code?: string; + /** The error message. */ + message?: string; + /** The target of the error. */ + target?: string; /** - * Operation name: {provider}/{resource}/{operation}. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly details?: ServiceErrorDetail[]; +} + +/** The error details. */ +export interface ServiceErrorDetail { /** - * The object that describes the operation. + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - display?: OperationDisplay; + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** The target of the error. */ + target?: string; } -/** - * Object that represents a Service resource. - */ +/** Collection of Service resources. */ +export interface ServicesListResult { + /** List of Service resources. */ + value?: Service[]; +} + +/** Object that represents a Service resource. */ export interface Service { /** * Id 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 id?: string; /** * 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; /** * Type of the resource 'Microsoft.Support/services'. - * **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 type?: string; - /** - * Localized name of the Azure service. - */ + /** Localized name of the Azure service. */ displayName?: string; - /** - * ARM Resource types. - */ + /** ARM Resource types. */ resourceTypes?: string[]; } -/** - * ProblemClassification resource object. - */ +/** Collection of ProblemClassification resources. */ +export interface ProblemClassificationsListResult { + /** List of ProblemClassification resources. */ + value?: ProblemClassification[]; +} + +/** ProblemClassification resource object. */ export interface ProblemClassification { /** * Id 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 id?: string; /** * 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; /** * Type of the resource 'Microsoft.Support/problemClassification'. - * **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 type?: string; - /** - * Localized name of problem classification. - */ + /** Localized name of problem classification. */ displayName?: string; } -/** - * Input of CheckNameAvailability API. - */ +/** Input of CheckNameAvailability API. */ export interface CheckNameAvailabilityInput { - /** - * The resource name to validate. - */ + /** The resource name to validate. */ name: string; - /** - * The type of resource. Possible values include: 'Microsoft.Support/supportTickets', - * 'Microsoft.Support/communications' - */ + /** The type of resource. */ type: Type; } -/** - * Output of check name availability API. - */ +/** Output of check name availability API. */ export interface CheckNameAvailabilityOutput { /** * Indicates whether the name is available. - * **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 nameAvailable?: boolean; /** * The reason why the name is not available. - * **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 reason?: string; /** * The detailed error message describing why the name is not available. - * **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; } -/** - * Contact information associated with the support ticket. - */ -export interface ContactProfile { - /** - * First name. - */ - firstName: string; - /** - * Last name. - */ - lastName: string; - /** - * Preferred contact method. Possible values include: 'email', 'phone' - */ - preferredContactMethod: PreferredContactMethod; - /** - * Primary email address. - */ - primaryEmailAddress: string; - /** - * Additional email addresses listed will be copied on any correspondence about the support - * ticket. - */ - additionalEmailAddresses?: string[]; - /** - * Phone number. This is required if preferred contact method is phone. - */ - phoneNumber?: string; - /** - * Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index - * Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). - */ - preferredTimeZone: string; - /** - * Country of the user. This is the ISO 3166-1 alpha-3 code. - */ - country: string; - /** - * Preferred language of support from Azure. Support languages vary based on the severity you - * choose for your support ticket. Learn more at [Azure Severity and - * responsiveness](https://azure.microsoft.com/support/plans/response). Use the standard - * language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' - * for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for - * Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for - * German. - */ - preferredSupportLanguage: string; -} - -/** - * Service Level Agreement details for a support ticket. - */ -export interface ServiceLevelAgreement { - /** - * Time in UTC (ISO 8601 format) when the service level agreement starts. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly startTime?: Date; - /** - * Time in UTC (ISO 8601 format) when the service level agreement expires. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly expirationTime?: Date; - /** - * Service Level Agreement in minutes. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly slaMinutes?: number; -} - -/** - * Support engineer information. - */ -export interface SupportEngineer { - /** - * Email address of the Azure Support engineer assigned to the support ticket. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly emailAddress?: string; -} - -/** - * Additional information for technical support ticket. - */ -export interface TechnicalTicketDetails { - /** - * This is the resource Id of the Azure service resource (For example: A virtual machine resource - * or an HDInsight resource) for which the support ticket is created. - */ - resourceId?: string; -} - -/** - * This property is required for providing the region and new quota limits. - */ -export interface QuotaChangeRequest { - /** - * Region for which the quota increase request is being made. - */ - region?: string; - /** - * Payload of the quota increase request. - */ - payload?: string; -} - -/** - * Additional set of information required for quota increase support ticket for certain quota - * types, e.g.: Virtual machine cores. Get complete details about Quota payload support request - * along with examples at [Support quota request](https://aka.ms/supportrpquotarequestpayload). - */ -export interface QuotaTicketDetails { - /** - * Required for certain quota types when there is a sub type, such as Batch, for which you are - * requesting a quota increase. - */ - quotaChangeRequestSubType?: string; - /** - * Quota change request version. - */ - quotaChangeRequestVersion?: string; - /** - * This property is required for providing the region and new quota limits. - */ - quotaChangeRequests?: QuotaChangeRequest[]; +/** Object that represents a collection of SupportTicket resources. */ +export interface SupportTicketsListResult { + /** List of SupportTicket resources. */ + value?: SupportTicketDetails[]; + /** The URI to fetch the next page of SupportTicket resources. */ + nextLink?: string; } -/** - * Object that represents SupportTicketDetails resource. - */ -export interface SupportTicketDetails extends BaseResource { +/** Object that represents SupportTicketDetails resource. */ +export interface SupportTicketDetails { /** * Id 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 id?: string; /** * 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; /** * Type of the resource 'Microsoft.Support/supportTickets'. - * **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 type?: string; - /** - * System generated support ticket Id that is unique. - */ + /** System generated support ticket Id that is unique. */ supportTicketId?: string; - /** - * Detailed description of the question or issue. - */ - description: string; - /** - * Each Azure service has its own set of issue categories, also known as problem classification. - * This parameter is the unique Id for the type of problem you are experiencing. - */ - problemClassificationId: string; + /** Detailed description of the question or issue. */ + description?: string; + /** Each Azure service has its own set of issue categories, also known as problem classification. This parameter is the unique Id for the type of problem you are experiencing. */ + problemClassificationId?: string; /** * Localized name of problem classification. - * **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 problemClassificationDisplayName?: string; - /** - * A value that indicates the urgency of the case, which in turn determines the response time - * according to the service level agreement of the technical support plan you have with Azure. - * Note: 'Highest critical impact' severity is reserved only for our Premium customers. Possible - * values include: 'minimal', 'moderate', 'critical', 'highestcriticalimpact' - */ - severity: SeverityLevel; + /** A value that indicates the urgency of the case, which in turn determines the response time according to the service level agreement of the technical support plan you have with Azure. Note: 'Highest critical impact', also known as the 'Emergency - Severe impact' level in the Azure portal is reserved only for our Premium customers. */ + severity?: SeverityLevel; /** * Enrollment Id associated with the support ticket. - * **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 enrollmentId?: string; - /** - * Indicates if this requires a 24x7 response from Azure. - */ + /** Indicates if this requires a 24x7 response from Azure. */ require24X7Response?: boolean; - /** - * Contact information of the user requesting to create a support ticket. - */ - contactDetails: ContactProfile; - /** - * Service Level Agreement information for this support ticket. - */ + /** Contact information of the user requesting to create a support ticket. */ + contactDetails?: ContactProfile; + /** Service Level Agreement information for this support ticket. */ serviceLevelAgreement?: ServiceLevelAgreement; - /** - * Information about the support engineer working on this support ticket. - */ + /** Information about the support engineer working on this support ticket. */ supportEngineer?: SupportEngineer; /** * Support plan type associated with the support ticket. - * **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 supportPlanType?: string; - /** - * Title of the support ticket. - */ - title: string; - /** - * Time in UTC (ISO 8601 format) when the problem started. - */ + /** Title of the support ticket. */ + title?: string; + /** Time in UTC (ISO 8601 format) when the problem started. */ problemStartTime?: Date; - /** - * This is the resource Id of the Azure service resource associated with the support ticket. - */ - serviceId: string; + /** This is the resource Id of the Azure service resource associated with the support ticket. */ + serviceId?: string; /** * Localized name of the Azure service. - * **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 serviceDisplayName?: string; /** * Status of the support ticket. - * **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 status?: string; /** * Time in UTC (ISO 8601 format) when the support ticket was created. - * **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 createdDate?: Date; /** * Time in UTC (ISO 8601 format) when the support ticket was last modified. - * **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 modifiedDate?: Date; - /** - * Additional ticket details associated with a technical support ticket request. - */ + /** Additional ticket details associated with a technical support ticket request. */ technicalTicketDetails?: TechnicalTicketDetails; - /** - * Additional ticket details associated with a quota support ticket request. - */ + /** Additional ticket details associated with a quota support ticket request. */ quotaTicketDetails?: QuotaTicketDetails; } -/** - * Object that represents a Communication resource. - */ -export interface CommunicationDetails extends BaseResource { - /** - * Id of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Name of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Type of the resource 'Microsoft.Support/communications'. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * Communication type. Possible values include: 'web', 'phone' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly communicationType?: CommunicationType; - /** - * Direction of communication. Possible values include: 'inbound', 'outbound' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly communicationDirection?: CommunicationDirection; - /** - * Email address of the sender. This property is required if called by a service principal. - */ - sender?: string; - /** - * Subject of the communication. - */ - subject: string; - /** - * Body of the communication. - */ - body: string; - /** - * Time in UTC (ISO 8601 format) when the communication was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly createdDate?: Date; +/** Contact information associated with the support ticket. */ +export interface ContactProfile { + /** First name. */ + firstName: string; + /** Last name. */ + lastName: string; + /** Preferred contact method. */ + preferredContactMethod: PreferredContactMethod; + /** Primary email address. */ + primaryEmailAddress: string; + /** Additional email addresses listed will be copied on any correspondence about the support ticket. */ + additionalEmailAddresses?: string[]; + /** Phone number. This is required if preferred contact method is phone. */ + phoneNumber?: string; + /** Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). */ + preferredTimeZone: string; + /** Country of the user. This is the ISO 3166-1 alpha-3 code. */ + country: string; + /** Preferred language of support from Azure. Support languages vary based on the severity you choose for your support ticket. Learn more at [Azure Severity and responsiveness](https://azure.microsoft.com/support/plans/response). Use the standard language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for German. */ + preferredSupportLanguage: string; } -/** - * The error details. - */ -export interface ServiceErrorDetail { +/** Service Level Agreement details for a support ticket. */ +export interface ServiceLevelAgreement { /** - * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Time in UTC (ISO 8601 format) when the service level agreement starts. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly startTime?: Date; /** - * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Time in UTC (ISO 8601 format) when the service level agreement expires. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly expirationTime?: Date; /** - * The target of the error. + * Service Level Agreement in minutes. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - target?: string; + readonly slaMinutes?: number; } -/** - * The API error details. - */ -export interface ServiceError { - /** - * The error code. - */ - code?: string; - /** - * The error message. - */ - message?: string; - /** - * The target of the error. - */ - target?: string; +/** Support engineer information. */ +export interface SupportEngineer { /** - * The list of error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Email address of the Azure Support engineer assigned to the support ticket. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ServiceErrorDetail[]; + readonly emailAddress?: string; } -/** - * The API error. - */ -export interface ExceptionResponse { - /** - * The API error details. - */ - error?: ServiceError; +/** Additional information for technical support ticket. */ +export interface TechnicalTicketDetails { + /** This is the resource Id of the Azure service resource (For example: A virtual machine resource or an HDInsight resource) for which the support ticket is created. */ + resourceId?: string; } -/** - * Contact information associated with the support ticket. - */ +/** Additional set of information required for quota increase support ticket for certain quota types, e.g.: Virtual machine cores. Get complete details about Quota payload support request along with examples at [Support quota request](https://aka.ms/supportrpquotarequestpayload). */ +export interface QuotaTicketDetails { + /** Required for certain quota types when there is a sub type, such as Batch, for which you are requesting a quota increase. */ + quotaChangeRequestSubType?: string; + /** Quota change request version. */ + quotaChangeRequestVersion?: string; + /** This property is required for providing the region and new quota limits. */ + quotaChangeRequests?: QuotaChangeRequest[]; +} + +/** This property is required for providing the region and new quota limits. */ +export interface QuotaChangeRequest { + /** Region for which the quota increase request is being made. */ + region?: string; + /** Payload of the quota increase request. */ + payload?: string; +} + +/** Updates severity, ticket status, and contact details in the support ticket. */ +export interface UpdateSupportTicket { + /** Severity level. */ + severity?: SeverityLevel; + /** Status to be updated on the ticket. */ + status?: Status; + /** Contact details to be updated on the support ticket. */ + contactDetails?: UpdateContactProfile; +} + +/** Contact information associated with the support ticket. */ export interface UpdateContactProfile { - /** - * First name. - */ + /** First name. */ firstName?: string; - /** - * Last name. - */ + /** Last name. */ lastName?: string; - /** - * Preferred contact method. Possible values include: 'email', 'phone' - */ + /** Preferred contact method. */ preferredContactMethod?: PreferredContactMethod; - /** - * Primary email address. - */ + /** Primary email address. */ primaryEmailAddress?: string; - /** - * Email addresses listed will be copied on any correspondence about the support ticket. - */ + /** Email addresses listed will be copied on any correspondence about the support ticket. */ additionalEmailAddresses?: string[]; - /** - * Phone number. This is required if preferred contact method is phone. - */ + /** Phone number. This is required if preferred contact method is phone. */ phoneNumber?: string; - /** - * Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index - * Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). - */ + /** Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). */ preferredTimeZone?: string; - /** - * Country of the user. This is the ISO 3166-1 alpha-3 code. - */ + /** Country of the user. This is the ISO 3166-1 alpha-3 code. */ country?: string; - /** - * Preferred language of support from Azure. Support languages vary based on the severity you - * choose for your support ticket. Learn more at [Azure Severity and - * responsiveness](https://azure.microsoft.com/support/plans/response/). Use the standard - * language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' - * for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for - * Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for - * German. - */ + /** Preferred language of support from Azure. Support languages vary based on the severity you choose for your support ticket. Learn more at [Azure Severity and responsiveness](https://azure.microsoft.com/support/plans/response/). Use the standard language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for German. */ preferredSupportLanguage?: string; } -/** - * Updates severity, ticket status, and contact details in the support ticket. - */ -export interface UpdateSupportTicket { - /** - * Severity level. Possible values include: 'minimal', 'moderate', 'critical', - * 'highestcriticalimpact' - */ - severity?: SeverityLevel; +/** Collection of Communication resources. */ +export interface CommunicationsListResult { + /** List of Communication resources. */ + value?: CommunicationDetails[]; + /** The URI to fetch the next page of Communication resources. */ + nextLink?: string; +} + +/** Object that represents a Communication resource. */ +export interface CommunicationDetails { /** - * Status to be updated on the ticket. Possible values include: 'open', 'closed' + * Id of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status?: Status; + readonly id?: string; /** - * Contact details to be updated on the support ticket. + * Name of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - contactDetails?: UpdateContactProfile; -} - -/** - * Optional Parameters. - */ -export interface SupportTicketsListOptionalParams extends msRest.RequestOptionsBase { + readonly name?: string; /** - * The number of values to return in the collection. Default is 25 and max is 100. + * Type of the resource 'Microsoft.Support/communications'. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly type?: string; /** - * The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn - * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_ filter can - * only be used with Equals ('eq') operator. For _CreatedDate_ filter, the supported operators - * are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine - * them using the logical 'AND'. + * Communication type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface CommunicationsListOptionalParams extends msRest.RequestOptionsBase { + readonly communicationType?: CommunicationType; /** - * The number of values to return in the collection. Default is 10 and max is 10. + * Direction of communication. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly communicationDirection?: CommunicationDirection; + /** Email address of the sender. This property is required if called by a service principal. */ + sender?: string; + /** Subject of the communication. */ + subject?: string; + /** Body of the communication. */ + body?: string; /** - * The filter to apply on the operation. You can filter by communicationType and createdDate - * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater - * Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType - * and CreatedDate filters by Logical And ('and') operator. + * Time in UTC (ISO 8601 format) when the communication was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - filter?: string; + readonly createdDate?: Date; } -/** - * An interface representing MicrosoftSupportOptions. - */ -export interface MicrosoftSupportOptions extends AzureServiceClientOptions { - baseUri?: string; +/** Known values of {@link SeverityLevel} that the service accepts. */ +export enum KnownSeverityLevel { + Minimal = "minimal", + Moderate = "moderate", + Critical = "critical", + Highestcriticalimpact = "highestcriticalimpact" } /** - * @interface - * The list of operations supported by Microsoft Support resource provider. - * @extends Array + * Defines values for SeverityLevel. \ + * {@link KnownSeverityLevel} can be used interchangeably with SeverityLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **minimal** \ + * **moderate** \ + * **critical** \ + * **highestcriticalimpact** */ -export interface OperationsListResult extends Array { -} +export type SeverityLevel = string; -/** - * @interface - * Collection of Service resources. - * @extends Array - */ -export interface ServicesListResult extends Array { +/** Known values of {@link PreferredContactMethod} that the service accepts. */ +export enum KnownPreferredContactMethod { + Email = "email", + Phone = "phone" } /** - * @interface - * Collection of ProblemClassification resources. - * @extends Array + * Defines values for PreferredContactMethod. \ + * {@link KnownPreferredContactMethod} can be used interchangeably with PreferredContactMethod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **email** \ + * **phone** */ -export interface ProblemClassificationsListResult extends Array { +export type PreferredContactMethod = string; + +/** Known values of {@link Status} that the service accepts. */ +export enum KnownStatus { + Open = "open", + Closed = "closed" } /** - * @interface - * Object that represents a collection of SupportTicket resources. - * @extends Array + * Defines values for Status. \ + * {@link KnownStatus} can be used interchangeably with Status, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **open** \ + * **closed** */ -export interface SupportTicketsListResult extends Array { - /** - * The URI to fetch the next page of SupportTicket resources. - */ - nextLink?: string; +export type Status = string; + +/** Known values of {@link CommunicationType} that the service accepts. */ +export enum KnownCommunicationType { + Web = "web", + Phone = "phone" } /** - * @interface - * Collection of Communication resources. - * @extends Array + * Defines values for CommunicationType. \ + * {@link KnownCommunicationType} can be used interchangeably with CommunicationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **web** \ + * **phone** */ -export interface CommunicationsListResult extends Array { - /** - * The URI to fetch the next page of Communication resources. - */ - nextLink?: string; +export type CommunicationType = string; + +/** Known values of {@link CommunicationDirection} that the service accepts. */ +export enum KnownCommunicationDirection { + Inbound = "inbound", + Outbound = "outbound" } /** - * Defines values for Type. - * Possible values include: 'Microsoft.Support/supportTickets', 'Microsoft.Support/communications' - * @readonly - * @enum {string} + * Defines values for CommunicationDirection. \ + * {@link KnownCommunicationDirection} can be used interchangeably with CommunicationDirection, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **inbound** \ + * **outbound** */ -export type Type = 'Microsoft.Support/supportTickets' | 'Microsoft.Support/communications'; +export type CommunicationDirection = string; +/** Defines values for Type. */ +export type Type = + | "Microsoft.Support/supportTickets" + | "Microsoft.Support/communications"; -/** - * Defines values for SeverityLevel. - * Possible values include: 'minimal', 'moderate', 'critical', 'highestcriticalimpact' - * @readonly - * @enum {string} - */ -export type SeverityLevel = 'minimal' | 'moderate' | 'critical' | 'highestcriticalimpact'; +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for PreferredContactMethod. - * Possible values include: 'email', 'phone' - * @readonly - * @enum {string} - */ -export type PreferredContactMethod = 'email' | 'phone'; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationsListResult; -/** - * Defines values for CommunicationType. - * Possible values include: 'web', 'phone' - * @readonly - * @enum {string} - */ -export type CommunicationType = 'web' | 'phone'; +/** Optional parameters. */ +export interface ServicesListOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for CommunicationDirection. - * Possible values include: 'inbound', 'outbound' - * @readonly - * @enum {string} - */ -export type CommunicationDirection = 'inbound' | 'outbound'; +/** Contains response data for the list operation. */ +export type ServicesListResponse = ServicesListResult; -/** - * Defines values for Status. - * Possible values include: 'open', 'closed' - * @readonly - * @enum {string} - */ -export type Status = 'open' | 'closed'; +/** Optional parameters. */ +export interface ServicesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationsListResult & { - /** - * 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: OperationsListResult; - }; -}; +/** Contains response data for the get operation. */ +export type ServicesGetResponse = Service; -/** - * Contains response data for the list operation. - */ -export type ServicesListResponse = ServicesListResult & { - /** - * 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: ServicesListResult; - }; -}; +/** Optional parameters. */ +export interface ProblemClassificationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ServicesGetResponse = Service & { - /** - * 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: Service; - }; -}; +/** Contains response data for the list operation. */ +export type ProblemClassificationsListResponse = ProblemClassificationsListResult; -/** - * Contains response data for the list operation. - */ -export type ProblemClassificationsListResponse = ProblemClassificationsListResult & { - /** - * 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: ProblemClassificationsListResult; - }; -}; +/** Optional parameters. */ +export interface ProblemClassificationsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ProblemClassificationsGetResponse = ProblemClassification & { - /** - * 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: ProblemClassification; - }; -}; +/** Contains response data for the get operation. */ +export type ProblemClassificationsGetResponse = ProblemClassification; -/** - * Contains response data for the checkNameAvailability operation. - */ -export type SupportTicketsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput & { - /** - * 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: CheckNameAvailabilityOutput; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type SupportTicketsListResponse = SupportTicketsListResult & { - /** - * 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: SupportTicketsListResult; - }; -}; +/** Contains response data for the checkNameAvailability operation. */ +export type SupportTicketsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput; -/** - * Contains response data for the get operation. - */ -export type SupportTicketsGetResponse = SupportTicketDetails & { - /** - * 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: SupportTicketDetails; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsListOptionalParams + extends coreClient.OperationOptions { + /** The number of values to return in the collection. Default is 25 and max is 100. */ + top?: number; + /** The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_ filter can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine them using the logical 'AND'. */ + filter?: string; +} -/** - * Contains response data for the update operation. - */ -export type SupportTicketsUpdateResponse = SupportTicketDetails & { - /** - * 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: SupportTicketDetails; - }; -}; +/** Contains response data for the list operation. */ +export type SupportTicketsListResponse = SupportTicketsListResult; -/** - * Contains response data for the create operation. - */ -export type SupportTicketsCreateResponse = SupportTicketDetails & { - /** - * 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: SupportTicketDetails; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreate operation. - */ -export type SupportTicketsBeginCreateResponse = SupportTicketDetails & { - /** - * 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: SupportTicketDetails; - }; -}; +/** Contains response data for the get operation. */ +export type SupportTicketsGetResponse = SupportTicketDetails; -/** - * Contains response data for the listNext operation. - */ -export type SupportTicketsListNextResponse = SupportTicketsListResult & { - /** - * 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: SupportTicketsListResult; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the checkNameAvailability operation. - */ -export type CommunicationsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput & { - /** - * 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: CheckNameAvailabilityOutput; - }; -}; +/** Contains response data for the update operation. */ +export type SupportTicketsUpdateResponse = SupportTicketDetails; -/** - * Contains response data for the list operation. - */ -export type CommunicationsListResponse = CommunicationsListResult & { - /** - * 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: CommunicationsListResult; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the get operation. - */ -export type CommunicationsGetResponse = CommunicationDetails & { - /** - * 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: CommunicationDetails; - }; -}; +/** Contains response data for the create operation. */ +export type SupportTicketsCreateResponse = SupportTicketDetails; -/** - * Contains response data for the create operation. - */ -export type CommunicationsCreateResponse = CommunicationDetails & { - /** - * 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: CommunicationDetails; - }; -}; +/** Optional parameters. */ +export interface SupportTicketsListNextOptionalParams + extends coreClient.OperationOptions { + /** The number of values to return in the collection. Default is 25 and max is 100. */ + top?: number; + /** The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_ filter can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine them using the logical 'AND'. */ + filter?: string; +} -/** - * Contains response data for the beginCreate operation. - */ -export type CommunicationsBeginCreateResponse = CommunicationDetails & { - /** - * 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: CommunicationDetails; - }; -}; +/** Contains response data for the listNext operation. */ +export type SupportTicketsListNextResponse = SupportTicketsListResult; -/** - * Contains response data for the listNext operation. - */ -export type CommunicationsListNextResponse = CommunicationsListResult & { - /** - * 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: CommunicationsListResult; - }; -}; +/** Optional parameters. */ +export interface CommunicationsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type CommunicationsCheckNameAvailabilityResponse = CheckNameAvailabilityOutput; + +/** Optional parameters. */ +export interface CommunicationsListOptionalParams + extends coreClient.OperationOptions { + /** The number of values to return in the collection. Default is 10 and max is 10. */ + top?: number; + /** The filter to apply on the operation. You can filter by communicationType and createdDate properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator. */ + filter?: string; +} + +/** Contains response data for the list operation. */ +export type CommunicationsListResponse = CommunicationsListResult; + +/** Optional parameters. */ +export interface CommunicationsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CommunicationsGetResponse = CommunicationDetails; + +/** Optional parameters. */ +export interface CommunicationsCreateOptionalParams + 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 create operation. */ +export type CommunicationsCreateResponse = CommunicationDetails; + +/** Optional parameters. */ +export interface CommunicationsListNextOptionalParams + extends coreClient.OperationOptions { + /** The number of values to return in the collection. Default is 10 and max is 10. */ + top?: number; + /** The filter to apply on the operation. You can filter by communicationType and createdDate properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator. */ + filter?: string; +} + +/** Contains response data for the listNext operation. */ +export type CommunicationsListNextResponse = CommunicationsListResult; + +/** Optional parameters. */ +export interface MicrosoftSupportOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/support/arm-support/src/models/mappers.ts b/sdk/support/arm-support/src/models/mappers.ts index 548fdd7e7103..e9261af013d9 100644 --- a/sdk/support/arm-support/src/models/mappers.ts +++ b/sdk/support/arm-support/src/models/mappers.ts @@ -1,47 +1,86 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; +export const OperationsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", className: "OperationDisplay", modelProperties: { description: { - readOnly: true, serializedName: "description", + readOnly: true, type: { name: "String" } }, operation: { - readOnly: true, serializedName: "operation", + readOnly: true, type: { name: "String" } }, provider: { - readOnly: true, serializedName: "provider", + readOnly: true, type: { name: "String" } }, resource: { - readOnly: true, serializedName: "resource", + readOnly: true, type: { name: "String" } @@ -50,53 +89,134 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const ExceptionResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "ExceptionResponse", modelProperties: { - name: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ServiceError" + } + } + } + } +}; + +export const ServiceError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServiceErrorDetail" + } + } + } + } + } + } +}; + +export const ServiceErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceErrorDetail", + modelProperties: { + code: { + serializedName: "code", readOnly: true, - serializedName: "name", type: { name: "String" } }, - display: { - serializedName: "display", + message: { + serializedName: "message", + readOnly: true, type: { - name: "Composite", - className: "OperationDisplay" + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + } + } + } +}; + +export const ServicesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServicesListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Service" + } + } } } } } }; -export const Service: msRest.CompositeMapper = { - serializedName: "Service", +export const Service: coreClient.CompositeMapper = { type: { name: "Composite", className: "Service", 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", + readOnly: true, type: { name: "String" } @@ -122,29 +242,49 @@ export const Service: msRest.CompositeMapper = { } }; -export const ProblemClassification: msRest.CompositeMapper = { - serializedName: "ProblemClassification", +export const ProblemClassificationsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProblemClassificationsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProblemClassification" + } + } + } + } + } + } +}; + +export const ProblemClassification: coreClient.CompositeMapper = { type: { name: "Composite", className: "ProblemClassification", 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", + readOnly: true, type: { name: "String" } @@ -159,22 +299,21 @@ export const ProblemClassification: msRest.CompositeMapper = { } }; -export const CheckNameAvailabilityInput: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityInput", +export const CheckNameAvailabilityInput: coreClient.CompositeMapper = { type: { name: "Composite", className: "CheckNameAvailabilityInput", modelProperties: { name: { - required: true, serializedName: "name", + required: true, type: { name: "String" } }, type: { - required: true, serializedName: "type", + required: true, type: { name: "Enum", allowedValues: [ @@ -187,29 +326,28 @@ export const CheckNameAvailabilityInput: msRest.CompositeMapper = { } }; -export const CheckNameAvailabilityOutput: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityOutput", +export const CheckNameAvailabilityOutput: coreClient.CompositeMapper = { type: { name: "Composite", className: "CheckNameAvailabilityOutput", modelProperties: { nameAvailable: { - readOnly: true, serializedName: "nameAvailable", + readOnly: true, type: { name: "Boolean" } }, reason: { - readOnly: true, serializedName: "reason", + readOnly: true, type: { name: "String" } }, message: { - readOnly: true, serializedName: "message", + readOnly: true, type: { name: "String" } @@ -218,266 +356,93 @@ export const CheckNameAvailabilityOutput: msRest.CompositeMapper = { } }; -export const ContactProfile: msRest.CompositeMapper = { - serializedName: "ContactProfile", +export const SupportTicketsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ContactProfile", + className: "SupportTicketsListResult", modelProperties: { - firstName: { - required: true, - serializedName: "firstName", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SupportTicketDetails" + } + } } }, - lastName: { - required: true, - serializedName: "lastName", + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - preferredContactMethod: { - required: true, - serializedName: "preferredContactMethod", + } + } + } +}; + +export const SupportTicketDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SupportTicketDetails", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - primaryEmailAddress: { - required: true, - serializedName: "primaryEmailAddress", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - additionalEmailAddresses: { - serializedName: "additionalEmailAddresses", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - phoneNumber: { - serializedName: "phoneNumber", + supportTicketId: { + serializedName: "properties.supportTicketId", type: { name: "String" } }, - preferredTimeZone: { - required: true, - serializedName: "preferredTimeZone", + description: { + serializedName: "properties.description", type: { name: "String" } }, - country: { - required: true, - serializedName: "country", + problemClassificationId: { + serializedName: "properties.problemClassificationId", type: { name: "String" } }, - preferredSupportLanguage: { - required: true, - serializedName: "preferredSupportLanguage", - type: { - name: "String" - } - } - } - } -}; - -export const ServiceLevelAgreement: msRest.CompositeMapper = { - serializedName: "ServiceLevelAgreement", - type: { - name: "Composite", - className: "ServiceLevelAgreement", - modelProperties: { - startTime: { - readOnly: true, - serializedName: "startTime", - type: { - name: "DateTime" - } - }, - expirationTime: { - readOnly: true, - serializedName: "expirationTime", - type: { - name: "DateTime" - } - }, - slaMinutes: { - readOnly: true, - serializedName: "slaMinutes", - type: { - name: "Number" - } - } - } - } -}; - -export const SupportEngineer: msRest.CompositeMapper = { - serializedName: "SupportEngineer", - type: { - name: "Composite", - className: "SupportEngineer", - modelProperties: { - emailAddress: { - readOnly: true, - serializedName: "emailAddress", - type: { - name: "String" - } - } - } - } -}; - -export const TechnicalTicketDetails: msRest.CompositeMapper = { - serializedName: "TechnicalTicketDetails", - type: { - name: "Composite", - className: "TechnicalTicketDetails", - modelProperties: { - resourceId: { - serializedName: "resourceId", - type: { - name: "String" - } - } - } - } -}; - -export const QuotaChangeRequest: msRest.CompositeMapper = { - serializedName: "QuotaChangeRequest", - type: { - name: "Composite", - className: "QuotaChangeRequest", - modelProperties: { - region: { - serializedName: "region", - type: { - name: "String" - } - }, - payload: { - serializedName: "payload", - type: { - name: "String" - } - } - } - } -}; - -export const QuotaTicketDetails: msRest.CompositeMapper = { - serializedName: "QuotaTicketDetails", - type: { - name: "Composite", - className: "QuotaTicketDetails", - modelProperties: { - quotaChangeRequestSubType: { - serializedName: "quotaChangeRequestSubType", - type: { - name: "String" - } - }, - quotaChangeRequestVersion: { - serializedName: "quotaChangeRequestVersion", - type: { - name: "String" - } - }, - quotaChangeRequests: { - serializedName: "quotaChangeRequests", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "QuotaChangeRequest" - } - } - } - } - } - } -}; - -export const SupportTicketDetails: msRest.CompositeMapper = { - serializedName: "SupportTicketDetails", - type: { - name: "Composite", - className: "SupportTicketDetails", - 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" - } - }, - supportTicketId: { - serializedName: "properties.supportTicketId", - type: { - name: "String" - } - }, - description: { - required: true, - serializedName: "properties.description", - type: { - name: "String" - } - }, - problemClassificationId: { - required: true, - serializedName: "properties.problemClassificationId", - type: { - name: "String" - } - }, - problemClassificationDisplayName: { - readOnly: true, - serializedName: "properties.problemClassificationDisplayName", + problemClassificationDisplayName: { + serializedName: "properties.problemClassificationDisplayName", + readOnly: true, type: { name: "String" } }, severity: { - required: true, serializedName: "properties.severity", type: { name: "String" } }, enrollmentId: { - readOnly: true, serializedName: "properties.enrollmentId", + readOnly: true, type: { name: "String" } @@ -489,7 +454,6 @@ export const SupportTicketDetails: msRest.CompositeMapper = { } }, contactDetails: { - required: true, serializedName: "properties.contactDetails", type: { name: "Composite", @@ -511,14 +475,13 @@ export const SupportTicketDetails: msRest.CompositeMapper = { } }, supportPlanType: { - readOnly: true, serializedName: "properties.supportPlanType", + readOnly: true, type: { name: "String" } }, title: { - required: true, serializedName: "properties.title", type: { name: "String" @@ -531,36 +494,35 @@ export const SupportTicketDetails: msRest.CompositeMapper = { } }, serviceId: { - required: true, serializedName: "properties.serviceId", type: { name: "String" } }, serviceDisplayName: { - readOnly: true, serializedName: "properties.serviceDisplayName", + readOnly: true, type: { name: "String" } }, status: { - readOnly: true, serializedName: "properties.status", + readOnly: true, type: { name: "String" } }, createdDate: { - readOnly: true, serializedName: "properties.createdDate", + readOnly: true, type: { name: "DateTime" } }, modifiedDate: { - readOnly: true, serializedName: "properties.modifiedDate", + readOnly: true, type: { name: "DateTime" } @@ -583,100 +545,119 @@ export const SupportTicketDetails: msRest.CompositeMapper = { } }; -export const CommunicationDetails: msRest.CompositeMapper = { - serializedName: "CommunicationDetails", +export const ContactProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CommunicationDetails", + className: "ContactProfile", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + firstName: { + serializedName: "firstName", + required: true, type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + lastName: { + serializedName: "lastName", + required: true, type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + preferredContactMethod: { + serializedName: "preferredContactMethod", + required: true, type: { name: "String" } }, - communicationType: { - readOnly: true, - serializedName: "properties.communicationType", + primaryEmailAddress: { + serializedName: "primaryEmailAddress", + required: true, type: { name: "String" } }, - communicationDirection: { - readOnly: true, - serializedName: "properties.communicationDirection", + additionalEmailAddresses: { + serializedName: "additionalEmailAddresses", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - sender: { - serializedName: "properties.sender", + phoneNumber: { + serializedName: "phoneNumber", type: { name: "String" } }, - subject: { + preferredTimeZone: { + serializedName: "preferredTimeZone", required: true, - serializedName: "properties.subject", type: { name: "String" } }, - body: { + country: { + serializedName: "country", required: true, - serializedName: "properties.body", type: { name: "String" } }, - createdDate: { - readOnly: true, - serializedName: "properties.createdDate", + preferredSupportLanguage: { + serializedName: "preferredSupportLanguage", + required: true, type: { - name: "DateTime" + name: "String" } } } } }; -export const ServiceErrorDetail: msRest.CompositeMapper = { - serializedName: "ServiceErrorDetail", +export const ServiceLevelAgreement: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceErrorDetail", + className: "ServiceLevelAgreement", modelProperties: { - code: { + startTime: { + serializedName: "startTime", readOnly: true, - serializedName: "code", type: { - name: "String" + name: "DateTime" } }, - message: { + expirationTime: { + serializedName: "expirationTime", readOnly: true, - serializedName: "message", type: { - name: "String" + name: "DateTime" } }, - target: { - serializedName: "target", + slaMinutes: { + serializedName: "slaMinutes", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const SupportEngineer: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SupportEngineer", + modelProperties: { + emailAddress: { + serializedName: "emailAddress", + readOnly: true, type: { name: "String" } @@ -685,39 +666,46 @@ export const ServiceErrorDetail: msRest.CompositeMapper = { } }; -export const ServiceError: msRest.CompositeMapper = { - serializedName: "ServiceError", +export const TechnicalTicketDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceError", + className: "TechnicalTicketDetails", modelProperties: { - code: { - serializedName: "code", + resourceId: { + serializedName: "resourceId", type: { name: "String" } - }, - message: { - serializedName: "message", + } + } + } +}; + +export const QuotaTicketDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QuotaTicketDetails", + modelProperties: { + quotaChangeRequestSubType: { + serializedName: "quotaChangeRequestSubType", type: { name: "String" } }, - target: { - serializedName: "target", + quotaChangeRequestVersion: { + serializedName: "quotaChangeRequestVersion", type: { name: "String" } }, - details: { - readOnly: true, - serializedName: "details", + quotaChangeRequests: { + serializedName: "quotaChangeRequests", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ServiceErrorDetail" + className: "QuotaChangeRequest" } } } @@ -726,25 +714,56 @@ export const ServiceError: msRest.CompositeMapper = { } }; -export const ExceptionResponse: msRest.CompositeMapper = { - serializedName: "ExceptionResponse", +export const QuotaChangeRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExceptionResponse", + className: "QuotaChangeRequest", modelProperties: { - error: { - serializedName: "error", + region: { + serializedName: "region", + type: { + name: "String" + } + }, + payload: { + serializedName: "payload", + type: { + name: "String" + } + } + } + } +}; + +export const UpdateSupportTicket: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UpdateSupportTicket", + modelProperties: { + severity: { + serializedName: "severity", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + contactDetails: { + serializedName: "contactDetails", type: { name: "Composite", - className: "ServiceError" + className: "UpdateContactProfile" } } } } }; -export const UpdateContactProfile: msRest.CompositeMapper = { - serializedName: "UpdateContactProfile", +export const UpdateContactProfile: coreClient.CompositeMapper = { type: { name: "Composite", className: "UpdateContactProfile", @@ -812,152 +831,97 @@ export const UpdateContactProfile: msRest.CompositeMapper = { } }; -export const UpdateSupportTicket: msRest.CompositeMapper = { - serializedName: "UpdateSupportTicket", - type: { - name: "Composite", - className: "UpdateSupportTicket", - modelProperties: { - severity: { - serializedName: "severity", - type: { - name: "String" - } - }, - status: { - serializedName: "status", - type: { - name: "String" - } - }, - contactDetails: { - serializedName: "contactDetails", - type: { - name: "Composite", - className: "UpdateContactProfile" - } - } - } - } -}; - -export const OperationsListResult: msRest.CompositeMapper = { - serializedName: "OperationsListResult", +export const CommunicationsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationsListResult", + className: "CommunicationsListResult", modelProperties: { value: { - serializedName: "", + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Operation" + className: "CommunicationDetails" } } } - } - } - } -}; - -export const ServicesListResult: msRest.CompositeMapper = { - serializedName: "ServicesListResult", - type: { - name: "Composite", - className: "ServicesListResult", - modelProperties: { - value: { - serializedName: "", + }, + nextLink: { + serializedName: "nextLink", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Service" - } - } + name: "String" } } } } }; -export const ProblemClassificationsListResult: msRest.CompositeMapper = { - serializedName: "ProblemClassificationsListResult", +export const CommunicationDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProblemClassificationsListResult", + className: "CommunicationDetails", modelProperties: { - value: { - serializedName: "", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProblemClassification" - } - } + name: "String" } - } - } - } -}; - -export const SupportTicketsListResult: msRest.CompositeMapper = { - serializedName: "SupportTicketsListResult", - type: { - name: "Composite", - className: "SupportTicketsListResult", - modelProperties: { - value: { - serializedName: "", + }, + name: { + serializedName: "name", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SupportTicketDetails" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const CommunicationsListResult: msRest.CompositeMapper = { - serializedName: "CommunicationsListResult", - type: { - name: "Composite", - className: "CommunicationsListResult", - modelProperties: { - value: { - serializedName: "", + }, + communicationType: { + serializedName: "properties.communicationType", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CommunicationDetails" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + communicationDirection: { + serializedName: "properties.communicationDirection", + readOnly: true, + type: { + name: "String" + } + }, + sender: { + serializedName: "properties.sender", + type: { + name: "String" + } + }, + subject: { + serializedName: "properties.subject", + type: { + name: "String" + } + }, + body: { + serializedName: "properties.body", type: { name: "String" } + }, + createdDate: { + serializedName: "properties.createdDate", + readOnly: true, + type: { + name: "DateTime" + } } } } diff --git a/sdk/support/arm-support/src/models/operationsMappers.ts b/sdk/support/arm-support/src/models/operationsMappers.ts deleted file mode 100644 index b6e72b14c6ce..000000000000 --- a/sdk/support/arm-support/src/models/operationsMappers.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ExceptionResponse, - Operation, - OperationDisplay, - OperationsListResult, - ServiceError, - ServiceErrorDetail -} from "../models/mappers"; diff --git a/sdk/support/arm-support/src/models/parameters.ts b/sdk/support/arm-support/src/models/parameters.ts index aafb28438615..c5116f0ed029 100644 --- a/sdk/support/arm-support/src/models/parameters.ts +++ b/sdk/support/arm-support/src/models/parameters.ts @@ -1,117 +1,174 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + CheckNameAvailabilityInput as CheckNameAvailabilityInputMapper, + UpdateSupportTicket as UpdateSupportTicketMapper, + SupportTicketDetails as SupportTicketDetailsMapper, + CommunicationDetails as CommunicationDetailsMapper +} 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, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2020-04-01", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const communicationName: msRest.OperationURLParameter = { - parameterPath: "communicationName", + +export const serviceName: OperationURLParameter = { + parameterPath: "serviceName", mapper: { + serializedName: "serviceName", required: true, - serializedName: "communicationName", type: { name: "String" } } }; -export const filter: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "filter" - ], + +export const problemClassificationName: OperationURLParameter = { + parameterPath: "problemClassificationName", mapper: { - serializedName: "$filter", + serializedName: "problemClassificationName", + required: true, type: { name: "String" } } }; -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 problemClassificationName: msRest.OperationURLParameter = { - parameterPath: "problemClassificationName", + +export const checkNameAvailabilityInput: OperationParameter = { + parameterPath: "checkNameAvailabilityInput", + mapper: CheckNameAvailabilityInputMapper +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "problemClassificationName", type: { name: "String" } } }; -export const serviceName: msRest.OperationURLParameter = { - parameterPath: "serviceName", + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], mapper: { - required: true, - serializedName: "serviceName", + serializedName: "$top", type: { - name: "String" + name: "Number" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], mapper: { - required: true, - serializedName: "subscriptionId", + serializedName: "$filter", type: { name: "String" } } }; -export const supportTicketName: msRest.OperationURLParameter = { + +export const supportTicketName: OperationURLParameter = { parameterPath: "supportTicketName", mapper: { - required: true, serializedName: "supportTicketName", + required: true, type: { name: "String" } } }; -export const top: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "top" - ], + +export const updateSupportTicket: OperationParameter = { + parameterPath: "updateSupportTicket", + mapper: UpdateSupportTicketMapper +}; + +export const createSupportTicketParameters: OperationParameter = { + parameterPath: "createSupportTicketParameters", + mapper: SupportTicketDetailsMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const communicationName: OperationURLParameter = { + parameterPath: "communicationName", mapper: { - serializedName: "$top", + serializedName: "communicationName", + required: true, type: { - name: "Number" + name: "String" } } }; + +export const createCommunicationParameters: OperationParameter = { + parameterPath: "createCommunicationParameters", + mapper: CommunicationDetailsMapper +}; diff --git a/sdk/support/arm-support/src/models/problemClassificationsMappers.ts b/sdk/support/arm-support/src/models/problemClassificationsMappers.ts deleted file mode 100644 index 0df8bd073f1f..000000000000 --- a/sdk/support/arm-support/src/models/problemClassificationsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ExceptionResponse, - ProblemClassification, - ProblemClassificationsListResult, - ServiceError, - ServiceErrorDetail -} from "../models/mappers"; diff --git a/sdk/support/arm-support/src/models/servicesMappers.ts b/sdk/support/arm-support/src/models/servicesMappers.ts deleted file mode 100644 index 69ec00ba73a6..000000000000 --- a/sdk/support/arm-support/src/models/servicesMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ExceptionResponse, - Service, - ServiceError, - ServiceErrorDetail, - ServicesListResult -} from "../models/mappers"; diff --git a/sdk/support/arm-support/src/models/supportTicketsMappers.ts b/sdk/support/arm-support/src/models/supportTicketsMappers.ts deleted file mode 100644 index 25fe954adb6c..000000000000 --- a/sdk/support/arm-support/src/models/supportTicketsMappers.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CheckNameAvailabilityInput, - CheckNameAvailabilityOutput, - CommunicationDetails, - ContactProfile, - ExceptionResponse, - QuotaChangeRequest, - QuotaTicketDetails, - ServiceError, - ServiceErrorDetail, - ServiceLevelAgreement, - SupportEngineer, - SupportTicketDetails, - SupportTicketsListResult, - TechnicalTicketDetails, - UpdateContactProfile, - UpdateSupportTicket -} from "../models/mappers"; diff --git a/sdk/support/arm-support/src/operations/communications.ts b/sdk/support/arm-support/src/operations/communications.ts index ce7693cb8649..9ac1cbf1bfe3 100644 --- a/sdk/support/arm-support/src/operations/communications.ts +++ b/sdk/support/arm-support/src/operations/communications.ts @@ -1,141 +1,155 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/communicationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Communications } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MicrosoftSupportContext } from "../microsoftSupportContext"; +import { MicrosoftSupport } from "../microsoftSupport"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + CommunicationDetails, + CommunicationsListNextOptionalParams, + CommunicationsListOptionalParams, + CheckNameAvailabilityInput, + CommunicationsCheckNameAvailabilityOptionalParams, + CommunicationsCheckNameAvailabilityResponse, + CommunicationsListResponse, + CommunicationsGetOptionalParams, + CommunicationsGetResponse, + CommunicationsCreateOptionalParams, + CommunicationsCreateResponse, + CommunicationsListNextResponse +} from "../models"; -/** Class representing a Communications. */ -export class Communications { - private readonly client: MicrosoftSupportContext; +/// +/** Class containing Communications operations. */ +export class CommunicationsImpl implements Communications { + private readonly client: MicrosoftSupport; /** - * Create a Communications. - * @param {MicrosoftSupportContext} client Reference to the service client. + * Initialize a new instance of the class Communications class. + * @param client Reference to the service client */ - constructor(client: MicrosoftSupportContext) { + constructor(client: MicrosoftSupport) { this.client = client; } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of - * the name for adding a new communication to the support ticket. + * Lists all communications (attachments not included) for a support ticket.

You can also + * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter + * parameter. The only type of communication supported today is _Web_. Output will be a paged result + * with _nextLink_, using which you can retrieve the next set of Communication results. + *

Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailability(supportTicketName: string, checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options?: msRest.RequestOptionsBase): Promise; - /** - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. - * @param callback The callback + * @param options The options parameters. */ - checkNameAvailability(supportTicketName: string, checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, callback: msRest.ServiceCallback): void; - /** - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. - * @param options The optional parameters - * @param callback The callback - */ - checkNameAvailability(supportTicketName: string, checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(supportTicketName: string, checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - supportTicketName, - checkNameAvailabilityInput, - options + public list( + supportTicketName: string, + options?: CommunicationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(supportTicketName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(supportTicketName, options); + } + }; } - /** - * Lists all communications (attachments not included) for a support ticket.

You can - * also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the - * $filter parameter. The only type of communication supported today is _Web_. Output will be a - * paged result with _nextLink_, using which you can retrieve the next set of Communication - * results.

Support ticket data is available for 12 months after ticket creation. If a - * ticket was created more than 12 months ago, a request for data might cause an error. - * @param supportTicketName Support ticket name. - * @param [options] The optional parameters - * @returns Promise - */ - list(supportTicketName: string, options?: Models.CommunicationsListOptionalParams): Promise; - /** - * @param supportTicketName Support ticket name. - * @param callback The callback - */ - list(supportTicketName: string, callback: msRest.ServiceCallback): void; - /** - * @param supportTicketName Support ticket name. - * @param options The optional parameters - * @param callback The callback - */ - list(supportTicketName: string, options: Models.CommunicationsListOptionalParams, callback: msRest.ServiceCallback): void; - list(supportTicketName: string, options?: Models.CommunicationsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + private async *listPagingPage( + supportTicketName: string, + options?: CommunicationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(supportTicketName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( supportTicketName, + continuationToken, options - }, - listOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + supportTicketName: string, + options?: CommunicationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(supportTicketName, options)) { + yield* page; + } } /** - * Returns communication details for a support ticket. - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param [options] The optional parameters - * @returns Promise - */ - get(supportTicketName: string, communicationName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the + * name for adding a new communication to the support ticket. * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param callback The callback + * @param checkNameAvailabilityInput Input to check. + * @param options The options parameters. */ - get(supportTicketName: string, communicationName: string, callback: msRest.ServiceCallback): void; + checkNameAvailability( + supportTicketName: string, + checkNameAvailabilityInput: CheckNameAvailabilityInput, + options?: CommunicationsCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { supportTicketName, checkNameAvailabilityInput, options }, + checkNameAvailabilityOperationSpec + ); + } + /** + * Lists all communications (attachments not included) for a support ticket.

You can also + * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter + * parameter. The only type of communication supported today is _Web_. Output will be a paged result + * with _nextLink_, using which you can retrieve the next set of Communication results. + *

Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(supportTicketName: string, communicationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(supportTicketName: string, communicationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + supportTicketName: string, + options?: CommunicationsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - supportTicketName, - communicationName, - options - }, - getOperationSpec, - callback) as Promise; + { supportTicketName, options }, + listOperationSpec + ); } /** - * Adds a new customer communication to an Azure support ticket. + * Returns communication details for a support ticket. * @param supportTicketName Support ticket name. * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(supportTicketName: string, communicationName: string, createCommunicationParameters: Models.CommunicationDetails, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(supportTicketName,communicationName,createCommunicationParameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + get( + supportTicketName: string, + communicationName: string, + options?: CommunicationsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { supportTicketName, communicationName, options }, + getOperationSpec + ); } /** @@ -143,77 +157,121 @@ export class Communications { * @param supportTicketName Support ticket name. * @param communicationName Communication name. * @param createCommunicationParameters Communication object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreate(supportTicketName: string, communicationName: string, createCommunicationParameters: Models.CommunicationDetails, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginCreate( + supportTicketName: string, + communicationName: string, + createCommunicationParameters: CommunicationDetails, + options?: CommunicationsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CommunicationsCreateResponse + > + > { + 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, { supportTicketName, communicationName, createCommunicationParameters, options }, - beginCreateOperationSpec, - options); + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Lists all communications (attachments not included) for a support ticket.

You can - * also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the - * $filter parameter. The only type of communication supported today is _Web_. Output will be a - * paged result with _nextLink_, using which you can retrieve the next set of Communication - * results.

Support ticket data is available for 12 months after ticket creation. If a - * ticket was created more than 12 months ago, a request for data might cause an error. - * @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 + * Adds a new customer communication to an Azure support ticket. + * @param supportTicketName Support ticket name. + * @param communicationName Communication name. + * @param createCommunicationParameters Communication object. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + async beginCreateAndWait( + supportTicketName: string, + communicationName: string, + createCommunicationParameters: CommunicationDetails, + options?: CommunicationsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + supportTicketName, + communicationName, + createCommunicationParameters, + options + ); + return poller.pollUntilDone(); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param supportTicketName Support ticket name. + * @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( + supportTicketName: string, + nextLink: string, + options?: CommunicationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { supportTicketName, nextLink, options }, + listNextOperationSpec + ); } } - // 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.Support/supportTickets/{supportTicketName}/checkNameAvailability", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/checkNameAvailability", - urlParameters: [ - Parameters.supportTicketName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "checkNameAvailabilityInput", - mapper: { - ...Mappers.CheckNameAvailabilityInput, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CheckNameAvailabilityOutput @@ -222,24 +280,21 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + requestBody: Parameters.checkNameAvailabilityInput, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications", - urlParameters: [ - Parameters.supportTicketName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.CommunicationsListResult @@ -248,23 +303,19 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName + ], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}", - urlParameters: [ - Parameters.supportTicketName, - Parameters.communicationName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.CommunicationDetails @@ -273,52 +324,52 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, - serializer -}; - -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.supportTicketName, - Parameters.communicationName, - Parameters.subscriptionId + Parameters.communicationName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "createCommunicationParameters", - mapper: { - ...Mappers.CommunicationDetails, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.CommunicationDetails }, - 202: {}, + 201: { + bodyMapper: Mappers.CommunicationDetails + }, + 202: { + bodyMapper: Mappers.CommunicationDetails + }, + 204: { + bodyMapper: Mappers.CommunicationDetails + }, default: { bodyMapper: Mappers.ExceptionResponse } }, + requestBody: Parameters.createCommunicationParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName, + Parameters.communicationName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.CommunicationsListResult @@ -327,5 +378,13 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/support/arm-support/src/operations/index.ts b/sdk/support/arm-support/src/operations/index.ts index c3dc4a3c928e..a2bdb16ecc1c 100644 --- a/sdk/support/arm-support/src/operations/index.ts +++ b/sdk/support/arm-support/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./operations"; diff --git a/sdk/support/arm-support/src/operations/operations.ts b/sdk/support/arm-support/src/operations/operations.ts index a92e538c1c82..4f09fbf397ca 100644 --- a/sdk/support/arm-support/src/operations/operations.ts +++ b/sdk/support/arm-support/src/operations/operations.ts @@ -1,67 +1,88 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MicrosoftSupportContext } from "../microsoftSupportContext"; +import { MicrosoftSupport } from "../microsoftSupport"; +import { + Operation, + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: MicrosoftSupportContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: MicrosoftSupport; /** - * Create a Operations. - * @param {MicrosoftSupportContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: MicrosoftSupportContext) { + constructor(client: MicrosoftSupport) { this.client = client; } /** * This lists all the available Microsoft Support REST API 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; + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** - * @param options The optional parameters - * @param callback The callback + * This lists all the available Microsoft Support REST API operations. + * @param options The options parameters. */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Support/operations", httpMethod: "GET", - path: "providers/Microsoft.Support/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationsListResult @@ -70,5 +91,8 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/support/arm-support/src/operations/problemClassifications.ts b/sdk/support/arm-support/src/operations/problemClassifications.ts index a853ea0add74..b5ef37bfe971 100644 --- a/sdk/support/arm-support/src/operations/problemClassifications.ts +++ b/sdk/support/arm-support/src/operations/problemClassifications.ts @@ -1,111 +1,123 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/problemClassificationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ProblemClassifications } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MicrosoftSupportContext } from "../microsoftSupportContext"; +import { MicrosoftSupport } from "../microsoftSupport"; +import { + ProblemClassification, + ProblemClassificationsListOptionalParams, + ProblemClassificationsListResponse, + ProblemClassificationsGetOptionalParams, + ProblemClassificationsGetResponse +} from "../models"; -/** Class representing a ProblemClassifications. */ -export class ProblemClassifications { - private readonly client: MicrosoftSupportContext; +/// +/** Class containing ProblemClassifications operations. */ +export class ProblemClassificationsImpl implements ProblemClassifications { + private readonly client: MicrosoftSupport; /** - * Create a ProblemClassifications. - * @param {MicrosoftSupportContext} client Reference to the service client. + * Initialize a new instance of the class ProblemClassifications class. + * @param client Reference to the service client */ - constructor(client: MicrosoftSupportContext) { + constructor(client: MicrosoftSupport) { this.client = client; } /** - * Lists all the problem classifications (categories) available for a specific Azure service. - * Always use the service and problem classifications obtained programmatically. This practice - * ensures that you always have the most recent set of service and problem classification Ids. + * Lists all the problem classifications (categories) available for a specific Azure service. Always + * use the service and problem classifications obtained programmatically. This practice ensures that + * you always have the most recent set of service and problem classification Ids. * @param serviceName Name of the Azure service for which the problem classifications need to be - * retrieved. - * @param [options] The optional parameters - * @returns Promise + * retrieved. + * @param options The options parameters. */ - list(serviceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param serviceName Name of the Azure service for which the problem classifications need to be - * retrieved. - * @param callback The callback - */ - list(serviceName: string, callback: msRest.ServiceCallback): void; + public list( + serviceName: string, + options?: ProblemClassificationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(serviceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(serviceName, options); + } + }; + } + + private async *listPagingPage( + serviceName: string, + options?: ProblemClassificationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(serviceName, options); + yield result.value || []; + } + + private async *listPagingAll( + serviceName: string, + options?: ProblemClassificationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(serviceName, options)) { + yield* page; + } + } + /** + * Lists all the problem classifications (categories) available for a specific Azure service. Always + * use the service and problem classifications obtained programmatically. This practice ensures that + * you always have the most recent set of service and problem classification Ids. * @param serviceName Name of the Azure service for which the problem classifications need to be - * retrieved. - * @param options The optional parameters - * @param callback The callback + * retrieved. + * @param options The options parameters. */ - list(serviceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(serviceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + serviceName: string, + options?: ProblemClassificationsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - serviceName, - options - }, - listOperationSpec, - callback) as Promise; + { serviceName, options }, + listOperationSpec + ); } /** * Get problem classification details for a specific Azure service. * @param serviceName Name of the Azure service available for support. * @param problemClassificationName Name of problem classification. - * @param [options] The optional parameters - * @returns Promise - */ - get(serviceName: string, problemClassificationName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param serviceName Name of the Azure service available for support. - * @param problemClassificationName Name of problem classification. - * @param callback The callback + * @param options The options parameters. */ - get(serviceName: string, problemClassificationName: string, callback: msRest.ServiceCallback): void; - /** - * @param serviceName Name of the Azure service available for support. - * @param problemClassificationName Name of problem classification. - * @param options The optional parameters - * @param callback The callback - */ - get(serviceName: string, problemClassificationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(serviceName: string, problemClassificationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + serviceName: string, + problemClassificationName: string, + options?: ProblemClassificationsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - serviceName, - problemClassificationName, - options - }, - getOperationSpec, - callback) as Promise; + { serviceName, problemClassificationName, options }, + getOperationSpec + ); } } - // 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.Support/services/{serviceName}/problemClassifications", httpMethod: "GET", - path: "providers/Microsoft.Support/services/{serviceName}/problemClassifications", - urlParameters: [ - Parameters.serviceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ProblemClassificationsListResult @@ -114,22 +126,15 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.serviceName], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Support/services/{serviceName}/problemClassifications/{problemClassificationName}", httpMethod: "GET", - path: "providers/Microsoft.Support/services/{serviceName}/problemClassifications/{problemClassificationName}", - urlParameters: [ - Parameters.serviceName, - Parameters.problemClassificationName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ProblemClassification @@ -138,5 +143,12 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.serviceName, + Parameters.problemClassificationName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/support/arm-support/src/operations/services.ts b/sdk/support/arm-support/src/operations/services.ts index c7d891a03a0d..e17fbe46d560 100644 --- a/sdk/support/arm-support/src/operations/services.ts +++ b/sdk/support/arm-support/src/operations/services.ts @@ -1,101 +1,117 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/servicesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Services } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MicrosoftSupportContext } from "../microsoftSupportContext"; +import { MicrosoftSupport } from "../microsoftSupport"; +import { + Service, + ServicesListOptionalParams, + ServicesListResponse, + ServicesGetOptionalParams, + ServicesGetResponse +} from "../models"; -/** Class representing a Services. */ -export class Services { - private readonly client: MicrosoftSupportContext; +/// +/** Class containing Services operations. */ +export class ServicesImpl implements Services { + private readonly client: MicrosoftSupport; /** - * Create a Services. - * @param {MicrosoftSupportContext} client Reference to the service client. + * Initialize a new instance of the class Services class. + * @param client Reference to the service client */ - constructor(client: MicrosoftSupportContext) { + constructor(client: MicrosoftSupport) { this.client = client; } /** - * Lists all the Azure services available for support ticket creation. For **Technical** issues, - * select the Service Id that maps to the Azure service/product as displayed in the **Services** - * drop-down list on the Azure portal's [New support - * request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) - * page. Always use the service and its corresponding problem classification(s) obtained - * programmatically for support ticket creation. This practice ensures that you always have the - * most recent set of service and problem classification Ids. - * @param [options] The optional parameters - * @returns Promise + * Lists all the Azure services available for support ticket creation. For **Technical** issues, select + * the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down + * list on the Azure portal's [New support + * request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. + * Always use the service and its corresponding problem classification(s) obtained programmatically for + * support ticket creation. This practice ensures that you always have the most recent set of service + * and problem classification Ids. + * @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?: ServicesListOptionalParams + ): 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?: ServicesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: ServicesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** - * Gets a specific Azure service for support ticket creation. - * @param serviceName Name of the Azure service. - * @param [options] The optional parameters - * @returns Promise - */ - get(serviceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param serviceName Name of the Azure service. - * @param callback The callback + * Lists all the Azure services available for support ticket creation. For **Technical** issues, select + * the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down + * list on the Azure portal's [New support + * request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. + * Always use the service and its corresponding problem classification(s) obtained programmatically for + * support ticket creation. This practice ensures that you always have the most recent set of service + * and problem classification Ids. + * @param options The options parameters. */ - get(serviceName: string, callback: msRest.ServiceCallback): void; + private _list( + options?: ServicesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** + * Gets a specific Azure service for support ticket creation. * @param serviceName Name of the Azure service. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(serviceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(serviceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + serviceName: string, + options?: ServicesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - serviceName, - options - }, - getOperationSpec, - callback) as Promise; + { serviceName, options }, + getOperationSpec + ); } } - // 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.Support/services", httpMethod: "GET", - path: "providers/Microsoft.Support/services", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ServicesListResult @@ -104,21 +120,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Support/services/{serviceName}", httpMethod: "GET", - path: "providers/Microsoft.Support/services/{serviceName}", - urlParameters: [ - Parameters.serviceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.Service @@ -127,5 +136,8 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.serviceName], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/support/arm-support/src/operations/supportTickets.ts b/sdk/support/arm-support/src/operations/supportTickets.ts index b6c2eeb6c063..6141bca6e44a 100644 --- a/sdk/support/arm-support/src/operations/supportTickets.ts +++ b/sdk/support/arm-support/src/operations/supportTickets.ts @@ -1,275 +1,306 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/supportTicketsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SupportTickets } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MicrosoftSupportContext } from "../microsoftSupportContext"; +import { MicrosoftSupport } from "../microsoftSupport"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + SupportTicketDetails, + SupportTicketsListNextOptionalParams, + SupportTicketsListOptionalParams, + CheckNameAvailabilityInput, + SupportTicketsCheckNameAvailabilityOptionalParams, + SupportTicketsCheckNameAvailabilityResponse, + SupportTicketsListResponse, + SupportTicketsGetOptionalParams, + SupportTicketsGetResponse, + UpdateSupportTicket, + SupportTicketsUpdateOptionalParams, + SupportTicketsUpdateResponse, + SupportTicketsCreateOptionalParams, + SupportTicketsCreateResponse, + SupportTicketsListNextResponse +} from "../models"; -/** Class representing a SupportTickets. */ -export class SupportTickets { - private readonly client: MicrosoftSupportContext; +/// +/** Class containing SupportTickets operations. */ +export class SupportTicketsImpl implements SupportTickets { + private readonly client: MicrosoftSupport; /** - * Create a SupportTickets. - * @param {MicrosoftSupportContext} client Reference to the service client. + * Initialize a new instance of the class SupportTickets class. + * @param client Reference to the service client */ - constructor(client: MicrosoftSupportContext) { + constructor(client: MicrosoftSupport) { this.client = client; } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of - * the name for support ticket creation for the selected subscription. - * @param checkNameAvailabilityInput Input to check. - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailability(checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options?: msRest.RequestOptionsBase): Promise; - /** - * @param checkNameAvailabilityInput Input to check. - * @param callback The callback - */ - checkNameAvailability(checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, callback: msRest.ServiceCallback): void; - /** - * @param checkNameAvailabilityInput Input to check. - * @param options The optional parameters - * @param callback The callback + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by + * _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with + * _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket + * data is available for 18 months after ticket creation. If a ticket was created more than 18 months + * ago, a request for data might cause an error. + * @param options The options parameters. */ - checkNameAvailability(checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(checkNameAvailabilityInput: Models.CheckNameAvailabilityInput, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - checkNameAvailabilityInput, - options + public list( + options?: SupportTicketsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: SupportTicketsListOptionalParams + ): 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?: SupportTicketsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets - * by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with - * _nextLink_, using which you can retrieve the next set of support tickets.

Support - * ticket data is available for 12 months after ticket creation. If a ticket was created more than - * 12 months ago, a request for data might cause an error. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: Models.SupportTicketsListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * Check the availability of a resource name. This API should be used to check the uniqueness of the + * name for support ticket creation for the selected subscription. + * @param checkNameAvailabilityInput Input to check. + * @param options The options parameters. */ - list(options: Models.SupportTicketsListOptionalParams, callback: msRest.ServiceCallback): void; - list(options?: Models.SupportTicketsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + checkNameAvailability( + checkNameAvailabilityInput: CheckNameAvailabilityInput, + options?: SupportTicketsCheckNameAvailabilityOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + { checkNameAvailabilityInput, options }, + checkNameAvailabilityOperationSpec + ); } /** - * Get ticket details for an Azure subscription. Support ticket data is available for 12 months - * after ticket creation. If a ticket was created more than 12 months ago, a request for data might - * cause an error. - * @param supportTicketName Support ticket name. - * @param [options] The optional parameters - * @returns Promise - */ - get(supportTicketName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param supportTicketName Support ticket name. - * @param callback The callback + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by + * _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with + * _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket + * data is available for 18 months after ticket creation. If a ticket was created more than 18 months + * ago, a request for data might cause an error. + * @param options The options parameters. */ - get(supportTicketName: string, callback: msRest.ServiceCallback): void; + private _list( + options?: SupportTicketsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** + * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after + * ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an + * error. * @param supportTicketName Support ticket name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(supportTicketName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(supportTicketName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + supportTicketName: string, + options?: SupportTicketsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - supportTicketName, - options - }, - getOperationSpec, - callback) as Promise; + { supportTicketName, options }, + getOperationSpec + ); } /** - * This API allows you to update the severity level, ticket status, and your contact information in - * the support ticket.

Note: The severity levels cannot be changed if a support ticket is - * actively being worked upon by an Azure support engineer. In such a case, contact your support - * engineer to request severity update by adding a new communication using the Communications - * API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When - * an engineer is actively working on the ticket, send your ticket closure request by sending a - * note to your engineer. - * @param supportTicketName Support ticket name. - * @param updateSupportTicket UpdateSupportTicket object. - * @param [options] The optional parameters - * @returns Promise - */ - update(supportTicketName: string, updateSupportTicket: Models.UpdateSupportTicket, options?: msRest.RequestOptionsBase): Promise; - /** - * @param supportTicketName Support ticket name. - * @param updateSupportTicket UpdateSupportTicket object. - * @param callback The callback - */ - update(supportTicketName: string, updateSupportTicket: Models.UpdateSupportTicket, callback: msRest.ServiceCallback): void; - /** + * This API allows you to update the severity level, ticket status, and your contact information in the + * support ticket.

Note: The severity levels cannot be changed if a support ticket is actively + * being worked upon by an Azure support engineer. In such a case, contact your support engineer to + * request severity update by adding a new communication using the Communications + * API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an + * engineer is actively working on the ticket, send your ticket closure request by sending a note to + * your engineer. * @param supportTicketName Support ticket name. * @param updateSupportTicket UpdateSupportTicket object. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(supportTicketName: string, updateSupportTicket: Models.UpdateSupportTicket, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(supportTicketName: string, updateSupportTicket: Models.UpdateSupportTicket, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + supportTicketName: string, + updateSupportTicket: UpdateSupportTicket, + options?: SupportTicketsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - supportTicketName, - updateSupportTicket, - options - }, - updateOperationSpec, - callback) as Promise; + { supportTicketName, updateSupportTicket, options }, + updateOperationSpec + ); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, - * and Subscription Management issues for the specified subscription. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always - * call the Services and ProblemClassifications API to get the most recent set of services and - * problem categories required for support ticket creation.

Adding attachments is not - * currently supported via the API. To add a file to an existing support ticket, visit the [Manage - * support + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and + * Subscription Management issues for the specified subscription. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem + * categories required for support ticket creation.

Adding attachments is not currently + * supported via the API. To add a file to an existing support ticket, visit the [Manage support * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) - * page in the Azure portal, select the support ticket, and use the file upload control to add a - * new file.

Providing consent to share diagnostic information with Azure support is - * currently not supported via the API. The Azure support engineer working on your ticket will - * reach out to you for consent if your issue requires gathering diagnostic information from your - * Azure resources.

**Creating a support ticket for on-behalf-of**: Include + * page in the Azure portal, select the support ticket, and use the file upload control to add a new + * file.

Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for + * consent if your issue requires gathering diagnostic information from your Azure + * resources.

**Creating a support ticket for on-behalf-of**: Include * _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). * The primary token will be from the tenant for whom a support ticket is being raised against the - * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be - * from the Cloud solution provider (CSP) partner tenant. + * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from + * the Cloud solution provider (CSP) partner tenant. * @param supportTicketName Support ticket name. * @param createSupportTicketParameters Support ticket request payload. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(supportTicketName: string, createSupportTicketParameters: Models.SupportTicketDetails, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(supportTicketName,createSupportTicketParameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreate( + supportTicketName: string, + createSupportTicketParameters: SupportTicketDetails, + options?: SupportTicketsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SupportTicketsCreateResponse + > + > { + 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, + { supportTicketName, createSupportTicketParameters, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, - * and Subscription Management issues for the specified subscription. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always - * call the Services and ProblemClassifications API to get the most recent set of services and - * problem categories required for support ticket creation.

Adding attachments is not - * currently supported via the API. To add a file to an existing support ticket, visit the [Manage - * support + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and + * Subscription Management issues for the specified subscription. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem + * categories required for support ticket creation.

Adding attachments is not currently + * supported via the API. To add a file to an existing support ticket, visit the [Manage support * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) - * page in the Azure portal, select the support ticket, and use the file upload control to add a - * new file.

Providing consent to share diagnostic information with Azure support is - * currently not supported via the API. The Azure support engineer working on your ticket will - * reach out to you for consent if your issue requires gathering diagnostic information from your - * Azure resources.

**Creating a support ticket for on-behalf-of**: Include + * page in the Azure portal, select the support ticket, and use the file upload control to add a new + * file.

Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for + * consent if your issue requires gathering diagnostic information from your Azure + * resources.

**Creating a support ticket for on-behalf-of**: Include * _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). * The primary token will be from the tenant for whom a support ticket is being raised against the - * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be - * from the Cloud solution provider (CSP) partner tenant. + * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from + * the Cloud solution provider (CSP) partner tenant. * @param supportTicketName Support ticket name. * @param createSupportTicketParameters Support ticket request payload. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreate(supportTicketName: string, createSupportTicketParameters: Models.SupportTicketDetails, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - supportTicketName, - createSupportTicketParameters, - options - }, - beginCreateOperationSpec, - options); + async beginCreateAndWait( + supportTicketName: string, + createSupportTicketParameters: SupportTicketDetails, + options?: SupportTicketsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + supportTicketName, + createSupportTicketParameters, + options + ); + return poller.pollUntilDone(); } /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets - * by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with - * _nextLink_, using which you can retrieve the next set of support tickets.

Support - * ticket data is available for 12 months after ticket creation. If a ticket was created more than - * 12 months ago, a request for data might cause an error. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @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?: SupportTicketsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // 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.Support/checkNameAvailability", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/checkNameAvailability", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "checkNameAvailabilityInput", - mapper: { - ...Mappers.CheckNameAvailabilityInput, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CheckNameAvailabilityOutput @@ -278,23 +309,17 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + requestBody: Parameters.checkNameAvailabilityInput, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.SupportTicketsListResult @@ -303,22 +328,15 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", - urlParameters: [ - Parameters.supportTicketName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.SupportTicketDetails @@ -327,29 +345,19 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName + ], + headerParameters: [Parameters.accept], serializer }; - -const updateOperationSpec: msRest.OperationSpec = { +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", - urlParameters: [ - Parameters.supportTicketName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "updateSupportTicket", - mapper: { - ...Mappers.UpdateSupportTicket, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.SupportTicketDetails @@ -358,51 +366,52 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + requestBody: Parameters.updateSupportTicket, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginCreateOperationSpec: msRest.OperationSpec = { +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}", - urlParameters: [ - Parameters.supportTicketName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "createSupportTicketParameters", - mapper: { - ...Mappers.SupportTicketDetails, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.SupportTicketDetails }, - 202: {}, + 201: { + bodyMapper: Mappers.SupportTicketDetails + }, + 202: { + bodyMapper: Mappers.SupportTicketDetails + }, + 204: { + bodyMapper: Mappers.SupportTicketDetails + }, default: { bodyMapper: Mappers.ExceptionResponse } }, + requestBody: Parameters.createSupportTicketParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.supportTicketName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SupportTicketsListResult @@ -411,5 +420,12 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/support/arm-support/src/operationsInterfaces/communications.ts b/sdk/support/arm-support/src/operationsInterfaces/communications.ts new file mode 100644 index 000000000000..a4241c24682c --- /dev/null +++ b/sdk/support/arm-support/src/operationsInterfaces/communications.ts @@ -0,0 +1,94 @@ +/* + * 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 { + CommunicationDetails, + CommunicationsListOptionalParams, + CheckNameAvailabilityInput, + CommunicationsCheckNameAvailabilityOptionalParams, + CommunicationsCheckNameAvailabilityResponse, + CommunicationsGetOptionalParams, + CommunicationsGetResponse, + CommunicationsCreateOptionalParams, + CommunicationsCreateResponse +} from "../models"; + +/// +/** Interface representing a Communications. */ +export interface Communications { + /** + * Lists all communications (attachments not included) for a support ticket.

You can also + * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter + * parameter. The only type of communication supported today is _Web_. Output will be a paged result + * with _nextLink_, using which you can retrieve the next set of Communication results. + *

Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. + * @param supportTicketName Support ticket name. + * @param options The options parameters. + */ + list( + supportTicketName: string, + options?: CommunicationsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the + * name for adding a new communication to the support ticket. + * @param supportTicketName Support ticket name. + * @param checkNameAvailabilityInput Input to check. + * @param options The options parameters. + */ + checkNameAvailability( + supportTicketName: string, + checkNameAvailabilityInput: CheckNameAvailabilityInput, + options?: CommunicationsCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Returns communication details for a support ticket. + * @param supportTicketName Support ticket name. + * @param communicationName Communication name. + * @param options The options parameters. + */ + get( + supportTicketName: string, + communicationName: string, + options?: CommunicationsGetOptionalParams + ): Promise; + /** + * Adds a new customer communication to an Azure support ticket. + * @param supportTicketName Support ticket name. + * @param communicationName Communication name. + * @param createCommunicationParameters Communication object. + * @param options The options parameters. + */ + beginCreate( + supportTicketName: string, + communicationName: string, + createCommunicationParameters: CommunicationDetails, + options?: CommunicationsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CommunicationsCreateResponse + > + >; + /** + * Adds a new customer communication to an Azure support ticket. + * @param supportTicketName Support ticket name. + * @param communicationName Communication name. + * @param createCommunicationParameters Communication object. + * @param options The options parameters. + */ + beginCreateAndWait( + supportTicketName: string, + communicationName: string, + createCommunicationParameters: CommunicationDetails, + options?: CommunicationsCreateOptionalParams + ): Promise; +} diff --git a/sdk/support/arm-support/src/operationsInterfaces/index.ts b/sdk/support/arm-support/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..a2bdb16ecc1c --- /dev/null +++ b/sdk/support/arm-support/src/operationsInterfaces/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./services"; +export * from "./problemClassifications"; +export * from "./supportTickets"; +export * from "./communications"; diff --git a/sdk/support/arm-support/src/operationsInterfaces/operations.ts b/sdk/support/arm-support/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..d819cb3a4dd6 --- /dev/null +++ b/sdk/support/arm-support/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 { + /** + * This lists all the available Microsoft Support REST API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/support/arm-support/src/operationsInterfaces/problemClassifications.ts b/sdk/support/arm-support/src/operationsInterfaces/problemClassifications.ts new file mode 100644 index 000000000000..e68a2aa49f14 --- /dev/null +++ b/sdk/support/arm-support/src/operationsInterfaces/problemClassifications.ts @@ -0,0 +1,43 @@ +/* + * 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 { + ProblemClassification, + ProblemClassificationsListOptionalParams, + ProblemClassificationsGetOptionalParams, + ProblemClassificationsGetResponse +} from "../models"; + +/// +/** Interface representing a ProblemClassifications. */ +export interface ProblemClassifications { + /** + * Lists all the problem classifications (categories) available for a specific Azure service. Always + * use the service and problem classifications obtained programmatically. This practice ensures that + * you always have the most recent set of service and problem classification Ids. + * @param serviceName Name of the Azure service for which the problem classifications need to be + * retrieved. + * @param options The options parameters. + */ + list( + serviceName: string, + options?: ProblemClassificationsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get problem classification details for a specific Azure service. + * @param serviceName Name of the Azure service available for support. + * @param problemClassificationName Name of problem classification. + * @param options The options parameters. + */ + get( + serviceName: string, + problemClassificationName: string, + options?: ProblemClassificationsGetOptionalParams + ): Promise; +} diff --git a/sdk/support/arm-support/src/operationsInterfaces/services.ts b/sdk/support/arm-support/src/operationsInterfaces/services.ts new file mode 100644 index 000000000000..a12dd7b23552 --- /dev/null +++ b/sdk/support/arm-support/src/operationsInterfaces/services.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Service, + ServicesListOptionalParams, + ServicesGetOptionalParams, + ServicesGetResponse +} from "../models"; + +/// +/** Interface representing a Services. */ +export interface Services { + /** + * Lists all the Azure services available for support ticket creation. For **Technical** issues, select + * the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down + * list on the Azure portal's [New support + * request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. + * Always use the service and its corresponding problem classification(s) obtained programmatically for + * support ticket creation. This practice ensures that you always have the most recent set of service + * and problem classification Ids. + * @param options The options parameters. + */ + list( + options?: ServicesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a specific Azure service for support ticket creation. + * @param serviceName Name of the Azure service. + * @param options The options parameters. + */ + get( + serviceName: string, + options?: ServicesGetOptionalParams + ): Promise; +} diff --git a/sdk/support/arm-support/src/operationsInterfaces/supportTickets.ts b/sdk/support/arm-support/src/operationsInterfaces/supportTickets.ts new file mode 100644 index 000000000000..8b92e8d21423 --- /dev/null +++ b/sdk/support/arm-support/src/operationsInterfaces/supportTickets.ts @@ -0,0 +1,137 @@ +/* + * 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 { + SupportTicketDetails, + SupportTicketsListOptionalParams, + CheckNameAvailabilityInput, + SupportTicketsCheckNameAvailabilityOptionalParams, + SupportTicketsCheckNameAvailabilityResponse, + SupportTicketsGetOptionalParams, + SupportTicketsGetResponse, + UpdateSupportTicket, + SupportTicketsUpdateOptionalParams, + SupportTicketsUpdateResponse, + SupportTicketsCreateOptionalParams, + SupportTicketsCreateResponse +} from "../models"; + +/// +/** Interface representing a SupportTickets. */ +export interface SupportTickets { + /** + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by + * _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with + * _nextLink_, using which you can retrieve the next set of support tickets.

Support ticket + * data is available for 18 months after ticket creation. If a ticket was created more than 18 months + * ago, a request for data might cause an error. + * @param options The options parameters. + */ + list( + options?: SupportTicketsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the + * name for support ticket creation for the selected subscription. + * @param checkNameAvailabilityInput Input to check. + * @param options The options parameters. + */ + checkNameAvailability( + checkNameAvailabilityInput: CheckNameAvailabilityInput, + options?: SupportTicketsCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after + * ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an + * error. + * @param supportTicketName Support ticket name. + * @param options The options parameters. + */ + get( + supportTicketName: string, + options?: SupportTicketsGetOptionalParams + ): Promise; + /** + * This API allows you to update the severity level, ticket status, and your contact information in the + * support ticket.

Note: The severity levels cannot be changed if a support ticket is actively + * being worked upon by an Azure support engineer. In such a case, contact your support engineer to + * request severity update by adding a new communication using the Communications + * API.

Changing the ticket status to _closed_ is allowed only on an unassigned case. When an + * engineer is actively working on the ticket, send your ticket closure request by sending a note to + * your engineer. + * @param supportTicketName Support ticket name. + * @param updateSupportTicket UpdateSupportTicket object. + * @param options The options parameters. + */ + update( + supportTicketName: string, + updateSupportTicket: UpdateSupportTicket, + options?: SupportTicketsUpdateOptionalParams + ): Promise; + /** + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and + * Subscription Management issues for the specified subscription. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem + * categories required for support ticket creation.

Adding attachments is not currently + * supported via the API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) + * page in the Azure portal, select the support ticket, and use the file upload control to add a new + * file.

Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for + * consent if your issue requires gathering diagnostic information from your Azure + * resources.

**Creating a support ticket for on-behalf-of**: Include + * _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the + * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from + * the Cloud solution provider (CSP) partner tenant. + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @param options The options parameters. + */ + beginCreate( + supportTicketName: string, + createSupportTicketParameters: SupportTicketDetails, + options?: SupportTicketsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SupportTicketsCreateResponse + > + >; + /** + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and + * Subscription Management issues for the specified subscription. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.

Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem + * categories required for support ticket creation.

Adding attachments is not currently + * supported via the API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) + * page in the Azure portal, select the support ticket, and use the file upload control to add a new + * file.

Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for + * consent if your issue requires gathering diagnostic information from your Azure + * resources.

**Creating a support ticket for on-behalf-of**: Include + * _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the + * subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from + * the Cloud solution provider (CSP) partner tenant. + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @param options The options parameters. + */ + beginCreateAndWait( + supportTicketName: string, + createSupportTicketParameters: SupportTicketDetails, + options?: SupportTicketsCreateOptionalParams + ): Promise; +} diff --git a/sdk/support/arm-support/test/sampleTest.ts b/sdk/support/arm-support/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/support/arm-support/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/support/arm-support/tsconfig.json b/sdk/support/arm-support/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/support/arm-support/tsconfig.json +++ b/sdk/support/arm-support/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/support/ci.yml b/sdk/support/ci.yml new file mode 100644 index 000000000000..c00a7bebb3e3 --- /dev/null +++ b/sdk/support/ci.yml @@ -0,0 +1,29 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/support/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/support/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: support + Artifacts: + - name: azure-arm-support + safeName: azurearmsupport + \ No newline at end of file