From 3c53deb1d750aa86633bf550e4e2f05e7ff9a51f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 08:51:40 +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-resourcegraph/CHANGELOG.md | 11 + .../{LICENSE.txt => LICENSE} | 4 +- sdk/resourcegraph/arm-resourcegraph/README.md | 138 +-- .../arm-resourcegraph/_meta.json | 7 + .../arm-resourcegraph/api-extractor.json | 18 + .../arm-resourcegraph/package.json | 92 +- .../review/arm-resourcegraph.api.md | 214 +++++ .../arm-resourcegraph/rollup.config.js | 211 ++++- .../arm-resourcegraph/src/index.ts | 12 + .../arm-resourcegraph/src/models/index.ts | 836 ++++------------- .../arm-resourcegraph/src/models/mappers.ts | 849 ++++++------------ .../src/models/parameters.ts | 60 +- .../arm-resourcegraph/src/operations/index.ts | 3 +- .../src/operations/operations.ts | 106 ++- .../index.ts} | 10 +- .../src/operationsInterfaces/operations.ts | 22 + .../src/resourceGraphClient.ts | 351 ++------ .../src/resourceGraphClientContext.ts | 59 -- .../arm-resourcegraph/test/sampleTest.ts | 48 + .../arm-resourcegraph/tsconfig.json | 6 +- sdk/resourcegraph/ci.yml | 29 + 23 files changed, 1421 insertions(+), 1801 deletions(-) create mode 100644 sdk/resourcegraph/arm-resourcegraph/CHANGELOG.md rename sdk/resourcegraph/arm-resourcegraph/{LICENSE.txt => LICENSE} (96%) create mode 100644 sdk/resourcegraph/arm-resourcegraph/_meta.json create mode 100644 sdk/resourcegraph/arm-resourcegraph/api-extractor.json create mode 100644 sdk/resourcegraph/arm-resourcegraph/review/arm-resourcegraph.api.md create mode 100644 sdk/resourcegraph/arm-resourcegraph/src/index.ts rename sdk/resourcegraph/arm-resourcegraph/src/{models/operationsMappers.ts => operationsInterfaces/index.ts} (59%) create mode 100644 sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/operations.ts delete mode 100644 sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClientContext.ts create mode 100644 sdk/resourcegraph/arm-resourcegraph/test/sampleTest.ts create mode 100644 sdk/resourcegraph/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..e323e32669f9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -64,6 +64,7 @@ specifiers: '@rush-temp/arm-recoveryservices': file:./projects/arm-recoveryservices.tgz '@rush-temp/arm-rediscache': file:./projects/arm-rediscache.tgz '@rush-temp/arm-relay': file:./projects/arm-relay.tgz + '@rush-temp/arm-resourcegraph': file:./projects/arm-resourcegraph.tgz '@rush-temp/arm-resourcehealth': file:./projects/arm-resourcehealth.tgz '@rush-temp/arm-resources': file:./projects/arm-resources.tgz '@rush-temp/arm-resources-subscriptions': file:./projects/arm-resources-subscriptions.tgz @@ -245,6 +246,7 @@ dependencies: '@rush-temp/arm-recoveryservices': file:projects/arm-recoveryservices.tgz '@rush-temp/arm-rediscache': file:projects/arm-rediscache.tgz '@rush-temp/arm-relay': file:projects/arm-relay.tgz + '@rush-temp/arm-resourcegraph': file:projects/arm-resourcegraph.tgz '@rush-temp/arm-resourcehealth': file:projects/arm-resourcehealth.tgz '@rush-temp/arm-resources': file:projects/arm-resources.tgz '@rush-temp/arm-resources-subscriptions': file:projects/arm-resources-subscriptions.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 @@ -9127,6 +9129,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-resourcegraph.tgz: + resolution: {integrity: sha512-bFjTQLNJL35KxWSM6bXsXRMPMe1ScqAQyAZ+OBuhgDRQsQ+iOHpsbFuWFkDxLP4zAJ2b/0ZdRboitVxEYNDoKA==, tarball: file:projects/arm-resourcegraph.tgz} + name: '@rush-temp/arm-resourcegraph' + 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-resourcehealth.tgz: resolution: {integrity: sha512-2aZ/KsYKwAjiAVYNgPcnIHIZ1zPnIhoqJzsV188fdQ+QJAf5uP3LuyYbqv128SbEqrHQK5XSbAgWNQiAk7DecQ==, tarball: file:projects/arm-resourcehealth.tgz} name: '@rush-temp/arm-resourcehealth' @@ -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..9718e509937c 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-resourcegraph", + "projectFolder": "sdk/resourcegraph/arm-resourcegraph", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/resourcegraph/arm-resourcegraph/CHANGELOG.md b/sdk/resourcegraph/arm-resourcegraph/CHANGELOG.md new file mode 100644 index 000000000000..7d7316fc41d8 --- /dev/null +++ b/sdk/resourcegraph/arm-resourcegraph/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 5.0.0-beta.1 (2022-01-05) + +The package of @azure/arm-resourcegraph is using our next generation design principles since version 5.0.0-beta.1, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/resourcegraph/arm-resourcegraph/LICENSE.txt b/sdk/resourcegraph/arm-resourcegraph/LICENSE similarity index 96% rename from sdk/resourcegraph/arm-resourcegraph/LICENSE.txt rename to sdk/resourcegraph/arm-resourcegraph/LICENSE index 2d3163745319..5d1d36e0af80 100644 --- a/sdk/resourcegraph/arm-resourcegraph/LICENSE.txt +++ b/sdk/resourcegraph/arm-resourcegraph/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/resourcegraph/arm-resourcegraph/README.md b/sdk/resourcegraph/arm-resourcegraph/README.md index 76978e5e821b..0baf63f441a2 100644 --- a/sdk/resourcegraph/arm-resourcegraph/README.md +++ b/sdk/resourcegraph/arm-resourcegraph/README.md @@ -1,98 +1,98 @@ -## Azure ResourceGraphClient SDK for JavaScript +# Azure ResourceGraph client library for JavaScript -This package contains an isomorphic SDK for ResourceGraphClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ResourceGraph client. + +Azure Resource Graph API Reference + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcegraph/arm-resourcegraph) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-resourcegraph) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resourcegraph?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-resourcegraph` package -### How to Install +Install the Azure ResourceGraph client library for JavaScript with `npm`: ```bash npm install @azure/arm-resourcegraph ``` -### How to use +### Create and authenticate a `ResourceGraphClient` -#### nodejs - client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure ResourceGraph API, you will need the `endpoint` of your Azure ResourceGraph resource and a `credential`. The Azure ResourceGraph client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure ResourceGraph 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 ResourceGraph** 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 { ResourceGraphClient } = require("@azure/arm-resourcegraph"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new ResourceGraphClient(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 ResourceGraphClient(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 + +### ResourceGraphClient -##### 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-resourcegraph sample - - - - - - - - +`ResourceGraphClient` is the primary interface for developers using the Azure ResourceGraph client library. Explore the methods on this client object to understand the different features of the Azure ResourceGraph 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%2Fresourcegraph%2Farm-resourcegraph%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/resourcegraph/arm-resourcegraph/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/resourcegraph/arm-resourcegraph/_meta.json b/sdk/resourcegraph/arm-resourcegraph/_meta.json new file mode 100644 index 000000000000..b66d9e9268e3 --- /dev/null +++ b/sdk/resourcegraph/arm-resourcegraph/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "5a1b7262be0a4f6a9004d35403b854429475cdf4", + "readme": "specification/resourcegraph/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/resourcegraph/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/resourcegraph/arm-resourcegraph/api-extractor.json b/sdk/resourcegraph/arm-resourcegraph/api-extractor.json new file mode 100644 index 000000000000..b1a55d788f31 --- /dev/null +++ b/sdk/resourcegraph/arm-resourcegraph/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-resourcegraph.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/resourcegraph/arm-resourcegraph/package.json b/sdk/resourcegraph/arm-resourcegraph/package.json index df62daefb40e..b265eaf2ff35 100644 --- a/sdk/resourcegraph/arm-resourcegraph/package.json +++ b/sdk/resourcegraph/arm-resourcegraph/package.json @@ -1,57 +1,89 @@ { "name": "@azure/arm-resourcegraph", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "ResourceGraphClient Library with typescript type definitions for node.js and browser.", - "version": "4.1.0", + "description": "A generated SDK for ResourceGraphClient.", + "version": "5.0.0-beta.1", + "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-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-resourcegraph.js", - "module": "./esm/resourceGraphClient.js", - "types": "./esm/resourceGraphClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-resourcegraph.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/resourcegraph/arm-resourcegraph", "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-resourcegraph.js.map'\" -o ./dist/arm-resourcegraph.min.js ./dist/arm-resourcegraph.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/resourcegraph/arm-resourcegraph/review/arm-resourcegraph.api.md b/sdk/resourcegraph/arm-resourcegraph/review/arm-resourcegraph.api.md new file mode 100644 index 000000000000..4c7e197e4cd2 --- /dev/null +++ b/sdk/resourcegraph/arm-resourcegraph/review/arm-resourcegraph.api.md @@ -0,0 +1,214 @@ +## API Report File for "@azure/arm-resourcegraph" + +> 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'; + +// @public +export type AuthorizationScopeFilter = "AtScopeAndBelow" | "AtScopeAndAbove" | "AtScopeExact" | "AtScopeAboveAndBelow"; + +// @public +export interface Column { + name: string; + type: ColumnDataType; +} + +// @public +export type ColumnDataType = "string" | "integer" | "number" | "boolean" | "object" | "datetime"; + +// @public +export interface DateTimeInterval { + end: Date; + start: Date; +} + +// @public +export interface ErrorDetails { + [property: string]: any; + code: string; + message: string; +} + +// @public +export interface ErrorModel { + code: string; + details?: ErrorDetails[]; + message: string; +} + +// @public +export interface ErrorResponse { + error: ErrorModel; +} + +// @public +export interface Facet { + expression: string; + resultType: "FacetResult" | "FacetError"; +} + +// @public +export type FacetError = Facet & { + resultType: "FacetError"; + errors: ErrorDetails[]; +}; + +// @public +export interface FacetRequest { + expression: string; + options?: FacetRequestOptions; +} + +// @public +export interface FacetRequestOptions { + filter?: string; + sortBy?: string; + sortOrder?: FacetSortOrder; + top?: number; +} + +// @public +export type FacetResult = Facet & { + resultType: "FacetResult"; + totalRecords: number; + count: number; + data: Record; +}; + +// @public +export type FacetSortOrder = "asc" | "desc"; + +// @public (undocumented) +export type FacetUnion = Facet | FacetResult | FacetError; + +// @public +export interface Operation { + display?: OperationDisplay; + name?: string; + origin?: string; +} + +// @public +export interface OperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationListResult { + value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export interface QueryRequest { + facets?: FacetRequest[]; + managementGroups?: string[]; + options?: QueryRequestOptions; + query: string; + subscriptions?: string[]; +} + +// @public +export interface QueryRequestOptions { + allowPartialScopes?: boolean; + authorizationScopeFilter?: AuthorizationScopeFilter; + resultFormat?: ResultFormat; + skip?: number; + skipToken?: string; + top?: number; +} + +// @public +export interface QueryResponse { + count: number; + data: Record; + facets?: FacetUnion[]; + resultTruncated: ResultTruncated; + skipToken?: string; + totalRecords: number; +} + +// @public (undocumented) +export class ResourceGraphClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, options?: ResourceGraphClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + operations: Operations; + resources(query: QueryRequest, options?: ResourcesOptionalParams): Promise; + resourcesHistory(request: ResourcesHistoryRequest, options?: ResourcesHistoryOptionalParams): Promise; +} + +// @public +export interface ResourceGraphClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface ResourcesHistoryOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ResourcesHistoryRequest { + managementGroups?: string[]; + options?: ResourcesHistoryRequestOptions; + query?: string; + subscriptions?: string[]; +} + +// @public +export interface ResourcesHistoryRequestOptions { + interval?: DateTimeInterval; + resultFormat?: ResultFormat; + skip?: number; + skipToken?: string; + top?: number; +} + +// @public +export type ResourcesHistoryResponse = Record; + +// @public +export interface ResourcesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcesResponse = QueryResponse; + +// @public +export type ResultFormat = "table" | "objectArray"; + +// @public +export type ResultTruncated = "true" | "false"; + +// @public +export interface Table { + columns: Column[]; + rows: Record[][]; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/resourcegraph/arm-resourcegraph/rollup.config.js b/sdk/resourcegraph/arm-resourcegraph/rollup.config.js index b4a13e4ff3f9..9be1955eb7f1 100644 --- a/sdk/resourcegraph/arm-resourcegraph/rollup.config.js +++ b/sdk/resourcegraph/arm-resourcegraph/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/resourceGraphClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-resourcegraph.js", - format: "umd", - name: "Azure.ArmResourcegraph", - 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/resourcegraph/arm-resourcegraph/src/index.ts b/sdk/resourcegraph/arm-resourcegraph/src/index.ts new file mode 100644 index 000000000000..45f329cbd465 --- /dev/null +++ b/sdk/resourcegraph/arm-resourcegraph/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { ResourceGraphClient } from "./resourceGraphClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/resourcegraph/arm-resourcegraph/src/models/index.ts b/sdk/resourcegraph/arm-resourcegraph/src/models/index.ts index 8d1bec988866..a1a27f63a861 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/models/index.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/models/index.ts @@ -6,707 +6,255 @@ * 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 }; - -/** - * An interval in time specifying the date and time for the inclusive start and exclusive end, i.e. - * `[start, end)`. - */ -export interface DateTimeInterval { - /** - * A datetime indicating the inclusive/closed start of the time interval, i.e. `[`**`start`**`, - * end)`. Specifying a `start` that occurs chronologically after `end` will result in an error. - */ - start: Date; - /** - * A datetime indicating the exclusive/open end of the time interval, i.e. `[start, - * `**`end`**`)`. Specifying an `end` that occurs chronologically before `start` will result in - * an error. - */ - end: Date; -} - -/** - * Specifies the date and time interval for a changes request. - */ -export interface ResourceChangesRequestParametersInterval extends DateTimeInterval {} - -/** - * The parameters for a specific changes request. - */ -export interface ResourceChangesRequestParameters { - /** - * Specifies the list of resources for a changes request. - */ - resourceIds?: string[]; - /** - * The subscription id of resources to query the changes from. - */ - subscriptionId?: string; - /** - * Specifies the date and time interval for a changes request. - */ - interval: ResourceChangesRequestParametersInterval; - /** - * Acts as the continuation token for paged responses. - */ - skipToken?: string; - /** - * The maximum number of changes the client can accept in a paged response. - */ - top?: number; - /** - * The table name to query resources from. - */ - table?: string; - /** - * The flag if set to true will fetch property changes - */ - fetchPropertyChanges?: boolean; - /** - * The flag if set to true will fetch change snapshots - */ - fetchSnapshots?: boolean; -} - -/** - * Data on a specific resource snapshot. - */ -export interface ResourceSnapshotData { - /** - * The ID of the snapshot. - */ - snapshotId?: string; - /** - * The time when the snapshot was created. - * The snapshot timestamp provides an approximation as to when a modification to a resource was - * detected. There can be a difference between the actual modification time and the detection - * time. This is due to differences in how operations that modify a resource are processed, - * versus how operation that record resource snapshots are processed. - */ - timestamp: Date; - /** - * The resource snapshot content (in resourceChangeDetails response only). - */ - content?: any; -} - -/** - * The snapshot before the change. - */ -export interface ResourceChangeDataBeforeSnapshot extends ResourceSnapshotData {} - -/** - * The snapshot after the change. - */ -export interface ResourceChangeDataAfterSnapshot extends ResourceSnapshotData {} - -/** - * The resource property change - */ -export interface ResourcePropertyChange { - /** - * The property name - */ - propertyName: string; - /** - * The property value in before snapshot - */ - beforeValue?: string; - /** - * The property value in after snapshot - */ - afterValue?: string; - /** - * The change category. Possible values include: 'User', 'System' - */ - changeCategory: ChangeCategory; - /** - * The property change Type. Possible values include: 'Insert', 'Update', 'Remove' - */ - propertyChangeType: PropertyChangeType; -} - -/** - * Data on a specific change, represented by a pair of before and after resource snapshots. - */ -export interface ResourceChangeData { - /** - * The resource for a change. - */ - resourceId?: string; - /** - * The change ID. Valid and unique within the specified resource only. - */ - changeId: string; - /** - * The snapshot before the change. - */ - beforeSnapshot: ResourceChangeDataBeforeSnapshot; - /** - * The snapshot after the change. - */ - afterSnapshot: ResourceChangeDataAfterSnapshot; - /** - * The change type for snapshot. PropertyChanges will be provided in case of Update change type. - * Possible values include: 'Create', 'Update', 'Delete' - */ - changeType?: ChangeType; - /** - * An array of resource property change - */ - propertyChanges?: ResourcePropertyChange[]; -} - -/** - * A list of changes associated with a resource over a specific time interval. - */ -export interface ResourceChangeList { - /** - * The pageable value returned by the operation, i.e. a list of changes to the resource. - * - * - The list is ordered from the most recent changes to the least recent changes. - * - This list will be empty if there were no changes during the requested interval. - * - The `Before` snapshot timestamp value of the oldest change can be outside of the specified - * time interval. - */ - changes?: ResourceChangeData[]; - /** - * Skip token that encodes the skip information while executing the current request - */ - skipToken?: any; -} - -/** - * The parameters for a specific change details request. - */ -export interface ResourceChangeDetailsRequestParameters { - /** - * Specifies the list of resources for a change details request. - */ - resourceIds: string[]; - /** - * Specifies the list of change IDs for a change details request. - */ - changeIds: string[]; -} - -/** - * An interface representing ErrorDetails. - * @summary Error details. - */ -export interface ErrorDetails { - /** - * Error code identifying the specific error. - */ - code: string; - /** - * A human readable error message. - */ - message: string; - /** - * Describes unknown properties. The value of an unknown property can be of "any" type. - */ - [property: string]: any; -} - -/** - * Error details. - * @summary Error info. - */ -export interface ErrorModel { - /** - * Error code identifying the specific error. - */ - code: string; - /** - * A human readable error message. - */ - message: string; - /** - * Error details - */ - details?: ErrorDetails[]; -} +export type FacetUnion = Facet | FacetResult | FacetError; -/** - * An error response from the API. - * @summary Error response. - */ -export interface ErrorResponse { - /** - * Error information. - */ - error: ErrorModel; +/** Describes a query to be executed. */ +export interface QueryRequest { + /** Azure subscriptions against which to execute the query. */ + subscriptions?: string[]; + /** Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ] */ + managementGroups?: string[]; + /** The resources query. */ + query: string; + /** The query evaluation options */ + options?: QueryRequestOptions; + /** An array of facet requests to be computed against the query result. */ + facets?: FacetRequest[]; } -/** - * The options for query evaluation - */ +/** The options for query evaluation */ export interface QueryRequestOptions { - /** - * Continuation token for pagination, capturing the next page size and offset, as well as the - * context of the query. - */ + /** Continuation token for pagination, capturing the next page size and offset, as well as the context of the query. */ skipToken?: string; - /** - * The maximum number of rows that the query should return. Overrides the page size when - * ```$skipToken``` property is present. - */ + /** The maximum number of rows that the query should return. Overrides the page size when ```$skipToken``` property is present. */ top?: number; - /** - * The number of rows to skip from the beginning of the results. Overrides the next page offset - * when ```$skipToken``` property is present. - */ + /** The number of rows to skip from the beginning of the results. Overrides the next page offset when ```$skipToken``` property is present. */ skip?: number; - /** - * Defines in which format query result returned. Possible values include: 'table', - * 'objectArray'. Default value: 'objectArray'. - */ + /** Defines in which format query result returned. */ resultFormat?: ResultFormat; - /** - * Only applicable for tenant and management group level queries to decide whether to allow - * partial scopes for result in case the number of subscriptions exceed allowed limits. Default - * value: false. - */ + /** Only applicable for tenant and management group level queries to decide whether to allow partial scopes for result in case the number of subscriptions exceed allowed limits. */ allowPartialScopes?: boolean; + /** Defines what level of authorization resources should be returned based on the which subscriptions and management groups are passed as scopes. */ + authorizationScopeFilter?: AuthorizationScopeFilter; } -/** - * The options for facet evaluation - */ -export interface FacetRequestOptions { - /** - * The column name or query expression to sort on. Defaults to count if not present. - */ - sortBy?: string; - /** - * The sorting order by the selected column (count by default). Possible values include: 'asc', - * 'desc'. Default value: 'desc'. - */ - sortOrder?: FacetSortOrder; - /** - * Specifies the filter condition for the 'where' clause which will be run on main query's - * result, just before the actual faceting. - */ - filter?: string; - /** - * The maximum number of facet rows that should be returned. - */ - top?: number; -} - -/** - * A request to compute additional statistics (facets) over the query results. - */ +/** A request to compute additional statistics (facets) over the query results. */ export interface FacetRequest { - /** - * The column or list of columns to summarize by - */ + /** The column or list of columns to summarize by */ expression: string; - /** - * The options for facet evaluation - */ + /** The options for facet evaluation */ options?: FacetRequestOptions; } -/** - * Describes a query to be executed. - */ -export interface QueryRequest { - /** - * Azure subscriptions against which to execute the query. - */ - subscriptions?: string[]; - /** - * Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ] - */ - managementGroups?: string[]; - /** - * The resources query. - */ - query: string; - /** - * The query evaluation options - */ - options?: QueryRequestOptions; - /** - * An array of facet requests to be computed against the query result. - */ - facets?: FacetRequest[]; -} - -/** - * Contains the possible cases for Facet. - */ -export type FacetUnion = Facet | FacetResult | FacetError; - -/** - * A facet containing additional statistics on the response of a query. Can be either FacetResult - * or FacetError. - */ -export interface Facet { - /** - * Polymorphic Discriminator - */ - resultType: "Facet"; - /** - * Facet expression, same as in the corresponding facet request. - */ - expression: string; +/** The options for facet evaluation */ +export interface FacetRequestOptions { + /** The column name or query expression to sort on. Defaults to count if not present. */ + sortBy?: string; + /** The sorting order by the selected column (count by default). */ + sortOrder?: FacetSortOrder; + /** Specifies the filter condition for the 'where' clause which will be run on main query's result, just before the actual faceting. */ + filter?: string; + /** The maximum number of facet rows that should be returned. */ + top?: number; } -/** - * Query result. - */ +/** Query result. */ export interface QueryResponse { - /** - * Number of total records matching the query. - */ + /** Number of total records matching the query. */ totalRecords: number; - /** - * Number of records returned in the current response. In the case of paging, this is the number - * of records in the current page. - */ + /** Number of records returned in the current response. In the case of paging, this is the number of records in the current page. */ count: number; - /** - * Indicates whether the query results are truncated. Possible values include: 'true', 'false' - */ + /** Indicates whether the query results are truncated. */ resultTruncated: ResultTruncated; - /** - * When present, the value can be passed to a subsequent query call (together with the same query - * and scopes used in the current request) to retrieve the next page of data. - */ + /** When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. */ skipToken?: string; - /** - * Query output in JObject array or Table format. - */ - data: any; - /** - * Query facets. - */ + /** Query output in JObject array or Table format. */ + data: Record; + /** Query facets. */ facets?: FacetUnion[]; } -/** - * Query result column descriptor. - */ -export interface Column { - /** - * Column name. - */ - name: string; - /** - * Column data type. Possible values include: 'string', 'integer', 'number', 'boolean', 'object' - */ - type: ColumnDataType; +/** A facet containing additional statistics on the response of a query. Can be either FacetResult or FacetError. */ +export interface Facet { + /** Polymorphic discriminator, which specifies the different types this object can be */ + resultType: "FacetResult" | "FacetError"; + /** Facet expression, same as in the corresponding facet request. */ + expression: string; } -/** - * Query output in tabular format. - */ -export interface Table { - /** - * Query result column descriptors. - */ - columns: Column[]; - /** - * Query result rows. - */ - rows: any[][]; +/** An error response from the API. */ +export interface ErrorResponse { + /** Error information. */ + error: ErrorModel; } -/** - * Successfully executed facet containing additional statistics on the response of a query. - */ -export interface FacetResult { - /** - * Polymorphic Discriminator - */ - resultType: "FacetResult"; - /** - * Facet expression, same as in the corresponding facet request. - */ - expression: string; - /** - * Number of total records in the facet results. - */ - totalRecords: number; - /** - * Number of records returned in the facet response. - */ - count: number; - /** - * A JObject array or Table containing the desired facets. Only present if the facet is valid. - */ - data: any; +/** Error details. */ +export interface ErrorModel { + /** Error code identifying the specific error. */ + code: string; + /** A human readable error message. */ + message: string; + /** Error details */ + details?: ErrorDetails[]; } -/** - * A facet whose execution resulted in an error. - */ -export interface FacetError { - /** - * Polymorphic Discriminator - */ - resultType: "FacetError"; - /** - * Facet expression, same as in the corresponding facet request. - */ - expression: string; - /** - * An array containing detected facet errors with details. - */ - errors: ErrorDetails[]; +/** Error details. */ +export interface ErrorDetails { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** Error code identifying the specific error. */ + code: string; + /** A human readable error message. */ + message: string; } -/** - * Display metadata associated with the operation. - */ -export interface OperationDisplay { - /** - * Service provider: Microsoft Resource Graph. - */ - provider?: string; - /** - * Resource on which the operation is performed etc. - */ - resource?: string; - /** - * Type of operation: get, read, delete, etc. - */ - operation?: string; - /** - * Description for the operation. - */ - description?: string; +/** Result of the request to list Resource Graph operations. It contains a list of operations and a URL link to get the next set of results. */ +export interface OperationListResult { + /** List of Resource Graph operations supported by the Resource Graph resource provider. */ + value?: Operation[]; } -/** - * Resource Graph REST API operation definition. - */ +/** Resource Graph REST API operation definition. */ export interface Operation { - /** - * Operation name: {provider}/{resource}/{operation} - */ + /** Operation name: {provider}/{resource}/{operation} */ name?: string; - /** - * Display metadata associated with the operation. - */ + /** Display metadata associated with the operation. */ display?: OperationDisplay; - /** - * The origin of operations. - */ + /** The origin of operations. */ origin?: string; } -/** - * An interface representing ResourcesHistoryRequestOptions. - */ -export interface ResourcesHistoryRequestOptions { - interval?: DateTimeInterval; - top?: number; - skip?: number; - skipToken?: string; - /** - * Possible values include: 'table', 'objectArray' - */ - resultFormat?: ResultFormat1; +/** Display metadata associated with the operation. */ +export interface OperationDisplay { + /** Service provider: Microsoft Resource Graph. */ + provider?: string; + /** Resource on which the operation is performed etc. */ + resource?: string; + /** Type of operation: get, read, delete, etc. */ + operation?: string; + /** Description for the operation. */ + description?: string; } -/** - * An interface representing ResourcesHistoryRequest. - */ +/** Describes a history request to be executed. */ export interface ResourcesHistoryRequest { + /** Azure subscriptions against which to execute the query. */ subscriptions?: string[]; + /** The resources query. */ query?: string; + /** The history request evaluation options */ options?: ResourcesHistoryRequestOptions; - managementGroupId?: string; + /** Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ] */ + managementGroups?: string[]; } -/** - * An interface representing ResourceGraphClientOptions. - */ -export interface ResourceGraphClientOptions extends AzureServiceClientOptions { - baseUri?: string; +/** The options for history request evaluation */ +export interface ResourcesHistoryRequestOptions { + /** The time interval used to fetch history. */ + interval?: DateTimeInterval; + /** The maximum number of rows that the query should return. Overrides the page size when ```$skipToken``` property is present. */ + top?: number; + /** The number of rows to skip from the beginning of the results. Overrides the next page offset when ```$skipToken``` property is present. */ + skip?: number; + /** Continuation token for pagination, capturing the next page size and offset, as well as the context of the query. */ + skipToken?: string; + /** Defines in which format query result returned. */ + resultFormat?: ResultFormat; } -/** - * @interface - * Result of the request to list Resource Graph operations. It contains a list of operations and a - * URL link to get the next set of results. - * @extends Array - */ -export interface OperationListResult extends Array {} +/** An interval in time specifying the date and time for the inclusive start and exclusive end, i.e. `[start, end)`. */ +export interface DateTimeInterval { + /** A datetime indicating the inclusive/closed start of the time interval, i.e. `[`**`start`**`, end)`. Specifying a `start` that occurs chronologically after `end` will result in an error. */ + start: Date; + /** A datetime indicating the exclusive/open end of the time interval, i.e. `[start, `**`end`**`)`. Specifying an `end` that occurs chronologically before `start` will result in an error. */ + end: Date; +} -/** - * Defines values for ChangeType. - * Possible values include: 'Create', 'Update', 'Delete' - * @readonly - * @enum {string} - */ -export type ChangeType = "Create" | "Update" | "Delete"; +/** Query output in tabular format. */ +export interface Table { + /** Query result column descriptors. */ + columns: Column[]; + /** Query result rows. */ + rows: Record[][]; +} -/** - * Defines values for ChangeCategory. - * Possible values include: 'User', 'System' - * @readonly - * @enum {string} - */ -export type ChangeCategory = "User" | "System"; +/** Query result column descriptor. */ +export interface Column { + /** Column name. */ + name: string; + /** Column data type. */ + type: ColumnDataType; +} -/** - * Defines values for PropertyChangeType. - * Possible values include: 'Insert', 'Update', 'Remove' - * @readonly - * @enum {string} - */ -export type PropertyChangeType = "Insert" | "Update" | "Remove"; +/** Successfully executed facet containing additional statistics on the response of a query. */ +export type FacetResult = Facet & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + resultType: "FacetResult"; + /** Number of total records in the facet results. */ + totalRecords: number; + /** Number of records returned in the facet response. */ + count: number; + /** A JObject array or Table containing the desired facets. Only present if the facet is valid. */ + data: Record; +}; -/** - * Defines values for ResultFormat. - * Possible values include: 'table', 'objectArray' - * @readonly - * @enum {string} - */ +/** A facet whose execution resulted in an error. */ +export type FacetError = Facet & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + resultType: "FacetError"; + /** An array containing detected facet errors with details. */ + errors: ErrorDetails[]; +}; +/** Defines values for ResultFormat. */ export type ResultFormat = "table" | "objectArray"; - -/** - * Defines values for FacetSortOrder. - * Possible values include: 'asc', 'desc' - * @readonly - * @enum {string} - */ +/** Defines values for AuthorizationScopeFilter. */ +export type AuthorizationScopeFilter = + | "AtScopeAndBelow" + | "AtScopeAndAbove" + | "AtScopeExact" + | "AtScopeAboveAndBelow"; +/** Defines values for FacetSortOrder. */ export type FacetSortOrder = "asc" | "desc"; - -/** - * Defines values for ResultTruncated. - * Possible values include: 'true', 'false' - * @readonly - * @enum {string} - */ +/** Defines values for ResultTruncated. */ export type ResultTruncated = "true" | "false"; - -/** - * Defines values for ColumnDataType. - * Possible values include: 'string', 'integer', 'number', 'boolean', 'object' - * @readonly - * @enum {string} - */ -export type ColumnDataType = "string" | "integer" | "number" | "boolean" | "object"; - -/** - * Defines values for ResultFormat1. - * Possible values include: 'table', 'objectArray' - * @readonly - * @enum {string} - */ -export type ResultFormat1 = "table" | "objectArray"; - -/** - * Contains response data for the resourceChanges operation. - */ -export type ResourceChangesResponse = ResourceChangeList & { - /** - * 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: ResourceChangeList; - }; -}; - -/** - * Contains response data for the resourceChangeDetails operation. - */ -export type ResourceChangeDetailsResponse = Array & { - /** - * 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: ResourceChangeData[]; - }; -}; - -/** - * Contains response data for the resources operation. - */ -export type ResourcesResponse = QueryResponse & { - /** - * 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: QueryResponse; - }; -}; - -/** - * Contains response data for the resourcesHistory operation. - */ -export type ResourcesHistoryResponse = { - /** - * The parsed response body. - */ - body: any; - - /** - * 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: any; - }; -}; - -/** - * 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; - }; -}; +/** Defines values for ColumnDataType. */ +export type ColumnDataType = + | "string" + | "integer" + | "number" + | "boolean" + | "object" + | "datetime"; + +/** Optional parameters. */ +export interface ResourcesOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the resources operation. */ +export type ResourcesResponse = QueryResponse; + +/** Optional parameters. */ +export interface ResourcesHistoryOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the resourcesHistory operation. */ +export type ResourcesHistoryResponse = Record; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface ResourceGraphClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/resourcegraph/arm-resourcegraph/src/models/mappers.ts b/sdk/resourcegraph/arm-resourcegraph/src/models/mappers.ts index 55be1b49bb96..1d45b2a7e03a 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/models/mappers.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/models/mappers.ts @@ -6,55 +6,26 @@ * 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 DateTimeInterval: msRest.CompositeMapper = { - serializedName: "DateTimeInterval", +export const QueryRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DateTimeInterval", + className: "QueryRequest", modelProperties: { - start: { - required: true, - serializedName: "start", + subscriptions: { + serializedName: "subscriptions", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - end: { - required: true, - serializedName: "end", - type: { - name: "DateTime" - } - } - } - } -}; - -export const ResourceChangesRequestParametersInterval: msRest.CompositeMapper = { - serializedName: "ResourceChangesRequestParameters_interval", - type: { - name: "Composite", - className: "ResourceChangesRequestParametersInterval", - modelProperties: { - ...DateTimeInterval.type.modelProperties - } - } -}; - -export const ResourceChangesRequestParameters: msRest.CompositeMapper = { - serializedName: "ResourceChangesRequestParameters", - type: { - name: "Composite", - className: "ResourceChangesRequestParameters", - modelProperties: { - resourceIds: { - serializedName: "resourceIds", + managementGroups: { + serializedName: "managementGroups", type: { name: "Sequence", element: { @@ -64,20 +35,41 @@ export const ResourceChangesRequestParameters: msRest.CompositeMapper = { } } }, - subscriptionId: { - serializedName: "subscriptionId", + query: { + serializedName: "query", + required: true, type: { name: "String" } }, - interval: { - required: true, - serializedName: "interval", + options: { + serializedName: "options", type: { name: "Composite", - className: "ResourceChangesRequestParametersInterval" + className: "QueryRequestOptions" } }, + facets: { + serializedName: "facets", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FacetRequest" + } + } + } + } + } + } +}; + +export const QueryRequestOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QueryRequestOptions", + modelProperties: { skipToken: { serializedName: "$skipToken", type: { @@ -85,183 +77,166 @@ export const ResourceChangesRequestParameters: msRest.CompositeMapper = { } }, top: { - serializedName: "$top", constraints: { InclusiveMaximum: 1000, InclusiveMinimum: 1 }, + serializedName: "$top", type: { name: "Number" } }, - table: { - serializedName: "table", + skip: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "$skip", type: { - name: "String" + name: "Number" } }, - fetchPropertyChanges: { - serializedName: "fetchPropertyChanges", + resultFormat: { + serializedName: "resultFormat", type: { - name: "Boolean" + name: "Enum", + allowedValues: ["table", "objectArray"] } }, - fetchSnapshots: { - serializedName: "fetchSnapshots", + allowPartialScopes: { + defaultValue: false, + serializedName: "allowPartialScopes", type: { name: "Boolean" } + }, + authorizationScopeFilter: { + defaultValue: "AtScopeAndBelow", + serializedName: "authorizationScopeFilter", + type: { + name: "Enum", + allowedValues: [ + "AtScopeAndBelow", + "AtScopeAndAbove", + "AtScopeExact", + "AtScopeAboveAndBelow" + ] + } } } } }; -export const ResourceSnapshotData: msRest.CompositeMapper = { - serializedName: "ResourceSnapshotData", +export const FacetRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceSnapshotData", + className: "FacetRequest", modelProperties: { - snapshotId: { - serializedName: "snapshotId", - type: { - name: "String" - } - }, - timestamp: { + expression: { + serializedName: "expression", required: true, - serializedName: "timestamp", type: { - name: "DateTime" + name: "String" } }, - content: { - serializedName: "content", + options: { + serializedName: "options", type: { - name: "Object" + name: "Composite", + className: "FacetRequestOptions" } } } } }; -export const ResourceChangeDataBeforeSnapshot: msRest.CompositeMapper = { - serializedName: "ResourceChangeData_beforeSnapshot", - type: { - name: "Composite", - className: "ResourceChangeDataBeforeSnapshot", - modelProperties: { - ...ResourceSnapshotData.type.modelProperties - } - } -}; - -export const ResourceChangeDataAfterSnapshot: msRest.CompositeMapper = { - serializedName: "ResourceChangeData_afterSnapshot", - type: { - name: "Composite", - className: "ResourceChangeDataAfterSnapshot", - modelProperties: { - ...ResourceSnapshotData.type.modelProperties - } - } -}; - -export const ResourcePropertyChange: msRest.CompositeMapper = { - serializedName: "ResourcePropertyChange", +export const FacetRequestOptions: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourcePropertyChange", + className: "FacetRequestOptions", modelProperties: { - propertyName: { - required: true, - serializedName: "propertyName", + sortBy: { + serializedName: "sortBy", type: { name: "String" } }, - beforeValue: { - serializedName: "beforeValue", + sortOrder: { + defaultValue: "desc", + serializedName: "sortOrder", type: { - name: "String" + name: "Enum", + allowedValues: ["asc", "desc"] } }, - afterValue: { - serializedName: "afterValue", + filter: { + serializedName: "filter", type: { name: "String" } }, - changeCategory: { - required: true, - serializedName: "changeCategory", - type: { - name: "Enum", - allowedValues: ["User", "System"] - } - }, - propertyChangeType: { - required: true, - serializedName: "propertyChangeType", + top: { + constraints: { + InclusiveMaximum: 1000, + InclusiveMinimum: 1 + }, + serializedName: "$top", type: { - name: "Enum", - allowedValues: ["Insert", "Update", "Remove"] + name: "Number" } } } } }; -export const ResourceChangeData: msRest.CompositeMapper = { - serializedName: "ResourceChangeData", +export const QueryResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceChangeData", + className: "QueryResponse", modelProperties: { - resourceId: { - serializedName: "resourceId", + totalRecords: { + serializedName: "totalRecords", + required: true, type: { - name: "String" + name: "Number" } }, - changeId: { + count: { + serializedName: "count", required: true, - serializedName: "changeId", type: { - name: "String" + name: "Number" } }, - beforeSnapshot: { + resultTruncated: { + serializedName: "resultTruncated", required: true, - serializedName: "beforeSnapshot", type: { - name: "Composite", - className: "ResourceChangeDataBeforeSnapshot" + name: "Enum", + allowedValues: ["true", "false"] } }, - afterSnapshot: { - required: true, - serializedName: "afterSnapshot", + skipToken: { + serializedName: "$skipToken", type: { - name: "Composite", - className: "ResourceChangeDataAfterSnapshot" + name: "String" } }, - changeType: { - serializedName: "changeType", + data: { + serializedName: "data", + required: true, type: { - name: "Enum", - allowedValues: ["Create", "Update", "Delete"] + name: "Dictionary", + value: { type: { name: "any" } } } }, - propertyChanges: { - serializedName: "propertyChanges", + facets: { + serializedName: "facets", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ResourcePropertyChange" + className: "Facet" } } } @@ -270,130 +245,122 @@ export const ResourceChangeData: msRest.CompositeMapper = { } }; -export const ResourceChangeList: msRest.CompositeMapper = { - serializedName: "ResourceChangeList", +export const Facet: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceChangeList", + className: "Facet", + uberParent: "Facet", + polymorphicDiscriminator: { + serializedName: "resultType", + clientName: "resultType" + }, modelProperties: { - changes: { - serializedName: "changes", + expression: { + serializedName: "expression", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceChangeData" - } - } + name: "String" } }, - skipToken: { - serializedName: "$skipToken", + resultType: { + serializedName: "resultType", + required: true, type: { - name: "Object" + name: "String" } } } } }; -export const ResourceChangeDetailsRequestParameters: msRest.CompositeMapper = { - serializedName: "ResourceChangeDetailsRequestParameters", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceChangeDetailsRequestParameters", + className: "ErrorResponse", modelProperties: { - resourceIds: { - required: true, - serializedName: "resourceIds", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - changeIds: { - required: true, - serializedName: "changeIds", + error: { + serializedName: "error", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Composite", + className: "ErrorModel" } } } } }; -export const ErrorDetails: msRest.CompositeMapper = { - serializedName: "ErrorDetails", +export const ErrorModel: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetails", + className: "ErrorModel", modelProperties: { code: { - required: true, serializedName: "code", + required: true, type: { name: "String" } }, message: { - required: true, serializedName: "message", + required: true, type: { name: "String" } - } - }, - additionalProperties: { - type: { - name: "Object" + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetails" + } + } + } } } } }; -export const ErrorModel: msRest.CompositeMapper = { - serializedName: "Error", +export const ErrorDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorModel", + className: "ErrorDetails", + additionalProperties: { type: { name: "Object" } }, modelProperties: { code: { - required: true, serializedName: "code", + required: true, type: { name: "String" } }, message: { - required: true, serializedName: "message", + required: true, type: { name: "String" } - }, - details: { - serializedName: "details", + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ErrorDetails", - additionalProperties: { - type: { - name: "Object" - } - } + className: "Operation" } } } @@ -402,143 +369,71 @@ export const ErrorModel: msRest.CompositeMapper = { } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - required: true, - serializedName: "error", - type: { - name: "Composite", - className: "ErrorModel" - } - } - } - } -}; - -export const QueryRequestOptions: msRest.CompositeMapper = { - serializedName: "QueryRequestOptions", - type: { - name: "Composite", - className: "QueryRequestOptions", + className: "Operation", modelProperties: { - skipToken: { - serializedName: "$skipToken", + name: { + serializedName: "name", type: { name: "String" } }, - top: { - serializedName: "$top", - constraints: { - InclusiveMaximum: 1000, - InclusiveMinimum: 1 - }, - type: { - name: "Number" - } - }, - skip: { - serializedName: "$skip", - constraints: { - InclusiveMinimum: 0 - }, - type: { - name: "Number" - } - }, - resultFormat: { - serializedName: "resultFormat", - defaultValue: "objectArray", + display: { + serializedName: "display", type: { - name: "Enum", - allowedValues: ["table", "objectArray"] + name: "Composite", + className: "OperationDisplay" } }, - allowPartialScopes: { - serializedName: "allowPartialScopes", - defaultValue: false, + origin: { + serializedName: "origin", type: { - name: "Boolean" + name: "String" } } } } }; -export const FacetRequestOptions: msRest.CompositeMapper = { - serializedName: "FacetRequestOptions", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "FacetRequestOptions", + className: "OperationDisplay", modelProperties: { - sortBy: { - serializedName: "sortBy", + provider: { + serializedName: "provider", type: { name: "String" } }, - sortOrder: { - serializedName: "sortOrder", - defaultValue: "desc", - type: { - name: "Enum", - allowedValues: ["asc", "desc"] - } - }, - filter: { - serializedName: "filter", + resource: { + serializedName: "resource", type: { name: "String" } }, - top: { - serializedName: "$top", - constraints: { - InclusiveMaximum: 1000, - InclusiveMinimum: 1 - }, - type: { - name: "Number" - } - } - } - } -}; - -export const FacetRequest: msRest.CompositeMapper = { - serializedName: "FacetRequest", - type: { - name: "Composite", - className: "FacetRequest", - modelProperties: { - expression: { - required: true, - serializedName: "expression", + operation: { + serializedName: "operation", type: { name: "String" } }, - options: { - serializedName: "options", + description: { + serializedName: "description", type: { - name: "Composite", - className: "FacetRequestOptions" + name: "String" } } } } }; -export const QueryRequest: msRest.CompositeMapper = { - serializedName: "QueryRequest", +export const ResourcesHistoryRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "QueryRequest", + className: "ResourcesHistoryRequest", modelProperties: { subscriptions: { serializedName: "subscriptions", @@ -551,19 +446,7 @@ export const QueryRequest: msRest.CompositeMapper = { } } }, - managementGroups: { - serializedName: "managementGroups", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, query: { - required: true, serializedName: "query", type: { name: "String" @@ -573,17 +456,16 @@ export const QueryRequest: msRest.CompositeMapper = { serializedName: "options", type: { name: "Composite", - className: "QueryRequestOptions" + className: "ResourcesHistoryRequestOptions" } }, - facets: { - serializedName: "facets", + managementGroups: { + serializedName: "managementGroups", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "FacetRequest" + name: "String" } } } @@ -592,126 +474,85 @@ export const QueryRequest: msRest.CompositeMapper = { } }; -export const Facet: msRest.CompositeMapper = { - serializedName: "Facet", +export const ResourcesHistoryRequestOptions: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: { - serializedName: "resultType", - clientName: "resultType" - }, - uberParent: "Facet", - className: "Facet", + className: "ResourcesHistoryRequestOptions", modelProperties: { - expression: { - required: true, - serializedName: "expression", + interval: { + serializedName: "interval", type: { - name: "String" + name: "Composite", + className: "DateTimeInterval" } }, - resultType: { - required: true, - serializedName: "resultType", - type: { - name: "String" - } - } - } - } -}; - -export const QueryResponse: msRest.CompositeMapper = { - serializedName: "QueryResponse", - type: { - name: "Composite", - className: "QueryResponse", - modelProperties: { - totalRecords: { - required: true, - serializedName: "totalRecords", + top: { + constraints: { + InclusiveMaximum: 1000, + InclusiveMinimum: 1 + }, + serializedName: "$top", type: { name: "Number" } }, - count: { - required: true, - serializedName: "count", + skip: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "$skip", type: { name: "Number" } }, - resultTruncated: { - required: true, - serializedName: "resultTruncated", - type: { - name: "Enum", - allowedValues: ["true", "false"] - } - }, skipToken: { serializedName: "$skipToken", type: { name: "String" } }, - data: { - required: true, - serializedName: "data", - type: { - name: "Object" - } - }, - facets: { - serializedName: "facets", + resultFormat: { + serializedName: "resultFormat", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Facet" - } - } + name: "Enum", + allowedValues: ["table", "objectArray"] } } } } }; -export const Column: msRest.CompositeMapper = { - serializedName: "Column", +export const DateTimeInterval: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Column", + className: "DateTimeInterval", modelProperties: { - name: { + start: { + serializedName: "start", required: true, - serializedName: "name", type: { - name: "String" + name: "DateTime" } }, - type: { + end: { + serializedName: "end", required: true, - serializedName: "type", type: { - name: "Enum", - allowedValues: ["string", "integer", "number", "boolean", "object"] + name: "DateTime" } } } } }; -export const Table: msRest.CompositeMapper = { - serializedName: "Table", +export const Table: coreClient.CompositeMapper = { type: { name: "Composite", className: "Table", modelProperties: { columns: { - required: true, serializedName: "columns", + required: true, type: { name: "Sequence", element: { @@ -723,8 +564,8 @@ export const Table: msRest.CompositeMapper = { } }, rows: { - required: true, serializedName: "rows", + required: true, type: { name: "Sequence", element: { @@ -732,7 +573,8 @@ export const Table: msRest.CompositeMapper = { name: "Sequence", element: { type: { - name: "Object" + name: "Dictionary", + value: { type: { name: "any" } } } } } @@ -743,229 +585,90 @@ export const Table: msRest.CompositeMapper = { } }; -export const FacetResult: msRest.CompositeMapper = { - serializedName: "FacetResult", +export const Column: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: Facet.type.polymorphicDiscriminator, - uberParent: "Facet", - className: "FacetResult", + className: "Column", modelProperties: { - ...Facet.type.modelProperties, - totalRecords: { - required: true, - serializedName: "totalRecords", - type: { - name: "Number" - } - }, - count: { + name: { + serializedName: "name", required: true, - serializedName: "count", type: { - name: "Number" + name: "String" } }, - data: { + type: { + serializedName: "type", required: true, - serializedName: "data", type: { - name: "Object" + name: "Enum", + allowedValues: [ + "string", + "integer", + "number", + "boolean", + "object", + "datetime" + ] } } } } }; -export const FacetError: msRest.CompositeMapper = { - serializedName: "FacetError", +export const FacetResult: coreClient.CompositeMapper = { + serializedName: "FacetResult", type: { name: "Composite", - polymorphicDiscriminator: Facet.type.polymorphicDiscriminator, + className: "FacetResult", uberParent: "Facet", - className: "FacetError", + polymorphicDiscriminator: Facet.type.polymorphicDiscriminator, modelProperties: { ...Facet.type.modelProperties, - errors: { + totalRecords: { + serializedName: "totalRecords", required: true, - serializedName: "errors", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetails", - additionalProperties: { - type: { - name: "Object" - } - } - } - } - } - } - } - } -}; - -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; - -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay" - } - }, - origin: { - serializedName: "origin", - type: { - name: "String" - } - } - } - } -}; - -export const ResourcesHistoryRequestOptions: msRest.CompositeMapper = { - serializedName: "ResourcesHistoryRequestOptions", - type: { - name: "Composite", - className: "ResourcesHistoryRequestOptions", - modelProperties: { - interval: { - serializedName: "interval", - type: { - name: "Composite", - className: "DateTimeInterval" - } - }, - top: { - serializedName: "$top", type: { name: "Number" } }, - skip: { - serializedName: "$skip", + count: { + serializedName: "count", + required: true, type: { name: "Number" } }, - skipToken: { - serializedName: "$skipToken", - type: { - name: "String" - } - }, - resultFormat: { - serializedName: "resultFormat", - type: { - name: "String" - } - } - } - } -}; - -export const ResourcesHistoryRequest: msRest.CompositeMapper = { - serializedName: "ResourcesHistoryRequest", - type: { - name: "Composite", - className: "ResourcesHistoryRequest", - modelProperties: { - subscriptions: { - serializedName: "subscriptions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - query: { - serializedName: "query", - type: { - name: "String" - } - }, - options: { - serializedName: "options", + data: { + serializedName: "data", + required: true, type: { - name: "Composite", - className: "ResourcesHistoryRequestOptions" - } - }, - managementGroupId: { - serializedName: "managementGroupId", - type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } } } } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const FacetError: coreClient.CompositeMapper = { + serializedName: "FacetError", type: { name: "Composite", - className: "OperationListResult", + className: "FacetError", + uberParent: "Facet", + polymorphicDiscriminator: Facet.type.polymorphicDiscriminator, modelProperties: { - value: { - serializedName: "", + ...Facet.type.modelProperties, + errors: { + serializedName: "errors", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "Operation" + className: "ErrorDetails" } } } @@ -974,7 +677,7 @@ export const OperationListResult: msRest.CompositeMapper = { } }; -export const discriminators = { +export let discriminators = { Facet: Facet, "Facet.FacetResult": FacetResult, "Facet.FacetError": FacetError diff --git a/sdk/resourcegraph/arm-resourcegraph/src/models/parameters.ts b/sdk/resourcegraph/arm-resourcegraph/src/models/parameters.ts index 9d39f7b83eb0..1a4e73d15e5c 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/models/parameters.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/models/parameters.ts @@ -3,55 +3,73 @@ * 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 { + QueryRequest as QueryRequestMapper, + ResourcesHistoryRequest as ResourcesHistoryRequestMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "accept-language", - defaultValue: "en-US", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const apiVersion0: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const query: OperationParameter = { + parameterPath: "query", + mapper: QueryRequestMapper +}; + +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - required: true, + defaultValue: "application/json", isConstant: true, - serializedName: "api-version", - defaultValue: "2020-09-01-preview", + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion1: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: "2021-03-01", type: { name: "String" } - } + }, + skipEncoding: true }; -export const apiVersion2: msRest.OperationQueryParameter = { + +export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - required: true, + defaultValue: "2021-06-01-preview", isConstant: true, serializedName: "api-version", - defaultValue: "2020-04-01-preview", type: { name: "String" } } }; + +export const request: OperationParameter = { + parameterPath: "request", + mapper: ResourcesHistoryRequestMapper +}; diff --git a/sdk/resourcegraph/arm-resourcegraph/src/operations/index.ts b/sdk/resourcegraph/arm-resourcegraph/src/operations/index.ts index dfc0b9f0e394..afc67b73542c 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/operations/index.ts +++ b/sdk/resourcegraph/arm-resourcegraph/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/resourcegraph/arm-resourcegraph/src/operations/operations.ts b/sdk/resourcegraph/arm-resourcegraph/src/operations/operations.ts index 475f4ecf68ce..9ddac3e5cb6d 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/operations/operations.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/operations/operations.ts @@ -3,67 +3,86 @@ * 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 { ResourceGraphClientContext } from "../resourceGraphClientContext"; +import { ResourceGraphClient } from "../resourceGraphClient"; +import { + Operation, + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: ResourceGraphClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: ResourceGraphClient; /** - * Create a Operations. - * @param {ResourceGraphClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: ResourceGraphClientContext) { + constructor(client: ResourceGraphClient) { this.client = client; } /** * Lists all of the available REST API operations. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** - * @param options The optional parameters - * @param callback The callback + * Lists all of the available REST API operations. + * @param options The options parameters. */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback - ) as Promise; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceGraph/operations", httpMethod: "GET", - path: "providers/Microsoft.ResourceGraph/operations", - queryParameters: [Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -72,5 +91,8 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/resourcegraph/arm-resourcegraph/src/models/operationsMappers.ts b/sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/index.ts similarity index 59% rename from sdk/resourcegraph/arm-resourcegraph/src/models/operationsMappers.ts rename to sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/index.ts index 654f4183efac..afc67b73542c 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/models/operationsMappers.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/index.ts @@ -6,12 +6,4 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export { - discriminators, - ErrorDetails, - ErrorModel, - ErrorResponse, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; +export * from "./operations"; diff --git a/sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/operations.ts b/sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..78f149280aee --- /dev/null +++ b/sdk/resourcegraph/arm-resourcegraph/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. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClient.ts b/sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClient.ts index c10ca6faa968..32b0f5ea2ca2 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClient.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClient.ts @@ -3,278 +3,114 @@ * 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 coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { OperationsImpl } from "./operations"; +import { Operations } from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; -import * as operations from "./operations"; -import { ResourceGraphClientContext } from "./resourceGraphClientContext"; +import * as Mappers from "./models/mappers"; +import { + ResourceGraphClientOptionalParams, + QueryRequest, + ResourcesOptionalParams, + ResourcesResponse, + ResourcesHistoryRequest, + ResourcesHistoryOptionalParams, + ResourcesHistoryResponse +} from "./models"; -class ResourceGraphClient extends ResourceGraphClientContext { - // Operation groups - operations: operations.Operations; +export class ResourceGraphClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; /** * Initializes a new instance of the ResourceGraphClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param [options] The parameter options + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param options The parameter options */ constructor( - credentials: msRest.ServiceClientCredentials, - options?: Models.ResourceGraphClientOptions + credentials: coreAuth.TokenCredential, + options?: ResourceGraphClientOptionalParams ) { - super(credentials, options); - this.operations = new operations.Operations(this); - } + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } - /** - * List changes to a resource for a given time interval. - * @param parameters the parameters for this request for changes. - * @param [options] The optional parameters - * @returns Promise - */ - resourceChanges( - parameters: Models.ResourceChangesRequestParameters, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param parameters the parameters for this request for changes. - * @param callback The callback - */ - resourceChanges( - parameters: Models.ResourceChangesRequestParameters, - callback: msRest.ServiceCallback - ): void; - /** - * @param parameters the parameters for this request for changes. - * @param options The optional parameters - * @param callback The callback - */ - resourceChanges( - parameters: Models.ResourceChangesRequestParameters, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - resourceChanges( - parameters: Models.ResourceChangesRequestParameters, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.sendOperationRequest( - { - parameters, - options - }, - resourceChangesOperationSpec, - callback - ) as Promise; - } + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ResourceGraphClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; - /** - * Get resource change details. - * @param parameters The parameters for this request for resource change details. - * @param [options] The optional parameters - * @returns Promise - */ - resourceChangeDetails( - parameters: Models.ResourceChangeDetailsRequestParameters, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param parameters The parameters for this request for resource change details. - * @param callback The callback - */ - resourceChangeDetails( - parameters: Models.ResourceChangeDetailsRequestParameters, - callback: msRest.ServiceCallback - ): void; - /** - * @param parameters The parameters for this request for resource change details. - * @param options The optional parameters - * @param callback The callback - */ - resourceChangeDetails( - parameters: Models.ResourceChangeDetailsRequestParameters, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - resourceChangeDetails( - parameters: Models.ResourceChangeDetailsRequestParameters, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.sendOperationRequest( - { - parameters, - options + const packageDetails = `azsdk-js-arm-resourcegraph/5.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix }, - resourceChangeDetailsOperationSpec, - callback - ) as Promise; + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-06-01-preview"; + this.operations = new OperationsImpl(this); } /** * Queries the resources managed by Azure Resource Manager for scopes specified in the request. * @param query Request specifying query and its options. - * @param [options] The optional parameters - * @returns Promise - */ - resources( - query: Models.QueryRequest, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param query Request specifying query and its options. - * @param callback The callback + * @param options The options parameters. */ resources( - query: Models.QueryRequest, - callback: msRest.ServiceCallback - ): void; - /** - * @param query Request specifying query and its options. - * @param options The optional parameters - * @param callback The callback - */ - resources( - query: Models.QueryRequest, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - resources( - query: Models.QueryRequest, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + query: QueryRequest, + options?: ResourcesOptionalParams + ): Promise { return this.sendOperationRequest( - { - query, - options - }, - resourcesOperationSpec, - callback - ) as Promise; + { query, options }, + resourcesOperationSpec + ); } /** * List all snapshots of a resource for a given time interval. - * @param request - * @param [options] The optional parameters - * @returns Promise - */ - resourcesHistory( - request: Models.ResourcesHistoryRequest, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param request - * @param callback The callback - */ - resourcesHistory( - request: Models.ResourcesHistoryRequest, - callback: msRest.ServiceCallback - ): void; - /** - * @param request - * @param options The optional parameters - * @param callback The callback + * @param request Request specifying the query and its options. + * @param options The options parameters. */ resourcesHistory( - request: Models.ResourcesHistoryRequest, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - resourcesHistory( - request: Models.ResourcesHistoryRequest, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + request: ResourcesHistoryRequest, + options?: ResourcesHistoryOptionalParams + ): Promise { return this.sendOperationRequest( - { - request, - options - }, - resourcesHistoryOperationSpec, - callback - ) as Promise; + { request, options }, + resourcesHistoryOperationSpec + ); } -} + operations: Operations; +} // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const resourceChangesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.ResourceGraph/resourceChanges", - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ResourceChangesRequestParameters, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.ResourceChangeList - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const resourceChangeDetailsOperationSpec: msRest.OperationSpec = { +const resourcesOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceGraph/resources", httpMethod: "POST", - path: "providers/Microsoft.ResourceGraph/resourceChangeDetails", - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ResourceChangeDetailsRequestParameters, - required: true - } - }, - responses: { - 200: { - bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceChangeData" - } - } - } - } - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const resourcesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.ResourceGraph/resources", - queryParameters: [Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "query", - mapper: { - ...Mappers.QueryRequest, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.QueryResponse @@ -283,41 +119,30 @@ const resourcesOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.query, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", serializer }; - -const resourcesHistoryOperationSpec: msRest.OperationSpec = { +const resourcesHistoryOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceGraph/resourcesHistory", httpMethod: "POST", - path: "providers/Microsoft.ResourceGraph/resourcesHistory", - queryParameters: [Parameters.apiVersion2], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "request", - mapper: { - ...Mappers.ResourcesHistoryRequest, - required: true - } - }, responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Object" - } + type: { name: "Dictionary", value: { type: { name: "any" } } } } }, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.request, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", serializer }; - -export { - ResourceGraphClient, - ResourceGraphClientContext, - Models as ResourceGraphModels, - Mappers as ResourceGraphMappers -}; -export * from "./operations"; diff --git a/sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClientContext.ts b/sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClientContext.ts deleted file mode 100644 index 16131061fc42..000000000000 --- a/sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClientContext.ts +++ /dev/null @@ -1,59 +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-resourcegraph"; -const packageVersion = "4.1.0"; - -export class ResourceGraphClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - - /** - * Initializes a new instance of the ResourceGraphClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param [options] The parameter options - */ - constructor( - credentials: msRest.ServiceClientCredentials, - options?: Models.ResourceGraphClientOptions - ) { - if (credentials == undefined) { - throw new Error("'credentials' cannot be null."); - } - - if (!options) { - options = {}; - } - if (!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - 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; - - 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/resourcegraph/arm-resourcegraph/test/sampleTest.ts b/sdk/resourcegraph/arm-resourcegraph/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/resourcegraph/arm-resourcegraph/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/resourcegraph/arm-resourcegraph/tsconfig.json b/sdk/resourcegraph/arm-resourcegraph/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/resourcegraph/arm-resourcegraph/tsconfig.json +++ b/sdk/resourcegraph/arm-resourcegraph/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/resourcegraph/ci.yml b/sdk/resourcegraph/ci.yml new file mode 100644 index 000000000000..265d98d219af --- /dev/null +++ b/sdk/resourcegraph/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/resourcegraph/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/resourcegraph/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: resourcegraph + Artifacts: + - name: azure-arm-resourcegraph + safeName: azurearmresourcegraph + \ No newline at end of file