From 0c80bb5e8529f8c1af06912c55e9b02882cd9e36 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 08:48:52 +0000 Subject: [PATCH] CodeGen from PR 16973 in Azure/azure-rest-api-specs Track2 modify readme.go.md 8 (#16973) * Track2 modify readme.go.md 8 * backup,siterecovery into recoveryservices --- common/config/rush/pnpm-lock.yaml | 131 +- rush.json | 5 + .../arm-redisenterprisecache/CHANGELOG.md | 11 + .../{LICENSE.txt => LICENSE} | 4 +- .../arm-redisenterprisecache/README.md | 138 +- .../arm-redisenterprisecache/_meta.json | 7 + .../api-extractor.json | 18 + .../arm-redisenterprisecache/package.json | 94 +- .../review/arm-redisenterprisecache.api.md | 705 +++++++ .../arm-redisenterprisecache/rollup.config.js | 211 +- .../{models/operationsMappers.ts => index.ts} | 12 +- .../arm-redisenterprisecache/src/lroImpl.ts | 34 + .../src/models/databasesMappers.ts | 33 - .../src/models/index.ts | 1771 +++++++---------- .../src/models/mappers.ts | 951 +++++---- .../src/models/parameters.ts | 178 +- .../privateEndpointConnectionsMappers.ts | 28 - .../src/models/privateLinkResourcesMappers.ts | 28 - .../src/models/redisEnterpriseMappers.ts | 29 - .../src/operations/databases.ts | 1208 +++++++---- .../src/operations/index.ts | 3 +- .../src/operations/operations.ts | 158 +- .../src/operations/operationsStatus.ts | 88 +- .../operations/privateEndpointConnections.ts | 428 ++-- .../src/operations/privateLinkResources.ts | 143 +- .../src/operations/redisEnterprise.ts | 839 +++++--- .../src/operationsInterfaces/databases.ts | 264 +++ .../index.ts} | 12 +- .../src/operationsInterfaces/operations.ts | 22 + .../operationsInterfaces/operationsStatus.ts | 27 + .../privateEndpointConnections.ts | 102 + .../privateLinkResources.ts | 29 + .../operationsInterfaces/redisEnterprise.ts | 139 ++ .../src/redisEnterpriseManagementClient.ts | 120 +- .../redisEnterpriseManagementClientContext.ts | 61 - .../test/sampleTest.ts | 48 + .../arm-redisenterprisecache/tsconfig.json | 6 +- sdk/redisenterprise/ci.yml | 29 + 38 files changed, 4969 insertions(+), 3145 deletions(-) create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/CHANGELOG.md rename sdk/redisenterprise/arm-redisenterprisecache/{LICENSE.txt => LICENSE} (96%) create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/_meta.json create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/api-extractor.json create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/review/arm-redisenterprisecache.api.md rename sdk/redisenterprise/arm-redisenterprisecache/src/{models/operationsMappers.ts => index.ts} (54%) create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/lroImpl.ts delete mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/models/databasesMappers.ts delete mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/models/privateEndpointConnectionsMappers.ts delete mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/models/privateLinkResourcesMappers.ts delete mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/models/redisEnterpriseMappers.ts create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/databases.ts rename sdk/redisenterprise/arm-redisenterprisecache/src/{models/operationsStatusMappers.ts => operationsInterfaces/index.ts} (51%) create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/operations.ts create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/operationsStatus.ts create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateEndpointConnections.ts create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateLinkResources.ts create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/redisEnterprise.ts delete mode 100644 sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClientContext.ts create mode 100644 sdk/redisenterprise/arm-redisenterprisecache/test/sampleTest.ts create mode 100644 sdk/redisenterprise/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..6a85aa5667e9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -63,6 +63,7 @@ specifiers: '@rush-temp/arm-quota': file:./projects/arm-quota.tgz '@rush-temp/arm-recoveryservices': file:./projects/arm-recoveryservices.tgz '@rush-temp/arm-rediscache': file:./projects/arm-rediscache.tgz + '@rush-temp/arm-redisenterprisecache': file:./projects/arm-redisenterprisecache.tgz '@rush-temp/arm-relay': file:./projects/arm-relay.tgz '@rush-temp/arm-resourcehealth': file:./projects/arm-resourcehealth.tgz '@rush-temp/arm-resources': file:./projects/arm-resources.tgz @@ -244,6 +245,7 @@ dependencies: '@rush-temp/arm-quota': file:projects/arm-quota.tgz '@rush-temp/arm-recoveryservices': file:projects/arm-recoveryservices.tgz '@rush-temp/arm-rediscache': file:projects/arm-rediscache.tgz + '@rush-temp/arm-redisenterprisecache': file:projects/arm-redisenterprisecache.tgz '@rush-temp/arm-relay': file:projects/arm-relay.tgz '@rush-temp/arm-resourcehealth': file:projects/arm-resourcehealth.tgz '@rush-temp/arm-resources': file:projects/arm-resources.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 @@ -9106,6 +9108,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-redisenterprisecache.tgz: + resolution: {integrity: sha512-1YJqhmES9j6e/6frVCJbB/0KMLNdTd9rch+leUAdAS0TCph/unQuHKldxeXZYxojLRZFd28mLsZk2qJPb1ijlA==, tarball: file:projects/arm-redisenterprisecache.tgz} + name: '@rush-temp/arm-redisenterprisecache' + 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-relay.tgz: resolution: {integrity: sha512-GTqmfFZ2ToplfgtJe7mDyTK9SRPuo5niMG5PTxOuHnjdqY9KG8+6nKu5rVgFsjIinMD+A/V52b1zHMK5cIjYfQ==, tarball: file:projects/arm-relay.tgz} name: '@rush-temp/arm-relay' @@ -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..2a314292d87a 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-redisenterprisecache", + "projectFolder": "sdk/redisenterprise/arm-redisenterprisecache", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/redisenterprise/arm-redisenterprisecache/CHANGELOG.md b/sdk/redisenterprise/arm-redisenterprisecache/CHANGELOG.md new file mode 100644 index 000000000000..ae37ce97912a --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-01-05) + +The package of @azure/arm-redisenterprisecache is using our next generation design principles since version 2.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/redisenterprise/arm-redisenterprisecache/LICENSE.txt b/sdk/redisenterprise/arm-redisenterprisecache/LICENSE similarity index 96% rename from sdk/redisenterprise/arm-redisenterprisecache/LICENSE.txt rename to sdk/redisenterprise/arm-redisenterprisecache/LICENSE index 2d3163745319..5d1d36e0af80 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/LICENSE.txt +++ b/sdk/redisenterprise/arm-redisenterprisecache/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/redisenterprise/arm-redisenterprisecache/README.md b/sdk/redisenterprise/arm-redisenterprisecache/README.md index f4ed2933f01d..0885ba794062 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/README.md +++ b/sdk/redisenterprise/arm-redisenterprisecache/README.md @@ -1,98 +1,98 @@ -## Azure RedisEnterpriseManagementClient SDK for JavaScript +# Azure RedisEnterpriseManagement client library for JavaScript -This package contains an isomorphic SDK for RedisEnterpriseManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure RedisEnterpriseManagement client. + +REST API for managing Redis Enterprise resources in Azure. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redisenterprise/arm-redisenterprisecache) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-redisenterprisecache) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-redisenterprisecache) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-redisenterprisecache` package -### How to Install +Install the Azure RedisEnterpriseManagement client library for JavaScript with `npm`: ```bash npm install @azure/arm-redisenterprisecache ``` -### How to use +### Create and authenticate a `RedisEnterpriseManagementClient` -#### nodejs - client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure RedisEnterpriseManagement API, you will need the `endpoint` of your Azure RedisEnterpriseManagement resource and a `credential`. The Azure RedisEnterpriseManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure RedisEnterpriseManagement resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" +npm install @azure/identity ``` -##### Sample code +You will also need to **register a new AAD application and grant access to Azure RedisEnterpriseManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). -While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package -```typescript -const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +```javascript const { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new RedisEnterpriseManagementClient(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new RedisEnterpriseManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). -```bash -npm install @azure/ms-rest-browserauth -``` +## Key concepts + +### RedisEnterpriseManagementClient -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-redisenterprisecache sample - - - - - - - - +`RedisEnterpriseManagementClient` is the primary interface for developers using the Azure RedisEnterpriseManagement client library. Explore the methods on this client object to understand the different features of the Azure RedisEnterpriseManagement 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%2Fredisenterprise%2Farm-redisenterprisecache%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/redisenterprise/arm-redisenterprisecache/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/redisenterprise/arm-redisenterprisecache/_meta.json b/sdk/redisenterprise/arm-redisenterprisecache/_meta.json new file mode 100644 index 000000000000..a551986d2e9a --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "5a1b7262be0a4f6a9004d35403b854429475cdf4", + "readme": "specification/redisenterprise/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/redisenterprise/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/redisenterprise/arm-redisenterprisecache/api-extractor.json b/sdk/redisenterprise/arm-redisenterprisecache/api-extractor.json new file mode 100644 index 000000000000..aa467acd6d7c --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/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-redisenterprisecache.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/package.json b/sdk/redisenterprise/arm-redisenterprisecache/package.json index 016c6da09bcf..22736c3d4026 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/package.json +++ b/sdk/redisenterprise/arm-redisenterprisecache/package.json @@ -1,57 +1,91 @@ { "name": "@azure/arm-redisenterprisecache", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "RedisEnterpriseManagementClient Library with typescript type definitions for node.js and browser.", - "version": "1.0.0", + "description": "A generated SDK for RedisEnterpriseManagementClient.", + "version": "2.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-redisenterprisecache.js", - "module": "./esm/redisEnterpriseManagementClient.js", - "types": "./esm/redisEnterpriseManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-redisenterprisecache.d.ts", "devDependencies": { - "typescript": "^3.5.3", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redisenterprise/arm-redisenterprisecache", "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-redisenterprisecache.js.map'\" -o ./dist/arm-redisenterprisecache.min.js ./dist/arm-redisenterprisecache.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/redisenterprise/arm-redisenterprisecache/review/arm-redisenterprisecache.api.md b/sdk/redisenterprise/arm-redisenterprisecache/review/arm-redisenterprisecache.api.md new file mode 100644 index 000000000000..51f77a9c4487 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/review/arm-redisenterprisecache.api.md @@ -0,0 +1,705 @@ +## API Report File for "@azure/arm-redisenterprisecache" + +> 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 AccessKeys { + readonly primaryKey?: string; + readonly secondaryKey?: string; +} + +// @public +export type AccessKeyType = "Primary" | "Secondary"; + +// @public +export type ActionType = string; + +// @public +export type AofFrequency = string; + +// @public +export type Cluster = TrackedResource & { + sku: Sku; + zones?: string[]; + minimumTlsVersion?: TlsVersion; + readonly hostName?: string; + readonly provisioningState?: ProvisioningState; + readonly resourceState?: ResourceState; + readonly redisVersion?: string; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; +}; + +// @public +export type ClusteringPolicy = string; + +// @public +export interface ClusterList { + readonly nextLink?: string; + value?: Cluster[]; +} + +// @public +export interface ClusterUpdate { + readonly hostName?: string; + minimumTlsVersion?: TlsVersion; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningState; + readonly redisVersion?: string; + readonly resourceState?: ResourceState; + sku?: Sku; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type Database = ProxyResource & { + clientProtocol?: Protocol; + port?: number; + readonly provisioningState?: ProvisioningState; + readonly resourceState?: ResourceState; + clusteringPolicy?: ClusteringPolicy; + evictionPolicy?: EvictionPolicy; + persistence?: Persistence; + modules?: Module[]; +}; + +// @public +export interface DatabaseList { + readonly nextLink?: string; + value?: Database[]; +} + +// @public +export interface Databases { + beginCreate(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Database, options?: DatabasesCreateOptionalParams): Promise, DatabasesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Database, options?: DatabasesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterName: string, databaseName: string, options?: DatabasesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, databaseName: string, options?: DatabasesDeleteOptionalParams): Promise; + beginExport(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ExportClusterParameters, options?: DatabasesExportOptionalParams): Promise, void>>; + beginExportAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ExportClusterParameters, options?: DatabasesExportOptionalParams): Promise; + beginImport(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ImportClusterParameters, options?: DatabasesImportOptionalParams): Promise, void>>; + beginImportAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ImportClusterParameters, options?: DatabasesImportOptionalParams): Promise; + beginRegenerateKey(resourceGroupName: string, clusterName: string, databaseName: string, parameters: RegenerateKeyParameters, options?: DatabasesRegenerateKeyOptionalParams): Promise, DatabasesRegenerateKeyResponse>>; + beginRegenerateKeyAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: RegenerateKeyParameters, options?: DatabasesRegenerateKeyOptionalParams): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, databaseName: string, parameters: DatabaseUpdate, options?: DatabasesUpdateOptionalParams): Promise, DatabasesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: DatabaseUpdate, options?: DatabasesUpdateOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, databaseName: string, options?: DatabasesGetOptionalParams): Promise; + listByCluster(resourceGroupName: string, clusterName: string, options?: DatabasesListByClusterOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, clusterName: string, databaseName: string, options?: DatabasesListKeysOptionalParams): Promise; +} + +// @public +export interface DatabasesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DatabasesCreateResponse = Database; + +// @public +export interface DatabasesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DatabasesExportOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DatabasesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DatabasesGetResponse = Database; + +// @public +export interface DatabasesImportOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DatabasesListByClusterNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DatabasesListByClusterNextResponse = DatabaseList; + +// @public +export interface DatabasesListByClusterOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DatabasesListByClusterResponse = DatabaseList; + +// @public +export interface DatabasesListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DatabasesListKeysResponse = AccessKeys; + +// @public +export interface DatabasesRegenerateKeyOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DatabasesRegenerateKeyResponse = AccessKeys; + +// @public +export interface DatabasesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DatabasesUpdateResponse = Database; + +// @public +export interface DatabaseUpdate { + clientProtocol?: Protocol; + clusteringPolicy?: ClusteringPolicy; + evictionPolicy?: EvictionPolicy; + modules?: Module[]; + persistence?: Persistence; + port?: number; + readonly provisioningState?: ProvisioningState; + readonly resourceState?: ResourceState; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export type EvictionPolicy = string; + +// @public +export interface ExportClusterParameters { + sasUri: string; +} + +// @public +export interface ImportClusterParameters { + sasUris: string[]; +} + +// @public +export enum KnownActionType { + // (undocumented) + Internal = "Internal" +} + +// @public +export enum KnownAofFrequency { + // (undocumented) + Always = "always", + // (undocumented) + OneS = "1s" +} + +// @public +export enum KnownClusteringPolicy { + // (undocumented) + EnterpriseCluster = "EnterpriseCluster", + // (undocumented) + OSSCluster = "OSSCluster" +} + +// @public +export enum KnownEvictionPolicy { + // (undocumented) + AllKeysLFU = "AllKeysLFU", + // (undocumented) + AllKeysLRU = "AllKeysLRU", + // (undocumented) + AllKeysRandom = "AllKeysRandom", + // (undocumented) + NoEviction = "NoEviction", + // (undocumented) + VolatileLFU = "VolatileLFU", + // (undocumented) + VolatileLRU = "VolatileLRU", + // (undocumented) + VolatileRandom = "VolatileRandom", + // (undocumented) + VolatileTTL = "VolatileTTL" +} + +// @public +export enum KnownOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user", + // (undocumented) + UserSystem = "user,system" +} + +// @public +export enum KnownPrivateEndpointConnectionProvisioningState { + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + // (undocumented) + Approved = "Approved", + // (undocumented) + Pending = "Pending", + // (undocumented) + Rejected = "Rejected" +} + +// @public +export enum KnownProtocol { + // (undocumented) + Encrypted = "Encrypted", + // (undocumented) + Plaintext = "Plaintext" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownRdbFrequency { + // (undocumented) + OneH = "1h", + // (undocumented) + SixH = "6h", + // (undocumented) + TwelveH = "12h" +} + +// @public +export enum KnownResourceState { + // (undocumented) + CreateFailed = "CreateFailed", + // (undocumented) + Creating = "Creating", + // (undocumented) + DeleteFailed = "DeleteFailed", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Disabled = "Disabled", + // (undocumented) + DisableFailed = "DisableFailed", + // (undocumented) + Disabling = "Disabling", + // (undocumented) + EnableFailed = "EnableFailed", + // (undocumented) + Enabling = "Enabling", + // (undocumented) + Running = "Running", + // (undocumented) + UpdateFailed = "UpdateFailed", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownSkuName { + // (undocumented) + EnterpriseE10 = "Enterprise_E10", + // (undocumented) + EnterpriseE100 = "Enterprise_E100", + // (undocumented) + EnterpriseE20 = "Enterprise_E20", + // (undocumented) + EnterpriseE50 = "Enterprise_E50", + // (undocumented) + EnterpriseFlashF1500 = "EnterpriseFlash_F1500", + // (undocumented) + EnterpriseFlashF300 = "EnterpriseFlash_F300", + // (undocumented) + EnterpriseFlashF700 = "EnterpriseFlash_F700" +} + +// @public +export enum KnownTlsVersion { + // (undocumented) + One0 = "1.0", + // (undocumented) + One1 = "1.1", + // (undocumented) + One2 = "1.2" +} + +// @public +export interface Module { + args?: string; + name: string; + readonly version?: string; +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export interface OperationsStatus { + get(location: string, operationId: string, options?: OperationsStatusGetOptionalParams): Promise; +} + +// @public +export interface OperationsStatusGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsStatusGetResponse = OperationStatus; + +// @public +export interface OperationStatus { + endTime?: string; + error?: ErrorResponse; + id?: string; + name?: string; + startTime?: string; + status?: string; +} + +// @public +export type Origin = string; + +// @public +export interface Persistence { + aofEnabled?: boolean; + aofFrequency?: AofFrequency; + rdbEnabled?: boolean; + rdbFrequency?: RdbFrequency; +} + +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export type PrivateEndpointConnection = Resource & { + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +}; + +// @public +export interface PrivateEndpointConnectionListResult { + value?: PrivateEndpointConnection[]; +} + +// @public +export type PrivateEndpointConnectionProvisioningState = string; + +// @public +export interface PrivateEndpointConnections { + beginPut(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams): Promise, PrivateEndpointConnectionsPutResponse>>; + beginPutAndWait(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams): Promise; + delete(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + list(resourceGroupName: string, clusterName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateEndpointConnectionsPutOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsPutResponse = PrivateEndpointConnection; + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export type PrivateLinkResource = Resource & { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +}; + +// @public +export interface PrivateLinkResourceListResult { + value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResources { + listByCluster(resourceGroupName: string, clusterName: string, options?: PrivateLinkResourcesListByClusterOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateLinkResourcesListByClusterOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByClusterResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + +// @public +export type Protocol = string; + +// @public +export type ProvisioningState = string; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export type RdbFrequency = string; + +// @public +export interface RedisEnterprise { + beginCreate(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: RedisEnterpriseCreateOptionalParams): Promise, RedisEnterpriseCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: RedisEnterpriseCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterName: string, options?: RedisEnterpriseDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, options?: RedisEnterpriseDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, parameters: ClusterUpdate, options?: RedisEnterpriseUpdateOptionalParams): Promise, RedisEnterpriseUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, clusterName: string, parameters: ClusterUpdate, options?: RedisEnterpriseUpdateOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, options?: RedisEnterpriseGetOptionalParams): Promise; + list(options?: RedisEnterpriseListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: RedisEnterpriseListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RedisEnterpriseCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type RedisEnterpriseCreateResponse = Cluster; + +// @public +export interface RedisEnterpriseDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface RedisEnterpriseGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RedisEnterpriseGetResponse = Cluster; + +// @public +export interface RedisEnterpriseListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RedisEnterpriseListByResourceGroupNextResponse = ClusterList; + +// @public +export interface RedisEnterpriseListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RedisEnterpriseListByResourceGroupResponse = ClusterList; + +// @public +export interface RedisEnterpriseListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RedisEnterpriseListNextResponse = ClusterList; + +// @public +export interface RedisEnterpriseListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RedisEnterpriseListResponse = ClusterList; + +// @public (undocumented) +export class RedisEnterpriseManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: RedisEnterpriseManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + databases: Databases; + // (undocumented) + operations: Operations; + // (undocumented) + operationsStatus: OperationsStatus; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) + redisEnterprise: RedisEnterprise; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface RedisEnterpriseManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface RedisEnterpriseUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type RedisEnterpriseUpdateResponse = Cluster; + +// @public +export interface RegenerateKeyParameters { + keyType: AccessKeyType; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type ResourceState = string; + +// @public +export interface Sku { + capacity?: number; + name: SkuName; +} + +// @public +export type SkuName = string; + +// @public +export type TlsVersion = string; + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redisenterprise/arm-redisenterprisecache/rollup.config.js b/sdk/redisenterprise/arm-redisenterprisecache/rollup.config.js index 28ecf3b872aa..9be1955eb7f1 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/rollup.config.js +++ b/sdk/redisenterprise/arm-redisenterprisecache/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; -import sourcemaps from "rollup-plugin-sourcemaps"; - -/** - * @type {rollup.RollupFileOptions} - */ -const config = { - input: "./esm/redisEnterpriseManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-redisenterprisecache.js", - format: "umd", - name: "Azure.ArmRedisenterprisecache", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" - }, - banner: `/* +/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/operationsMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/index.ts similarity index 54% rename from sdk/redisenterprise/arm-redisenterprisecache/src/models/operationsMappers.ts rename to sdk/redisenterprise/arm-redisenterprisecache/src/index.ts index fddc3077d64b..4e5c5ae264da 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/operationsMappers.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/index.ts @@ -6,11 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export { - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; +/// +export * from "./models"; +export { RedisEnterpriseManagementClient } from "./redisEnterpriseManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/lroImpl.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/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/redisenterprise/arm-redisenterprisecache/src/models/databasesMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/databasesMappers.ts deleted file mode 100644 index 8b92032e0b14..000000000000 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/databasesMappers.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AccessKeys, - AzureEntityResource, - BaseResource, - Cluster, - Database, - DatabaseList, - DatabaseUpdate, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - ExportClusterParameters, - ImportClusterParameters, - Module, - Persistence, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateLinkResource, - PrivateLinkServiceConnectionState, - ProxyResource, - RegenerateKeyParameters, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/index.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/index.ts index 1f701a1789fc..d2481bd0e776 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/index.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/index.ts @@ -6,1313 +6,930 @@ * 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 }; - -/** - * SKU parameters supplied to the create RedisEnterprise operation. - */ -export interface Sku { +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { /** - * The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, - * EnterpriseFlash_F300 etc.). Possible values include: 'Enterprise_E10', 'Enterprise_E20', - * 'Enterprise_E50', 'Enterprise_E100', 'EnterpriseFlash_F300', 'EnterpriseFlash_F700', - * 'EnterpriseFlash_F1500' + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name: SkuName; + readonly value?: Operation[]; /** - * The size of the RedisEnterprise cluster. Defaults to 2 or 3 depending on SKU. Valid values are - * (2, 4, 6, ...) for Enterprise SKUs and (3, 9, 15, ...) for Flash SKUs. + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - capacity?: number; + readonly nextLink?: string; } -/** - * The Private Endpoint resource. - */ -export interface PrivateEndpoint { +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { /** - * The ARM identifier for Private Endpoint - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; -} - -/** - * A collection of information about the state of the connection between service consumer and - * provider. - */ -export interface PrivateLinkServiceConnectionState { + readonly name?: string; /** - * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. Possible values include: 'Pending', 'Approved', 'Rejected' + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status?: PrivateEndpointServiceConnectionStatus; + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; /** - * The reason for approval/rejection of the connection. + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; + readonly origin?: Origin; /** - * A message indicating if changes on the service provider require any updates on the consumer. + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - actionsRequired?: string; + readonly actionType?: ActionType; } -/** - * Common fields that are returned in the response for all Azure Resource Manager resources - * @summary Resource - */ -export interface Resource extends BaseResource { +/** Localized display information for this particular operation. */ +export interface OperationDisplay { /** - * 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.** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly provider?: string; /** - * The name of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly resource?: string; /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - * "Microsoft.Storage/storageAccounts" - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; } -/** - * The Private Endpoint Connection resource. - */ -export interface PrivateEndpointConnection extends Resource { +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { /** - * The resource of private end point. + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - privateEndpoint?: PrivateEndpoint; + readonly code?: string; /** - * A collection of information about the state of the connection between service consumer and - * provider. + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly message?: string; /** - * The provisioning state of the private endpoint connection resource. Possible values include: - * 'Succeeded', 'Creating', 'Deleting', 'Failed' + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provisioningState?: PrivateEndpointConnectionProvisioningState; -} - -/** - * The resource model definition for an Azure Resource Manager tracked top level resource which has - * 'tags' and a 'location' - * @summary Tracked Resource - */ -export interface TrackedResource extends Resource { + readonly target?: string; /** - * Resource tags. + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly details?: ErrorDetail[]; /** - * The geo-location where the resource lives + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location: string; + readonly additionalInfo?: ErrorAdditionalInfo[]; } -/** - * Describes the RedisEnterprise cluster - */ -export interface Cluster extends TrackedResource { - /** - * The SKU to create, which affects price, performance, and features. - */ - sku: Sku; - /** - * The Availability Zones where this cluster will be deployed. - */ - zones?: string[]; +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { /** - * The minimum TLS version for the cluster to support, e.g. '1.2'. Possible values include: - * '1.0', '1.1', '1.2' + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - minimumTlsVersion?: TlsVersion; + readonly type?: string; /** - * DNS name of the cluster endpoint - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly hostName?: string; + readonly info?: Record; +} + +/** The status of a long-running operation. */ +export interface OperationStatus { + /** The operation's unique id. */ + id?: string; + /** The operation's name. */ + name?: string; + /** The start time of the operation. */ + startTime?: string; + /** The end time of the operation. */ + endTime?: string; + /** The current status of the operation. */ + status?: string; + /** Error response describing why the operation failed. */ + error?: ErrorResponse; +} + +/** SKU parameters supplied to the create RedisEnterprise operation. */ +export interface Sku { + /** The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.) */ + name: SkuName; + /** The size of the RedisEnterprise cluster. Defaults to 2 or 3 depending on SKU. Valid values are (2, 4, 6, ...) for Enterprise SKUs and (3, 9, 15, ...) for Flash SKUs. */ + capacity?: number; +} + +/** The Private Endpoint resource. */ +export interface PrivateEndpoint { /** - * Current provisioning status of the cluster. Possible values include: 'Succeeded', 'Failed', - * 'Canceled', 'Creating', 'Updating', 'Deleting' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ARM identifier for Private Endpoint + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: ProvisioningState; + readonly id?: string; +} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * Current resource status of the cluster. Possible values include: 'Running', 'Creating', - * 'CreateFailed', 'Updating', 'UpdateFailed', 'Deleting', 'DeleteFailed', 'Enabling', - * 'EnableFailed', 'Disabling', 'DisableFailed', 'Disabled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resourceState?: ResourceState; + readonly id?: string; /** - * Version of redis the cluster supports, e.g. '6' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly redisVersion?: string; + readonly name?: string; /** - * List of private endpoint connections associated with the specified RedisEnterprise cluster - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly type?: string; } -/** - * A partial update to the RedisEnterprise cluster - */ +/** A partial update to the RedisEnterprise cluster */ export interface ClusterUpdate { - /** - * The SKU to create, which affects price, performance, and features. - */ + /** The SKU to create, which affects price, performance, and features. */ sku?: Sku; - /** - * The minimum TLS version for the cluster to support, e.g. '1.2'. Possible values include: - * '1.0', '1.1', '1.2' - */ + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The minimum TLS version for the cluster to support, e.g. '1.2' */ minimumTlsVersion?: TlsVersion; /** * DNS name of the cluster endpoint - * **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 hostName?: string; /** - * Current provisioning status of the cluster. Possible values include: 'Succeeded', 'Failed', - * 'Canceled', 'Creating', 'Updating', 'Deleting' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current provisioning status of the cluster + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; /** - * Current resource status of the cluster. Possible values include: 'Running', 'Creating', - * 'CreateFailed', 'Updating', 'UpdateFailed', 'Deleting', 'DeleteFailed', 'Enabling', - * 'EnableFailed', 'Disabling', 'DisableFailed', 'Disabled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current resource status of the cluster + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resourceState?: ResourceState; /** * Version of redis the cluster supports, e.g. '6' - * **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 redisVersion?: string; /** * List of private endpoint connections associated with the specified RedisEnterprise cluster - * **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 privateEndpointConnections?: PrivateEndpointConnection[]; +} + +/** The response of a list-all operation. */ +export interface ClusterList { + /** List of clusters. */ + value?: Cluster[]; /** - * Resource tags. + * The URI to fetch the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly nextLink?: string; } -/** - * Persistence-related configuration for the RedisEnterprise database - * @summary Persistence settings - */ -export interface Persistence { +/** The response of a list-all operation. */ +export interface DatabaseList { + /** List of databases */ + value?: Database[]; /** - * Sets whether AOF is enabled. + * The URI to fetch the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly nextLink?: string; +} + +/** Persistence-related configuration for the RedisEnterprise database */ +export interface Persistence { + /** Sets whether AOF is enabled. */ aofEnabled?: boolean; - /** - * Sets whether RDB is enabled. - */ + /** Sets whether RDB is enabled. */ rdbEnabled?: boolean; - /** - * Sets the frequency at which data is written to disk. Possible values include: '1s', 'always' - */ + /** Sets the frequency at which data is written to disk. */ aofFrequency?: AofFrequency; - /** - * Sets the frequency at which a snapshot of the database is created. Possible values include: - * '1h', '6h', '12h' - */ + /** Sets the frequency at which a snapshot of the database is created. */ rdbFrequency?: RdbFrequency; } -/** - * Specifies configuration of a redis module - * @summary Module settings - */ +/** Specifies configuration of a redis module */ export interface Module { - /** - * The name of the module, e.g. 'RedisBloom', 'RediSearch', 'RedisTimeSeries' - */ + /** The name of the module, e.g. 'RedisBloom', 'RediSearch', 'RedisTimeSeries' */ name: string; - /** - * Configuration options for the module, e.g. 'ERROR_RATE 0.00 INITIAL_SIZE 400'. - */ + /** Configuration options for the module, e.g. 'ERROR_RATE 0.00 INITIAL_SIZE 400'. */ args?: string; /** * The version of the module, e.g. '1.0'. - * **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 version?: string; } -/** - * The resource model definition for a Azure Resource Manager proxy resource. It will not have tags - * and a location - * @summary Proxy Resource - */ -export interface ProxyResource extends Resource { -} - -/** - * Describes a database on the RedisEnterprise cluster - */ -export interface Database extends ProxyResource { - /** - * Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. - * Default is TLS-encrypted. Possible values include: 'Encrypted', 'Plaintext' - */ - clientProtocol?: Protocol; - /** - * TCP port of the database endpoint. Specified at create time. Defaults to an available port. - */ - port?: number; - /** - * Current provisioning status of the database. Possible values include: 'Succeeded', 'Failed', - * 'Canceled', 'Creating', 'Updating', 'Deleting' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: ProvisioningState; - /** - * Current resource status of the database. Possible values include: 'Running', 'Creating', - * 'CreateFailed', 'Updating', 'UpdateFailed', 'Deleting', 'DeleteFailed', 'Enabling', - * 'EnableFailed', 'Disabling', 'DisableFailed', 'Disabled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resourceState?: ResourceState; - /** - * Clustering policy - default is OSSCluster. Specified at create time. Possible values include: - * 'EnterpriseCluster', 'OSSCluster' - */ - clusteringPolicy?: ClusteringPolicy; - /** - * Redis eviction policy - default is VolatileLRU. Possible values include: 'AllKeysLFU', - * 'AllKeysLRU', 'AllKeysRandom', 'VolatileLRU', 'VolatileLFU', 'VolatileTTL', 'VolatileRandom', - * 'NoEviction' - */ - evictionPolicy?: EvictionPolicy; - /** - * Persistence settings - */ - persistence?: Persistence; - /** - * Optional set of redis modules to enable in this database - modules can only be added at - * creation time. - */ - modules?: Module[]; -} - -/** - * A partial update to the RedisEnterprise database - */ +/** A partial update to the RedisEnterprise database */ export interface DatabaseUpdate { - /** - * Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. - * Default is TLS-encrypted. Possible values include: 'Encrypted', 'Plaintext' - */ + /** Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. */ clientProtocol?: Protocol; - /** - * TCP port of the database endpoint. Specified at create time. Defaults to an available port. - */ + /** TCP port of the database endpoint. Specified at create time. Defaults to an available port. */ port?: number; /** - * Current provisioning status of the database. Possible values include: 'Succeeded', 'Failed', - * 'Canceled', 'Creating', 'Updating', 'Deleting' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current provisioning status of the database + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; /** - * Current resource status of the database. Possible values include: 'Running', 'Creating', - * 'CreateFailed', 'Updating', 'UpdateFailed', 'Deleting', 'DeleteFailed', 'Enabling', - * 'EnableFailed', 'Disabling', 'DisableFailed', 'Disabled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current resource status of the database + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resourceState?: ResourceState; - /** - * Clustering policy - default is OSSCluster. Specified at create time. Possible values include: - * 'EnterpriseCluster', 'OSSCluster' - */ + /** Clustering policy - default is OSSCluster. Specified at create time. */ clusteringPolicy?: ClusteringPolicy; - /** - * Redis eviction policy - default is VolatileLRU. Possible values include: 'AllKeysLFU', - * 'AllKeysLRU', 'AllKeysRandom', 'VolatileLRU', 'VolatileLFU', 'VolatileTTL', 'VolatileRandom', - * 'NoEviction' - */ + /** Redis eviction policy - default is VolatileLRU */ evictionPolicy?: EvictionPolicy; - /** - * Persistence settings - */ + /** Persistence settings */ persistence?: Persistence; - /** - * Optional set of redis modules to enable in this database - modules can only be added at - * creation time. - */ + /** Optional set of redis modules to enable in this database - modules can only be added at creation time. */ modules?: Module[]; } -/** - * The secret access keys used for authenticating connections to redis - * @summary Access keys - */ +/** The secret access keys used for authenticating connections to redis */ export interface AccessKeys { /** * The current primary key that clients can use to authenticate - * **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 primaryKey?: string; /** * The current secondary key that clients can use to authenticate - * **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 secondaryKey?: string; } -/** - * Specifies which access keys to reset to a new random value. - * @summary Regenerate access keys request - */ +/** Specifies which access keys to reset to a new random value. */ export interface RegenerateKeyParameters { - /** - * Which access key to regenerate. Possible values include: 'Primary', 'Secondary' - */ + /** Which access key to regenerate. */ keyType: AccessKeyType; } -/** - * Parameters for a Redis Enterprise import operation. - * @summary Import an RDB file into a target database - */ +/** Parameters for a Redis Enterprise import operation. */ export interface ImportClusterParameters { - /** - * SAS URI for the target blob to import from - */ - sasUri: string; + /** SAS URIs for the target blobs to import from */ + sasUris: string[]; } -/** - * Parameters for a Redis Enterprise export operation. - * @summary Export an RDB file into a target database - */ +/** Parameters for a Redis Enterprise export operation. */ export interface ExportClusterParameters { - /** - * SAS URI for the target directory to export to - */ + /** SAS URI for the target directory to export to */ sasUri: string; } -/** - * The resource management error additional info. - */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; +/** List of private endpoint connection associated with the specified storage account */ +export interface PrivateEndpointConnectionListResult { + /** Array of private endpoint connections */ + value?: PrivateEndpointConnection[]; +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** Array of private link resources */ + value?: PrivateLinkResource[]; +} + +/** The Private Endpoint Connection resource. */ +export type PrivateEndpointConnection = Resource & { + /** The resource of private end point. */ + privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; /** - * The additional info. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The provisioning state of the private endpoint connection resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly info?: any; -} + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +}; -/** - * The error detail. - */ -export interface ErrorDetail { +/** 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 & {}; + +/** A private link resource */ +export type PrivateLinkResource = Resource & { /** - * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The private link resource group id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly groupId?: string; /** - * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The private link resource required member names. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; +}; + +/** Describes the RedisEnterprise cluster */ +export type Cluster = TrackedResource & { + /** The SKU to create, which affects price, performance, and features. */ + sku: Sku; + /** The Availability Zones where this cluster will be deployed. */ + zones?: string[]; + /** The minimum TLS version for the cluster to support, e.g. '1.2' */ + minimumTlsVersion?: TlsVersion; /** - * The error target. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * DNS name of the cluster endpoint + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly target?: string; + readonly hostName?: string; /** - * The error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current provisioning status of the cluster + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ErrorDetail[]; + readonly provisioningState?: ProvisioningState; /** - * The error additional info. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current resource status of the cluster + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** - * Common error response for all Azure Resource Manager APIs to return error details for failed - * operations. (This also follows the OData error response format.). - * @summary Error response - */ -export interface ErrorResponse { - /** - * The error object. - */ - error?: ErrorDetail; -} - -/** - * The status of a long-running operation. - */ -export interface OperationStatus { - /** - * The operation's unique id. - */ - id?: string; - /** - * The operation's name. - */ - name?: string; + readonly resourceState?: ResourceState; /** - * The start time of the operation. + * Version of redis the cluster supports, e.g. '6' + * NOTE: This property will not be serialized. It can only be populated by the server. */ - startTime?: string; + readonly redisVersion?: string; /** - * The end time of the operation. + * List of private endpoint connections associated with the specified RedisEnterprise cluster + * NOTE: This property will not be serialized. It can only be populated by the server. */ - endTime?: string; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; +}; + +/** Describes a database on the RedisEnterprise cluster */ +export type Database = ProxyResource & { + /** Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. */ + clientProtocol?: Protocol; + /** TCP port of the database endpoint. Specified at create time. Defaults to an available port. */ + port?: number; /** - * The current status of the operation. + * Current provisioning status of the database + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status?: string; + readonly provisioningState?: ProvisioningState; /** - * Error response describing why the operation failed. + * Current resource status of the database + * NOTE: This property will not be serialized. It can only be populated by the server. */ - error?: ErrorResponse; + readonly resourceState?: ResourceState; + /** Clustering policy - default is OSSCluster. Specified at create time. */ + clusteringPolicy?: ClusteringPolicy; + /** Redis eviction policy - default is VolatileLRU */ + evictionPolicy?: EvictionPolicy; + /** Persistence settings */ + persistence?: Persistence; + /** Optional set of redis modules to enable in this database - modules can only be added at creation time. */ + modules?: Module[]; +}; + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + User = "user", + System = "system", + UserSystem = "user,system" } /** - * The resource model definition for an Azure Resource Manager resource with an etag. - * @summary Entity Resource + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** */ -export interface AzureEntityResource extends Resource { - /** - * Resource Etag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly etag?: string; +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + Internal = "Internal" } /** - * A private link resource + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** */ -export interface PrivateLinkResource extends Resource { - /** - * The private link resource group id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly groupId?: string; - /** - * The private link resource required member names. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly requiredMembers?: string[]; - /** - * The private link resource Private link DNS zone name. - */ - requiredZoneNames?: string[]; +export type ActionType = string; + +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + EnterpriseE10 = "Enterprise_E10", + EnterpriseE20 = "Enterprise_E20", + EnterpriseE50 = "Enterprise_E50", + EnterpriseE100 = "Enterprise_E100", + EnterpriseFlashF300 = "EnterpriseFlash_F300", + EnterpriseFlashF700 = "EnterpriseFlash_F700", + EnterpriseFlashF1500 = "EnterpriseFlash_F1500" } /** - * Localized display information for this particular operation. - */ -export interface OperationDisplay { - /** - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring - * Insights" or "Microsoft Compute". - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provider?: string; - /** - * The localized friendly name of the resource type related to this operation. E.g. "Virtual - * Machines" or "Job Schedule Collections". - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resource?: string; - /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create - * or Update Virtual Machine", "Restart Virtual Machine". - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operation?: string; - /** - * The short, localized friendly description of the operation; suitable for tool tips and - * detailed views. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly description?: string; + * Defines values for SkuName. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enterprise_E10** \ + * **Enterprise_E20** \ + * **Enterprise_E50** \ + * **Enterprise_E100** \ + * **EnterpriseFlash_F300** \ + * **EnterpriseFlash_F700** \ + * **EnterpriseFlash_F1500** + */ +export type SkuName = string; + +/** Known values of {@link TlsVersion} that the service accepts. */ +export enum KnownTlsVersion { + One0 = "1.0", + One1 = "1.1", + One2 = "1.2" } /** - * Details of a REST API operation, returned from the Resource Provider Operations API - * @summary REST API Operation - */ -export interface Operation { - /** - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and - * "false" for ARM/control-plane operations. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly isDataAction?: boolean; - /** - * Localized display information for this particular operation. - */ - display?: OperationDisplay; - /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - * logs UX. Default value is "user,system". Possible values include: 'user', 'system', - * 'user,system' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly origin?: Origin; - /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * Possible values include: 'Internal' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly actionType?: ActionType; + * Defines values for TlsVersion. \ + * {@link KnownTlsVersion} can be used interchangeably with TlsVersion, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **1.0** \ + * **1.1** \ + * **1.2** + */ +export type TlsVersion = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Succeeded = "Succeeded", + Failed = "Failed", + Canceled = "Canceled", + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting" } /** - * An interface representing RedisEnterpriseManagementClientOptions. - */ -export interface RedisEnterpriseManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Creating** \ + * **Updating** \ + * **Deleting** + */ +export type ProvisioningState = string; + +/** Known values of {@link ResourceState} that the service accepts. */ +export enum KnownResourceState { + Running = "Running", + Creating = "Creating", + CreateFailed = "CreateFailed", + Updating = "Updating", + UpdateFailed = "UpdateFailed", + Deleting = "Deleting", + DeleteFailed = "DeleteFailed", + Enabling = "Enabling", + EnableFailed = "EnableFailed", + Disabling = "Disabling", + DisableFailed = "DisableFailed", + Disabled = "Disabled" } /** - * @interface - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link - * to get the next set of results. - * @extends Array - */ -export interface OperationListResult extends Array { - /** - * URL to get the next set of operation list results (if there are any). - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; + * Defines values for ResourceState. \ + * {@link KnownResourceState} can be used interchangeably with ResourceState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Running** \ + * **Creating** \ + * **CreateFailed** \ + * **Updating** \ + * **UpdateFailed** \ + * **Deleting** \ + * **DeleteFailed** \ + * **Enabling** \ + * **EnableFailed** \ + * **Disabling** \ + * **DisableFailed** \ + * **Disabled** + */ +export type ResourceState = string; + +/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected" } /** - * @interface - * The response of a list-all operation. - * @extends Array + * Defines values for PrivateEndpointServiceConnectionStatus. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** */ -export interface ClusterList extends Array { - /** - * The URI to fetch the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +export type PrivateEndpointServiceConnectionStatus = string; + +/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + Succeeded = "Succeeded", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed" } /** - * @interface - * The response of a list-all operation. - * @extends Array + * Defines values for PrivateEndpointConnectionProvisioningState. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Deleting** \ + * **Failed** */ -export interface DatabaseList extends Array { - /** - * The URI to fetch the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +export type PrivateEndpointConnectionProvisioningState = string; + +/** Known values of {@link Protocol} that the service accepts. */ +export enum KnownProtocol { + Encrypted = "Encrypted", + Plaintext = "Plaintext" } /** - * @interface - * List of private endpoint connection associated with the specified storage account - * @extends Array + * Defines values for Protocol. \ + * {@link KnownProtocol} can be used interchangeably with Protocol, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Encrypted** \ + * **Plaintext** */ -export interface PrivateEndpointConnectionListResult extends Array { +export type Protocol = string; + +/** Known values of {@link ClusteringPolicy} that the service accepts. */ +export enum KnownClusteringPolicy { + EnterpriseCluster = "EnterpriseCluster", + OSSCluster = "OSSCluster" } /** - * @interface - * A list of private link resources - * @extends Array - */ -export interface PrivateLinkResourceListResult extends Array { + * Defines values for ClusteringPolicy. \ + * {@link KnownClusteringPolicy} can be used interchangeably with ClusteringPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EnterpriseCluster** \ + * **OSSCluster** + */ +export type ClusteringPolicy = string; + +/** Known values of {@link EvictionPolicy} that the service accepts. */ +export enum KnownEvictionPolicy { + AllKeysLFU = "AllKeysLFU", + AllKeysLRU = "AllKeysLRU", + AllKeysRandom = "AllKeysRandom", + VolatileLRU = "VolatileLRU", + VolatileLFU = "VolatileLFU", + VolatileTTL = "VolatileTTL", + VolatileRandom = "VolatileRandom", + NoEviction = "NoEviction" } /** - * Defines values for SkuName. - * Possible values include: 'Enterprise_E10', 'Enterprise_E20', 'Enterprise_E50', - * 'Enterprise_E100', 'EnterpriseFlash_F300', 'EnterpriseFlash_F700', 'EnterpriseFlash_F1500' - * @readonly - * @enum {string} - */ -export type SkuName = 'Enterprise_E10' | 'Enterprise_E20' | 'Enterprise_E50' | 'Enterprise_E100' | 'EnterpriseFlash_F300' | 'EnterpriseFlash_F700' | 'EnterpriseFlash_F1500'; + * Defines values for EvictionPolicy. \ + * {@link KnownEvictionPolicy} can be used interchangeably with EvictionPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AllKeysLFU** \ + * **AllKeysLRU** \ + * **AllKeysRandom** \ + * **VolatileLRU** \ + * **VolatileLFU** \ + * **VolatileTTL** \ + * **VolatileRandom** \ + * **NoEviction** + */ +export type EvictionPolicy = string; + +/** Known values of {@link AofFrequency} that the service accepts. */ +export enum KnownAofFrequency { + OneS = "1s", + Always = "always" +} /** - * Defines values for ProvisioningState. - * Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Creating', 'Updating', 'Deleting' - * @readonly - * @enum {string} + * Defines values for AofFrequency. \ + * {@link KnownAofFrequency} can be used interchangeably with AofFrequency, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **1s** \ + * **always** */ -export type ProvisioningState = 'Succeeded' | 'Failed' | 'Canceled' | 'Creating' | 'Updating' | 'Deleting'; +export type AofFrequency = string; -/** - * Defines values for ResourceState. - * Possible values include: 'Running', 'Creating', 'CreateFailed', 'Updating', 'UpdateFailed', - * 'Deleting', 'DeleteFailed', 'Enabling', 'EnableFailed', 'Disabling', 'DisableFailed', 'Disabled' - * @readonly - * @enum {string} - */ -export type ResourceState = 'Running' | 'Creating' | 'CreateFailed' | 'Updating' | 'UpdateFailed' | 'Deleting' | 'DeleteFailed' | 'Enabling' | 'EnableFailed' | 'Disabling' | 'DisableFailed' | 'Disabled'; +/** Known values of {@link RdbFrequency} that the service accepts. */ +export enum KnownRdbFrequency { + OneH = "1h", + SixH = "6h", + TwelveH = "12h" +} /** - * Defines values for TlsVersion. - * Possible values include: '1.0', '1.1', '1.2' - * @readonly - * @enum {string} + * Defines values for RdbFrequency. \ + * {@link KnownRdbFrequency} can be used interchangeably with RdbFrequency, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **1h** \ + * **6h** \ + * **12h** */ -export type TlsVersion = '1.0' | '1.1' | '1.2'; +export type RdbFrequency = string; +/** Defines values for AccessKeyType. */ +export type AccessKeyType = "Primary" | "Secondary"; -/** - * Defines values for PrivateEndpointServiceConnectionStatus. - * Possible values include: 'Pending', 'Approved', 'Rejected' - * @readonly - * @enum {string} - */ -export type PrivateEndpointServiceConnectionStatus = 'Pending' | 'Approved' | 'Rejected'; +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for PrivateEndpointConnectionProvisioningState. - * Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' - * @readonly - * @enum {string} - */ -export type PrivateEndpointConnectionProvisioningState = 'Succeeded' | 'Creating' | 'Deleting' | 'Failed'; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; -/** - * Defines values for Protocol. - * Possible values include: 'Encrypted', 'Plaintext' - * @readonly - * @enum {string} - */ -export type Protocol = 'Encrypted' | 'Plaintext'; +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ClusteringPolicy. - * Possible values include: 'EnterpriseCluster', 'OSSCluster' - * @readonly - * @enum {string} - */ -export type ClusteringPolicy = 'EnterpriseCluster' | 'OSSCluster'; +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; -/** - * Defines values for EvictionPolicy. - * Possible values include: 'AllKeysLFU', 'AllKeysLRU', 'AllKeysRandom', 'VolatileLRU', - * 'VolatileLFU', 'VolatileTTL', 'VolatileRandom', 'NoEviction' - * @readonly - * @enum {string} - */ -export type EvictionPolicy = 'AllKeysLFU' | 'AllKeysLRU' | 'AllKeysRandom' | 'VolatileLRU' | 'VolatileLFU' | 'VolatileTTL' | 'VolatileRandom' | 'NoEviction'; +/** Optional parameters. */ +export interface OperationsStatusGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for AofFrequency. - * Possible values include: '1s', 'always' - * @readonly - * @enum {string} - */ -export type AofFrequency = '1s' | 'always'; +/** Contains response data for the get operation. */ +export type OperationsStatusGetResponse = OperationStatus; -/** - * Defines values for RdbFrequency. - * Possible values include: '1h', '6h', '12h' - * @readonly - * @enum {string} - */ -export type RdbFrequency = '1h' | '6h' | '12h'; +/** Optional parameters. */ +export interface RedisEnterpriseCreateOptionalParams + 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; +} -/** - * Defines values for AccessKeyType. - * Possible values include: 'Primary', 'Secondary' - * @readonly - * @enum {string} - */ -export type AccessKeyType = 'Primary' | 'Secondary'; +/** Contains response data for the create operation. */ +export type RedisEnterpriseCreateResponse = Cluster; -/** - * Defines values for Origin. - * Possible values include: 'user', 'system', 'user,system' - * @readonly - * @enum {string} - */ -export type Origin = 'user' | 'system' | 'user,system'; +/** Optional parameters. */ +export interface RedisEnterpriseUpdateOptionalParams + 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; +} -/** - * Defines values for ActionType. - * Possible values include: 'Internal' - * @readonly - * @enum {string} - */ -export type ActionType = 'Internal'; +/** Contains response data for the update operation. */ +export type RedisEnterpriseUpdateResponse = Cluster; -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Optional parameters. */ +export interface RedisEnterpriseDeleteOptionalParams + 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 OperationsListNextResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Optional parameters. */ +export interface RedisEnterpriseGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type OperationsStatusGetResponse = OperationStatus & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationStatus; - }; -}; +/** Contains response data for the get operation. */ +export type RedisEnterpriseGetResponse = Cluster; -/** - * Contains response data for the create operation. - */ -export type RedisEnterpriseCreateResponse = Cluster & { - /** - * 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: Cluster; - }; -}; +/** Optional parameters. */ +export interface RedisEnterpriseListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type RedisEnterpriseUpdateResponse = Cluster & { - /** - * 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: Cluster; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type RedisEnterpriseListByResourceGroupResponse = ClusterList; -/** - * Contains response data for the get operation. - */ -export type RedisEnterpriseGetResponse = Cluster & { - /** - * 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: Cluster; - }; -}; +/** Optional parameters. */ +export interface RedisEnterpriseListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type RedisEnterpriseListByResourceGroupResponse = ClusterList & { - /** - * 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: ClusterList; - }; -}; +/** Contains response data for the list operation. */ +export type RedisEnterpriseListResponse = ClusterList; -/** - * Contains response data for the list operation. - */ -export type RedisEnterpriseListResponse = ClusterList & { - /** - * 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: ClusterList; - }; -}; +/** Optional parameters. */ +export interface RedisEnterpriseListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreate operation. - */ -export type RedisEnterpriseBeginCreateResponse = Cluster & { - /** - * 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: Cluster; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type RedisEnterpriseListByResourceGroupNextResponse = ClusterList; -/** - * Contains response data for the beginUpdate operation. - */ -export type RedisEnterpriseBeginUpdateResponse = Cluster & { - /** - * 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: Cluster; - }; -}; +/** Optional parameters. */ +export interface RedisEnterpriseListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type RedisEnterpriseListByResourceGroupNextResponse = ClusterList & { - /** - * 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: ClusterList; - }; -}; +/** Contains response data for the listNext operation. */ +export type RedisEnterpriseListNextResponse = ClusterList; -/** - * Contains response data for the listNext operation. - */ -export type RedisEnterpriseListNextResponse = ClusterList & { - /** - * 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: ClusterList; - }; -}; +/** Optional parameters. */ +export interface DatabasesListByClusterOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByCluster operation. - */ -export type DatabasesListByClusterResponse = DatabaseList & { - /** - * 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: DatabaseList; - }; -}; +/** Contains response data for the listByCluster operation. */ +export type DatabasesListByClusterResponse = DatabaseList; -/** - * Contains response data for the create operation. - */ -export type DatabasesCreateResponse = Database & { - /** - * 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: Database; - }; -}; +/** Optional parameters. */ +export interface DatabasesCreateOptionalParams + 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 DatabasesUpdateResponse = Database & { - /** - * 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: Database; - }; -}; +/** Contains response data for the create operation. */ +export type DatabasesCreateResponse = Database; -/** - * Contains response data for the get operation. - */ -export type DatabasesGetResponse = Database & { - /** - * 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: Database; - }; -}; +/** Optional parameters. */ +export interface DatabasesUpdateOptionalParams + 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 listKeys operation. - */ -export type DatabasesListKeysResponse = AccessKeys & { - /** - * 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: AccessKeys; - }; -}; +/** Contains response data for the update operation. */ +export type DatabasesUpdateResponse = Database; -/** - * Contains response data for the regenerateKey operation. - */ -export type DatabasesRegenerateKeyResponse = AccessKeys & { - /** - * 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: AccessKeys; - }; -}; +/** Optional parameters. */ +export interface DatabasesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreate operation. - */ -export type DatabasesBeginCreateResponse = Database & { - /** - * 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: Database; - }; -}; +/** Contains response data for the get operation. */ +export type DatabasesGetResponse = Database; -/** - * Contains response data for the beginUpdate operation. - */ -export type DatabasesBeginUpdateResponse = Database & { - /** - * 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: Database; - }; -}; +/** Optional parameters. */ +export interface DatabasesDeleteOptionalParams + 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 beginRegenerateKey operation. - */ -export type DatabasesBeginRegenerateKeyResponse = AccessKeys & { - /** - * 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: AccessKeys; - }; -}; +/** Optional parameters. */ +export interface DatabasesListKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByClusterNext operation. - */ -export type DatabasesListByClusterNextResponse = DatabaseList & { - /** - * 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: DatabaseList; - }; -}; +/** Contains response data for the listKeys operation. */ +export type DatabasesListKeysResponse = AccessKeys; -/** - * Contains response data for the list operation. - */ -export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult & { - /** - * 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: PrivateEndpointConnectionListResult; - }; -}; +/** Optional parameters. */ +export interface DatabasesRegenerateKeyOptionalParams + 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 PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & { - /** - * 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: PrivateEndpointConnection; - }; -}; +/** Contains response data for the regenerateKey operation. */ +export type DatabasesRegenerateKeyResponse = AccessKeys; -/** - * Contains response data for the put operation. - */ -export type PrivateEndpointConnectionsPutResponse = PrivateEndpointConnection & { - /** - * 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: PrivateEndpointConnection; - }; -}; +/** Optional parameters. */ +export interface DatabasesImportOptionalParams + 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 beginPut operation. - */ -export type PrivateEndpointConnectionsBeginPutResponse = PrivateEndpointConnection & { - /** - * 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: PrivateEndpointConnection; - }; -}; +/** Optional parameters. */ +export interface DatabasesExportOptionalParams + 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 listByCluster operation. - */ -export type PrivateLinkResourcesListByClusterResponse = PrivateLinkResourceListResult & { - /** - * 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: PrivateLinkResourceListResult; - }; -}; +/** Optional parameters. */ +export interface DatabasesListByClusterNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByClusterNext operation. */ +export type DatabasesListByClusterNextResponse = DatabaseList; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsPutOptionalParams + 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 put operation. */ +export type PrivateEndpointConnectionsPutResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByClusterOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCluster operation. */ +export type PrivateLinkResourcesListByClusterResponse = PrivateLinkResourceListResult; + +/** Optional parameters. */ +export interface RedisEnterpriseManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/mappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/mappers.ts index da7943f2f74b..197f60139550 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/mappers.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/mappers.ts @@ -6,72 +6,73 @@ * 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 Sku: msRest.CompositeMapper = { - serializedName: "Sku", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Sku", + className: "OperationListResult", modelProperties: { - name: { - required: true, - serializedName: "name", + value: { + serializedName: "value", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } } }, - capacity: { - serializedName: "capacity", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Number" + name: "String" } } } } }; -export const PrivateEndpoint: msRest.CompositeMapper = { - serializedName: "PrivateEndpoint", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpoint", + className: "Operation", modelProperties: { - id: { + name: { + serializedName: "name", readOnly: true, - serializedName: "id", type: { name: "String" } - } - } - } -}; - -export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { - serializedName: "PrivateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - modelProperties: { - status: { - serializedName: "status", + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, type: { - name: "String" + name: "Boolean" } }, - description: { - serializedName: "description", + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, type: { name: "String" } }, - actionsRequired: { - serializedName: "actionsRequired", + actionType: { + serializedName: "actionType", + readOnly: true, type: { name: "String" } @@ -80,61 +81,35 @@ export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "OperationDisplay", modelProperties: { - id: { + provider: { + serializedName: "provider", readOnly: true, - serializedName: "id", type: { name: "String" } }, - name: { + resource: { + serializedName: "resource", readOnly: true, - serializedName: "name", type: { name: "String" } }, - type: { + operation: { + serializedName: "operation", readOnly: true, - serializedName: "type", type: { name: "String" } - } - } - } -}; - -export const PrivateEndpointConnection: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnection", - type: { - name: "Composite", - className: "PrivateEndpointConnection", - modelProperties: { - ...Resource.type.modelProperties, - privateEndpoint: { - serializedName: "properties.privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpoint" - } - }, - privateLinkServiceConnectionState: { - required: true, - serializedName: "properties.privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState" - } }, - provisioningState: { - serializedName: "properties.provisioningState", + description: { + serializedName: "description", + readOnly: true, type: { name: "String" } @@ -143,104 +118,70 @@ export const PrivateEndpointConnection: msRest.CompositeMapper = { } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "ErrorResponse", modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - location: { - required: true, - serializedName: "location", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "ErrorDetail" } } } } }; -export const Cluster: msRest.CompositeMapper = { - serializedName: "Cluster", +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Cluster", + className: "ErrorDetail", modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - required: true, - serializedName: "sku", - type: { - name: "Composite", - className: "Sku" - } - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - minimumTlsVersion: { - serializedName: "properties.minimumTlsVersion", - type: { - name: "String" - } - }, - hostName: { + code: { + serializedName: "code", readOnly: true, - serializedName: "properties.hostName", type: { name: "String" } }, - provisioningState: { + message: { + serializedName: "message", readOnly: true, - serializedName: "properties.provisioningState", type: { name: "String" } }, - resourceState: { + target: { + serializedName: "target", readOnly: true, - serializedName: "properties.resourceState", type: { name: "String" } }, - redisVersion: { + details: { + serializedName: "details", readOnly: true, - serializedName: "properties.redisVersion", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } } }, - privateEndpointConnections: { + additionalInfo: { + serializedName: "additionalInfo", readOnly: true, - serializedName: "properties.privateEndpointConnections", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PrivateEndpointConnection" + className: "ErrorAdditionalInfo" } } } @@ -249,107 +190,106 @@ export const Cluster: msRest.CompositeMapper = { } }; -export const ClusterUpdate: msRest.CompositeMapper = { - serializedName: "ClusterUpdate", +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClusterUpdate", + className: "ErrorAdditionalInfo", modelProperties: { - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku" - } - }, - minimumTlsVersion: { - serializedName: "properties.minimumTlsVersion", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - hostName: { + info: { + serializedName: "info", readOnly: true, - serializedName: "properties.hostName", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const OperationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatus", + modelProperties: { + id: { + serializedName: "id", type: { name: "String" } }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + name: { + serializedName: "name", type: { name: "String" } }, - resourceState: { - readOnly: true, - serializedName: "properties.resourceState", + startTime: { + serializedName: "startTime", type: { name: "String" } }, - redisVersion: { - readOnly: true, - serializedName: "properties.redisVersion", + endTime: { + serializedName: "endTime", type: { name: "String" } }, - privateEndpointConnections: { - readOnly: true, - serializedName: "properties.privateEndpointConnections", + status: { + serializedName: "status", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } + name: "String" } }, - tags: { - serializedName: "tags", + error: { + serializedName: "error", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Composite", + className: "ErrorResponse" } } } } }; -export const Persistence: msRest.CompositeMapper = { - serializedName: "Persistence", +export const Sku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Persistence", + className: "Sku", modelProperties: { - aofEnabled: { - serializedName: "aofEnabled", - type: { - name: "Boolean" - } - }, - rdbEnabled: { - serializedName: "rdbEnabled", + name: { + serializedName: "name", + required: true, type: { - name: "Boolean" + name: "String" } }, - aofFrequency: { - serializedName: "aofFrequency", + capacity: { + serializedName: "capacity", type: { - name: "String" + name: "Number" } - }, - rdbFrequency: { - serializedName: "rdbFrequency", + } + } + } +}; + +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } @@ -358,28 +298,25 @@ export const Persistence: msRest.CompositeMapper = { } }; -export const Module: msRest.CompositeMapper = { - serializedName: "Module", +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Module", + className: "PrivateLinkServiceConnectionState", modelProperties: { - name: { - required: true, - serializedName: "name", + status: { + serializedName: "status", type: { name: "String" } }, - args: { - serializedName: "args", + description: { + serializedName: "description", type: { name: "String" } }, - version: { - readOnly: true, - serializedName: "version", + actionsRequired: { + serializedName: "actionsRequired", type: { name: "String" } @@ -388,87 +325,225 @@ export const Module: msRest.CompositeMapper = { } }; -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProxyResource", + className: "Resource", modelProperties: { - ...Resource.type.modelProperties + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } } } }; -export const Database: msRest.CompositeMapper = { - serializedName: "Database", +export const ClusterUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Database", + className: "ClusterUpdate", modelProperties: { - ...ProxyResource.type.modelProperties, - clientProtocol: { - serializedName: "properties.clientProtocol", + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + minimumTlsVersion: { + serializedName: "properties.minimumTlsVersion", type: { name: "String" } }, - port: { - serializedName: "properties.port", + hostName: { + serializedName: "properties.hostName", + readOnly: true, type: { - name: "Number" + name: "String" } }, provisioningState: { - readOnly: true, serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } }, resourceState: { - readOnly: true, serializedName: "properties.resourceState", + readOnly: true, type: { name: "String" } }, - clusteringPolicy: { - serializedName: "properties.clusteringPolicy", + redisVersion: { + serializedName: "properties.redisVersion", + readOnly: true, type: { name: "String" } }, - evictionPolicy: { - serializedName: "properties.evictionPolicy", + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } } - }, - persistence: { - serializedName: "properties.persistence", + } + } + } +}; + +export const ClusterList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterList", + modelProperties: { + value: { + serializedName: "value", type: { - name: "Composite", - className: "Persistence" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Cluster" + } + } } }, - modules: { - serializedName: "properties.modules", + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DatabaseList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatabaseList", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Module" + className: "Database" } } } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Persistence: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Persistence", + modelProperties: { + aofEnabled: { + serializedName: "aofEnabled", + type: { + name: "Boolean" + } + }, + rdbEnabled: { + serializedName: "rdbEnabled", + type: { + name: "Boolean" + } + }, + aofFrequency: { + serializedName: "aofFrequency", + type: { + name: "String" + } + }, + rdbFrequency: { + serializedName: "rdbFrequency", + type: { + name: "String" + } + } + } + } +}; + +export const Module: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Module", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + args: { + serializedName: "args", + type: { + name: "String" + } + }, + version: { + serializedName: "version", + readOnly: true, + type: { + name: "String" + } } } } }; -export const DatabaseUpdate: msRest.CompositeMapper = { - serializedName: "DatabaseUpdate", +export const DatabaseUpdate: coreClient.CompositeMapper = { type: { name: "Composite", className: "DatabaseUpdate", @@ -486,15 +561,15 @@ export const DatabaseUpdate: msRest.CompositeMapper = { } }, provisioningState: { - readOnly: true, serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } }, resourceState: { - readOnly: true, serializedName: "properties.resourceState", + readOnly: true, type: { name: "String" } @@ -534,22 +609,21 @@ export const DatabaseUpdate: msRest.CompositeMapper = { } }; -export const AccessKeys: msRest.CompositeMapper = { - serializedName: "AccessKeys", +export const AccessKeys: coreClient.CompositeMapper = { type: { name: "Composite", className: "AccessKeys", modelProperties: { primaryKey: { - readOnly: true, serializedName: "primaryKey", + readOnly: true, type: { name: "String" } }, secondaryKey: { - readOnly: true, serializedName: "secondaryKey", + readOnly: true, type: { name: "String" } @@ -558,53 +632,52 @@ export const AccessKeys: msRest.CompositeMapper = { } }; -export const RegenerateKeyParameters: msRest.CompositeMapper = { - serializedName: "RegenerateKeyParameters", +export const RegenerateKeyParameters: coreClient.CompositeMapper = { type: { name: "Composite", className: "RegenerateKeyParameters", modelProperties: { keyType: { - required: true, serializedName: "keyType", + required: true, type: { name: "Enum", - allowedValues: [ - "Primary", - "Secondary" - ] + allowedValues: ["Primary", "Secondary"] } } } } }; -export const ImportClusterParameters: msRest.CompositeMapper = { - serializedName: "ImportClusterParameters", +export const ImportClusterParameters: coreClient.CompositeMapper = { type: { name: "Composite", className: "ImportClusterParameters", modelProperties: { - sasUri: { + sasUris: { + serializedName: "sasUris", required: true, - serializedName: "sasUri", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const ExportClusterParameters: msRest.CompositeMapper = { - serializedName: "ExportClusterParameters", +export const ExportClusterParameters: coreClient.CompositeMapper = { type: { name: "Composite", className: "ExportClusterParameters", modelProperties: { sasUri: { - required: true, serializedName: "sasUri", + required: true, type: { name: "String" } @@ -613,79 +686,40 @@ export const ExportClusterParameters: msRest.CompositeMapper = { } }; -export const ErrorAdditionalInfo: msRest.CompositeMapper = { - serializedName: "ErrorAdditionalInfo", +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorAdditionalInfo", + className: "PrivateEndpointConnectionListResult", modelProperties: { - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } - }, - info: { - readOnly: true, - serializedName: "info", + value: { + serializedName: "value", type: { - name: "Object" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } } } } } }; -export const ErrorDetail: msRest.CompositeMapper = { - serializedName: "ErrorDetail", +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetail", + className: "PrivateLinkResourceListResult", modelProperties: { - code: { - readOnly: true, - serializedName: "code", - type: { - name: "String" - } - }, - message: { - readOnly: true, - serializedName: "message", - type: { - name: "String" - } - }, - target: { - readOnly: true, - serializedName: "target", - type: { - name: "String" - } - }, - details: { - readOnly: true, - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail" - } - } - } - }, - additionalInfo: { - readOnly: true, - serializedName: "additionalInfo", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" + className: "PrivateLinkResource" } } } @@ -694,105 +728,87 @@ export const ErrorDetail: msRest.CompositeMapper = { } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const PrivateEndpointConnection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "PrivateEndpointConnection", modelProperties: { - error: { - serializedName: "error", + ...Resource.type.modelProperties, + privateEndpoint: { + serializedName: "properties.privateEndpoint", type: { name: "Composite", - className: "ErrorDetail" + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" } } } } }; -export const OperationStatus: msRest.CompositeMapper = { - serializedName: "OperationStatus", +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationStatus", + className: "TrackedResource", modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - name: { - serializedName: "name", - type: { - name: "String" - } - }, - startTime: { - serializedName: "startTime", - type: { - name: "String" - } - }, - endTime: { - serializedName: "endTime", + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - status: { - serializedName: "status", + location: { + serializedName: "location", + required: true, type: { name: "String" } - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorResponse" - } } } } }; -export const AzureEntityResource: msRest.CompositeMapper = { - serializedName: "AzureEntityResource", +export const ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureEntityResource", + className: "ProxyResource", modelProperties: { - ...Resource.type.modelProperties, - etag: { - readOnly: true, - serializedName: "etag", - type: { - name: "String" - } - } + ...Resource.type.modelProperties } } }; -export const PrivateLinkResource: msRest.CompositeMapper = { - serializedName: "PrivateLinkResource", +export const PrivateLinkResource: coreClient.CompositeMapper = { type: { name: "Composite", className: "PrivateLinkResource", modelProperties: { ...Resource.type.modelProperties, groupId: { - readOnly: true, serializedName: "properties.groupId", + readOnly: true, type: { name: "String" } }, requiredMembers: { - readOnly: true, serializedName: "properties.requiredMembers", + readOnly: true, type: { name: "Sequence", element: { @@ -817,213 +833,140 @@ export const PrivateLinkResource: msRest.CompositeMapper = { } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const Cluster: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "Cluster", modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", type: { - name: "String" + name: "Composite", + className: "Sku" } }, - resource: { - readOnly: true, - serializedName: "resource", + zones: { + serializedName: "zones", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - operation: { - readOnly: true, - serializedName: "operation", + minimumTlsVersion: { + serializedName: "properties.minimumTlsVersion", type: { name: "String" } }, - description: { - readOnly: true, - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; - -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { + hostName: { + serializedName: "properties.hostName", readOnly: true, - serializedName: "name", type: { name: "String" } }, - isDataAction: { + provisioningState: { + serializedName: "properties.provisioningState", readOnly: true, - serializedName: "isDataAction", - type: { - name: "Boolean" - } - }, - display: { - serializedName: "display", type: { - name: "Composite", - className: "OperationDisplay" + name: "String" } }, - origin: { + resourceState: { + serializedName: "properties.resourceState", readOnly: true, - serializedName: "origin", type: { name: "String" } }, - actionType: { + redisVersion: { + serializedName: "properties.redisVersion", readOnly: true, - serializedName: "actionType", type: { name: "String" } - } - } - } -}; - -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", readOnly: true, - serializedName: "", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Operation" + className: "PrivateEndpointConnection" } } } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", - type: { - name: "String" - } } } } }; -export const ClusterList: msRest.CompositeMapper = { - serializedName: "ClusterList", +export const Database: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClusterList", + className: "Database", modelProperties: { - value: { - serializedName: "", + ...ProxyResource.type.modelProperties, + clientProtocol: { + serializedName: "properties.clientProtocol", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Cluster" - } - } + name: "String" } }, - nextLink: { + port: { + serializedName: "properties.port", + type: { + name: "Number" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const DatabaseList: msRest.CompositeMapper = { - serializedName: "DatabaseList", - type: { - name: "Composite", - className: "DatabaseList", - modelProperties: { - value: { - serializedName: "", + }, + resourceState: { + serializedName: "properties.resourceState", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Database" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + clusteringPolicy: { + serializedName: "properties.clusteringPolicy", type: { name: "String" } - } - } - } -}; - -export const PrivateEndpointConnectionListResult: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnectionListResult", - type: { - name: "Composite", - className: "PrivateEndpointConnectionListResult", - modelProperties: { - value: { - serializedName: "", + }, + evictionPolicy: { + serializedName: "properties.evictionPolicy", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } + name: "String" } - } - } - } -}; - -export const PrivateLinkResourceListResult: msRest.CompositeMapper = { - serializedName: "PrivateLinkResourceListResult", - type: { - name: "Composite", - className: "PrivateLinkResourceListResult", - modelProperties: { - value: { - serializedName: "", + }, + persistence: { + serializedName: "properties.persistence", + type: { + name: "Composite", + className: "Persistence" + } + }, + modules: { + serializedName: "properties.modules", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PrivateLinkResource" + className: "Module" } } } diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/parameters.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/parameters.ts index 98f4bd82664b..0d3fb87eca50 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/parameters.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/parameters.ts @@ -3,121 +3,205 @@ * 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 { + Cluster as ClusterMapper, + ClusterUpdate as ClusterUpdateMapper, + Database as DatabaseMapper, + DatabaseUpdate as DatabaseUpdateMapper, + RegenerateKeyParameters as RegenerateKeyParametersMapper, + ImportClusterParameters as ImportClusterParametersMapper, + ExportClusterParameters as ExportClusterParametersMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "api-version", - constraints: { - MinLength: 1 - }, type: { name: "String" } - } + }, + skipEncoding: true }; -export const clusterName: msRest.OperationURLParameter = { - parameterPath: "clusterName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "clusterName", + defaultValue: "2021-08-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const databaseName: msRest.OperationURLParameter = { - parameterPath: "databaseName", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - serializedName: "databaseName", type: { name: "String" } - } + }, + skipEncoding: true }; -export const location: msRest.OperationURLParameter = { + +export const location: OperationURLParameter = { parameterPath: "location", mapper: { - required: true, serializedName: "location", + required: true, type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const operationId: OperationURLParameter = { + parameterPath: "operationId", mapper: { + serializedName: "operationId", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const operationId: msRest.OperationURLParameter = { - parameterPath: "operationId", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", required: true, - serializedName: "operationId", type: { name: "String" } } }; -export const privateEndpointConnectionName: msRest.OperationURLParameter = { - parameterPath: "privateEndpointConnectionName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "privateEndpointConnectionName", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: ClusterMapper +}; + +export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { - required: true, - serializedName: "resourceGroupName", constraints: { MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const clusterName: OperationURLParameter = { + parameterPath: "clusterName", mapper: { + serializedName: "clusterName", required: true, - serializedName: "subscriptionId", - constraints: { - MinLength: 1 - }, type: { name: "String" } } }; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: ClusterUpdateMapper +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: DatabaseMapper +}; + +export const databaseName: OperationURLParameter = { + parameterPath: "databaseName", + mapper: { + serializedName: "databaseName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: DatabaseUpdateMapper +}; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: RegenerateKeyParametersMapper +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: ImportClusterParametersMapper +}; + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: ExportClusterParametersMapper +}; + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + serializedName: "privateEndpointConnectionName", + required: true, + type: { + name: "String" + } + } +}; + +export const properties: OperationParameter = { + parameterPath: "properties", + mapper: PrivateEndpointConnectionMapper +}; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/privateEndpointConnectionsMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/privateEndpointConnectionsMappers.ts deleted file mode 100644 index 965cde2b1b26..000000000000 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/privateEndpointConnectionsMappers.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AzureEntityResource, - BaseResource, - Cluster, - Database, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - Module, - Persistence, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateEndpointConnectionListResult, - PrivateLinkResource, - PrivateLinkServiceConnectionState, - ProxyResource, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/privateLinkResourcesMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/privateLinkResourcesMappers.ts deleted file mode 100644 index 8a66020d28c2..000000000000 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/privateLinkResourcesMappers.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AzureEntityResource, - BaseResource, - Cluster, - Database, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - Module, - Persistence, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateLinkResource, - PrivateLinkResourceListResult, - PrivateLinkServiceConnectionState, - ProxyResource, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/redisEnterpriseMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/redisEnterpriseMappers.ts deleted file mode 100644 index 9beb18ebd427..000000000000 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/redisEnterpriseMappers.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AzureEntityResource, - BaseResource, - Cluster, - ClusterList, - ClusterUpdate, - Database, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - Module, - Persistence, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateLinkResource, - PrivateLinkServiceConnectionState, - ProxyResource, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/databases.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/databases.ts index 5317e2a3bf78..71867cabd88a 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/databases.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/databases.ts @@ -3,26 +3,52 @@ * 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/databasesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Databases } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; +import { RedisEnterpriseManagementClient } from "../redisEnterpriseManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Database, + DatabasesListByClusterNextOptionalParams, + DatabasesListByClusterOptionalParams, + DatabasesListByClusterResponse, + DatabasesCreateOptionalParams, + DatabasesCreateResponse, + DatabaseUpdate, + DatabasesUpdateOptionalParams, + DatabasesUpdateResponse, + DatabasesGetOptionalParams, + DatabasesGetResponse, + DatabasesDeleteOptionalParams, + DatabasesListKeysOptionalParams, + DatabasesListKeysResponse, + RegenerateKeyParameters, + DatabasesRegenerateKeyOptionalParams, + DatabasesRegenerateKeyResponse, + ImportClusterParameters, + DatabasesImportOptionalParams, + ExportClusterParameters, + DatabasesExportOptionalParams, + DatabasesListByClusterNextResponse +} from "../models"; -/** Class representing a Databases. */ -export class Databases { - private readonly client: RedisEnterpriseManagementClientContext; +/// +/** Class containing Databases operations. */ +export class DatabasesImpl implements Databases { + private readonly client: RedisEnterpriseManagementClient; /** - * Create a Databases. - * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Databases class. + * @param client Reference to the service client */ - constructor(client: RedisEnterpriseManagementClientContext) { + constructor(client: RedisEnterpriseManagementClient) { this.client = client; } @@ -30,295 +56,657 @@ export class Databases { * Gets all databases in the specified RedisEnterprise cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByCluster(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param callback The callback - */ - listByCluster(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param options The optional parameters - * @param callback The callback - */ - listByCluster(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByCluster(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByCluster( + resourceGroupName: string, + clusterName: string, + options?: DatabasesListByClusterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByClusterPagingAll( + resourceGroupName, + clusterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByClusterPagingPage( + resourceGroupName, + clusterName, + options + ); + } + }; + } + + private async *listByClusterPagingPage( + resourceGroupName: string, + clusterName: string, + options?: DatabasesListByClusterOptionalParams + ): AsyncIterableIterator { + let result = await this._listByCluster( + resourceGroupName, + clusterName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByClusterNext( resourceGroupName, clusterName, + continuationToken, options - }, - listByClusterOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByClusterPagingAll( + resourceGroupName: string, + clusterName: string, + options?: DatabasesListByClusterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByClusterPagingPage( + resourceGroupName, + clusterName, + options + )) { + yield* page; + } } /** - * Creates a database + * Gets all databases in the specified RedisEnterprise cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param databaseName The name of the database. - * @param parameters Parameters supplied to the create or update database operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Models.Database, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(resourceGroupName,clusterName,databaseName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + private _listByCluster( + resourceGroupName: string, + clusterName: string, + options?: DatabasesListByClusterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + listByClusterOperationSpec + ); } /** - * Updates a database + * Creates a database * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. * @param parameters Parameters supplied to the create or update database operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Models.DatabaseUpdate, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdate(resourceGroupName,clusterName,databaseName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreate( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: Database, + options?: DatabasesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DatabasesCreateResponse + > + > { + 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, clusterName, databaseName, parameters, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "original-uri" + }); } /** - * Gets information about a database in a RedisEnterprise cluster. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param databaseName The name of the database. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param databaseName The name of the database. - * @param callback The callback - */ - get(resourceGroupName: string, clusterName: string, databaseName: string, callback: msRest.ServiceCallback): void; - /** + * Creates a database * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param options The optional parameters - * @param callback The callback + * @param parameters Parameters supplied to the create or update database operation. + * @param options The options parameters. */ - get(resourceGroupName: string, clusterName: string, databaseName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - clusterName, - databaseName, - options - }, - getOperationSpec, - callback) as Promise; + async beginCreateAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: Database, + options?: DatabasesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + clusterName, + databaseName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Deletes a single database + * Updates a database * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters supplied to the create or update database operation. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,clusterName,databaseName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginUpdate( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: DatabaseUpdate, + options?: DatabasesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DatabasesUpdateResponse + > + > { + 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, clusterName, databaseName, parameters, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Retrieves the access keys for the RedisEnterprise database. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param databaseName The name of the database. - * @param [options] The optional parameters - * @returns Promise - */ - listKeys(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Updates a database * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param callback The callback + * @param parameters Parameters supplied to the create or update database operation. + * @param options The options parameters. */ - listKeys(resourceGroupName: string, clusterName: string, databaseName: string, callback: msRest.ServiceCallback): void; + async beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: DatabaseUpdate, + options?: DatabasesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + clusterName, + databaseName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets information about a database in a RedisEnterprise cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listKeys(resourceGroupName: string, clusterName: string, databaseName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeys(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + clusterName: string, + databaseName: string, + options?: DatabasesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - clusterName, - databaseName, - options - }, - listKeysOperationSpec, - callback) as Promise; + { resourceGroupName, clusterName, databaseName, options }, + getOperationSpec + ); } /** - * Regenerates the RedisEnterprise database's access keys. + * Deletes a single database * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param keyType Which access key to regenerate. Possible values include: 'Primary', 'Secondary' - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - regenerateKey(resourceGroupName: string, clusterName: string, databaseName: string, keyType: Models.AccessKeyType, options?: msRest.RequestOptionsBase): Promise { - return this.beginRegenerateKey(resourceGroupName,clusterName,databaseName,keyType,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginDelete( + resourceGroupName: string, + clusterName: string, + databaseName: string, + options?: DatabasesDeleteOptionalParams + ): 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, clusterName, databaseName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Imports a database file to target database. + * Deletes a single database * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param sasUri SAS URI for the target blob to import from - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - importMethod(resourceGroupName: string, clusterName: string, databaseName: string, sasUri: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginImportMethod(resourceGroupName,clusterName,databaseName,sasUri,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + options?: DatabasesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + databaseName, + options + ); + return poller.pollUntilDone(); } /** - * Exports a database file from target database. + * Retrieves the access keys for the RedisEnterprise database. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param sasUri SAS URI for the target directory to export to - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - exportMethod(resourceGroupName: string, clusterName: string, databaseName: string, sasUri: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginExportMethod(resourceGroupName,clusterName,databaseName,sasUri,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + listKeys( + resourceGroupName: string, + clusterName: string, + databaseName: string, + options?: DatabasesListKeysOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, databaseName, options }, + listKeysOperationSpec + ); } /** - * Creates a database + * Regenerates the RedisEnterprise database's access keys. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param parameters Parameters supplied to the create or update database operation. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Specifies which key to regenerate. + * @param options The options parameters. */ - beginCreate(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Models.Database, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - databaseName, - parameters, - options - }, - beginCreateOperationSpec, - options); + async beginRegenerateKey( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: RegenerateKeyParameters, + options?: DatabasesRegenerateKeyOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DatabasesRegenerateKeyResponse + > + > { + 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, clusterName, databaseName, parameters, options }, + regenerateKeyOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Updates a database + * Regenerates the RedisEnterprise database's access keys. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param parameters Parameters supplied to the create or update database operation. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Specifies which key to regenerate. + * @param options The options parameters. */ - beginUpdate(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Models.DatabaseUpdate, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - databaseName, - parameters, - options - }, - beginUpdateOperationSpec, - options); + async beginRegenerateKeyAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: RegenerateKeyParameters, + options?: DatabasesRegenerateKeyOptionalParams + ): Promise { + const poller = await this.beginRegenerateKey( + resourceGroupName, + clusterName, + databaseName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Deletes a single database + * Imports database files to target database. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Storage information for importing into the cluster + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - databaseName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginImport( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: ImportClusterParameters, + options?: DatabasesImportOptionalParams + ): 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, clusterName, databaseName, parameters, options }, + importOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Regenerates the RedisEnterprise database's access keys. + * Imports database files to target database. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param keyType Which access key to regenerate. Possible values include: 'Primary', 'Secondary' - * @param [options] The optional parameters - * @returns Promise + * @param parameters Storage information for importing into the cluster + * @param options The options parameters. */ - beginRegenerateKey(resourceGroupName: string, clusterName: string, databaseName: string, keyType: Models.AccessKeyType, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - databaseName, - keyType, - options - }, - beginRegenerateKeyOperationSpec, - options); + async beginImportAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: ImportClusterParameters, + options?: DatabasesImportOptionalParams + ): Promise { + const poller = await this.beginImport( + resourceGroupName, + clusterName, + databaseName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Imports a database file to target database. + * Exports a database file from target database. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param sasUri SAS URI for the target blob to import from - * @param [options] The optional parameters - * @returns Promise + * @param parameters Storage information for exporting into the cluster + * @param options The options parameters. */ - beginImportMethod(resourceGroupName: string, clusterName: string, databaseName: string, sasUri: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - databaseName, - sasUri, - options - }, - beginImportMethodOperationSpec, - options); + async beginExport( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: ExportClusterParameters, + options?: DatabasesExportOptionalParams + ): 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, clusterName, databaseName, parameters, options }, + exportOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** @@ -326,68 +714,52 @@ export class Databases { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. * @param databaseName The name of the database. - * @param sasUri SAS URI for the target directory to export to - * @param [options] The optional parameters - * @returns Promise + * @param parameters Storage information for exporting into the cluster + * @param options The options parameters. */ - beginExportMethod(resourceGroupName: string, clusterName: string, databaseName: string, sasUri: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - databaseName, - sasUri, - options - }, - beginExportMethodOperationSpec, - options); + async beginExportAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: ExportClusterParameters, + options?: DatabasesExportOptionalParams + ): Promise { + const poller = await this.beginExport( + resourceGroupName, + clusterName, + databaseName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Gets all databases in the specified RedisEnterprise cluster. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByClusterNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByClusterNext(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 + * ListByClusterNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param nextLink The nextLink from the previous successful call to the ListByCluster method. + * @param options The options parameters. */ - listByClusterNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByClusterNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByClusterNext( + resourceGroupName: string, + clusterName: string, + nextLink: string, + options?: DatabasesListByClusterNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByClusterNextOperationSpec, - callback) as Promise; + { resourceGroupName, clusterName, nextLink, options }, + listByClusterNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByClusterOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByClusterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.clusterName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.DatabaseList @@ -396,83 +768,54 @@ const listByClusterOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.clusterName, - Parameters.databaseName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.clusterName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Database }, + 201: { + bodyMapper: Mappers.Database + }, + 202: { + bodyMapper: Mappers.Database + }, + 204: { + bodyMapper: Mappers.Database + }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/listKeys", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName, - Parameters.databaseName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion + Parameters.databaseName ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.AccessKeys - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.clusterName, - Parameters.databaseName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Database, - required: true - } - }, +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.Database @@ -480,190 +823,188 @@ const beginCreateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.Database }, + 202: { + bodyMapper: Mappers.Database + }, + 204: { + bodyMapper: Mappers.Database + }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName, - Parameters.databaseName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion + Parameters.databaseName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.DatabaseUpdate, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Database }, - 202: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName, - Parameters.databaseName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.databaseName ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginRegenerateKeyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/regenerateKey", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName, - Parameters.databaseName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion + Parameters.databaseName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: { - keyType: "keyType" - }, - mapper: { - ...Mappers.RegenerateKeyParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/listKeys", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.AccessKeys }, - 202: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginImportMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/import", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName, - Parameters.databaseName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.databaseName ], - requestBody: { - parameterPath: { - sasUri: "sasUri" + headerParameters: [Parameters.accept], + serializer +}; +const regenerateKeyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/regenerateKey", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AccessKeys + }, + 201: { + bodyMapper: Mappers.AccessKeys + }, + 202: { + bodyMapper: Mappers.AccessKeys + }, + 204: { + bodyMapper: Mappers.AccessKeys }, - mapper: { - ...Mappers.ImportClusterParameters, - required: true + default: { + bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.databaseName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const importOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/import", + httpMethod: "POST", responses: { 200: {}, + 201: {}, 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginExportMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/export", + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName, - Parameters.databaseName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion + Parameters.databaseName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: { - sasUri: "sasUri" - }, - mapper: { - ...Mappers.ExportClusterParameters, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const exportOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/export", + httpMethod: "POST", responses: { 200: {}, + 201: {}, 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.databaseName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listByClusterNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByClusterNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DatabaseList @@ -672,5 +1013,14 @@ const listByClusterNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/index.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/index.ts index 15d088f84042..cb8946c7cbcc 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/index.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/index.ts @@ -3,8 +3,7 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./operations"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operations.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operations.ts index b08303351ab9..1a88c4bad767 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operations.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operations.ts @@ -3,92 +3,109 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; +import { RedisEnterpriseManagementClient } from "../redisEnterpriseManagementClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: RedisEnterpriseManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: RedisEnterpriseManagementClient; /** - * Create a Operations. - * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: RedisEnterpriseManagementClientContext) { + constructor(client: RedisEnterpriseManagementClient) { this.client = client; } /** * Lists all of the available REST API operations of the Microsoft.Cache provider. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Lists all of the available REST API operations of the Microsoft.Cache provider. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Cache/operations", httpMethod: "GET", - path: "providers/Microsoft.Cache/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -97,22 +114,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -121,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operationsStatus.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operationsStatus.ts index c6e650f64c2c..2fc2e330a963 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operationsStatus.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operationsStatus.ts @@ -3,25 +3,28 @@ * 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/operationsStatusMappers"; +import { OperationsStatus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; +import { RedisEnterpriseManagementClient } from "../redisEnterpriseManagementClient"; +import { + OperationsStatusGetOptionalParams, + OperationsStatusGetResponse +} from "../models"; -/** Class representing a OperationsStatus. */ -export class OperationsStatus { - private readonly client: RedisEnterpriseManagementClientContext; +/** Class containing OperationsStatus operations. */ +export class OperationsStatusImpl implements OperationsStatus { + private readonly client: RedisEnterpriseManagementClient; /** - * Create a OperationsStatus. - * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class OperationsStatus class. + * @param client Reference to the service client */ - constructor(client: RedisEnterpriseManagementClientContext) { + constructor(client: RedisEnterpriseManagementClient) { this.client = client; } @@ -29,51 +32,26 @@ export class OperationsStatus { * Gets the status of operation. * @param location The region the operation is in. * @param operationId The operation's unique identifier. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(location: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param location The region the operation is in. - * @param operationId The operation's unique identifier. - * @param callback The callback - */ - get(location: string, operationId: string, callback: msRest.ServiceCallback): void; - /** - * @param location The region the operation is in. - * @param operationId The operation's unique identifier. - * @param options The optional parameters - * @param callback The callback - */ - get(location: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(location: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + location: string, + operationId: string, + options?: OperationsStatusGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - location, - operationId, - options - }, - getOperationSpec, - callback) as Promise; + { location, operationId, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/operationsStatus/{operationId}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/operationsStatus/{operationId}", - urlParameters: [ - Parameters.location, - Parameters.operationId, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationStatus @@ -82,5 +60,13 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.location, + Parameters.operationId, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateEndpointConnections.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateEndpointConnections.ts index 01d839cfc0f2..3a7621024413 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateEndpointConnections.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateEndpointConnections.ts @@ -3,26 +3,39 @@ * 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/privateEndpointConnectionsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; +import { RedisEnterpriseManagementClient } from "../redisEnterpriseManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsListResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsPutOptionalParams, + PrivateEndpointConnectionsPutResponse, + PrivateEndpointConnectionsDeleteOptionalParams +} from "../models"; -/** Class representing a PrivateEndpointConnections. */ -export class PrivateEndpointConnections { - private readonly client: RedisEnterpriseManagementClientContext; +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: RedisEnterpriseManagementClient; /** - * Create a PrivateEndpointConnections. - * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client */ - constructor(client: RedisEnterpriseManagementClientContext) { + constructor(client: RedisEnterpriseManagementClient) { this.client = client; } @@ -30,117 +43,211 @@ export class PrivateEndpointConnections { * Lists all the private endpoint connections associated with the RedisEnterprise cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; + public list( + resourceGroupName: string, + clusterName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, clusterName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, clusterName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + clusterName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, clusterName, options); + yield result.value || []; + } + + private async *listPagingAll( + resourceGroupName: string, + clusterName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + clusterName, + options + )) { + yield* page; + } + } + /** + * Lists all the private endpoint connections associated with the RedisEnterprise cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param callback The callback + * @param options The options parameters. */ - list(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; + private _list( + resourceGroupName: string, + clusterName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + listOperationSpec + ); + } + /** + * Gets the specified private endpoint connection associated with the RedisEnterprise cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param options The optional parameters - * @param callback The callback + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. */ - list(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + clusterName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, clusterName, + privateEndpointConnectionName, options }, - listOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** - * Gets the specified private endpoint connection associated with the RedisEnterprise cluster. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param callback The callback - */ - get(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; - /** + * Updates the state of the specified private endpoint connection associated with the RedisEnterprise + * cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param options The optional parameters - * @param callback The callback + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param properties The private endpoint connection properties. + * @param options The options parameters. */ - get(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginPut( + resourceGroupName: string, + clusterName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsPutOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsPutResponse + > + > { + 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, clusterName, privateEndpointConnectionName, + properties, options }, - getOperationSpec, - callback) as Promise; + putOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Updates the state of the specified private endpoint connection associated with the - * RedisEnterprise cluster. + * Updates the state of the specified private endpoint connection associated with the RedisEnterprise + * cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource * @param properties The private endpoint connection properties. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - put(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise { - return this.beginPut(resourceGroupName,clusterName,privateEndpointConnectionName,properties,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginPutAndWait( + resourceGroupName: string, + clusterName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsPutOptionalParams + ): Promise { + const poller = await this.beginPut( + resourceGroupName, + clusterName, + privateEndpointConnectionName, + properties, + options + ); + return poller.pollUntilDone(); } /** * Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param [options] The optional parameters - * @returns Promise + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + clusterName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -148,51 +255,17 @@ export class PrivateEndpointConnections { privateEndpointConnectionName, options }, - deleteMethodOperationSpec, - callback); - } - - /** - * Updates the state of the specified private endpoint connection associated with the - * RedisEnterprise cluster. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param properties The private endpoint connection properties. - * @param [options] The optional parameters - * @returns Promise - */ - beginPut(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - privateEndpointConnectionName, - properties, - options - }, - beginPutOperationSpec, - options); + deleteOperationSpec + ); } } - // 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.clusterName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnectionListResult @@ -201,50 +274,77 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName, - Parameters.privateEndpointConnectionName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.privateEndpointConnectionName ], + headerParameters: [Parameters.accept], + serializer +}; +const putOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnection }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection + }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}", + requestBody: Parameters.properties, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName, - Parameters.subscriptionId, Parameters.privateEndpointConnectionName ], - 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.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -252,38 +352,14 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginPutOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName, - Parameters.subscriptionId, Parameters.privateEndpointConnectionName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "properties", - mapper: { - ...Mappers.PrivateEndpointConnection, - required: true - } - }, - responses: { - 201: { - bodyMapper: Mappers.PrivateEndpointConnection - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateLinkResources.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateLinkResources.ts index c70a164fff31..f9fc4d7e999e 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateLinkResources.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateLinkResources.ts @@ -3,25 +3,31 @@ * 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/privateLinkResourcesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; +import { RedisEnterpriseManagementClient } from "../redisEnterpriseManagementClient"; +import { + PrivateLinkResource, + PrivateLinkResourcesListByClusterOptionalParams, + PrivateLinkResourcesListByClusterResponse +} from "../models"; -/** Class representing a PrivateLinkResources. */ -export class PrivateLinkResources { - private readonly client: RedisEnterpriseManagementClientContext; +/// +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: RedisEnterpriseManagementClient; /** - * Create a PrivateLinkResources. - * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client */ - constructor(client: RedisEnterpriseManagementClientContext) { + constructor(client: RedisEnterpriseManagementClient) { this.client = client; } @@ -29,51 +35,86 @@ export class PrivateLinkResources { * Gets the private link resources that need to be created for a RedisEnterprise cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByCluster(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param callback The callback - */ - listByCluster(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; + public listByCluster( + resourceGroupName: string, + clusterName: string, + options?: PrivateLinkResourcesListByClusterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByClusterPagingAll( + resourceGroupName, + clusterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByClusterPagingPage( + resourceGroupName, + clusterName, + options + ); + } + }; + } + + private async *listByClusterPagingPage( + resourceGroupName: string, + clusterName: string, + options?: PrivateLinkResourcesListByClusterOptionalParams + ): AsyncIterableIterator { + let result = await this._listByCluster( + resourceGroupName, + clusterName, + options + ); + yield result.value || []; + } + + private async *listByClusterPagingAll( + resourceGroupName: string, + clusterName: string, + options?: PrivateLinkResourcesListByClusterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByClusterPagingPage( + resourceGroupName, + clusterName, + options + )) { + yield* page; + } + } + /** + * Gets the private link resources that need to be created for a RedisEnterprise cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByCluster(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByCluster(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByCluster( + resourceGroupName: string, + clusterName: string, + options?: PrivateLinkResourcesListByClusterOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - clusterName, - options - }, - listByClusterOperationSpec, - callback) as Promise; + { resourceGroupName, clusterName, options }, + listByClusterOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByClusterOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByClusterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateLinkResources", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateLinkResources", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.clusterName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.PrivateLinkResourceListResult @@ -82,5 +123,13 @@ const listByClusterOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/redisEnterprise.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/redisEnterprise.ts index dccaae6b2b1d..68dbcf6b321c 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/redisEnterprise.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/redisEnterprise.ts @@ -3,446 +3,637 @@ * 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/redisEnterpriseMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { RedisEnterprise } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; +import { RedisEnterpriseManagementClient } from "../redisEnterpriseManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Cluster, + RedisEnterpriseListByResourceGroupNextOptionalParams, + RedisEnterpriseListByResourceGroupOptionalParams, + RedisEnterpriseListNextOptionalParams, + RedisEnterpriseListOptionalParams, + RedisEnterpriseCreateOptionalParams, + RedisEnterpriseCreateResponse, + ClusterUpdate, + RedisEnterpriseUpdateOptionalParams, + RedisEnterpriseUpdateResponse, + RedisEnterpriseDeleteOptionalParams, + RedisEnterpriseGetOptionalParams, + RedisEnterpriseGetResponse, + RedisEnterpriseListByResourceGroupResponse, + RedisEnterpriseListResponse, + RedisEnterpriseListByResourceGroupNextResponse, + RedisEnterpriseListNextResponse +} from "../models"; -/** Class representing a RedisEnterprise. */ -export class RedisEnterprise { - private readonly client: RedisEnterpriseManagementClientContext; +/// +/** Class containing RedisEnterprise operations. */ +export class RedisEnterpriseImpl implements RedisEnterprise { + private readonly client: RedisEnterpriseManagementClient; /** - * Create a RedisEnterprise. - * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class RedisEnterprise class. + * @param client Reference to the service client */ - constructor(client: RedisEnterpriseManagementClientContext) { + constructor(client: RedisEnterpriseManagementClient) { this.client = client; } /** - * Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster + * Lists all RedisEnterprise clusters in a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param parameters Parameters supplied to the Create RedisEnterprise operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(resourceGroupName: string, clusterName: string, parameters: Models.Cluster, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(resourceGroupName,clusterName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + public listByResourceGroup( + resourceGroupName: string, + options?: RedisEnterpriseListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; } - /** - * Updates an existing RedisEnterprise cluster - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param parameters Parameters supplied to the Update RedisEnterprise operation. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, clusterName: string, parameters: Models.ClusterUpdate, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdate(resourceGroupName,clusterName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: RedisEnterpriseListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Deletes a RedisEnterprise cache cluster. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,clusterName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: RedisEnterpriseListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Gets information about a RedisEnterprise cluster - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the RedisEnterprise cluster. - * @param [options] The optional parameters - * @returns Promise + * Gets all RedisEnterprise clusters in the specified subscription. + * @param options The options parameters. */ - get(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; + public list( + options?: RedisEnterpriseListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: RedisEnterpriseListOptionalParams + ): 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?: RedisEnterpriseListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** + * Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param callback The callback + * @param parameters Parameters supplied to the Create RedisEnterprise operation. + * @param options The options parameters. */ - get(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; + async beginCreate( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: RedisEnterpriseCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RedisEnterpriseCreateResponse + > + > { + 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, clusterName, parameters, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "original-uri" + }); + } + /** + * Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param options The optional parameters - * @param callback The callback + * @param parameters Parameters supplied to the Create RedisEnterprise operation. + * @param options The options parameters. */ - get(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - clusterName, - options - }, - getOperationSpec, - callback) as Promise; + async beginCreateAndWait( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: RedisEnterpriseCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + clusterName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Lists all RedisEnterprise clusters in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** + * Updates an existing RedisEnterprise cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback + * @param clusterName The name of the RedisEnterprise cluster. + * @param parameters Parameters supplied to the Update RedisEnterprise operation. + * @param options The options parameters. */ - 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; + async beginUpdate( + resourceGroupName: string, + clusterName: string, + parameters: ClusterUpdate, + options?: RedisEnterpriseUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RedisEnterpriseUpdateResponse + > + > { + 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, clusterName, parameters, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Gets all RedisEnterprise clusters 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 + * Updates an existing RedisEnterprise cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param parameters Parameters supplied to the Update RedisEnterprise operation. + * @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; + async beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + parameters: ClusterUpdate, + options?: RedisEnterpriseUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + clusterName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster + * Deletes a RedisEnterprise cache cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param parameters Parameters supplied to the Create RedisEnterprise operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreate(resourceGroupName: string, clusterName: string, parameters: Models.Cluster, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - parameters, - options - }, - beginCreateOperationSpec, - options); + async beginDelete( + resourceGroupName: string, + clusterName: string, + options?: RedisEnterpriseDeleteOptionalParams + ): 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, clusterName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); } /** - * Updates an existing RedisEnterprise cluster + * Deletes a RedisEnterprise cache cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param parameters Parameters supplied to the Update RedisEnterprise operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginUpdate(resourceGroupName: string, clusterName: string, parameters: Models.ClusterUpdate, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - parameters, - options - }, - beginUpdateOperationSpec, - options); + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + options?: RedisEnterpriseDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + options + ); + return poller.pollUntilDone(); } /** - * Deletes a RedisEnterprise cache cluster. + * Gets information about a RedisEnterprise cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - options - }, - beginDeleteMethodOperationSpec, - options); + get( + resourceGroupName: string, + clusterName: string, + options?: RedisEnterpriseGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + getOperationSpec + ); } /** * Lists all RedisEnterprise clusters in a resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: RedisEnterpriseListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** * Gets all RedisEnterprise clusters in the specified subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + private _list( + options?: RedisEnterpriseListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: RedisEnterpriseListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + /** - * @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?: RedisEnterpriseListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.clusterName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Cluster }, + 201: { + bodyMapper: Mappers.Cluster + }, + 202: { + bodyMapper: Mappers.Cluster + }, + 204: { + bodyMapper: Mappers.Cluster + }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.clusterName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.ClusterList + bodyMapper: Mappers.Cluster + }, + 201: { + bodyMapper: Mappers.Cluster + }, + 202: { + bodyMapper: Mappers.Cluster + }, + 204: { + bodyMapper: Mappers.Cluster }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Cache/redisEnterprise", + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.ClusterList - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.clusterName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.clusterName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Cluster, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Cluster }, - 201: { - bodyMapper: Mappers.Cluster - }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.clusterName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion + Parameters.clusterName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ClusterUpdate, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Cluster + bodyMapper: Mappers.ClusterList }, - 202: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, - Parameters.clusterName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Cache/redisEnterprise", + httpMethod: "GET", responses: { - 200: {}, - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.ClusterList + }, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ClusterList @@ -451,22 +642,19 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ClusterList @@ -475,5 +663,12 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/databases.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/databases.ts new file mode 100644 index 000000000000..2da2b5aacdef --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/databases.ts @@ -0,0 +1,264 @@ +/* + * 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 { + Database, + DatabasesListByClusterOptionalParams, + DatabasesCreateOptionalParams, + DatabasesCreateResponse, + DatabaseUpdate, + DatabasesUpdateOptionalParams, + DatabasesUpdateResponse, + DatabasesGetOptionalParams, + DatabasesGetResponse, + DatabasesDeleteOptionalParams, + DatabasesListKeysOptionalParams, + DatabasesListKeysResponse, + RegenerateKeyParameters, + DatabasesRegenerateKeyOptionalParams, + DatabasesRegenerateKeyResponse, + ImportClusterParameters, + DatabasesImportOptionalParams, + ExportClusterParameters, + DatabasesExportOptionalParams +} from "../models"; + +/// +/** Interface representing a Databases. */ +export interface Databases { + /** + * Gets all databases in the specified RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param options The options parameters. + */ + listByCluster( + resourceGroupName: string, + clusterName: string, + options?: DatabasesListByClusterOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates a database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Parameters supplied to the create or update database operation. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: Database, + options?: DatabasesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DatabasesCreateResponse + > + >; + /** + * Creates a database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Parameters supplied to the create or update database operation. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: Database, + options?: DatabasesCreateOptionalParams + ): Promise; + /** + * Updates a database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Parameters supplied to the create or update database operation. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: DatabaseUpdate, + options?: DatabasesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DatabasesUpdateResponse + > + >; + /** + * Updates a database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Parameters supplied to the create or update database operation. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: DatabaseUpdate, + options?: DatabasesUpdateOptionalParams + ): Promise; + /** + * Gets information about a database in a RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + databaseName: string, + options?: DatabasesGetOptionalParams + ): Promise; + /** + * Deletes a single database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterName: string, + databaseName: string, + options?: DatabasesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a single database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + options?: DatabasesDeleteOptionalParams + ): Promise; + /** + * Retrieves the access keys for the RedisEnterprise database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + clusterName: string, + databaseName: string, + options?: DatabasesListKeysOptionalParams + ): Promise; + /** + * Regenerates the RedisEnterprise database's access keys. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Specifies which key to regenerate. + * @param options The options parameters. + */ + beginRegenerateKey( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: RegenerateKeyParameters, + options?: DatabasesRegenerateKeyOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DatabasesRegenerateKeyResponse + > + >; + /** + * Regenerates the RedisEnterprise database's access keys. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Specifies which key to regenerate. + * @param options The options parameters. + */ + beginRegenerateKeyAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: RegenerateKeyParameters, + options?: DatabasesRegenerateKeyOptionalParams + ): Promise; + /** + * Imports database files to target database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Storage information for importing into the cluster + * @param options The options parameters. + */ + beginImport( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: ImportClusterParameters, + options?: DatabasesImportOptionalParams + ): Promise, void>>; + /** + * Imports database files to target database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Storage information for importing into the cluster + * @param options The options parameters. + */ + beginImportAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: ImportClusterParameters, + options?: DatabasesImportOptionalParams + ): Promise; + /** + * Exports a database file from target database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Storage information for exporting into the cluster + * @param options The options parameters. + */ + beginExport( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: ExportClusterParameters, + options?: DatabasesExportOptionalParams + ): Promise, void>>; + /** + * Exports a database file from target database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Storage information for exporting into the cluster + * @param options The options parameters. + */ + beginExportAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: ExportClusterParameters, + options?: DatabasesExportOptionalParams + ): Promise; +} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/operationsStatusMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/index.ts similarity index 51% rename from sdk/redisenterprise/arm-redisenterprisecache/src/models/operationsStatusMappers.ts rename to sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/index.ts index f0219f9c237e..cb8946c7cbcc 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/operationsStatusMappers.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/index.ts @@ -6,9 +6,9 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export { - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - OperationStatus -} from "../models/mappers"; +export * from "./operations"; +export * from "./operationsStatus"; +export * from "./redisEnterprise"; +export * from "./databases"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/operations.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..5f19c5128309 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/operationsStatus.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/operationsStatus.ts new file mode 100644 index 000000000000..1b05cbcca2f4 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/operationsStatus.ts @@ -0,0 +1,27 @@ +/* + * 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 { + OperationsStatusGetOptionalParams, + OperationsStatusGetResponse +} from "../models"; + +/** Interface representing a OperationsStatus. */ +export interface OperationsStatus { + /** + * Gets the status of operation. + * @param location The region the operation is in. + * @param operationId The operation's unique identifier. + * @param options The options parameters. + */ + get( + location: string, + operationId: string, + options?: OperationsStatusGetOptionalParams + ): Promise; +} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..a4c3f7de0e22 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,102 @@ +/* + * 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 { + PrivateEndpointConnection, + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsPutOptionalParams, + PrivateEndpointConnectionsPutResponse, + PrivateEndpointConnectionsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * Lists all the private endpoint connections associated with the RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + clusterName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the specified private endpoint connection associated with the RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; + /** + * Updates the state of the specified private endpoint connection associated with the RedisEnterprise + * cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param properties The private endpoint connection properties. + * @param options The options parameters. + */ + beginPut( + resourceGroupName: string, + clusterName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsPutOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsPutResponse + > + >; + /** + * Updates the state of the specified private endpoint connection associated with the RedisEnterprise + * cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param properties The private endpoint connection properties. + * @param options The options parameters. + */ + beginPutAndWait( + resourceGroupName: string, + clusterName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsPutOptionalParams + ): Promise; + /** + * Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + clusterName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateLinkResources.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..9cec5721aa66 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,29 @@ +/* + * 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 { + PrivateLinkResource, + PrivateLinkResourcesListByClusterOptionalParams +} from "../models"; + +/// +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param options The options parameters. + */ + listByCluster( + resourceGroupName: string, + clusterName: string, + options?: PrivateLinkResourcesListByClusterOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/redisEnterprise.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/redisEnterprise.ts new file mode 100644 index 000000000000..0676a7b62dc3 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/redisEnterprise.ts @@ -0,0 +1,139 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Cluster, + RedisEnterpriseListByResourceGroupOptionalParams, + RedisEnterpriseListOptionalParams, + RedisEnterpriseCreateOptionalParams, + RedisEnterpriseCreateResponse, + ClusterUpdate, + RedisEnterpriseUpdateOptionalParams, + RedisEnterpriseUpdateResponse, + RedisEnterpriseDeleteOptionalParams, + RedisEnterpriseGetOptionalParams, + RedisEnterpriseGetResponse +} from "../models"; + +/// +/** Interface representing a RedisEnterprise. */ +export interface RedisEnterprise { + /** + * Lists all RedisEnterprise clusters in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: RedisEnterpriseListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all RedisEnterprise clusters in the specified subscription. + * @param options The options parameters. + */ + list( + options?: RedisEnterpriseListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param parameters Parameters supplied to the Create RedisEnterprise operation. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: RedisEnterpriseCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RedisEnterpriseCreateResponse + > + >; + /** + * Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param parameters Parameters supplied to the Create RedisEnterprise operation. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: RedisEnterpriseCreateOptionalParams + ): Promise; + /** + * Updates an existing RedisEnterprise cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param parameters Parameters supplied to the Update RedisEnterprise operation. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + clusterName: string, + parameters: ClusterUpdate, + options?: RedisEnterpriseUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RedisEnterpriseUpdateResponse + > + >; + /** + * Updates an existing RedisEnterprise cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param parameters Parameters supplied to the Update RedisEnterprise operation. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + parameters: ClusterUpdate, + options?: RedisEnterpriseUpdateOptionalParams + ): Promise; + /** + * Deletes a RedisEnterprise cache cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterName: string, + options?: RedisEnterpriseDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a RedisEnterprise cache cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + options?: RedisEnterpriseDeleteOptionalParams + ): Promise; + /** + * Gets information about a RedisEnterprise cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + options?: RedisEnterpriseGetOptionalParams + ): Promise; +} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClient.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClient.ts index 39c21aeb4b84..c8809c323349 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClient.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClient.ts @@ -3,49 +3,97 @@ * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { RedisEnterpriseManagementClientContext } from "./redisEnterpriseManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + OperationsStatusImpl, + RedisEnterpriseImpl, + DatabasesImpl, + PrivateEndpointConnectionsImpl, + PrivateLinkResourcesImpl +} from "./operations"; +import { + Operations, + OperationsStatus, + RedisEnterprise, + Databases, + PrivateEndpointConnections, + PrivateLinkResources +} from "./operationsInterfaces"; +import { RedisEnterpriseManagementClientOptionalParams } from "./models"; - -class RedisEnterpriseManagementClient extends RedisEnterpriseManagementClientContext { - // Operation groups - operations: operations.Operations; - operationsStatus: operations.OperationsStatus; - redisEnterprise: operations.RedisEnterprise; - databases: operations.Databases; - privateEndpointConnections: operations.PrivateEndpointConnections; - privateLinkResources: operations.PrivateLinkResources; +export class RedisEnterpriseManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the RedisEnterpriseManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId The ID of the target subscription. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.RedisEnterpriseManagementClientOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.operationsStatus = new operations.OperationsStatus(this); - this.redisEnterprise = new operations.RedisEnterprise(this); - this.databases = new operations.Databases(this); - this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); - this.privateLinkResources = new operations.PrivateLinkResources(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: RedisEnterpriseManagementClientOptionalParams + ) { + 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: RedisEnterpriseManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-redisenterprisecache/2.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - RedisEnterpriseManagementClient, - RedisEnterpriseManagementClientContext, - Models as RedisEnterpriseManagementModels, - Mappers as RedisEnterpriseManagementMappers -}; -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 || "2021-08-01"; + this.operations = new OperationsImpl(this); + this.operationsStatus = new OperationsStatusImpl(this); + this.redisEnterprise = new RedisEnterpriseImpl(this); + this.databases = new DatabasesImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + } + + operations: Operations; + operationsStatus: OperationsStatus; + redisEnterprise: RedisEnterprise; + databases: Databases; + privateEndpointConnections: PrivateEndpointConnections; + privateLinkResources: PrivateLinkResources; +} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClientContext.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClientContext.ts deleted file mode 100644 index 3682ef12303b..000000000000 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClientContext.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-redisenterprisecache"; -const packageVersion = "1.0.0"; - -export class RedisEnterpriseManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the RedisEnterpriseManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The ID of the target subscription. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.RedisEnterpriseManagementClientOptions) { - 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 = '2021-03-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/test/sampleTest.ts b/sdk/redisenterprise/arm-redisenterprisecache/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/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/redisenterprise/arm-redisenterprisecache/tsconfig.json b/sdk/redisenterprise/arm-redisenterprisecache/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/tsconfig.json +++ b/sdk/redisenterprise/arm-redisenterprisecache/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/redisenterprise/ci.yml b/sdk/redisenterprise/ci.yml new file mode 100644 index 000000000000..0df63fa929ad --- /dev/null +++ b/sdk/redisenterprise/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/redisenterprise/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/redisenterprise/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: redisenterprise + Artifacts: + - name: azure-arm-redisenterprisecache + safeName: azurearmredisenterprisecache + \ No newline at end of file