From d97efdd2480f35f6438fb21c5a76ccf22eb484de Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 11:31:26 +0000 Subject: [PATCH] CodeGen from PR 16925 in Azure/azure-rest-api-specs Track2 modify readme.go.md 5 (#16925) --- common/config/rush/pnpm-lock.yaml | 131 +-- rush.json | 5 + sdk/hanaonazure/arm-hanaonazure/CHANGELOG.md | 11 + .../arm-hanaonazure/{LICENSE.txt => LICENSE} | 4 +- sdk/hanaonazure/arm-hanaonazure/README.md | 149 ++- sdk/hanaonazure/arm-hanaonazure/_meta.json | 7 + .../arm-hanaonazure/api-extractor.json | 18 + sdk/hanaonazure/arm-hanaonazure/package.json | 95 +- .../review/arm-hanaonazure.api.md | 260 +++++ .../arm-hanaonazure/rollup.config.js | 211 ++++- .../src/hanaManagementClient.ts | 115 ++- .../src/hanaManagementClientContext.ts | 69 -- sdk/hanaonazure/arm-hanaonazure/src/index.ts | 12 + .../arm-hanaonazure/src/lroImpl.ts | 34 + .../src/models/hanaInstancesMappers.ts | 23 - .../arm-hanaonazure/src/models/index.ts | 890 +++++------------- .../arm-hanaonazure/src/models/mappers.ts | 538 +++-------- .../src/models/operationsMappers.ts | 14 - .../arm-hanaonazure/src/models/parameters.ts | 114 ++- .../src/models/sapMonitorsMappers.ts | 23 - .../src/operations/hanaInstances.ts | 654 ------------- .../arm-hanaonazure/src/operations/index.ts | 10 +- .../src/operations/operations.ts | 108 ++- .../src/operations/providerInstances.ts | 477 ++++++++++ .../src/operations/sapMonitors.ts | 588 +++++++----- .../src/operationsInterfaces/index.ts | 11 + .../src/operationsInterfaces/operations.ts | 22 + .../operationsInterfaces/providerInstances.ts | 115 +++ .../src/operationsInterfaces/sapMonitors.ts | 113 +++ .../arm-hanaonazure/test/sampleTest.ts | 48 + sdk/hanaonazure/arm-hanaonazure/tsconfig.json | 6 +- sdk/hanaonazure/ci.yml | 29 + 32 files changed, 2471 insertions(+), 2433 deletions(-) create mode 100644 sdk/hanaonazure/arm-hanaonazure/CHANGELOG.md rename sdk/hanaonazure/arm-hanaonazure/{LICENSE.txt => LICENSE} (96%) create mode 100644 sdk/hanaonazure/arm-hanaonazure/_meta.json create mode 100644 sdk/hanaonazure/arm-hanaonazure/api-extractor.json create mode 100644 sdk/hanaonazure/arm-hanaonazure/review/arm-hanaonazure.api.md delete mode 100644 sdk/hanaonazure/arm-hanaonazure/src/hanaManagementClientContext.ts create mode 100644 sdk/hanaonazure/arm-hanaonazure/src/index.ts create mode 100644 sdk/hanaonazure/arm-hanaonazure/src/lroImpl.ts delete mode 100644 sdk/hanaonazure/arm-hanaonazure/src/models/hanaInstancesMappers.ts delete mode 100644 sdk/hanaonazure/arm-hanaonazure/src/models/operationsMappers.ts delete mode 100644 sdk/hanaonazure/arm-hanaonazure/src/models/sapMonitorsMappers.ts delete mode 100644 sdk/hanaonazure/arm-hanaonazure/src/operations/hanaInstances.ts create mode 100644 sdk/hanaonazure/arm-hanaonazure/src/operations/providerInstances.ts create mode 100644 sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/index.ts create mode 100644 sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/operations.ts create mode 100644 sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/providerInstances.ts create mode 100644 sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/sapMonitors.ts create mode 100644 sdk/hanaonazure/arm-hanaonazure/test/sampleTest.ts create mode 100644 sdk/hanaonazure/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..efc0dba0bb79 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -38,6 +38,7 @@ specifiers: '@rush-temp/arm-eventhub': file:./projects/arm-eventhub.tgz '@rush-temp/arm-extendedlocation': file:./projects/arm-extendedlocation.tgz '@rush-temp/arm-features': file:./projects/arm-features.tgz + '@rush-temp/arm-hanaonazure': file:./projects/arm-hanaonazure.tgz '@rush-temp/arm-hdinsight': file:./projects/arm-hdinsight.tgz '@rush-temp/arm-iothub': file:./projects/arm-iothub.tgz '@rush-temp/arm-keyvault': file:./projects/arm-keyvault.tgz @@ -219,6 +220,7 @@ dependencies: '@rush-temp/arm-eventhub': file:projects/arm-eventhub.tgz '@rush-temp/arm-extendedlocation': file:projects/arm-extendedlocation.tgz '@rush-temp/arm-features': file:projects/arm-features.tgz + '@rush-temp/arm-hanaonazure': file:projects/arm-hanaonazure.tgz '@rush-temp/arm-hdinsight': file:projects/arm-hdinsight.tgz '@rush-temp/arm-iothub': file:projects/arm-iothub.tgz '@rush-temp/arm-keyvault': file:projects/arm-keyvault.tgz @@ -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 @@ -8583,6 +8585,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-hanaonazure.tgz: + resolution: {integrity: sha512-No4mQLsFsEiDgYBNcV5TcYIlwZn3EBr+DhmNFVhjfAy2bekiJoWaso6hVRzUnsGzwjBLjRfjsuBRkuqm6uaN5w==, tarball: file:projects/arm-hanaonazure.tgz} + name: '@rush-temp/arm-hanaonazure' + 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-hdinsight.tgz: resolution: {integrity: sha512-MxGX73BGBcYHfMjJFjOMYtx6Z/hU8PsFZyudN1LPg+kjlghRCdfOpsSLkSl9YmekZEVGxkR9/DyeFQBfg5/+IA==, tarball: file:projects/arm-hdinsight.tgz} name: '@rush-temp/arm-hdinsight' @@ -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..e85151a02478 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-hanaonazure", + "projectFolder": "sdk/hanaonazure/arm-hanaonazure", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/hanaonazure/arm-hanaonazure/CHANGELOG.md b/sdk/hanaonazure/arm-hanaonazure/CHANGELOG.md new file mode 100644 index 000000000000..c6e71f718211 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 4.0.0-beta.1 (2022-01-05) + +The package of @azure/arm-hanaonazure is using our next generation design principles since version 4.0.0-beta.1, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/hanaonazure/arm-hanaonazure/LICENSE.txt b/sdk/hanaonazure/arm-hanaonazure/LICENSE similarity index 96% rename from sdk/hanaonazure/arm-hanaonazure/LICENSE.txt rename to sdk/hanaonazure/arm-hanaonazure/LICENSE index ea8fb1516028..5d1d36e0af80 100644 --- a/sdk/hanaonazure/arm-hanaonazure/LICENSE.txt +++ b/sdk/hanaonazure/arm-hanaonazure/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/hanaonazure/arm-hanaonazure/README.md b/sdk/hanaonazure/arm-hanaonazure/README.md index 041c2ba406bd..52a27f24745d 100644 --- a/sdk/hanaonazure/arm-hanaonazure/README.md +++ b/sdk/hanaonazure/arm-hanaonazure/README.md @@ -1,109 +1,98 @@ -## Azure HanaManagementClient SDK for JavaScript +# Azure HanaManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for HanaManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure HanaManagement client. + +HANA on Azure Client + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hanaonazure/arm-hanaonazure) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-hanaonazure) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-hanaonazure?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-hanaonazure` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-hanaonazure` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure HanaManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-hanaonazure @azure/identity +npm install @azure/arm-hanaonazure ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `HanaManagementClient` -### How to use +To create a client object to access the Azure HanaManagement API, you will need the `endpoint` of your Azure HanaManagement resource and a `credential`. The Azure HanaManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure HanaManagement resource in the [Azure Portal][azure_portal]. -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure HanaManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Sample code +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { HanaManagementClient } = require("@azure/arm-hanaonazure"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new HanaManagementClient(creds, subscriptionId); - -client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new HanaManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and list operations as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-hanaonazure sample - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### HanaManagementClient + +`HanaManagementClient` is the primary interface for developers using the Azure HanaManagement client library. Explore the methods on this client object to understand the different features of the Azure HanaManagement 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%2Fhanaonazure%2Farm-hanaonazure%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/hanaonazure/arm-hanaonazure/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/hanaonazure/arm-hanaonazure/_meta.json b/sdk/hanaonazure/arm-hanaonazure/_meta.json new file mode 100644 index 000000000000..ef0c4773ab89 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "9f28b00aaee6d4360ac3dee7f9a10279f5d15568", + "readme": "specification/hanaonazure/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/hanaonazure/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/hanaonazure/arm-hanaonazure/api-extractor.json b/sdk/hanaonazure/arm-hanaonazure/api-extractor.json new file mode 100644 index 000000000000..ec5cbdb352d3 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/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-hanaonazure.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/hanaonazure/arm-hanaonazure/package.json b/sdk/hanaonazure/arm-hanaonazure/package.json index ab0cea549edf..48aa12142242 100644 --- a/sdk/hanaonazure/arm-hanaonazure/package.json +++ b/sdk/hanaonazure/arm-hanaonazure/package.json @@ -1,58 +1,91 @@ { "name": "@azure/arm-hanaonazure", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "HanaManagementClient Library with typescript type definitions for node.js and browser.", - "version": "3.1.0", + "description": "A generated SDK for HanaManagementClient.", + "version": "4.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-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-hanaonazure.js", - "module": "./esm/hanaManagementClient.js", - "types": "./esm/hanaManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-hanaonazure.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hanaonazure/arm-hanaonazure", "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-hanaonazure.js.map'\" -o ./dist/arm-hanaonazure.min.js ./dist/arm-hanaonazure.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/hanaonazure/arm-hanaonazure/review/arm-hanaonazure.api.md b/sdk/hanaonazure/arm-hanaonazure/review/arm-hanaonazure.api.md new file mode 100644 index 000000000000..3ebf89023503 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/review/arm-hanaonazure.api.md @@ -0,0 +1,260 @@ +## API Report File for "@azure/arm-hanaonazure" + +> 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 Display { + readonly description?: string; + readonly operation?: string; + readonly origin?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorResponseError; +} + +// @public +export interface ErrorResponseError { + readonly code?: string; + readonly message?: string; +} + +// @public (undocumented) +export class HanaManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: HanaManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + operations: Operations; + // (undocumented) + providerInstances: ProviderInstances; + // (undocumented) + sapMonitors: SapMonitors; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface HanaManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type HanaProvisioningStatesEnum = string; + +// @public +export enum KnownHanaProvisioningStatesEnum { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Migrating = "Migrating", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export interface Operation { + display?: Display; + readonly name?: string; +} + +// @public +export interface OperationList { + value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationList; + +// @public +export type ProviderInstance = ProxyResource & { + typePropertiesType?: string; + properties?: string; + metadata?: string; + readonly provisioningState?: HanaProvisioningStatesEnum; +}; + +// @public +export interface ProviderInstanceListResult { + nextLink?: string; + value?: ProviderInstance[]; +} + +// @public +export interface ProviderInstances { + beginCreate(resourceGroupName: string, sapMonitorName: string, providerInstanceName: string, providerInstanceParameter: ProviderInstance, options?: ProviderInstancesCreateOptionalParams): Promise, ProviderInstancesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, sapMonitorName: string, providerInstanceName: string, providerInstanceParameter: ProviderInstance, options?: ProviderInstancesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, sapMonitorName: string, providerInstanceName: string, options?: ProviderInstancesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, sapMonitorName: string, providerInstanceName: string, options?: ProviderInstancesDeleteOptionalParams): Promise; + get(resourceGroupName: string, sapMonitorName: string, providerInstanceName: string, options?: ProviderInstancesGetOptionalParams): Promise; + list(resourceGroupName: string, sapMonitorName: string, options?: ProviderInstancesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ProviderInstancesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ProviderInstancesCreateResponse = ProviderInstance; + +// @public +export interface ProviderInstancesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ProviderInstancesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProviderInstancesGetResponse = ProviderInstance; + +// @public +export interface ProviderInstancesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProviderInstancesListNextResponse = ProviderInstanceListResult; + +// @public +export interface ProviderInstancesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProviderInstancesListResponse = ProviderInstanceListResult; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type SapMonitor = TrackedResource & { + readonly provisioningState?: HanaProvisioningStatesEnum; + readonly managedResourceGroupName?: string; + logAnalyticsWorkspaceArmId?: string; + enableCustomerAnalytics?: boolean; + logAnalyticsWorkspaceId?: string; + logAnalyticsWorkspaceSharedKey?: string; + readonly sapMonitorCollectorVersion?: string; + monitorSubnet?: string; +}; + +// @public +export interface SapMonitorListResult { + nextLink?: string; + value?: SapMonitor[]; +} + +// @public +export interface SapMonitors { + beginCreate(resourceGroupName: string, sapMonitorName: string, sapMonitorParameter: SapMonitor, options?: SapMonitorsCreateOptionalParams): Promise, SapMonitorsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, sapMonitorName: string, sapMonitorParameter: SapMonitor, options?: SapMonitorsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, sapMonitorName: string, options?: SapMonitorsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, sapMonitorName: string, options?: SapMonitorsDeleteOptionalParams): Promise; + get(resourceGroupName: string, sapMonitorName: string, options?: SapMonitorsGetOptionalParams): Promise; + list(options?: SapMonitorsListOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, sapMonitorName: string, tagsParameter: Tags, options?: SapMonitorsUpdateOptionalParams): Promise; +} + +// @public +export interface SapMonitorsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SapMonitorsCreateResponse = SapMonitor; + +// @public +export interface SapMonitorsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SapMonitorsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SapMonitorsGetResponse = SapMonitor; + +// @public +export interface SapMonitorsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SapMonitorsListNextResponse = SapMonitorListResult; + +// @public +export interface SapMonitorsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SapMonitorsListResponse = SapMonitorListResult; + +// @public +export interface SapMonitorsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SapMonitorsUpdateResponse = SapMonitor; + +// @public +export interface Tags { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/hanaonazure/arm-hanaonazure/rollup.config.js b/sdk/hanaonazure/arm-hanaonazure/rollup.config.js index 61733b1e9dc1..9be1955eb7f1 100644 --- a/sdk/hanaonazure/arm-hanaonazure/rollup.config.js +++ b/sdk/hanaonazure/arm-hanaonazure/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/hanaManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-hanaonazure.js", - format: "umd", - name: "Azure.ArmHanaonazure", - 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/hanaonazure/arm-hanaonazure/src/hanaManagementClient.ts b/sdk/hanaonazure/arm-hanaonazure/src/hanaManagementClient.ts index afa2feda18ea..de202f7e7e25 100644 --- a/sdk/hanaonazure/arm-hanaonazure/src/hanaManagementClient.ts +++ b/sdk/hanaonazure/arm-hanaonazure/src/hanaManagementClient.ts @@ -1,53 +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 { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { HanaManagementClientContext } from "./hanaManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + SapMonitorsImpl, + ProviderInstancesImpl +} from "./operations"; +import { + Operations, + SapMonitors, + ProviderInstances +} from "./operationsInterfaces"; +import { HanaManagementClientOptionalParams } from "./models"; - -class HanaManagementClient extends HanaManagementClientContext { - // Operation groups - operations: operations.Operations; - hanaInstances: operations.HanaInstances; - sapMonitors: operations.SapMonitors; +export class HanaManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the HanaManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Subscription ID which uniquely identify Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. - * @param [options] The parameter options + * subscription ID forms part of the URI for every service call. + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.HanaManagementClientOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.hanaInstances = new operations.HanaInstances(this); - this.sapMonitors = new operations.SapMonitors(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: HanaManagementClientOptionalParams + ) { + 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: HanaManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-hanaonazure/4.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - HanaManagementClient, - HanaManagementClientContext, - Models as HanaManagementModels, - Mappers as HanaManagementMappers -}; -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-02-07-preview"; + this.operations = new OperationsImpl(this); + this.sapMonitors = new SapMonitorsImpl(this); + this.providerInstances = new ProviderInstancesImpl(this); + } + + operations: Operations; + sapMonitors: SapMonitors; + providerInstances: ProviderInstances; +} diff --git a/sdk/hanaonazure/arm-hanaonazure/src/hanaManagementClientContext.ts b/sdk/hanaonazure/arm-hanaonazure/src/hanaManagementClientContext.ts deleted file mode 100644 index 972d0d47795d..000000000000 --- a/sdk/hanaonazure/arm-hanaonazure/src/hanaManagementClientContext.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-hanaonazure"; -const packageVersion = "3.1.0"; - -export class HanaManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the HanaManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId Subscription ID which uniquely identify Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.HanaManagementClientOptions) { - 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 = '2017-11-03-preview'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/hanaonazure/arm-hanaonazure/src/index.ts b/sdk/hanaonazure/arm-hanaonazure/src/index.ts new file mode 100644 index 000000000000..827e78e03e2b --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/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 { HanaManagementClient } from "./hanaManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/hanaonazure/arm-hanaonazure/src/lroImpl.ts b/sdk/hanaonazure/arm-hanaonazure/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/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/hanaonazure/arm-hanaonazure/src/models/hanaInstancesMappers.ts b/sdk/hanaonazure/arm-hanaonazure/src/models/hanaInstancesMappers.ts deleted file mode 100644 index 665b0c62e27a..000000000000 --- a/sdk/hanaonazure/arm-hanaonazure/src/models/hanaInstancesMappers.ts +++ /dev/null @@ -1,23 +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, - Disk, - ErrorResponse, - HanaInstance, - HanaInstancesListResult, - HardwareProfile, - IpAddress, - NetworkProfile, - OSProfile, - Resource, - SapMonitor, - StorageProfile, - Tags -} from "../models/mappers"; diff --git a/sdk/hanaonazure/arm-hanaonazure/src/models/index.ts b/sdk/hanaonazure/arm-hanaonazure/src/models/index.ts index 131d2259292f..6a88abd740bb 100644 --- a/sdk/hanaonazure/arm-hanaonazure/src/models/index.ts +++ b/sdk/hanaonazure/arm-hanaonazure/src/models/index.ts @@ -1,752 +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. */ -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 resource model definition. - */ -export interface Resource extends BaseResource { - /** - * Resource ID - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * Resource location - */ - location?: string; - /** - * Resource tags - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly tags?: { [propertyName: string]: string }; +/** List of HANA operations */ +export interface OperationList { + /** List of HANA operations */ + value?: Operation[]; } -/** - * Specifies the hardware settings for the HANA instance. - */ -export interface HardwareProfile { - /** - * Name of the hardware type (vendor and/or their product name). Possible values include: - * 'Cisco_UCS', 'HPE' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly hardwareType?: HanaHardwareTypeNamesEnum; - /** - * Specifies the HANA instance SKU. Possible values include: 'S72m', 'S144m', 'S72', 'S144', - * 'S192', 'S192m', 'S192xm', 'S96', 'S112', 'S224', 'S224m', 'S224om', 'S224oo', 'S224oom', - * 'S224ooo', 'S384', 'S384m', 'S384xm', 'S384xxm', 'S576m', 'S576xm', 'S768', 'S768m', 'S768xm', - * 'S960m' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly hanaInstanceSize?: HanaInstanceSizeNamesEnum; -} - -/** - * Specifies the disk information fo the HANA instance - */ -export interface Disk { - /** - * The disk name. - */ - name?: string; - /** - * Specifies the size of an empty data disk in gigabytes. - */ - diskSizeGB?: number; - /** - * Specifies the logical unit number of the data disk. This value is used to identify data disks - * within the VM and therefore must be unique for each data disk attached to a VM. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly lun?: number; -} - -/** - * Specifies the storage settings for the HANA instance disks. - */ -export interface StorageProfile { - /** - * IP Address to connect to storage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nfsIpAddress?: string; - /** - * Specifies information about the operating system disk used by the hana instance. - */ - osDisks?: Disk[]; -} - -/** - * Specifies the operating system settings for the HANA instance. - */ -export interface OSProfile { - /** - * Specifies the host OS name of the HANA instance. - */ - computerName?: string; - /** - * This property allows you to specify the type of the OS. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly osType?: string; - /** - * Specifies version of operating system. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly version?: string; - /** - * Specifies the SSH public key used to access the operating system. - */ - sshPublicKey?: string; -} - -/** - * Specifies the IP address of the network interface. - */ -export interface IpAddress { - /** - * Specifies the IP address of the network interface. - */ - ipAddress?: string; -} - -/** - * Specifies the network settings for the HANA instance disks. - */ -export interface NetworkProfile { - /** - * Specifies the network interfaces for the HANA instance. - */ - networkInterfaces?: IpAddress[]; - /** - * Specifies the circuit id for connecting to express route. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly circuitId?: string; -} - -/** - * HANA instance info on Azure (ARM properties and HANA properties) - */ -export interface HanaInstance extends Resource { - /** - * Specifies the hardware settings for the HANA instance. - */ - hardwareProfile?: HardwareProfile; - /** - * Specifies the storage settings for the HANA instance disks. - */ - storageProfile?: StorageProfile; - /** - * Specifies the operating system settings for the HANA instance. - */ - osProfile?: OSProfile; - /** - * Specifies the network settings for the HANA instance. - */ - networkProfile?: NetworkProfile; - /** - * Specifies the HANA instance unique ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly hanaInstanceId?: string; - /** - * Resource power state. Possible values include: 'starting', 'started', 'stopping', 'stopped', - * 'restarting', 'unknown' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly powerState?: HanaInstancePowerStateEnum; - /** - * Resource proximity placement group - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly proximityPlacementGroup?: string; - /** - * Hardware revision of a HANA instance - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly hwRevision?: string; - /** - * ARM ID of another HanaInstance that will share a network with this HanaInstance - */ - partnerNodeId?: string; +/** HANA operation information */ +export interface Operation { /** - * State of provisioning of the HanaInstance. Possible values include: 'Accepted', 'Creating', - * 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: HanaProvisioningStatesEnum; + readonly name?: string; + /** Displayed HANA operation information */ + display?: Display; } -/** - * Detailed HANA operation information - */ +/** Detailed HANA operation information */ export interface Display { /** - * The localized friendly form of the resource provider name. This form is also expected to - * include the publisher/company responsible. Use Title Casing. Begin with "Microsoft" for 1st - * party services. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The localized friendly form of the resource provider name. This form is also expected to include the publisher/company responsible. Use Title Casing. Begin with "Microsoft" for 1st party services. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provider?: string; /** - * The localized friendly form of the resource type related to this action/operation. This form - * should match the public documentation for the resource provider. Use Title Casing. For - * examples, refer to the “name” section. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The localized friendly form of the resource type related to this action/operation. This form should match the public documentation for the resource provider. Use Title Casing. For examples, refer to the “name” section. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resource?: string; /** - * The localized friendly name for the operation as shown to the user. This name should be - * concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and include the - * entity/resource to which it applies. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The localized friendly name for the operation as shown to the user. This name should be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and include the entity/resource to which it applies. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly operation?: string; /** - * The localized friendly description for the operation as shown to the user. This description - * should be thorough, yet concise. It will be used in tool-tips and detailed views. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The localized friendly description for the operation as shown to the user. This description should be thorough, yet concise. It will be used in tool-tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly description?: string; /** - * The intended executor of the operation; governs the display of the operation in the RBAC UX - * and the audit logs UX. Default value is 'user,system' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is 'user,system' + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly origin?: string; } -/** - * HANA operation information - */ -export interface Operation { - /** - * The name of the operation being performed on this particular object. This name should match - * the action name that appears in RBAC / the event service. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Displayed HANA operation information - */ - display?: Display; +/** Describes the format of Error response. */ +export interface ErrorResponse { + /** Describes the error object. */ + error?: ErrorResponseError; } -/** - * Describes the format of Error response. - */ -export interface ErrorResponse { +/** Describes the error object. */ +export interface ErrorResponseError { /** * Error code + * NOTE: This property will not be serialized. It can only be populated by the server. */ - code?: string; + readonly code?: string; /** * Error message indicating why the operation failed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - message?: string; + readonly message?: string; } -/** - * Tags field of the HANA instance. - */ -export interface Tags { - /** - * Tags field of the HANA instance. - */ - tags?: { [propertyName: string]: string }; +/** The response from the List SAP monitors operation. */ +export interface SapMonitorListResult { + /** The list of SAP monitors. */ + value?: SapMonitor[]; + /** The URL to get the next set of SAP monitors. */ + nextLink?: string; } -/** - * Details needed to monitor a Hana Instance - */ -export interface MonitoringDetails { - /** - * ARM ID of an Azure Subnet with access to the HANA instance. - */ - hanaSubnet?: string; - /** - * Hostname of the HANA Instance blade. - */ - hanaHostname?: string; - /** - * Name of the database itself. - */ - hanaDbName?: string; +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * The port number of the tenant DB. Used to connect to the DB. + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. */ - hanaDbSqlPort?: number; + readonly id?: string; /** - * Username for the HANA database to login to for monitoring + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - hanaDbUsername?: string; + readonly name?: string; /** - * Password for the HANA database to login for monitoring + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. */ - hanaDbPassword?: string; + readonly type?: string; } -/** - * SAP monitor info on Azure (ARM properties and SAP monitor properties) - */ -export interface SapMonitor extends Resource { - /** - * Specifies the SAP monitor unique ID. - */ - hanaSubnet?: string; - /** - * Hostname of the HANA instance. - */ - hanaHostname?: string; - /** - * Database name of the HANA instance. - */ - hanaDbName?: string; - /** - * Database port of the HANA instance. - */ - hanaDbSqlPort?: number; - /** - * Database username of the HANA instance. - */ - hanaDbUsername?: string; - /** - * Database password of the HANA instance. - */ - hanaDbPassword?: string; - /** - * KeyVault URL link to the password for the HANA database. - */ - hanaDbPasswordKeyVaultUrl?: string; - /** - * MSI ID passed by customer which has access to customer's KeyVault and to be assigned to the - * Collector VM. - */ - hanaDbCredentialsMsiId?: string; - /** - * Key Vault ID containing customer's HANA credentials. - */ - keyVaultId?: string; +/** Tags field of the resource. */ +export interface Tags { + /** Tags field of the resource. */ + tags?: { [propertyName: string]: string }; +} + +/** The response from the List provider instances operation. */ +export interface ProviderInstanceListResult { + /** The list of provider instances. */ + value?: ProviderInstance[]; + /** The URL to get the next set of provider instances. */ + nextLink?: string; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export type ProxyResource = Resource & {}; + +/** SAP monitor info on Azure (ARM properties and SAP monitor properties) */ +export type SapMonitor = TrackedResource & { /** - * State of provisioning of the HanaInstance. Possible values include: 'Accepted', 'Creating', - * 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * State of provisioning of the HanaInstance + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: HanaProvisioningStatesEnum; /** * The name of the resource group the SAP Monitor resources get deployed into. - * **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 managedResourceGroupName?: string; - /** - * The ARM ID of the Log Analytics Workspace that is used for monitoring - */ + /** The ARM ID of the Log Analytics Workspace that is used for monitoring */ logAnalyticsWorkspaceArmId?: string; - /** - * The value indicating whether to send analytics to Microsoft - */ + /** The value indicating whether to send analytics to Microsoft */ enableCustomerAnalytics?: boolean; - /** - * The workspace ID of the log analytics workspace to be used for monitoring - */ + /** The workspace ID of the log analytics workspace to be used for monitoring */ logAnalyticsWorkspaceId?: string; - /** - * The shared key of the log analytics workspace that is used for monitoring - */ + /** The shared key of the log analytics workspace that is used for monitoring */ logAnalyticsWorkspaceSharedKey?: string; -} - -/** - * An interface representing HanaManagementClientOptions. - */ -export interface HanaManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} - -/** - * @interface - * List of HANA operations - * @extends Array - */ -export interface OperationList extends Array { -} - -/** - * @interface - * The response from the List HANA Instances operation. - * @extends Array - */ -export interface HanaInstancesListResult extends Array { /** - * The URL to get the next set of HANA instances. + * The version of the payload running in the Collector VM + * NOTE: This property will not be serialized. It can only be populated by the server. */ - nextLink?: string; -} + readonly sapMonitorCollectorVersion?: string; + /** The subnet which the SAP monitor will be deployed in */ + monitorSubnet?: string; +}; -/** - * @interface - * The response from the List SAP monitors operation. - * @extends Array - */ -export interface SapMonitorListResult extends Array { +/** A provider instance associated with a SAP monitor. */ +export type ProviderInstance = ProxyResource & { + /** The type of provider instance. */ + typePropertiesType?: string; + /** A JSON string containing the properties of the provider instance. */ + properties?: string; + /** A JSON string containing metadata of the provider instance. */ + metadata?: string; /** - * The URL to get the next set of SAP monitors. + * State of provisioning of the provider instance + * NOTE: This property will not be serialized. It can only be populated by the server. */ - nextLink?: string; -} - -/** - * Defines values for HanaHardwareTypeNamesEnum. - * Possible values include: 'Cisco_UCS', 'HPE' - * @readonly - * @enum {string} - */ -export type HanaHardwareTypeNamesEnum = 'Cisco_UCS' | 'HPE'; - -/** - * Defines values for HanaInstanceSizeNamesEnum. - * Possible values include: 'S72m', 'S144m', 'S72', 'S144', 'S192', 'S192m', 'S192xm', 'S96', - * 'S112', 'S224', 'S224m', 'S224om', 'S224oo', 'S224oom', 'S224ooo', 'S384', 'S384m', 'S384xm', - * 'S384xxm', 'S576m', 'S576xm', 'S768', 'S768m', 'S768xm', 'S960m' - * @readonly - * @enum {string} - */ -export type HanaInstanceSizeNamesEnum = 'S72m' | 'S144m' | 'S72' | 'S144' | 'S192' | 'S192m' | 'S192xm' | 'S96' | 'S112' | 'S224' | 'S224m' | 'S224om' | 'S224oo' | 'S224oom' | 'S224ooo' | 'S384' | 'S384m' | 'S384xm' | 'S384xxm' | 'S576m' | 'S576xm' | 'S768' | 'S768m' | 'S768xm' | 'S960m'; - -/** - * Defines values for HanaInstancePowerStateEnum. - * Possible values include: 'starting', 'started', 'stopping', 'stopped', 'restarting', 'unknown' - * @readonly - * @enum {string} - */ -export type HanaInstancePowerStateEnum = 'starting' | 'started' | 'stopping' | 'stopped' | 'restarting' | 'unknown'; + readonly provisioningState?: HanaProvisioningStatesEnum; +}; -/** - * Defines values for HanaProvisioningStatesEnum. - * Possible values include: 'Accepted', 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', - * 'Migrating' - * @readonly - * @enum {string} - */ -export type HanaProvisioningStatesEnum = 'Accepted' | 'Creating' | 'Updating' | 'Failed' | 'Succeeded' | 'Deleting' | 'Migrating'; +/** Known values of {@link HanaProvisioningStatesEnum} that the service accepts. */ +export enum KnownHanaProvisioningStatesEnum { + Accepted = "Accepted", + Creating = "Creating", + Updating = "Updating", + Failed = "Failed", + Succeeded = "Succeeded", + Deleting = "Deleting", + Migrating = "Migrating" +} /** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationList; - }; -}; + * Defines values for HanaProvisioningStatesEnum. \ + * {@link KnownHanaProvisioningStatesEnum} can be used interchangeably with HanaProvisioningStatesEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Accepted** \ + * **Creating** \ + * **Updating** \ + * **Failed** \ + * **Succeeded** \ + * **Deleting** \ + * **Migrating** + */ +export type HanaProvisioningStatesEnum = string; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationList; + +/** Optional parameters. */ +export interface SapMonitorsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SapMonitorsListResponse = SapMonitorListResult; + +/** Optional parameters. */ +export interface SapMonitorsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SapMonitorsGetResponse = SapMonitor; + +/** Optional parameters. */ +export interface SapMonitorsCreateOptionalParams + 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 list operation. - */ -export type HanaInstancesListResponse = HanaInstancesListResult & { - /** - * 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: HanaInstancesListResult; - }; -}; +/** Contains response data for the create operation. */ +export type SapMonitorsCreateResponse = SapMonitor; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type HanaInstancesListByResourceGroupResponse = HanaInstancesListResult & { - /** - * 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: HanaInstancesListResult; - }; -}; +/** Optional parameters. */ +export interface SapMonitorsDeleteOptionalParams + 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 HanaInstancesGetResponse = HanaInstance & { - /** - * 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: HanaInstance; - }; -}; +/** Optional parameters. */ +export interface SapMonitorsUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the create operation. - */ -export type HanaInstancesCreateResponse = HanaInstance & { - /** - * 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: HanaInstance; - }; -}; +/** Contains response data for the update operation. */ +export type SapMonitorsUpdateResponse = SapMonitor; -/** - * Contains response data for the update operation. - */ -export type HanaInstancesUpdateResponse = HanaInstance & { - /** - * 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: HanaInstance; - }; -}; +/** Optional parameters. */ +export interface SapMonitorsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreate operation. - */ -export type HanaInstancesBeginCreateResponse = HanaInstance & { - /** - * 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: HanaInstance; - }; -}; +/** Contains response data for the listNext operation. */ +export type SapMonitorsListNextResponse = SapMonitorListResult; -/** - * Contains response data for the listNext operation. - */ -export type HanaInstancesListNextResponse = HanaInstancesListResult & { - /** - * 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: HanaInstancesListResult; - }; -}; +/** Optional parameters. */ +export interface ProviderInstancesListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type HanaInstancesListByResourceGroupNextResponse = HanaInstancesListResult & { - /** - * 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: HanaInstancesListResult; - }; -}; +/** Contains response data for the list operation. */ +export type ProviderInstancesListResponse = ProviderInstanceListResult; -/** - * Contains response data for the list operation. - */ -export type SapMonitorsListResponse = SapMonitorListResult & { - /** - * 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: SapMonitorListResult; - }; -}; +/** Optional parameters. */ +export interface ProviderInstancesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type SapMonitorsGetResponse = SapMonitor & { - /** - * 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: SapMonitor; - }; -}; +/** Contains response data for the get operation. */ +export type ProviderInstancesGetResponse = ProviderInstance; -/** - * Contains response data for the create operation. - */ -export type SapMonitorsCreateResponse = SapMonitor & { - /** - * 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: SapMonitor; - }; -}; +/** Optional parameters. */ +export interface ProviderInstancesCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the update operation. - */ -export type SapMonitorsUpdateResponse = SapMonitor & { - /** - * 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: SapMonitor; - }; -}; +/** Contains response data for the create operation. */ +export type ProviderInstancesCreateResponse = ProviderInstance; -/** - * Contains response data for the beginCreate operation. - */ -export type SapMonitorsBeginCreateResponse = SapMonitor & { - /** - * 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: SapMonitor; - }; -}; +/** Optional parameters. */ +export interface ProviderInstancesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listNext operation. - */ -export type SapMonitorsListNextResponse = SapMonitorListResult & { - /** - * 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: SapMonitorListResult; - }; -}; +/** Optional parameters. */ +export interface ProviderInstancesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ProviderInstancesListNextResponse = ProviderInstanceListResult; + +/** Optional parameters. */ +export interface HanaManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/hanaonazure/arm-hanaonazure/src/models/mappers.ts b/sdk/hanaonazure/arm-hanaonazure/src/models/mappers.ts index bfbd9139fc79..40994d814326 100644 --- a/sdk/hanaonazure/arm-hanaonazure/src/models/mappers.ts +++ b/sdk/hanaonazure/arm-hanaonazure/src/models/mappers.ts @@ -1,58 +1,26 @@ /* - * 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 Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const OperationList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "OperationList", 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" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - tags: { - readOnly: true, - serializedName: "tags", + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "Operation" } } } @@ -61,116 +29,65 @@ export const Resource: msRest.CompositeMapper = { } }; -export const HardwareProfile: msRest.CompositeMapper = { - serializedName: "HardwareProfile", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HardwareProfile", - modelProperties: { - hardwareType: { - readOnly: true, - serializedName: "hardwareType", - type: { - name: "String" - } - }, - hanaInstanceSize: { - readOnly: true, - serializedName: "hanaInstanceSize", - type: { - name: "String" - } - } - } - } -}; - -export const Disk: msRest.CompositeMapper = { - serializedName: "Disk", - type: { - name: "Composite", - className: "Disk", + className: "Operation", modelProperties: { name: { serializedName: "name", + readOnly: true, type: { name: "String" } }, - diskSizeGB: { - serializedName: "diskSizeGB", - type: { - name: "Number" - } - }, - lun: { - readOnly: true, - serializedName: "lun", + display: { + serializedName: "display", type: { - name: "Number" + name: "Composite", + className: "Display" } } } } }; -export const StorageProfile: msRest.CompositeMapper = { - serializedName: "StorageProfile", +export const Display: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageProfile", + className: "Display", modelProperties: { - nfsIpAddress: { + provider: { + serializedName: "provider", readOnly: true, - serializedName: "nfsIpAddress", type: { name: "String" } }, - osDisks: { - serializedName: "osDisks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Disk" - } - } - } - } - } - } -}; - -export const OSProfile: msRest.CompositeMapper = { - serializedName: "OSProfile", - type: { - name: "Composite", - className: "OSProfile", - modelProperties: { - computerName: { - serializedName: "computerName", + resource: { + serializedName: "resource", + readOnly: true, type: { name: "String" } }, - osType: { + operation: { + serializedName: "operation", readOnly: true, - serializedName: "osType", type: { name: "String" } }, - version: { + description: { + serializedName: "description", readOnly: true, - serializedName: "version", type: { name: "String" } }, - sshPublicKey: { - serializedName: "sshPublicKey", + origin: { + serializedName: "origin", + readOnly: true, type: { name: "String" } @@ -179,43 +96,37 @@ export const OSProfile: msRest.CompositeMapper = { } }; -export const IpAddress: msRest.CompositeMapper = { - serializedName: "IpAddress", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IpAddress", + className: "ErrorResponse", modelProperties: { - ipAddress: { - serializedName: "ipAddress", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "ErrorResponseError" } } } } }; -export const NetworkProfile: msRest.CompositeMapper = { - serializedName: "NetworkProfile", +export const ErrorResponseError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkProfile", + className: "ErrorResponseError", modelProperties: { - networkInterfaces: { - serializedName: "networkInterfaces", + code: { + serializedName: "code", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "IpAddress" - } - } + name: "String" } }, - circuitId: { + message: { + serializedName: "message", readOnly: true, - serializedName: "circuitId", type: { name: "String" } @@ -224,78 +135,25 @@ export const NetworkProfile: msRest.CompositeMapper = { } }; -export const HanaInstance: msRest.CompositeMapper = { - serializedName: "HanaInstance", +export const SapMonitorListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HanaInstance", + className: "SapMonitorListResult", modelProperties: { - ...Resource.type.modelProperties, - hardwareProfile: { - serializedName: "properties.hardwareProfile", - type: { - name: "Composite", - className: "HardwareProfile" - } - }, - storageProfile: { - serializedName: "properties.storageProfile", - type: { - name: "Composite", - className: "StorageProfile" - } - }, - osProfile: { - serializedName: "properties.osProfile", - type: { - name: "Composite", - className: "OSProfile" - } - }, - networkProfile: { - serializedName: "properties.networkProfile", - type: { - name: "Composite", - className: "NetworkProfile" - } - }, - hanaInstanceId: { - readOnly: true, - serializedName: "properties.hanaInstanceId", - type: { - name: "String" - } - }, - powerState: { - readOnly: true, - serializedName: "properties.powerState", - type: { - name: "String" - } - }, - proximityPlacementGroup: { - readOnly: true, - serializedName: "properties.proximityPlacementGroup", - type: { - name: "String" - } - }, - hwRevision: { - readOnly: true, - serializedName: "properties.hwRevision", - type: { - name: "String" - } - }, - partnerNodeId: { - serializedName: "properties.partnerNodeId", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SapMonitor" + } + } } }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -304,43 +162,28 @@ export const HanaInstance: msRest.CompositeMapper = { } }; -export const Display: msRest.CompositeMapper = { - serializedName: "Display", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Display", + className: "Resource", modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - readOnly: true, - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { + id: { + serializedName: "id", readOnly: true, - serializedName: "operation", type: { name: "String" } }, - description: { + name: { + serializedName: "name", readOnly: true, - serializedName: "description", type: { name: "String" } }, - origin: { + type: { + serializedName: "type", readOnly: true, - serializedName: "origin", type: { name: "String" } @@ -349,44 +192,41 @@ export const Display: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const Tags: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "Tags", modelProperties: { - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - display: { - serializedName: "display", + tags: { + serializedName: "tags", type: { - name: "Composite", - className: "Display" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const ProviderInstanceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "ProviderInstanceListResult", modelProperties: { - code: { - serializedName: "code", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProviderInstance" + } + } } }, - message: { - serializedName: "message", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -395,144 +235,56 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; -export const Tags: msRest.CompositeMapper = { - serializedName: "Tags", +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Tags", + className: "TrackedResource", modelProperties: { + ...Resource.type.modelProperties, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" } } } } }; -export const MonitoringDetails: msRest.CompositeMapper = { - serializedName: "MonitoringDetails", +export const ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MonitoringDetails", + className: "ProxyResource", modelProperties: { - hanaSubnet: { - serializedName: "hanaSubnet", - type: { - name: "String" - } - }, - hanaHostname: { - serializedName: "hanaHostname", - type: { - name: "String" - } - }, - hanaDbName: { - serializedName: "hanaDbName", - type: { - name: "String" - } - }, - hanaDbSqlPort: { - serializedName: "hanaDbSqlPort", - type: { - name: "Number" - } - }, - hanaDbUsername: { - serializedName: "hanaDbUsername", - type: { - name: "String" - } - }, - hanaDbPassword: { - serializedName: "hanaDbPassword", - type: { - name: "String" - } - } + ...Resource.type.modelProperties } } }; -export const SapMonitor: msRest.CompositeMapper = { - serializedName: "SapMonitor", +export const SapMonitor: coreClient.CompositeMapper = { type: { name: "Composite", className: "SapMonitor", modelProperties: { - ...Resource.type.modelProperties, - hanaSubnet: { - serializedName: "properties.hanaSubnet", - type: { - name: "String" - } - }, - hanaHostname: { - serializedName: "properties.hanaHostname", - type: { - name: "String" - } - }, - hanaDbName: { - serializedName: "properties.hanaDbName", - type: { - name: "String" - } - }, - hanaDbSqlPort: { - serializedName: "properties.hanaDbSqlPort", - type: { - name: "Number" - } - }, - hanaDbUsername: { - serializedName: "properties.hanaDbUsername", - type: { - name: "String" - } - }, - hanaDbPassword: { - serializedName: "properties.hanaDbPassword", - type: { - name: "String" - } - }, - hanaDbPasswordKeyVaultUrl: { - serializedName: "properties.hanaDbPasswordKeyVaultUrl", - type: { - name: "String" - } - }, - hanaDbCredentialsMsiId: { - serializedName: "properties.hanaDbCredentialsMsiId", - type: { - name: "String" - } - }, - keyVaultId: { - serializedName: "properties.keyVaultId", - type: { - name: "String" - } - }, + ...TrackedResource.type.modelProperties, provisioningState: { - readOnly: true, serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } }, managedResourceGroupName: { - readOnly: true, serializedName: "properties.managedResourceGroupName", + readOnly: true, type: { name: "String" } @@ -560,81 +312,51 @@ export const SapMonitor: msRest.CompositeMapper = { type: { name: "String" } - } - } - } -}; - -export const OperationList: msRest.CompositeMapper = { - serializedName: "OperationList", - type: { - name: "Composite", - className: "OperationList", - modelProperties: { - value: { - serializedName: "", + }, + sapMonitorCollectorVersion: { + serializedName: "properties.sapMonitorCollectorVersion", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } + name: "String" + } + }, + monitorSubnet: { + serializedName: "properties.monitorSubnet", + type: { + name: "String" } } } } }; -export const HanaInstancesListResult: msRest.CompositeMapper = { - serializedName: "HanaInstancesListResult", +export const ProviderInstance: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HanaInstancesListResult", + className: "ProviderInstance", modelProperties: { - value: { - serializedName: "", + ...ProxyResource.type.modelProperties, + typePropertiesType: { + serializedName: "properties.type", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "HanaInstance" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + properties: { + serializedName: "properties.properties", type: { name: "String" } - } - } - } -}; - -export const SapMonitorListResult: msRest.CompositeMapper = { - serializedName: "SapMonitorListResult", - type: { - name: "Composite", - className: "SapMonitorListResult", - modelProperties: { - value: { - serializedName: "", + }, + metadata: { + serializedName: "properties.metadata", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SapMonitor" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } diff --git a/sdk/hanaonazure/arm-hanaonazure/src/models/operationsMappers.ts b/sdk/hanaonazure/arm-hanaonazure/src/models/operationsMappers.ts deleted file mode 100644 index a9be85e4bd23..000000000000 --- a/sdk/hanaonazure/arm-hanaonazure/src/models/operationsMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - Display, - ErrorResponse, - Operation, - OperationList -} from "../models/mappers"; diff --git a/sdk/hanaonazure/arm-hanaonazure/src/models/parameters.ts b/sdk/hanaonazure/arm-hanaonazure/src/models/parameters.ts index 3f362383f381..bcb86b62e563 100644 --- a/sdk/hanaonazure/arm-hanaonazure/src/models/parameters.ts +++ b/sdk/hanaonazure/arm-hanaonazure/src/models/parameters.ts @@ -1,83 +1,137 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + SapMonitor as SapMonitorMapper, + Tags as TagsMapper, + ProviderInstance as ProviderInstanceMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "api-version", type: { name: "String" } - } + }, + skipEncoding: true }; -export const hanaInstanceName: msRest.OperationURLParameter = { - parameterPath: "hanaInstanceName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "hanaInstanceName", + defaultValue: "2020-02-07-preview", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const resourceGroupName: msRest.OperationURLParameter = { + +export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { - required: true, serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const sapMonitorName: msRest.OperationURLParameter = { + +export const sapMonitorName: OperationURLParameter = { parameterPath: "sapMonitorName", mapper: { - required: true, serializedName: "sapMonitorName", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const sapMonitorParameter: OperationParameter = { + parameterPath: "sapMonitorParameter", + mapper: SapMonitorMapper +}; + +export const tagsParameter: OperationParameter = { + parameterPath: "tagsParameter", + mapper: TagsMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const providerInstanceName: OperationURLParameter = { + parameterPath: "providerInstanceName", + mapper: { + serializedName: "providerInstanceName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; + +export const providerInstanceParameter: OperationParameter = { + parameterPath: "providerInstanceParameter", + mapper: ProviderInstanceMapper +}; diff --git a/sdk/hanaonazure/arm-hanaonazure/src/models/sapMonitorsMappers.ts b/sdk/hanaonazure/arm-hanaonazure/src/models/sapMonitorsMappers.ts deleted file mode 100644 index 9da8ccf84683..000000000000 --- a/sdk/hanaonazure/arm-hanaonazure/src/models/sapMonitorsMappers.ts +++ /dev/null @@ -1,23 +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, - Disk, - ErrorResponse, - HanaInstance, - HardwareProfile, - IpAddress, - NetworkProfile, - OSProfile, - Resource, - SapMonitor, - SapMonitorListResult, - StorageProfile, - Tags -} from "../models/mappers"; diff --git a/sdk/hanaonazure/arm-hanaonazure/src/operations/hanaInstances.ts b/sdk/hanaonazure/arm-hanaonazure/src/operations/hanaInstances.ts deleted file mode 100644 index cfe2e48701a2..000000000000 --- a/sdk/hanaonazure/arm-hanaonazure/src/operations/hanaInstances.ts +++ /dev/null @@ -1,654 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/hanaInstancesMappers"; -import * as Parameters from "../models/parameters"; -import { HanaManagementClientContext } from "../hanaManagementClientContext"; - -/** Class representing a HanaInstances. */ -export class HanaInstances { - private readonly client: HanaManagementClientContext; - - /** - * Create a HanaInstances. - * @param {HanaManagementClientContext} client Reference to the service client. - */ - constructor(client: HanaManagementClientContext) { - this.client = client; - } - - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various - * properties of each SAP HANA on Azure instance. - * @summary Gets a list of SAP HANA instances in the specified subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; - } - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The - * operations returns various properties of each SAP HANA on Azure instance. - * @summary Gets a list of SAP HANA instances in the specified subscription and the resource group. - * @param resourceGroupName Name of the resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; - } - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and - * instance name. - * @summary Gets properties of a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param callback The callback - */ - get(resourceGroupName: string, hanaInstanceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, hanaInstanceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - hanaInstanceName, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * @summary Creates a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance - * @param [options] The optional parameters - * @returns Promise - */ - create(resourceGroupName: string, hanaInstanceName: string, hanaInstanceParameter: Models.HanaInstance, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(resourceGroupName,hanaInstanceName,hanaInstanceParameter,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * @summary Deletes a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,hanaInstanceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Patches the Tags field of a SAP HANA instance for the specified subscription, resource group, - * and instance name. - * @summary Patches the Tags field of a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param tagsParameter Request body that only contains the new Tags field - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, hanaInstanceName: string, tagsParameter: Models.Tags, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param tagsParameter Request body that only contains the new Tags field - * @param callback The callback - */ - update(resourceGroupName: string, hanaInstanceName: string, tagsParameter: Models.Tags, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param tagsParameter Request body that only contains the new Tags field - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, hanaInstanceName: string, tagsParameter: Models.Tags, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, hanaInstanceName: string, tagsParameter: Models.Tags, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - hanaInstanceName, - tagsParameter, - options - }, - updateOperationSpec, - callback) as Promise; - } - - /** - * The operation to restart a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param [options] The optional parameters - * @returns Promise - */ - restart(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginRestart(resourceGroupName,hanaInstanceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * The operation to start a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param [options] The optional parameters - * @returns Promise - */ - start(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginStart(resourceGroupName,hanaInstanceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * The operation to shutdown a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param [options] The optional parameters - * @returns Promise - */ - shutdown(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginShutdown(resourceGroupName,hanaInstanceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * @summary Creates a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance - * @param [options] The optional parameters - * @returns Promise - */ - beginCreate(resourceGroupName: string, hanaInstanceName: string, hanaInstanceParameter: Models.HanaInstance, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - hanaInstanceName, - hanaInstanceParameter, - options - }, - beginCreateOperationSpec, - options); - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * @summary Deletes a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteMethod(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - hanaInstanceName, - options - }, - beginDeleteMethodOperationSpec, - options); - } - - /** - * The operation to restart a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param [options] The optional parameters - * @returns Promise - */ - beginRestart(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - hanaInstanceName, - options - }, - beginRestartOperationSpec, - options); - } - - /** - * The operation to start a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param [options] The optional parameters - * @returns Promise - */ - beginStart(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - hanaInstanceName, - options - }, - beginStartOperationSpec, - options); - } - - /** - * The operation to shutdown a SAP HANA instance. - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param [options] The optional parameters - * @returns Promise - */ - beginShutdown(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - hanaInstanceName, - options - }, - beginShutdownOperationSpec, - options); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various - * properties of each SAP HANA on Azure instance. - * @summary Gets a list of SAP HANA instances in the specified subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The - * operations returns various properties of each SAP HANA on Azure instance. - * @summary Gets a list of SAP HANA instances in the specified subscription and the resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/hanaInstances", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.HanaInstancesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.HanaInstancesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hanaInstanceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.HanaInstance - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hanaInstanceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "tagsParameter", - mapper: { - ...Mappers.Tags, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.HanaInstance - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hanaInstanceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "hanaInstanceParameter", - mapper: { - ...Mappers.HanaInstance, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.HanaInstance - }, - 201: { - bodyMapper: Mappers.HanaInstance - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hanaInstanceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const beginRestartOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/restart", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hanaInstanceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const beginStartOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/start", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hanaInstanceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const beginShutdownOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/shutdown", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hanaInstanceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 202: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.HanaInstancesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.HanaInstancesListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; diff --git a/sdk/hanaonazure/arm-hanaonazure/src/operations/index.ts b/sdk/hanaonazure/arm-hanaonazure/src/operations/index.ts index 3d0d939c0761..51054130b040 100644 --- a/sdk/hanaonazure/arm-hanaonazure/src/operations/index.ts +++ b/sdk/hanaonazure/arm-hanaonazure/src/operations/index.ts @@ -1,13 +1,11 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./operations"; -export * from "./hanaInstances"; export * from "./sapMonitors"; +export * from "./providerInstances"; diff --git a/sdk/hanaonazure/arm-hanaonazure/src/operations/operations.ts b/sdk/hanaonazure/arm-hanaonazure/src/operations/operations.ts index 6f9d3634099a..f417f9f1cbd8 100644 --- a/sdk/hanaonazure/arm-hanaonazure/src/operations/operations.ts +++ b/sdk/hanaonazure/arm-hanaonazure/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 { HanaManagementClientContext } from "../hanaManagementClientContext"; +import { HanaManagementClient } from "../hanaManagementClient"; +import { + Operation, + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: HanaManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: HanaManagementClient; /** - * Create a Operations. - * @param {HanaManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: HanaManagementClientContext) { + constructor(client: HanaManagementClient) { this.client = client; } /** * Gets a list of SAP HANA management 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 + * Gets a list of SAP HANA management 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.HanaOnAzure/operations", httpMethod: "GET", - path: "providers/Microsoft.HanaOnAzure/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationList @@ -70,5 +91,8 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/hanaonazure/arm-hanaonazure/src/operations/providerInstances.ts b/sdk/hanaonazure/arm-hanaonazure/src/operations/providerInstances.ts new file mode 100644 index 000000000000..7665c79e1f59 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/src/operations/providerInstances.ts @@ -0,0 +1,477 @@ +/* + * 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 { ProviderInstances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HanaManagementClient } from "../hanaManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ProviderInstance, + ProviderInstancesListNextOptionalParams, + ProviderInstancesListOptionalParams, + ProviderInstancesListResponse, + ProviderInstancesGetOptionalParams, + ProviderInstancesGetResponse, + ProviderInstancesCreateOptionalParams, + ProviderInstancesCreateResponse, + ProviderInstancesDeleteOptionalParams, + ProviderInstancesListNextResponse +} from "../models"; + +/// +/** Class containing ProviderInstances operations. */ +export class ProviderInstancesImpl implements ProviderInstances { + private readonly client: HanaManagementClient; + + /** + * Initialize a new instance of the class ProviderInstances class. + * @param client Reference to the service client + */ + constructor(client: HanaManagementClient) { + this.client = client; + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various + * properties of each provider instances. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + sapMonitorName: string, + options?: ProviderInstancesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, sapMonitorName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, sapMonitorName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + sapMonitorName: string, + options?: ProviderInstancesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, sapMonitorName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + sapMonitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + sapMonitorName: string, + options?: ProviderInstancesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + sapMonitorName, + options + )) { + yield* page; + } + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various + * properties of each provider instances. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + sapMonitorName: string, + options?: ProviderInstancesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sapMonitorName, options }, + listOperationSpec + ); + } + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor + * name, and resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + sapMonitorName: string, + providerInstanceName: string, + options?: ProviderInstancesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sapMonitorName, providerInstanceName, options }, + getOperationSpec + ); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + sapMonitorName: string, + providerInstanceName: string, + providerInstanceParameter: ProviderInstance, + options?: ProviderInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProviderInstancesCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + sapMonitorName, + providerInstanceName, + providerInstanceParameter, + options + }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + sapMonitorName: string, + providerInstanceName: string, + providerInstanceParameter: ProviderInstance, + options?: ProviderInstancesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + sapMonitorName, + providerInstanceName, + providerInstanceParameter, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + sapMonitorName: string, + providerInstanceName: string, + options?: ProviderInstancesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, sapMonitorName, providerInstanceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + sapMonitorName: string, + providerInstanceName: string, + options?: ProviderInstancesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + sapMonitorName, + providerInstanceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + sapMonitorName: string, + nextLink: string, + options?: ProviderInstancesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sapMonitorName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}/providerInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProviderInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sapMonitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProviderInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sapMonitorName, + Parameters.providerInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ProviderInstance + }, + 201: { + bodyMapper: Mappers.ProviderInstance + }, + 202: { + bodyMapper: Mappers.ProviderInstance + }, + 204: { + bodyMapper: Mappers.ProviderInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.providerInstanceParameter, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sapMonitorName, + Parameters.providerInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sapMonitorName, + Parameters.providerInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProviderInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sapMonitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/hanaonazure/arm-hanaonazure/src/operations/sapMonitors.ts b/sdk/hanaonazure/arm-hanaonazure/src/operations/sapMonitors.ts index 7726f577bf80..453ea76abcd3 100644 --- a/sdk/hanaonazure/arm-hanaonazure/src/operations/sapMonitors.ts +++ b/sdk/hanaonazure/arm-hanaonazure/src/operations/sapMonitors.ts @@ -1,242 +1,331 @@ /* - * 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/sapMonitorsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SapMonitors } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HanaManagementClientContext } from "../hanaManagementClientContext"; +import { HanaManagementClient } from "../hanaManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + SapMonitor, + SapMonitorsListNextOptionalParams, + SapMonitorsListOptionalParams, + SapMonitorsListResponse, + SapMonitorsGetOptionalParams, + SapMonitorsGetResponse, + SapMonitorsCreateOptionalParams, + SapMonitorsCreateResponse, + SapMonitorsDeleteOptionalParams, + Tags, + SapMonitorsUpdateOptionalParams, + SapMonitorsUpdateResponse, + SapMonitorsListNextResponse +} from "../models"; -/** Class representing a SapMonitors. */ -export class SapMonitors { - private readonly client: HanaManagementClientContext; +/// +/** Class containing SapMonitors operations. */ +export class SapMonitorsImpl implements SapMonitors { + private readonly client: HanaManagementClient; /** - * Create a SapMonitors. - * @param {HanaManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class SapMonitors class. + * @param client Reference to the service client */ - constructor(client: HanaManagementClientContext) { + constructor(client: HanaManagementClient) { this.client = client; } /** - * Gets a list of SAP monitors in the specified subscription. The operations returns various - * properties of each SAP monitor. - * @summary Gets a list of SAP monitors in the specified subscription. - * @param [options] The optional parameters - * @returns Promise + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties + * of each SAP monitor. + * @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?: SapMonitorsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); }, - listOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: SapMonitorsListOptionalParams + ): 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?: SapMonitorsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** - * Gets properties of a SAP monitor for the specified subscription, resource group, and resource - * name. - * @summary Gets properties of a SAP monitor. - * @param resourceGroupName Name of the resource group. - * @param sapMonitorName Name of the SAP monitor resource. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, sapMonitorName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group. - * @param sapMonitorName Name of the SAP monitor resource. - * @param callback The callback + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties + * of each SAP monitor. + * @param options The options parameters. */ - get(resourceGroupName: string, sapMonitorName: string, callback: msRest.ServiceCallback): void; + private _list( + options?: SapMonitorsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. * @param resourceGroupName Name of the resource group. * @param sapMonitorName Name of the SAP monitor resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, sapMonitorName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, sapMonitorName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + sapMonitorName: string, + options?: SapMonitorsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - sapMonitorName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, sapMonitorName, options }, + getOperationSpec + ); } /** * Creates a SAP monitor for the specified subscription, resource group, and resource name. - * @summary Creates a SAP monitor. * @param resourceGroupName Name of the resource group. * @param sapMonitorName Name of the SAP monitor resource. * @param sapMonitorParameter Request body representing a SAP Monitor - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(resourceGroupName: string, sapMonitorName: string, sapMonitorParameter: Models.SapMonitor, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(resourceGroupName,sapMonitorName,sapMonitorParameter,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreate( + resourceGroupName: string, + sapMonitorName: string, + sapMonitorParameter: SapMonitor, + options?: SapMonitorsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SapMonitorsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, sapMonitorName, sapMonitorParameter, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. - * @summary Deletes a SAP monitor. + * Creates a SAP monitor for the specified subscription, resource group, and resource name. * @param resourceGroupName Name of the resource group. * @param sapMonitorName Name of the SAP monitor resource. - * @param [options] The optional parameters - * @returns Promise + * @param sapMonitorParameter Request body representing a SAP Monitor + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, sapMonitorName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,sapMonitorName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateAndWait( + resourceGroupName: string, + sapMonitorName: string, + sapMonitorParameter: SapMonitor, + options?: SapMonitorsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + sapMonitorName, + sapMonitorParameter, + options + ); + return poller.pollUntilDone(); } /** - * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and - * monitor name. - * @summary Patches the Tags field of a SAP monitor. - * @param resourceGroupName Name of the resource group. - * @param sapMonitorName Name of the SAP monitor resource. - * @param tagsParameter Request body that only contains the new Tags field - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, sapMonitorName: string, tagsParameter: Models.Tags, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group. - * @param sapMonitorName Name of the SAP monitor resource. - * @param tagsParameter Request body that only contains the new Tags field - * @param callback The callback - */ - update(resourceGroupName: string, sapMonitorName: string, tagsParameter: Models.Tags, callback: msRest.ServiceCallback): void; - /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. * @param resourceGroupName Name of the resource group. * @param sapMonitorName Name of the SAP monitor resource. - * @param tagsParameter Request body that only contains the new Tags field - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, sapMonitorName: string, tagsParameter: Models.Tags, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, sapMonitorName: string, tagsParameter: Models.Tags, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - sapMonitorName, - tagsParameter, - options - }, - updateOperationSpec, - callback) as Promise; + async beginDelete( + resourceGroupName: string, + sapMonitorName: string, + options?: SapMonitorsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, sapMonitorName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Creates a SAP monitor for the specified subscription, resource group, and resource name. - * @summary Creates a SAP monitor. + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. * @param resourceGroupName Name of the resource group. * @param sapMonitorName Name of the SAP monitor resource. - * @param sapMonitorParameter Request body representing a SAP Monitor - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreate(resourceGroupName: string, sapMonitorName: string, sapMonitorParameter: Models.SapMonitor, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - sapMonitorName, - sapMonitorParameter, - options - }, - beginCreateOperationSpec, - options); + async beginDeleteAndWait( + resourceGroupName: string, + sapMonitorName: string, + options?: SapMonitorsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + sapMonitorName, + options + ); + return poller.pollUntilDone(); } /** - * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. - * @summary Deletes a SAP monitor. + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor + * name. * @param resourceGroupName Name of the resource group. * @param sapMonitorName Name of the SAP monitor resource. - * @param [options] The optional parameters - * @returns Promise + * @param tagsParameter Request body that only contains the new Tags field + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, sapMonitorName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - sapMonitorName, - options - }, - beginDeleteMethodOperationSpec, - options); + update( + resourceGroupName: string, + sapMonitorName: string, + tagsParameter: Tags, + options?: SapMonitorsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sapMonitorName, tagsParameter, options }, + updateOperationSpec + ); } /** - * Gets a list of SAP monitors in the specified subscription. The operations returns various - * properties of each SAP monitor. - * @summary Gets a list of SAP monitors in the specified subscription. - * @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?: SapMonitorsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/sapMonitors", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/sapMonitors", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.SapMonitorListResult @@ -245,23 +334,15 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.sapMonitorName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.SapMonitor @@ -270,62 +351,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.sapMonitorName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "tagsParameter", - mapper: { - ...Mappers.Tags, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.SapMonitor - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + headerParameters: [Parameters.accept], serializer }; - -const beginCreateOperationSpec: msRest.OperationSpec = { +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.sapMonitorName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "sapMonitorParameter", - mapper: { - ...Mappers.SapMonitor, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.SapMonitor @@ -333,48 +372,78 @@ const beginCreateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.SapMonitor }, + 202: { + bodyMapper: Mappers.SapMonitor + }, + 204: { + bodyMapper: Mappers.SapMonitor + }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}", + requestBody: Parameters.sapMonitorParameter, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.sapMonitorName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sapMonitorName + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.SapMonitor + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.tagsParameter, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sapMonitorName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SapMonitorListResult @@ -383,5 +452,12 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/index.ts b/sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..51054130b040 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./sapMonitors"; +export * from "./providerInstances"; diff --git a/sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/operations.ts b/sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..f57ad9dd11b9 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/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 { + /** + * Gets a list of SAP HANA management operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/providerInstances.ts b/sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/providerInstances.ts new file mode 100644 index 000000000000..d30ee1405069 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/providerInstances.ts @@ -0,0 +1,115 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ProviderInstance, + ProviderInstancesListOptionalParams, + ProviderInstancesGetOptionalParams, + ProviderInstancesGetResponse, + ProviderInstancesCreateOptionalParams, + ProviderInstancesCreateResponse, + ProviderInstancesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a ProviderInstances. */ +export interface ProviderInstances { + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various + * properties of each provider instances. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + sapMonitorName: string, + options?: ProviderInstancesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor + * name, and resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + sapMonitorName: string, + providerInstanceName: string, + options?: ProviderInstancesGetOptionalParams + ): Promise; + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + sapMonitorName: string, + providerInstanceName: string, + providerInstanceParameter: ProviderInstance, + options?: ProviderInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProviderInstancesCreateResponse + > + >; + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + sapMonitorName: string, + providerInstanceName: string, + providerInstanceParameter: ProviderInstance, + options?: ProviderInstancesCreateOptionalParams + ): Promise; + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + sapMonitorName: string, + providerInstanceName: string, + options?: ProviderInstancesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + sapMonitorName: string, + providerInstanceName: string, + options?: ProviderInstancesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/sapMonitors.ts b/sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/sapMonitors.ts new file mode 100644 index 000000000000..bd15db7b7f98 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/src/operationsInterfaces/sapMonitors.ts @@ -0,0 +1,113 @@ +/* + * 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 { + SapMonitor, + SapMonitorsListOptionalParams, + SapMonitorsGetOptionalParams, + SapMonitorsGetResponse, + SapMonitorsCreateOptionalParams, + SapMonitorsCreateResponse, + SapMonitorsDeleteOptionalParams, + Tags, + SapMonitorsUpdateOptionalParams, + SapMonitorsUpdateResponse +} from "../models"; + +/// +/** Interface representing a SapMonitors. */ +export interface SapMonitors { + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties + * of each SAP monitor. + * @param options The options parameters. + */ + list( + options?: SapMonitorsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + sapMonitorName: string, + options?: SapMonitorsGetOptionalParams + ): Promise; + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter Request body representing a SAP Monitor + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + sapMonitorName: string, + sapMonitorParameter: SapMonitor, + options?: SapMonitorsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SapMonitorsCreateResponse + > + >; + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter Request body representing a SAP Monitor + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + sapMonitorName: string, + sapMonitorParameter: SapMonitor, + options?: SapMonitorsCreateOptionalParams + ): Promise; + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + sapMonitorName: string, + options?: SapMonitorsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + sapMonitorName: string, + options?: SapMonitorsDeleteOptionalParams + ): Promise; + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor + * name. + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Request body that only contains the new Tags field + * @param options The options parameters. + */ + update( + resourceGroupName: string, + sapMonitorName: string, + tagsParameter: Tags, + options?: SapMonitorsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/hanaonazure/arm-hanaonazure/test/sampleTest.ts b/sdk/hanaonazure/arm-hanaonazure/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/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/hanaonazure/arm-hanaonazure/tsconfig.json b/sdk/hanaonazure/arm-hanaonazure/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/hanaonazure/arm-hanaonazure/tsconfig.json +++ b/sdk/hanaonazure/arm-hanaonazure/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/hanaonazure/ci.yml b/sdk/hanaonazure/ci.yml new file mode 100644 index 000000000000..8055e25be2de --- /dev/null +++ b/sdk/hanaonazure/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/hanaonazure/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/hanaonazure/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: hanaonazure + Artifacts: + - name: azure-arm-hanaonazure + safeName: azurearmhanaonazure + \ No newline at end of file