From 233079aa9edf10b53ca56ab14b74db0f6de35c35 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 09:43:25 +0000 Subject: [PATCH] CodeGen from PR 16902 in Azure/azure-rest-api-specs Track2 modify readme.go.md 4 (#16902) * Track2 modify readme.go.md 4 * devops --- common/config/rush/pnpm-lock.yaml | 131 +- rush.json | 5 + sdk/dns/arm-dns/CHANGELOG.md | 11 + sdk/dns/arm-dns/{LICENSE.txt => LICENSE} | 4 +- sdk/dns/arm-dns/README.md | 156 +-- sdk/dns/arm-dns/_meta.json | 7 + sdk/dns/arm-dns/api-extractor.json | 18 + sdk/dns/arm-dns/package.json | 95 +- sdk/dns/arm-dns/review/arm-dns.api.md | 393 ++++++ sdk/dns/arm-dns/rollup.config.js | 211 +++- sdk/dns/arm-dns/src/dnsManagementClient.ts | 119 +- .../arm-dns/src/dnsManagementClientContext.ts | 69 - sdk/dns/arm-dns/src/index.ts | 12 + sdk/dns/arm-dns/src/lroImpl.ts | 34 + .../dnsResourceReferenceOperationsMappers.ts | 15 - sdk/dns/arm-dns/src/models/index.ts | 1118 +++++------------ sdk/dns/arm-dns/src/models/mappers.ts | 698 +++++----- sdk/dns/arm-dns/src/models/parameters.ts | 189 ++- .../arm-dns/src/models/recordSetsMappers.ts | 27 - sdk/dns/arm-dns/src/models/zonesMappers.ts | 28 - .../dnsResourceReferenceOperations.ts | 93 +- sdk/dns/arm-dns/src/operations/index.ts | 8 +- sdk/dns/arm-dns/src/operations/recordSets.ts | 919 ++++++++------ sdk/dns/arm-dns/src/operations/zones.ts | 665 +++++----- .../dnsResourceReferenceOperations.ts | 26 + .../arm-dns/src/operationsInterfaces/index.ts | 11 + .../src/operationsInterfaces/recordSets.ts | 129 ++ .../arm-dns/src/operationsInterfaces/zones.ts | 103 ++ sdk/dns/arm-dns/test/sampleTest.ts | 48 + sdk/dns/arm-dns/tsconfig.json | 6 +- sdk/dns/ci.yml | 29 + 31 files changed, 3020 insertions(+), 2357 deletions(-) create mode 100644 sdk/dns/arm-dns/CHANGELOG.md rename sdk/dns/arm-dns/{LICENSE.txt => LICENSE} (96%) create mode 100644 sdk/dns/arm-dns/_meta.json create mode 100644 sdk/dns/arm-dns/api-extractor.json create mode 100644 sdk/dns/arm-dns/review/arm-dns.api.md delete mode 100644 sdk/dns/arm-dns/src/dnsManagementClientContext.ts create mode 100644 sdk/dns/arm-dns/src/index.ts create mode 100644 sdk/dns/arm-dns/src/lroImpl.ts delete mode 100644 sdk/dns/arm-dns/src/models/dnsResourceReferenceOperationsMappers.ts delete mode 100644 sdk/dns/arm-dns/src/models/recordSetsMappers.ts delete mode 100644 sdk/dns/arm-dns/src/models/zonesMappers.ts create mode 100644 sdk/dns/arm-dns/src/operationsInterfaces/dnsResourceReferenceOperations.ts create mode 100644 sdk/dns/arm-dns/src/operationsInterfaces/index.ts create mode 100644 sdk/dns/arm-dns/src/operationsInterfaces/recordSets.ts create mode 100644 sdk/dns/arm-dns/src/operationsInterfaces/zones.ts create mode 100644 sdk/dns/arm-dns/test/sampleTest.ts create mode 100644 sdk/dns/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..33de9faf1dea 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -34,6 +34,7 @@ specifiers: '@rush-temp/arm-datalake-analytics': file:./projects/arm-datalake-analytics.tgz '@rush-temp/arm-desktopvirtualization': file:./projects/arm-desktopvirtualization.tgz '@rush-temp/arm-devtestlabs': file:./projects/arm-devtestlabs.tgz + '@rush-temp/arm-dns': file:./projects/arm-dns.tgz '@rush-temp/arm-eventgrid': file:./projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:./projects/arm-eventhub.tgz '@rush-temp/arm-extendedlocation': file:./projects/arm-extendedlocation.tgz @@ -215,6 +216,7 @@ dependencies: '@rush-temp/arm-datalake-analytics': file:projects/arm-datalake-analytics.tgz '@rush-temp/arm-desktopvirtualization': file:projects/arm-desktopvirtualization.tgz '@rush-temp/arm-devtestlabs': file:projects/arm-devtestlabs.tgz + '@rush-temp/arm-dns': file:projects/arm-dns.tgz '@rush-temp/arm-eventgrid': file:projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:projects/arm-eventhub.tgz '@rush-temp/arm-extendedlocation': file:projects/arm-extendedlocation.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 @@ -8500,6 +8502,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-dns.tgz: + resolution: {integrity: sha512-iTkokjSSWrYz6+DTYquJPKfNupoCM6dz6LNvozORK9hyp68ZcQLPlF6c0+ug8zf5QU4X2SNYJSu6I+3RkRTyuQ==, tarball: file:projects/arm-dns.tgz} + name: '@rush-temp/arm-dns' + 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-eventgrid.tgz: resolution: {integrity: sha512-26uyTQ6UX9N1i+BWqT3Ga154/45qazjGOcYOuleDzv7+gERljkMNe6dHkAbeLpwr8k/Tt9mdHY/1dLHrcRIa+w==, tarball: file:projects/arm-eventgrid.tgz} name: '@rush-temp/arm-eventgrid' @@ -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..4374a497637f 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-dns", + "projectFolder": "sdk/dns/arm-dns", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/dns/arm-dns/CHANGELOG.md b/sdk/dns/arm-dns/CHANGELOG.md new file mode 100644 index 000000000000..71a115d37015 --- /dev/null +++ b/sdk/dns/arm-dns/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 5.0.0 (2022-01-05) + +The package of @azure/arm-dns is using our next generation design principles since version 5.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/dns/arm-dns/LICENSE.txt b/sdk/dns/arm-dns/LICENSE similarity index 96% rename from sdk/dns/arm-dns/LICENSE.txt rename to sdk/dns/arm-dns/LICENSE index ea8fb1516028..5d1d36e0af80 100644 --- a/sdk/dns/arm-dns/LICENSE.txt +++ b/sdk/dns/arm-dns/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/dns/arm-dns/README.md b/sdk/dns/arm-dns/README.md index 806e1ac8583a..ea8bc7174650 100644 --- a/sdk/dns/arm-dns/README.md +++ b/sdk/dns/arm-dns/README.md @@ -1,116 +1,98 @@ -## Azure DnsManagementClient SDK for JavaScript +# Azure DnsManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for DnsManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DnsManagement client. + +The DNS Management Client. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-dns) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dns) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-dns` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-dns` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure DnsManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-dns @azure/identity +npm install @azure/arm-dns ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `DnsManagementClient` -### How to use +To create a client object to access the Azure DnsManagement API, you will need the `endpoint` of your Azure DnsManagement resource and a `credential`. The Azure DnsManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure DnsManagement resource in the [Azure Portal][azure_portal]. -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and get recordSets as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure DnsManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Sample code +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { DnsManagementClient } = require("@azure/arm-dns"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new DnsManagementClient(creds, subscriptionId); -const resourceGroupName = "testresourceGroupName"; -const zoneName = "testzoneName"; -const relativeRecordSetName = "testrelativeRecordSetName"; -const recordType = "A"; -client.recordSets.get(resourceGroupName, zoneName, relativeRecordSetName, recordType).then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new DnsManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and get recordSets as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-dns sample - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### DnsManagementClient + +`DnsManagementClient` is the primary interface for developers using the Azure DnsManagement client library. Explore the methods on this client object to understand the different features of the Azure DnsManagement 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%2Fdns%2Farm-dns%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/dns/arm-dns/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/dns/arm-dns/_meta.json b/sdk/dns/arm-dns/_meta.json new file mode 100644 index 000000000000..687c7e1ce974 --- /dev/null +++ b/sdk/dns/arm-dns/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "cea6492a1e41b3f3b4f8b4f69bdcc10431e79c0e", + "readme": "specification/dns/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/dns/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/dns/arm-dns/api-extractor.json b/sdk/dns/arm-dns/api-extractor.json new file mode 100644 index 000000000000..c583a0195bd7 --- /dev/null +++ b/sdk/dns/arm-dns/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-dns.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/dns/arm-dns/package.json b/sdk/dns/arm-dns/package.json index 37bcfae3c4ae..3e16938ffeb2 100644 --- a/sdk/dns/arm-dns/package.json +++ b/sdk/dns/arm-dns/package.json @@ -1,58 +1,91 @@ { "name": "@azure/arm-dns", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "DnsManagementClient Library with typescript type definitions for node.js and browser.", - "version": "4.1.0", + "description": "A generated SDK for DnsManagementClient.", + "version": "5.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-dns.js", - "module": "./esm/dnsManagementClient.js", - "types": "./esm/dnsManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-dns.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns", "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-dns.js.map'\" -o ./dist/arm-dns.min.js ./dist/arm-dns.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/dns/arm-dns/review/arm-dns.api.md b/sdk/dns/arm-dns/review/arm-dns.api.md new file mode 100644 index 000000000000..762778f41f6c --- /dev/null +++ b/sdk/dns/arm-dns/review/arm-dns.api.md @@ -0,0 +1,393 @@ +## API Report File for "@azure/arm-dns" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export interface AaaaRecord { + ipv6Address?: string; +} + +// @public +export interface ARecord { + ipv4Address?: string; +} + +// @public +export interface CaaRecord { + flags?: number; + tag?: string; + value?: string; +} + +// @public +export interface CloudError { + error?: CloudErrorBody; +} + +// @public +export interface CloudErrorBody { + code?: string; + details?: CloudErrorBody[]; + message?: string; + target?: string; +} + +// @public +export interface CnameRecord { + cname?: string; +} + +// @public (undocumented) +export class DnsManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: DnsManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + dnsResourceReferenceOperations: DnsResourceReferenceOperations; + // (undocumented) + recordSets: RecordSets; + // (undocumented) + subscriptionId: string; + // (undocumented) + zones: Zones; +} + +// @public +export interface DnsManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface DnsResourceReference { + dnsResources?: SubResource[]; + targetResource?: SubResource; +} + +// @public +export interface DnsResourceReferenceGetByTargetResourcesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DnsResourceReferenceGetByTargetResourcesResponse = DnsResourceReferenceResult; + +// @public +export interface DnsResourceReferenceOperations { + getByTargetResources(parameters: DnsResourceReferenceRequest, options?: DnsResourceReferenceGetByTargetResourcesOptionalParams): Promise; +} + +// @public +export interface DnsResourceReferenceRequest { + targetResources?: SubResource[]; +} + +// @public +export interface DnsResourceReferenceResult { + dnsResourceReferences?: DnsResourceReference[]; +} + +// @public +export interface MxRecord { + exchange?: string; + preference?: number; +} + +// @public +export interface NsRecord { + nsdname?: string; +} + +// @public +export interface PtrRecord { + ptrdname?: string; +} + +// @public +export interface RecordSet { + aaaaRecords?: AaaaRecord[]; + aRecords?: ARecord[]; + caaRecords?: CaaRecord[]; + cnameRecord?: CnameRecord; + etag?: string; + readonly fqdn?: string; + readonly id?: string; + metadata?: { + [propertyName: string]: string; + }; + mxRecords?: MxRecord[]; + readonly name?: string; + nsRecords?: NsRecord[]; + readonly provisioningState?: string; + ptrRecords?: PtrRecord[]; + soaRecord?: SoaRecord; + srvRecords?: SrvRecord[]; + targetResource?: SubResource; + ttl?: number; + txtRecords?: TxtRecord[]; + readonly type?: string; +} + +// @public +export interface RecordSetListResult { + readonly nextLink?: string; + value?: RecordSet[]; +} + +// @public +export interface RecordSets { + createOrUpdate(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: RecordType, parameters: RecordSet, options?: RecordSetsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: RecordType, options?: RecordSetsDeleteOptionalParams): Promise; + get(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: RecordType, options?: RecordSetsGetOptionalParams): Promise; + listAllByDnsZone(resourceGroupName: string, zoneName: string, options?: RecordSetsListAllByDnsZoneOptionalParams): PagedAsyncIterableIterator; + listByDnsZone(resourceGroupName: string, zoneName: string, options?: RecordSetsListByDnsZoneOptionalParams): PagedAsyncIterableIterator; + listByType(resourceGroupName: string, zoneName: string, recordType: RecordType, options?: RecordSetsListByTypeOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: RecordType, parameters: RecordSet, options?: RecordSetsUpdateOptionalParams): Promise; +} + +// @public +export interface RecordSetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; + ifNoneMatch?: string; +} + +// @public +export type RecordSetsCreateOrUpdateResponse = RecordSet; + +// @public +export interface RecordSetsDeleteOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; +} + +// @public +export interface RecordSetsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RecordSetsGetResponse = RecordSet; + +// @public +export interface RecordSetsListAllByDnsZoneNextOptionalParams extends coreClient.OperationOptions { + recordSetNameSuffix?: string; + top?: number; +} + +// @public +export type RecordSetsListAllByDnsZoneNextResponse = RecordSetListResult; + +// @public +export interface RecordSetsListAllByDnsZoneOptionalParams extends coreClient.OperationOptions { + recordSetNameSuffix?: string; + top?: number; +} + +// @public +export type RecordSetsListAllByDnsZoneResponse = RecordSetListResult; + +// @public +export interface RecordSetsListByDnsZoneNextOptionalParams extends coreClient.OperationOptions { + recordsetnamesuffix?: string; + top?: number; +} + +// @public +export type RecordSetsListByDnsZoneNextResponse = RecordSetListResult; + +// @public +export interface RecordSetsListByDnsZoneOptionalParams extends coreClient.OperationOptions { + recordsetnamesuffix?: string; + top?: number; +} + +// @public +export type RecordSetsListByDnsZoneResponse = RecordSetListResult; + +// @public +export interface RecordSetsListByTypeNextOptionalParams extends coreClient.OperationOptions { + recordsetnamesuffix?: string; + top?: number; +} + +// @public +export type RecordSetsListByTypeNextResponse = RecordSetListResult; + +// @public +export interface RecordSetsListByTypeOptionalParams extends coreClient.OperationOptions { + recordsetnamesuffix?: string; + top?: number; +} + +// @public +export type RecordSetsListByTypeResponse = RecordSetListResult; + +// @public +export interface RecordSetsUpdateOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; +} + +// @public +export type RecordSetsUpdateResponse = RecordSet; + +// @public +export interface RecordSetUpdateParameters { + recordSet?: RecordSet; +} + +// @public +export type RecordType = "A" | "AAAA" | "CAA" | "CNAME" | "MX" | "NS" | "PTR" | "SOA" | "SRV" | "TXT"; + +// @public +export interface Resource { + readonly id?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface SoaRecord { + email?: string; + expireTime?: number; + host?: string; + minimumTtl?: number; + refreshTime?: number; + retryTime?: number; + serialNumber?: number; +} + +// @public +export interface SrvRecord { + port?: number; + priority?: number; + target?: string; + weight?: number; +} + +// @public +export interface SubResource { + id?: string; +} + +// @public +export interface TxtRecord { + value?: string[]; +} + +// @public +export type Zone = Resource & { + etag?: string; + readonly maxNumberOfRecordSets?: number; + readonly maxNumberOfRecordsPerRecordSet?: number; + readonly numberOfRecordSets?: number; + readonly nameServers?: string[]; + zoneType?: ZoneType; + registrationVirtualNetworks?: SubResource[]; + resolutionVirtualNetworks?: SubResource[]; +}; + +// @public +export interface ZoneListResult { + readonly nextLink?: string; + value?: Zone[]; +} + +// @public +export interface Zones { + beginDelete(resourceGroupName: string, zoneName: string, options?: ZonesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, zoneName: string, options?: ZonesDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, zoneName: string, parameters: Zone, options?: ZonesCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, zoneName: string, options?: ZonesGetOptionalParams): Promise; + list(options?: ZonesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: ZonesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, zoneName: string, parameters: ZoneUpdate, options?: ZonesUpdateOptionalParams): Promise; +} + +// @public +export interface ZonesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; + ifNoneMatch?: string; +} + +// @public +export type ZonesCreateOrUpdateResponse = Zone; + +// @public +export interface ZonesDeleteOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ZonesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ZonesGetResponse = Zone; + +// @public +export interface ZonesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ZonesListByResourceGroupNextResponse = ZoneListResult; + +// @public +export interface ZonesListByResourceGroupOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ZonesListByResourceGroupResponse = ZoneListResult; + +// @public +export interface ZonesListNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ZonesListNextResponse = ZoneListResult; + +// @public +export interface ZonesListOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ZonesListResponse = ZoneListResult; + +// @public +export interface ZonesUpdateOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; +} + +// @public +export type ZonesUpdateResponse = Zone; + +// @public +export type ZoneType = "Public" | "Private"; + +// @public +export interface ZoneUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/dns/arm-dns/rollup.config.js b/sdk/dns/arm-dns/rollup.config.js index 2737b1e41813..9be1955eb7f1 100644 --- a/sdk/dns/arm-dns/rollup.config.js +++ b/sdk/dns/arm-dns/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/dnsManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-dns.js", - format: "umd", - name: "Azure.ArmDns", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/dns/arm-dns/src/dnsManagementClient.ts b/sdk/dns/arm-dns/src/dnsManagementClient.ts index 5a7d85c07575..df63a2c1266b 100644 --- a/sdk/dns/arm-dns/src/dnsManagementClient.ts +++ b/sdk/dns/arm-dns/src/dnsManagementClient.ts @@ -1,53 +1,90 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { DnsManagementClientContext } from "./dnsManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + RecordSetsImpl, + ZonesImpl, + DnsResourceReferenceOperationsImpl +} from "./operations"; +import { + RecordSets, + Zones, + DnsResourceReferenceOperations +} from "./operationsInterfaces"; +import { DnsManagementClientOptionalParams } from "./models"; - -class DnsManagementClient extends DnsManagementClientContext { - // Operation groups - recordSets: operations.RecordSets; - zones: operations.Zones; - dnsResourceReference: operations.DnsResourceReferenceOperations; +export class DnsManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the DnsManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId Specifies the Azure subscription ID, which uniquely identifies the - * Microsoft Azure subscription. - * @param [options] The parameter options + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId Specifies the Azure subscription ID, which uniquely identifies the Microsoft + * Azure subscription. + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.DnsManagementClientOptions) { - super(credentials, subscriptionId, options); - this.recordSets = new operations.RecordSets(this); - this.zones = new operations.Zones(this); - this.dnsResourceReference = new operations.DnsResourceReferenceOperations(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: DnsManagementClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: DnsManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-dns/5.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - DnsManagementClient, - DnsManagementClientContext, - Models as DnsManagementModels, - Mappers as DnsManagementMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2018-05-01"; + this.recordSets = new RecordSetsImpl(this); + this.zones = new ZonesImpl(this); + this.dnsResourceReferenceOperations = new DnsResourceReferenceOperationsImpl( + this + ); + } + + recordSets: RecordSets; + zones: Zones; + dnsResourceReferenceOperations: DnsResourceReferenceOperations; +} diff --git a/sdk/dns/arm-dns/src/dnsManagementClientContext.ts b/sdk/dns/arm-dns/src/dnsManagementClientContext.ts deleted file mode 100644 index f11d7d427648..000000000000 --- a/sdk/dns/arm-dns/src/dnsManagementClientContext.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-dns"; -const packageVersion = "4.1.0"; - -export class DnsManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the DnsManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId Specifies the Azure subscription ID, which uniquely identifies the - * Microsoft Azure subscription. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.DnsManagementClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2018-05-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/dns/arm-dns/src/index.ts b/sdk/dns/arm-dns/src/index.ts new file mode 100644 index 000000000000..31a795a64cd0 --- /dev/null +++ b/sdk/dns/arm-dns/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 { DnsManagementClient } from "./dnsManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/dns/arm-dns/src/lroImpl.ts b/sdk/dns/arm-dns/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/dns/arm-dns/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/dns/arm-dns/src/models/dnsResourceReferenceOperationsMappers.ts b/sdk/dns/arm-dns/src/models/dnsResourceReferenceOperationsMappers.ts deleted file mode 100644 index c355dc3a376f..000000000000 --- a/sdk/dns/arm-dns/src/models/dnsResourceReferenceOperationsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CloudError, - DnsResourceReference, - DnsResourceReferenceRequest, - DnsResourceReferenceResult, - SubResource -} from "../models/mappers"; diff --git a/sdk/dns/arm-dns/src/models/index.ts b/sdk/dns/arm-dns/src/models/index.ts index d1290f20e2e1..60e1b06a5e5d 100644 --- a/sdk/dns/arm-dns/src/models/index.ts +++ b/sdk/dns/arm-dns/src/models/index.ts @@ -1,929 +1,499 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; - -/** - * An A record. - */ -export interface ARecord { +/** Describes a DNS record set (a collection of DNS records with the same name and type). */ +export interface RecordSet { /** - * The IPv4 address of this A record. + * The ID of the record set. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly id?: string; + /** + * The name of the record set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the record set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** The etag of the record set. */ + etag?: string; + /** The metadata attached to the record set. */ + metadata?: { [propertyName: string]: string }; + /** The TTL (time-to-live) of the records in the record set. */ + ttl?: number; + /** + * Fully qualified domain name of the record set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly fqdn?: string; + /** + * provisioning State of the record set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** A reference to an azure resource from where the dns resource value is taken. */ + targetResource?: SubResource; + /** The list of A records in the record set. */ + aRecords?: ARecord[]; + /** The list of AAAA records in the record set. */ + aaaaRecords?: AaaaRecord[]; + /** The list of MX records in the record set. */ + mxRecords?: MxRecord[]; + /** The list of NS records in the record set. */ + nsRecords?: NsRecord[]; + /** The list of PTR records in the record set. */ + ptrRecords?: PtrRecord[]; + /** The list of SRV records in the record set. */ + srvRecords?: SrvRecord[]; + /** The list of TXT records in the record set. */ + txtRecords?: TxtRecord[]; + /** The CNAME record in the record set. */ + cnameRecord?: CnameRecord; + /** The SOA record in the record set. */ + soaRecord?: SoaRecord; + /** The list of CAA records in the record set. */ + caaRecords?: CaaRecord[]; +} + +/** A reference to a another resource */ +export interface SubResource { + /** Resource Id. */ + id?: string; +} + +/** An A record. */ +export interface ARecord { + /** The IPv4 address of this A record. */ ipv4Address?: string; } -/** - * An AAAA record. - */ +/** An AAAA record. */ export interface AaaaRecord { - /** - * The IPv6 address of this AAAA record. - */ + /** The IPv6 address of this AAAA record. */ ipv6Address?: string; } -/** - * An MX record. - */ +/** An MX record. */ export interface MxRecord { - /** - * The preference value for this MX record. - */ + /** The preference value for this MX record. */ preference?: number; - /** - * The domain name of the mail host for this MX record. - */ + /** The domain name of the mail host for this MX record. */ exchange?: string; } -/** - * An NS record. - */ +/** An NS record. */ export interface NsRecord { - /** - * The name server name for this NS record. - */ + /** The name server name for this NS record. */ nsdname?: string; } -/** - * A PTR record. - */ +/** A PTR record. */ export interface PtrRecord { - /** - * The PTR target domain name for this PTR record. - */ + /** The PTR target domain name for this PTR record. */ ptrdname?: string; } -/** - * An SRV record. - */ +/** An SRV record. */ export interface SrvRecord { - /** - * The priority value for this SRV record. - */ + /** The priority value for this SRV record. */ priority?: number; - /** - * The weight value for this SRV record. - */ + /** The weight value for this SRV record. */ weight?: number; - /** - * The port value for this SRV record. - */ + /** The port value for this SRV record. */ port?: number; - /** - * The target domain name for this SRV record. - */ + /** The target domain name for this SRV record. */ target?: string; } -/** - * A TXT record. - */ +/** A TXT record. */ export interface TxtRecord { - /** - * The text value of this TXT record. - */ + /** The text value of this TXT record. */ value?: string[]; } -/** - * A CNAME record. - */ +/** A CNAME record. */ export interface CnameRecord { - /** - * The canonical name for this CNAME record. - */ + /** The canonical name for this CNAME record. */ cname?: string; } -/** - * An SOA record. - */ +/** An SOA record. */ export interface SoaRecord { - /** - * The domain name of the authoritative name server for this SOA record. - */ + /** The domain name of the authoritative name server for this SOA record. */ host?: string; - /** - * The email contact for this SOA record. - */ + /** The email contact for this SOA record. */ email?: string; - /** - * The serial number for this SOA record. - */ + /** The serial number for this SOA record. */ serialNumber?: number; - /** - * The refresh value for this SOA record. - */ + /** The refresh value for this SOA record. */ refreshTime?: number; - /** - * The retry time for this SOA record. - */ + /** The retry time for this SOA record. */ retryTime?: number; - /** - * The expire time for this SOA record. - */ + /** The expire time for this SOA record. */ expireTime?: number; - /** - * The minimum value for this SOA record. By convention this is used to determine the negative - * caching duration. - */ + /** The minimum value for this SOA record. By convention this is used to determine the negative caching duration. */ minimumTtl?: number; } -/** - * A CAA record. - */ +/** A CAA record. */ export interface CaaRecord { - /** - * The flags for this CAA record as an integer between 0 and 255. - */ + /** The flags for this CAA record as an integer between 0 and 255. */ flags?: number; - /** - * The tag for this CAA record. - */ + /** The tag for this CAA record. */ tag?: string; - /** - * The value for this CAA record. - */ + /** The value for this CAA record. */ value?: string; } -/** - * A reference to a another resource - */ -export interface SubResource { - /** - * Resource Id. - */ - id?: string; +/** An error response from the service. */ +export interface CloudError { + /** Cloud error body. */ + error?: CloudErrorBody; } -/** - * Describes a DNS record set (a collection of DNS records with the same name and type). - */ -export interface RecordSet extends BaseResource { - /** - * The ID of the record set. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The name of the record set. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The type of the record set. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * The etag of the record set. - */ - etag?: string; - /** - * The metadata attached to the record set. - */ - metadata?: { [propertyName: string]: string }; - /** - * The TTL (time-to-live) of the records in the record set. - */ - tTL?: number; - /** - * Fully qualified domain name of the record set. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly fqdn?: string; - /** - * provisioning State of the record set. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: string; - /** - * A reference to an azure resource from where the dns resource value is taken. - */ - targetResource?: SubResource; - /** - * The list of A records in the record set. - */ - aRecords?: ARecord[]; - /** - * The list of AAAA records in the record set. - */ - aaaaRecords?: AaaaRecord[]; - /** - * The list of MX records in the record set. - */ - mxRecords?: MxRecord[]; - /** - * The list of NS records in the record set. - */ - nsRecords?: NsRecord[]; - /** - * The list of PTR records in the record set. - */ - ptrRecords?: PtrRecord[]; - /** - * The list of SRV records in the record set. - */ - srvRecords?: SrvRecord[]; - /** - * The list of TXT records in the record set. - */ - txtRecords?: TxtRecord[]; - /** - * The CNAME record in the record set. - */ - cnameRecord?: CnameRecord; - /** - * The SOA record in the record set. - */ - soaRecord?: SoaRecord; - /** - * The list of CAA records in the record set. - */ - caaRecords?: CaaRecord[]; +/** An error response from the service. */ +export interface CloudErrorBody { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ + code?: string; + /** A message describing the error, intended to be suitable for display in a user interface. */ + message?: string; + /** The target of the particular error. For example, the name of the property in error. */ + target?: string; + /** A list of additional details about the error. */ + details?: CloudErrorBody[]; } -/** - * Parameters supplied to update a record set. - */ -export interface RecordSetUpdateParameters { +/** The response to a record set List operation. */ +export interface RecordSetListResult { + /** Information about the record sets in the response. */ + value?: RecordSet[]; /** - * Specifies information about the record set being updated. + * The continuation token for the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - recordSet?: RecordSet; + readonly nextLink?: string; } -/** - * Common properties of an Azure Resource Manager resource - */ -export interface Resource extends BaseResource { +/** Common properties of an Azure Resource Manager resource */ +export interface Resource { /** * Resource ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * Resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * Resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** - * Resource location. - */ + /** Resource location. */ location: string; - /** - * Resource tags. - */ + /** Resource tags. */ tags?: { [propertyName: string]: string }; } -/** - * Describes a DNS zone. - */ -export interface Zone extends Resource { - /** - * The etag of the zone. - */ - etag?: string; - /** - * The maximum number of record sets that can be created in this DNS zone. This is a read-only - * property and any attempt to set this value will be ignored. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly maxNumberOfRecordSets?: number; - /** - * The current number of record sets in this DNS zone. This is a read-only property and any - * attempt to set this value will be ignored. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly numberOfRecordSets?: number; - /** - * The name servers for this DNS zone. This is a read-only property and any attempt to set this - * value will be ignored. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nameServers?: string[]; - /** - * The type of this DNS zone (Public or Private). Possible values include: 'Public', 'Private'. - * Default value: 'Public'. - */ - zoneType?: ZoneType; - /** - * A list of references to virtual networks that register hostnames in this DNS zone. This is a - * only when ZoneType is Private. - */ - registrationVirtualNetworks?: SubResource[]; - /** - * A list of references to virtual networks that resolve records in this DNS zone. This is a only - * when ZoneType is Private. - */ - resolutionVirtualNetworks?: SubResource[]; +/** Describes a request to update a DNS zone. */ +export interface ZoneUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; } -/** - * Describes a request to update a DNS zone. - */ -export interface ZoneUpdate { +/** The response to a Zone List or ListAll operation. */ +export interface ZoneListResult { + /** Information about the DNS zones. */ + value?: Zone[]; /** - * Resource tags. + * The continuation token for the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly nextLink?: string; } -/** - * Represents the properties of the Dns Resource Reference Request. - */ +/** Represents the properties of the Dns Resource Reference Request. */ export interface DnsResourceReferenceRequest { - /** - * A list of references to azure resources for which referencing dns records need to be queried. - */ + /** A list of references to azure resources for which referencing dns records need to be queried. */ targetResources?: SubResource[]; } -/** - * Represents a single Azure resource and its referencing DNS records. - */ +/** Represents the properties of the Dns Resource Reference Result. */ +export interface DnsResourceReferenceResult { + /** The result of dns resource reference request. A list of dns resource references for each of the azure resource in the request */ + dnsResourceReferences?: DnsResourceReference[]; +} + +/** Represents a single Azure resource and its referencing DNS records. */ export interface DnsResourceReference { - /** - * A list of dns Records - */ + /** A list of dns Records */ dnsResources?: SubResource[]; - /** - * A reference to an azure resource from where the dns resource value is taken. - */ + /** A reference to an azure resource from where the dns resource value is taken. */ targetResource?: SubResource; } -/** - * Represents the properties of the Dns Resource Reference Result. - */ -export interface DnsResourceReferenceResult { - /** - * The result of dns resource reference request. A list of dns resource references for each of - * the azure resource in the request - */ - dnsResourceReferences?: DnsResourceReference[]; +/** Parameters supplied to update a record set. */ +export interface RecordSetUpdateParameters { + /** Specifies information about the record set being updated. */ + recordSet?: RecordSet; } -/** - * Optional Parameters. - */ -export interface RecordSetsUpdateOptionalParams extends msRest.RequestOptionsBase { +/** Describes a DNS zone. */ +export type Zone = Resource & { + /** The etag of the zone. */ + etag?: string; /** - * The etag of the record set. Omit this value to always overwrite the current record set. - * Specify the last-seen etag value to prevent accidentally overwriting concurrent changes. + * The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - ifMatch?: string; -} - -/** - * Optional Parameters. - */ -export interface RecordSetsCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { + readonly maxNumberOfRecordSets?: number; /** - * The etag of the record set. Omit this value to always overwrite the current record set. - * Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. + * The maximum number of records per record set that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - ifMatch?: string; + readonly maxNumberOfRecordsPerRecordSet?: number; /** - * Set to '*' to allow a new record set to be created, but to prevent updating an existing record - * set. Other values will be ignored. + * The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly numberOfRecordSets?: number; + /** + * The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nameServers?: string[]; + /** The type of this DNS zone (Public or Private). */ + zoneType?: ZoneType; + /** A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private. */ + registrationVirtualNetworks?: SubResource[]; + /** A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private. */ + resolutionVirtualNetworks?: SubResource[]; +}; +/** Defines values for RecordType. */ +export type RecordType = + | "A" + | "AAAA" + | "CAA" + | "CNAME" + | "MX" + | "NS" + | "PTR" + | "SOA" + | "SRV" + | "TXT"; +/** Defines values for ZoneType. */ +export type ZoneType = "Public" | "Private"; + +/** Optional parameters. */ +export interface RecordSetsUpdateOptionalParams + extends coreClient.OperationOptions { + /** The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwriting concurrent changes. */ + ifMatch?: string; +} + +/** Contains response data for the update operation. */ +export type RecordSetsUpdateResponse = RecordSet; + +/** Optional parameters. */ +export interface RecordSetsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. */ + ifMatch?: string; + /** Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will be ignored. */ ifNoneMatch?: string; } -/** - * Optional Parameters. - */ -export interface RecordSetsDeleteMethodOptionalParams extends msRest.RequestOptionsBase { - /** - * The etag of the record set. Omit this value to always delete the current record set. Specify - * the last-seen etag value to prevent accidentally deleting any concurrent changes. - */ +/** Contains response data for the createOrUpdate operation. */ +export type RecordSetsCreateOrUpdateResponse = RecordSet; + +/** Optional parameters. */ +export interface RecordSetsDeleteOptionalParams + extends coreClient.OperationOptions { + /** The etag of the record set. Omit this value to always delete the current record set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. */ ifMatch?: string; } -/** - * Optional Parameters. - */ -export interface RecordSetsListByTypeOptionalParams extends msRest.RequestOptionsBase { - /** - * The maximum number of record sets to return. If not specified, returns up to 100 record sets. - */ +/** Optional parameters. */ +export interface RecordSetsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type RecordSetsGetResponse = RecordSet; + +/** Optional parameters. */ +export interface RecordSetsListByTypeOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ top?: number; - /** - * The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end - * with . - */ + /** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with . */ recordsetnamesuffix?: string; } -/** - * Optional Parameters. - */ -export interface RecordSetsListByDnsZoneOptionalParams extends msRest.RequestOptionsBase { - /** - * The maximum number of record sets to return. If not specified, returns up to 100 record sets. - */ +/** Contains response data for the listByType operation. */ +export type RecordSetsListByTypeResponse = RecordSetListResult; + +/** Optional parameters. */ +export interface RecordSetsListByDnsZoneOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ top?: number; - /** - * The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end - * with . - */ + /** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with . */ recordsetnamesuffix?: string; } -/** - * Optional Parameters. - */ -export interface RecordSetsListAllByDnsZoneOptionalParams extends msRest.RequestOptionsBase { - /** - * The maximum number of record sets to return. If not specified, returns up to 100 record sets. - */ +/** Contains response data for the listByDnsZone operation. */ +export type RecordSetsListByDnsZoneResponse = RecordSetListResult; + +/** Optional parameters. */ +export interface RecordSetsListAllByDnsZoneOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ top?: number; - /** - * The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end - * with . - */ + /** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with . */ recordSetNameSuffix?: string; } -/** - * Optional Parameters. - */ -export interface ZonesCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the - * last-seen etag value to prevent accidentally overwriting any concurrent changes. - */ - ifMatch?: string; - /** - * Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. - * Other values will be ignored. - */ - ifNoneMatch?: string; -} +/** Contains response data for the listAllByDnsZone operation. */ +export type RecordSetsListAllByDnsZoneResponse = RecordSetListResult; -/** - * Optional Parameters. - */ -export interface ZonesDeleteMethodOptionalParams extends msRest.RequestOptionsBase { - /** - * The etag of the DNS zone. Omit this value to always delete the current zone. Specify the - * last-seen etag value to prevent accidentally deleting any concurrent changes. - */ - ifMatch?: string; +/** Optional parameters. */ +export interface RecordSetsListByTypeNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ + top?: number; + /** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with . */ + recordsetnamesuffix?: string; } -/** - * Optional Parameters. - */ -export interface ZonesUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the - * last-seen etag value to prevent accidentally overwriting any concurrent changes. - */ - ifMatch?: string; -} +/** Contains response data for the listByTypeNext operation. */ +export type RecordSetsListByTypeNextResponse = RecordSetListResult; -/** - * Optional Parameters. - */ -export interface ZonesListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * The maximum number of record sets to return. If not specified, returns up to 100 record sets. - */ +/** Optional parameters. */ +export interface RecordSetsListByDnsZoneNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ top?: number; + /** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with . */ + recordsetnamesuffix?: string; } -/** - * Optional Parameters. - */ -export interface ZonesListOptionalParams extends msRest.RequestOptionsBase { - /** - * The maximum number of DNS zones to return. If not specified, returns up to 100 zones. - */ +/** Contains response data for the listByDnsZoneNext operation. */ +export type RecordSetsListByDnsZoneNextResponse = RecordSetListResult; + +/** Optional parameters. */ +export interface RecordSetsListAllByDnsZoneNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ top?: number; + /** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with . */ + recordSetNameSuffix?: string; } -/** - * Optional Parameters. - */ -export interface ZonesBeginDeleteMethodOptionalParams extends msRest.RequestOptionsBase { - /** - * The etag of the DNS zone. Omit this value to always delete the current zone. Specify the - * last-seen etag value to prevent accidentally deleting any concurrent changes. - */ - ifMatch?: string; -} +/** Contains response data for the listAllByDnsZoneNext operation. */ +export type RecordSetsListAllByDnsZoneNextResponse = RecordSetListResult; -/** - * An interface representing DnsManagementClientOptions. - */ -export interface DnsManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; +/** Optional parameters. */ +export interface ZonesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. */ + ifMatch?: string; + /** Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. Other values will be ignored. */ + ifNoneMatch?: string; } -/** - * @interface - * The response to a record set List operation. - * @extends Array - */ -export interface RecordSetListResult extends Array { - /** - * The continuation token for the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} +/** Contains response data for the createOrUpdate operation. */ +export type ZonesCreateOrUpdateResponse = Zone; -/** - * @interface - * The response to a Zone List or ListAll operation. - * @extends Array - */ -export interface ZoneListResult extends Array { - /** - * The continuation token for the next page of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +/** Optional parameters. */ +export interface ZonesDeleteOptionalParams extends coreClient.OperationOptions { + /** The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. */ + ifMatch?: string; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * Defines values for ZoneType. - * Possible values include: 'Public', 'Private' - * @readonly - * @enum {string} - */ -export type ZoneType = 'Public' | 'Private'; - -/** - * Defines values for RecordType. - * Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @readonly - * @enum {string} - */ -export type RecordType = 'A' | 'AAAA' | 'CAA' | 'CNAME' | 'MX' | 'NS' | 'PTR' | 'SOA' | 'SRV' | 'TXT'; - -/** - * Contains response data for the update operation. - */ -export type RecordSetsUpdateResponse = RecordSet & { - /** - * 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: RecordSet; - }; -}; +/** Optional parameters. */ +export interface ZonesGetOptionalParams extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type RecordSetsCreateOrUpdateResponse = RecordSet & { - /** - * 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: RecordSet; - }; -}; +/** Contains response data for the get operation. */ +export type ZonesGetResponse = Zone; -/** - * Contains response data for the get operation. - */ -export type RecordSetsGetResponse = RecordSet & { - /** - * 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: RecordSet; - }; -}; - -/** - * Contains response data for the listByType operation. - */ -export type RecordSetsListByTypeResponse = RecordSetListResult & { - /** - * 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: RecordSetListResult; - }; -}; - -/** - * Contains response data for the listByDnsZone operation. - */ -export type RecordSetsListByDnsZoneResponse = RecordSetListResult & { - /** - * 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: RecordSetListResult; - }; -}; +/** Optional parameters. */ +export interface ZonesUpdateOptionalParams extends coreClient.OperationOptions { + /** The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. */ + ifMatch?: string; +} -/** - * Contains response data for the listAllByDnsZone operation. - */ -export type RecordSetsListAllByDnsZoneResponse = RecordSetListResult & { - /** - * 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: RecordSetListResult; - }; -}; +/** Contains response data for the update operation. */ +export type ZonesUpdateResponse = Zone; -/** - * Contains response data for the listByTypeNext operation. - */ -export type RecordSetsListByTypeNextResponse = RecordSetListResult & { - /** - * 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: RecordSetListResult; - }; -}; +/** Optional parameters. */ +export interface ZonesListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ + top?: number; +} -/** - * Contains response data for the listByDnsZoneNext operation. - */ -export type RecordSetsListByDnsZoneNextResponse = RecordSetListResult & { - /** - * 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: RecordSetListResult; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type ZonesListByResourceGroupResponse = ZoneListResult; -/** - * Contains response data for the listAllByDnsZoneNext operation. - */ -export type RecordSetsListAllByDnsZoneNextResponse = RecordSetListResult & { - /** - * 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: RecordSetListResult; - }; -}; +/** Optional parameters. */ +export interface ZonesListOptionalParams extends coreClient.OperationOptions { + /** The maximum number of DNS zones to return. If not specified, returns up to 100 zones. */ + top?: number; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ZonesCreateOrUpdateResponse = Zone & { - /** - * 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: Zone; - }; -}; +/** Contains response data for the list operation. */ +export type ZonesListResponse = ZoneListResult; -/** - * Contains response data for the get operation. - */ -export type ZonesGetResponse = Zone & { - /** - * 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: Zone; - }; -}; +/** Optional parameters. */ +export interface ZonesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ + top?: number; +} -/** - * Contains response data for the update operation. - */ -export type ZonesUpdateResponse = Zone & { - /** - * 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: Zone; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type ZonesListByResourceGroupNextResponse = ZoneListResult; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ZonesListByResourceGroupResponse = ZoneListResult & { - /** - * 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: ZoneListResult; - }; -}; +/** Optional parameters. */ +export interface ZonesListNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of DNS zones to return. If not specified, returns up to 100 zones. */ + top?: number; +} -/** - * Contains response data for the list operation. - */ -export type ZonesListResponse = ZoneListResult & { - /** - * 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: ZoneListResult; - }; -}; +/** Contains response data for the listNext operation. */ +export type ZonesListNextResponse = ZoneListResult; -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type ZonesListByResourceGroupNextResponse = ZoneListResult & { - /** - * 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: ZoneListResult; - }; -}; +/** Optional parameters. */ +export interface DnsResourceReferenceGetByTargetResourcesOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type ZonesListNextResponse = ZoneListResult & { - /** - * 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: ZoneListResult; - }; -}; +/** Contains response data for the getByTargetResources operation. */ +export type DnsResourceReferenceGetByTargetResourcesResponse = DnsResourceReferenceResult; -/** - * Contains response data for the getByTargetResources operation. - */ -export type DnsResourceReferenceGetByTargetResourcesResponse = DnsResourceReferenceResult & { - /** - * 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: DnsResourceReferenceResult; - }; -}; +/** Optional parameters. */ +export interface DnsManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/dns/arm-dns/src/models/mappers.ts b/sdk/dns/arm-dns/src/models/mappers.ts index 75602f130641..a50750dc54e4 100644 --- a/sdk/dns/arm-dns/src/models/mappers.ts +++ b/sdk/dns/arm-dns/src/models/mappers.ts @@ -1,19 +1,209 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; +export const RecordSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RecordSet", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + ttl: { + serializedName: "properties.TTL", + type: { + name: "Number" + } + }, + fqdn: { + serializedName: "properties.fqdn", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + targetResource: { + serializedName: "properties.targetResource", + type: { + name: "Composite", + className: "SubResource" + } + }, + aRecords: { + serializedName: "properties.ARecords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ARecord" + } + } + } + }, + aaaaRecords: { + serializedName: "properties.AAAARecords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AaaaRecord" + } + } + } + }, + mxRecords: { + serializedName: "properties.MXRecords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MxRecord" + } + } + } + }, + nsRecords: { + serializedName: "properties.NSRecords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NsRecord" + } + } + } + }, + ptrRecords: { + serializedName: "properties.PTRRecords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PtrRecord" + } + } + } + }, + srvRecords: { + serializedName: "properties.SRVRecords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SrvRecord" + } + } + } + }, + txtRecords: { + serializedName: "properties.TXTRecords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TxtRecord" + } + } + } + }, + cnameRecord: { + serializedName: "properties.CNAMERecord", + type: { + name: "Composite", + className: "CnameRecord" + } + }, + soaRecord: { + serializedName: "properties.SOARecord", + type: { + name: "Composite", + className: "SoaRecord" + } + }, + caaRecords: { + serializedName: "properties.caaRecords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CaaRecord" + } + } + } + } + } + } +}; -export const ARecord: msRest.CompositeMapper = { - serializedName: "ARecord", +export const SubResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubResource", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const ARecord: coreClient.CompositeMapper = { type: { name: "Composite", className: "ARecord", @@ -28,8 +218,7 @@ export const ARecord: msRest.CompositeMapper = { } }; -export const AaaaRecord: msRest.CompositeMapper = { - serializedName: "AaaaRecord", +export const AaaaRecord: coreClient.CompositeMapper = { type: { name: "Composite", className: "AaaaRecord", @@ -44,8 +233,7 @@ export const AaaaRecord: msRest.CompositeMapper = { } }; -export const MxRecord: msRest.CompositeMapper = { - serializedName: "MxRecord", +export const MxRecord: coreClient.CompositeMapper = { type: { name: "Composite", className: "MxRecord", @@ -66,8 +254,7 @@ export const MxRecord: msRest.CompositeMapper = { } }; -export const NsRecord: msRest.CompositeMapper = { - serializedName: "NsRecord", +export const NsRecord: coreClient.CompositeMapper = { type: { name: "Composite", className: "NsRecord", @@ -82,8 +269,7 @@ export const NsRecord: msRest.CompositeMapper = { } }; -export const PtrRecord: msRest.CompositeMapper = { - serializedName: "PtrRecord", +export const PtrRecord: coreClient.CompositeMapper = { type: { name: "Composite", className: "PtrRecord", @@ -98,8 +284,7 @@ export const PtrRecord: msRest.CompositeMapper = { } }; -export const SrvRecord: msRest.CompositeMapper = { - serializedName: "SrvRecord", +export const SrvRecord: coreClient.CompositeMapper = { type: { name: "Composite", className: "SrvRecord", @@ -132,8 +317,7 @@ export const SrvRecord: msRest.CompositeMapper = { } }; -export const TxtRecord: msRest.CompositeMapper = { - serializedName: "TxtRecord", +export const TxtRecord: coreClient.CompositeMapper = { type: { name: "Composite", className: "TxtRecord", @@ -153,8 +337,7 @@ export const TxtRecord: msRest.CompositeMapper = { } }; -export const CnameRecord: msRest.CompositeMapper = { - serializedName: "CnameRecord", +export const CnameRecord: coreClient.CompositeMapper = { type: { name: "Composite", className: "CnameRecord", @@ -169,8 +352,7 @@ export const CnameRecord: msRest.CompositeMapper = { } }; -export const SoaRecord: msRest.CompositeMapper = { - serializedName: "SoaRecord", +export const SoaRecord: coreClient.CompositeMapper = { type: { name: "Composite", className: "SoaRecord", @@ -221,8 +403,7 @@ export const SoaRecord: msRest.CompositeMapper = { } }; -export const CaaRecord: msRest.CompositeMapper = { - serializedName: "CaaRecord", +export const CaaRecord: coreClient.CompositeMapper = { type: { name: "Composite", className: "CaaRecord", @@ -249,364 +430,190 @@ export const CaaRecord: msRest.CompositeMapper = { } }; -export const SubResource: msRest.CompositeMapper = { - serializedName: "SubResource", +export const CloudError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SubResource", + className: "CloudError", modelProperties: { - id: { - serializedName: "id", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "CloudErrorBody" } } } } }; -export const RecordSet: msRest.CompositeMapper = { - serializedName: "RecordSet", +export const CloudErrorBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RecordSet", + className: "CloudErrorBody", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + code: { + serializedName: "code", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + message: { + serializedName: "message", type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + target: { + serializedName: "target", type: { name: "String" } }, - etag: { - serializedName: "etag", + details: { + serializedName: "details", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CloudErrorBody" + } + } } - }, - metadata: { - serializedName: "properties.metadata", + } + } + } +}; + +export const RecordSetListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RecordSetListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "RecordSet" } } } }, - tTL: { - serializedName: "properties.TTL", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Number" + name: "String" } - }, - fqdn: { + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", readOnly: true, - serializedName: "properties.fqdn", type: { name: "String" } }, - provisioningState: { + name: { + serializedName: "name", readOnly: true, - serializedName: "properties.provisioningState", type: { name: "String" } }, - targetResource: { - serializedName: "properties.targetResource", - type: { - name: "Composite", - className: "SubResource" - } - }, - aRecords: { - serializedName: "properties.ARecords", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ARecord" - } - } - } - }, - aaaaRecords: { - serializedName: "properties.AAAARecords", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AaaaRecord" - } - } - } - }, - mxRecords: { - serializedName: "properties.MXRecords", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MxRecord" - } - } - } - }, - nsRecords: { - serializedName: "properties.NSRecords", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NsRecord" - } - } - } - }, - ptrRecords: { - serializedName: "properties.PTRRecords", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PtrRecord" - } - } - } - }, - srvRecords: { - serializedName: "properties.SRVRecords", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SrvRecord" - } - } - } - }, - txtRecords: { - serializedName: "properties.TXTRecords", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TxtRecord" - } - } - } - }, - cnameRecord: { - serializedName: "properties.CNAMERecord", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Composite", - className: "CnameRecord" + name: "String" } }, - soaRecord: { - serializedName: "properties.SOARecord", + location: { + serializedName: "location", + required: true, type: { - name: "Composite", - className: "SoaRecord" + name: "String" } }, - caaRecords: { - serializedName: "properties.caaRecords", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CaaRecord" - } - } - } - } - } - } -}; - -export const RecordSetUpdateParameters: msRest.CompositeMapper = { - serializedName: "RecordSetUpdateParameters", - type: { - name: "Composite", - className: "RecordSetUpdateParameters", - modelProperties: { - recordSet: { - serializedName: "RecordSet", + tags: { + serializedName: "tags", type: { - name: "Composite", - className: "RecordSet" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const ZoneUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ZoneUpdate", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } - }, - location: { - required: true, - serializedName: "location", - type: { - name: "String" - } - }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } } } } }; -export const Zone: msRest.CompositeMapper = { - serializedName: "Zone", +export const ZoneListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Zone", + className: "ZoneListResult", modelProperties: { - ...Resource.type.modelProperties, - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - maxNumberOfRecordSets: { - readOnly: true, - serializedName: "properties.maxNumberOfRecordSets", - type: { - name: "Number" - } - }, - numberOfRecordSets: { - readOnly: true, - serializedName: "properties.numberOfRecordSets", - type: { - name: "Number" - } - }, - nameServers: { - readOnly: true, - serializedName: "properties.nameServers", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - zoneType: { - serializedName: "properties.zoneType", - defaultValue: 'Public', - type: { - name: "Enum", - allowedValues: [ - "Public", - "Private" - ] - } - }, - registrationVirtualNetworks: { - serializedName: "properties.registrationVirtualNetworks", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "SubResource" + className: "Zone" } } } }, - resolutionVirtualNetworks: { - serializedName: "properties.resolutionVirtualNetworks", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource" - } - } + name: "String" } } } } }; -export const ZoneUpdate: msRest.CompositeMapper = { - serializedName: "ZoneUpdate", +export const DnsResourceReferenceRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ZoneUpdate", + className: "DnsResourceReferenceRequest", modelProperties: { - tags: { - serializedName: "tags", + targetResources: { + serializedName: "properties.targetResources", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "SubResource" } } } @@ -615,20 +622,19 @@ export const ZoneUpdate: msRest.CompositeMapper = { } }; -export const DnsResourceReferenceRequest: msRest.CompositeMapper = { - serializedName: "DnsResourceReferenceRequest", +export const DnsResourceReferenceResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DnsResourceReferenceRequest", + className: "DnsResourceReferenceResult", modelProperties: { - targetResources: { - serializedName: "properties.targetResources", + dnsResourceReferences: { + serializedName: "properties.dnsResourceReferences", type: { name: "Sequence", element: { type: { name: "Composite", - className: "SubResource" + className: "DnsResourceReference" } } } @@ -637,8 +643,7 @@ export const DnsResourceReferenceRequest: msRest.CompositeMapper = { } }; -export const DnsResourceReference: msRest.CompositeMapper = { - serializedName: "DnsResourceReference", +export const DnsResourceReference: coreClient.CompositeMapper = { type: { name: "Composite", className: "DnsResourceReference", @@ -666,80 +671,97 @@ export const DnsResourceReference: msRest.CompositeMapper = { } }; -export const DnsResourceReferenceResult: msRest.CompositeMapper = { - serializedName: "DnsResourceReferenceResult", +export const RecordSetUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DnsResourceReferenceResult", + className: "RecordSetUpdateParameters", modelProperties: { - dnsResourceReferences: { - serializedName: "properties.dnsResourceReferences", + recordSet: { + serializedName: "RecordSet", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DnsResourceReference" - } - } + name: "Composite", + className: "RecordSet" } } } } }; -export const RecordSetListResult: msRest.CompositeMapper = { - serializedName: "RecordSetListResult", +export const Zone: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RecordSetListResult", + className: "Zone", modelProperties: { - value: { - serializedName: "", + ...Resource.type.modelProperties, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + maxNumberOfRecordSets: { + serializedName: "properties.maxNumberOfRecordSets", + readOnly: true, + type: { + name: "Number" + } + }, + maxNumberOfRecordsPerRecordSet: { + serializedName: "properties.maxNumberOfRecordsPerRecordSet", + readOnly: true, + type: { + name: "Number" + } + }, + numberOfRecordSets: { + serializedName: "properties.numberOfRecordSets", + readOnly: true, + type: { + name: "Number" + } + }, + nameServers: { + serializedName: "properties.nameServers", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "RecordSet" + name: "String" } } } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + zoneType: { + defaultValue: "Public", + serializedName: "properties.zoneType", type: { - name: "String" + name: "Enum", + allowedValues: ["Public", "Private"] } - } - } - } -}; - -export const ZoneListResult: msRest.CompositeMapper = { - serializedName: "ZoneListResult", - type: { - name: "Composite", - className: "ZoneListResult", - modelProperties: { - value: { - serializedName: "", + }, + registrationVirtualNetworks: { + serializedName: "properties.registrationVirtualNetworks", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Zone" + className: "SubResource" } } } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + resolutionVirtualNetworks: { + serializedName: "properties.resolutionVirtualNetworks", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubResource" + } + } } } } diff --git a/sdk/dns/arm-dns/src/models/parameters.ts b/sdk/dns/arm-dns/src/models/parameters.ts index c7f054e39aac..f2f09e1baba3 100644 --- a/sdk/dns/arm-dns/src/models/parameters.ts +++ b/sdk/dns/arm-dns/src/models/parameters.ts @@ -1,87 +1,103 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + RecordSet as RecordSetMapper, + Zone as ZoneMapper, + ZoneUpdate as ZoneUpdateMapper, + DnsResourceReferenceRequest as DnsResourceReferenceRequestMapper +} 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 apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: RecordSetMapper +}; + +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - required: true, - serializedName: "api-version", + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const ifMatch: msRest.OperationParameter = { - parameterPath: [ - "options", - "ifMatch" - ], + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { - serializedName: "If-Match", + serializedName: "$host", + required: true, type: { name: "String" } - } + }, + skipEncoding: true }; -export const ifNoneMatch: msRest.OperationParameter = { - parameterPath: [ - "options", - "ifNoneMatch" - ], + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { - serializedName: "If-None-Match", + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const zoneName: OperationURLParameter = { + parameterPath: "zoneName", mapper: { + serializedName: "zoneName", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const recordSetNameSuffix: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "recordSetNameSuffix" - ], + +export const relativeRecordSetName: OperationURLParameter = { + parameterPath: "relativeRecordSetName", mapper: { - serializedName: "$recordsetnamesuffix", + serializedName: "relativeRecordSetName", + required: true, type: { name: "String" } - } + }, + skipEncoding: true }; -export const recordType: msRest.OperationURLParameter = { + +export const recordType: OperationURLParameter = { parameterPath: "recordType", mapper: { - required: true, serializedName: "recordType", + required: true, type: { name: "Enum", allowedValues: [ @@ -99,54 +115,52 @@ export const recordType: msRest.OperationURLParameter = { } } }; -export const recordsetnamesuffix: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "recordsetnamesuffix" - ], + +export const ifMatch: OperationParameter = { + parameterPath: ["options", "ifMatch"], mapper: { - serializedName: "$recordsetnamesuffix", + serializedName: "If-Match", type: { name: "String" } } }; -export const relativeRecordSetName: msRest.OperationURLParameter = { - parameterPath: "relativeRecordSetName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "relativeRecordSetName", + defaultValue: "2018-05-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } - }, - skipEncoding: true + } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const ifNoneMatch: OperationParameter = { + parameterPath: ["options", "ifNoneMatch"], mapper: { - required: true, - serializedName: "subscriptionId", + serializedName: "If-None-Match", type: { name: "String" } } }; -export const top: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "top" - ], + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], mapper: { serializedName: "$top", type: { @@ -154,13 +168,50 @@ export const top: msRest.OperationQueryParameter = { } } }; -export const zoneName: msRest.OperationURLParameter = { - parameterPath: "zoneName", + +export const recordsetnamesuffix: OperationQueryParameter = { + parameterPath: ["options", "recordsetnamesuffix"], mapper: { - required: true, - serializedName: "zoneName", + serializedName: "$recordsetnamesuffix", type: { name: "String" } } }; + +export const recordSetNameSuffix: OperationQueryParameter = { + parameterPath: ["options", "recordSetNameSuffix"], + mapper: { + serializedName: "$recordsetnamesuffix", + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: ZoneMapper +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: ZoneUpdateMapper +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: DnsResourceReferenceRequestMapper +}; diff --git a/sdk/dns/arm-dns/src/models/recordSetsMappers.ts b/sdk/dns/arm-dns/src/models/recordSetsMappers.ts deleted file mode 100644 index d564d6db7062..000000000000 --- a/sdk/dns/arm-dns/src/models/recordSetsMappers.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AaaaRecord, - ARecord, - BaseResource, - CaaRecord, - CloudError, - CnameRecord, - MxRecord, - NsRecord, - PtrRecord, - RecordSet, - RecordSetListResult, - Resource, - SoaRecord, - SrvRecord, - SubResource, - TxtRecord, - Zone -} from "../models/mappers"; diff --git a/sdk/dns/arm-dns/src/models/zonesMappers.ts b/sdk/dns/arm-dns/src/models/zonesMappers.ts deleted file mode 100644 index 177ff6d4fc9a..000000000000 --- a/sdk/dns/arm-dns/src/models/zonesMappers.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AaaaRecord, - ARecord, - BaseResource, - CaaRecord, - CloudError, - CnameRecord, - MxRecord, - NsRecord, - PtrRecord, - RecordSet, - Resource, - SoaRecord, - SrvRecord, - SubResource, - TxtRecord, - Zone, - ZoneListResult, - ZoneUpdate -} from "../models/mappers"; diff --git a/sdk/dns/arm-dns/src/operations/dnsResourceReferenceOperations.ts b/sdk/dns/arm-dns/src/operations/dnsResourceReferenceOperations.ts index e315c3713111..cd888a059a4f 100644 --- a/sdk/dns/arm-dns/src/operations/dnsResourceReferenceOperations.ts +++ b/sdk/dns/arm-dns/src/operations/dnsResourceReferenceOperations.ts @@ -1,81 +1,57 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/dnsResourceReferenceOperationsMappers"; +import { DnsResourceReferenceOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DnsManagementClientContext } from "../dnsManagementClientContext"; +import { DnsManagementClient } from "../dnsManagementClient"; +import { + DnsResourceReferenceRequest, + DnsResourceReferenceGetByTargetResourcesOptionalParams, + DnsResourceReferenceGetByTargetResourcesResponse +} from "../models"; -/** Class representing a DnsResourceReferenceOperations. */ -export class DnsResourceReferenceOperations { - private readonly client: DnsManagementClientContext; +/** Class containing DnsResourceReferenceOperations operations. */ +export class DnsResourceReferenceOperationsImpl + implements DnsResourceReferenceOperations { + private readonly client: DnsManagementClient; /** - * Create a DnsResourceReferenceOperations. - * @param {DnsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class DnsResourceReferenceOperations class. + * @param client Reference to the service client */ - constructor(client: DnsManagementClientContext) { + constructor(client: DnsManagementClient) { this.client = client; } /** * Returns the DNS records specified by the referencing targetResourceIds. * @param parameters Properties for dns resource reference request. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getByTargetResources(parameters: Models.DnsResourceReferenceRequest, options?: msRest.RequestOptionsBase): Promise; - /** - * @param parameters Properties for dns resource reference request. - * @param callback The callback - */ - getByTargetResources(parameters: Models.DnsResourceReferenceRequest, callback: msRest.ServiceCallback): void; - /** - * @param parameters Properties for dns resource reference request. - * @param options The optional parameters - * @param callback The callback - */ - getByTargetResources(parameters: Models.DnsResourceReferenceRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getByTargetResources(parameters: Models.DnsResourceReferenceRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getByTargetResources( + parameters: DnsResourceReferenceRequest, + options?: DnsResourceReferenceGetByTargetResourcesOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - parameters, - options - }, - getByTargetResourcesOperationSpec, - callback) as Promise; + { parameters, options }, + getByTargetResourcesOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getByTargetResourcesOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getByTargetResourcesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/getDnsResourceReference", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Network/getDnsResourceReference", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.DnsResourceReferenceRequest, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.DnsResourceReferenceResult @@ -84,5 +60,10 @@ const getByTargetResourcesOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", serializer }; diff --git a/sdk/dns/arm-dns/src/operations/index.ts b/sdk/dns/arm-dns/src/operations/index.ts index c3c01f8bfd52..249eca50d8e6 100644 --- a/sdk/dns/arm-dns/src/operations/index.ts +++ b/sdk/dns/arm-dns/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./recordSets"; diff --git a/sdk/dns/arm-dns/src/operations/recordSets.ts b/sdk/dns/arm-dns/src/operations/recordSets.ts index 36ca178620ce..4a2973c18d92 100644 --- a/sdk/dns/arm-dns/src/operations/recordSets.ts +++ b/sdk/dns/arm-dns/src/operations/recordSets.ts @@ -1,65 +1,293 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/recordSetsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { RecordSets } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DnsManagementClientContext } from "../dnsManagementClientContext"; +import { DnsManagementClient } from "../dnsManagementClient"; +import { + RecordSet, + RecordType, + RecordSetsListByTypeNextOptionalParams, + RecordSetsListByTypeOptionalParams, + RecordSetsListByDnsZoneNextOptionalParams, + RecordSetsListByDnsZoneOptionalParams, + RecordSetsListAllByDnsZoneNextOptionalParams, + RecordSetsListAllByDnsZoneOptionalParams, + RecordSetsUpdateOptionalParams, + RecordSetsUpdateResponse, + RecordSetsCreateOrUpdateOptionalParams, + RecordSetsCreateOrUpdateResponse, + RecordSetsDeleteOptionalParams, + RecordSetsGetOptionalParams, + RecordSetsGetResponse, + RecordSetsListByTypeResponse, + RecordSetsListByDnsZoneResponse, + RecordSetsListAllByDnsZoneResponse, + RecordSetsListByTypeNextResponse, + RecordSetsListByDnsZoneNextResponse, + RecordSetsListAllByDnsZoneNextResponse +} from "../models"; -/** Class representing a RecordSets. */ -export class RecordSets { - private readonly client: DnsManagementClientContext; +/// +/** Class containing RecordSets operations. */ +export class RecordSetsImpl implements RecordSets { + private readonly client: DnsManagementClient; /** - * Create a RecordSets. - * @param {DnsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class RecordSets class. + * @param client Reference to the service client */ - constructor(client: DnsManagementClientContext) { + constructor(client: DnsManagementClient) { this.client = client; } /** - * Updates a record set within a DNS zone. + * Lists the record sets of a specified type in a DNS zone. * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', - * 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param parameters Parameters supplied to the Update operation. - * @param [options] The optional parameters - * @returns Promise + * @param recordType The type of record sets to enumerate. + * @param options The options parameters. */ - update(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, parameters: Models.RecordSet, options?: Models.RecordSetsUpdateOptionalParams): Promise; + public listByType( + resourceGroupName: string, + zoneName: string, + recordType: RecordType, + options?: RecordSetsListByTypeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByTypePagingAll( + resourceGroupName, + zoneName, + recordType, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByTypePagingPage( + resourceGroupName, + zoneName, + recordType, + options + ); + } + }; + } + + private async *listByTypePagingPage( + resourceGroupName: string, + zoneName: string, + recordType: RecordType, + options?: RecordSetsListByTypeOptionalParams + ): AsyncIterableIterator { + let result = await this._listByType( + resourceGroupName, + zoneName, + recordType, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByTypeNext( + resourceGroupName, + zoneName, + recordType, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByTypePagingAll( + resourceGroupName: string, + zoneName: string, + recordType: RecordType, + options?: RecordSetsListByTypeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByTypePagingPage( + resourceGroupName, + zoneName, + recordType, + options + )) { + yield* page; + } + } + /** + * Lists all record sets in a DNS zone. * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', - * 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param parameters Parameters supplied to the Update operation. - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, parameters: Models.RecordSet, callback: msRest.ServiceCallback): void; + public listByDnsZone( + resourceGroupName: string, + zoneName: string, + options?: RecordSetsListByDnsZoneOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDnsZonePagingAll( + resourceGroupName, + zoneName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDnsZonePagingPage( + resourceGroupName, + zoneName, + options + ); + } + }; + } + + private async *listByDnsZonePagingPage( + resourceGroupName: string, + zoneName: string, + options?: RecordSetsListByDnsZoneOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDnsZone( + resourceGroupName, + zoneName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDnsZoneNext( + resourceGroupName, + zoneName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDnsZonePagingAll( + resourceGroupName: string, + zoneName: string, + options?: RecordSetsListByDnsZoneOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDnsZonePagingPage( + resourceGroupName, + zoneName, + options + )) { + yield* page; + } + } + /** + * Lists all record sets in a DNS zone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + public listAllByDnsZone( + resourceGroupName: string, + zoneName: string, + options?: RecordSetsListAllByDnsZoneOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAllByDnsZonePagingAll( + resourceGroupName, + zoneName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAllByDnsZonePagingPage( + resourceGroupName, + zoneName, + options + ); + } + }; + } + + private async *listAllByDnsZonePagingPage( + resourceGroupName: string, + zoneName: string, + options?: RecordSetsListAllByDnsZoneOptionalParams + ): AsyncIterableIterator { + let result = await this._listAllByDnsZone( + resourceGroupName, + zoneName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAllByDnsZoneNext( + resourceGroupName, + zoneName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAllByDnsZonePagingAll( + resourceGroupName: string, + zoneName: string, + options?: RecordSetsListAllByDnsZoneOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAllByDnsZonePagingPage( + resourceGroupName, + zoneName, + options + )) { + yield* page; + } + } + + /** + * Updates a record set within a DNS zone. * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', - * 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. * @param parameters Parameters supplied to the Update operation. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, parameters: Models.RecordSet, options: Models.RecordSetsUpdateOptionalParams, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, parameters: Models.RecordSet, options?: Models.RecordSetsUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + zoneName: string, + relativeRecordSetName: string, + recordType: RecordType, + parameters: RecordSet, + options?: RecordSetsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -69,8 +297,8 @@ export class RecordSets { parameters, options }, - updateOperationSpec, - callback) as Promise; + updateOperationSpec + ); } /** @@ -78,38 +306,19 @@ export class RecordSets { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be - * updated but not created (they are created when the DNS zone is created). Possible values - * include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated + * but not created (they are created when the DNS zone is created). * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, parameters: Models.RecordSet, options?: Models.RecordSetsCreateOrUpdateOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be - * updated but not created (they are created when the DNS zone is created). Possible values - * include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, parameters: Models.RecordSet, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be - * updated but not created (they are created when the DNS zone is created). Possible values - * include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, parameters: Models.RecordSet, options: Models.RecordSetsCreateOrUpdateOptionalParams, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, parameters: Models.RecordSet, options?: Models.RecordSetsCreateOrUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + zoneName: string, + relativeRecordSetName: string, + recordType: RecordType, + parameters: RecordSet, + options?: RecordSetsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -119,8 +328,8 @@ export class RecordSets { parameters, options }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); } /** @@ -129,34 +338,16 @@ export class RecordSets { * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be - * deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', - * 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, options?: Models.RecordSetsDeleteMethodOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be - * deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', - * 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be - * deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', - * 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param options The optional parameters - * @param callback The callback + * deleted (they are deleted when the DNS zone is deleted). + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, options: Models.RecordSetsDeleteMethodOptionalParams, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, options?: Models.RecordSetsDeleteMethodOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + zoneName: string, + relativeRecordSetName: string, + recordType: RecordType, + options?: RecordSetsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -165,8 +356,8 @@ export class RecordSets { recordType, options }, - deleteMethodOperationSpec, - callback); + deleteOperationSpec + ); } /** @@ -174,32 +365,16 @@ export class RecordSets { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', - * 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', - * 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param callback The callback + * @param recordType The type of DNS record in this record set. + * @param options The options parameters. */ - get(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', - * 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, zoneName: string, relativeRecordSetName: string, recordType: Models.RecordType, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + zoneName: string, + relativeRecordSetName: string, + recordType: RecordType, + options?: RecordSetsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -208,224 +383,129 @@ export class RecordSets { recordType, options }, - getOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** * Lists the record sets of a specified type in a DNS zone. * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', - * 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param [options] The optional parameters - * @returns Promise - */ - listByType(resourceGroupName: string, zoneName: string, recordType: Models.RecordType, options?: Models.RecordSetsListByTypeOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', - * 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param callback The callback - */ - listByType(resourceGroupName: string, zoneName: string, recordType: Models.RecordType, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', - * 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - * @param options The optional parameters - * @param callback The callback + * @param recordType The type of record sets to enumerate. + * @param options The options parameters. */ - listByType(resourceGroupName: string, zoneName: string, recordType: Models.RecordType, options: Models.RecordSetsListByTypeOptionalParams, callback: msRest.ServiceCallback): void; - listByType(resourceGroupName: string, zoneName: string, recordType: Models.RecordType, options?: Models.RecordSetsListByTypeOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByType( + resourceGroupName: string, + zoneName: string, + recordType: RecordType, + options?: RecordSetsListByTypeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - zoneName, - recordType, - options - }, - listByTypeOperationSpec, - callback) as Promise; + { resourceGroupName, zoneName, recordType, options }, + listByTypeOperationSpec + ); } /** * Lists all record sets in a DNS zone. * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDnsZone(resourceGroupName: string, zoneName: string, options?: Models.RecordSetsListByDnsZoneOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param callback The callback - */ - listByDnsZone(resourceGroupName: string, zoneName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param options The optional parameters - * @param callback The callback - */ - listByDnsZone(resourceGroupName: string, zoneName: string, options: Models.RecordSetsListByDnsZoneOptionalParams, callback: msRest.ServiceCallback): void; - listByDnsZone(resourceGroupName: string, zoneName: string, options?: Models.RecordSetsListByDnsZoneOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDnsZone( + resourceGroupName: string, + zoneName: string, + options?: RecordSetsListByDnsZoneOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - zoneName, - options - }, - listByDnsZoneOperationSpec, - callback) as Promise; + { resourceGroupName, zoneName, options }, + listByDnsZoneOperationSpec + ); } /** * Lists all record sets in a DNS zone. * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param [options] The optional parameters - * @returns Promise - */ - listAllByDnsZone(resourceGroupName: string, zoneName: string, options?: Models.RecordSetsListAllByDnsZoneOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param callback The callback + * @param options The options parameters. */ - listAllByDnsZone(resourceGroupName: string, zoneName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param options The optional parameters - * @param callback The callback - */ - listAllByDnsZone(resourceGroupName: string, zoneName: string, options: Models.RecordSetsListAllByDnsZoneOptionalParams, callback: msRest.ServiceCallback): void; - listAllByDnsZone(resourceGroupName: string, zoneName: string, options?: Models.RecordSetsListAllByDnsZoneOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listAllByDnsZone( + resourceGroupName: string, + zoneName: string, + options?: RecordSetsListAllByDnsZoneOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - zoneName, - options - }, - listAllByDnsZoneOperationSpec, - callback) as Promise; + { resourceGroupName, zoneName, options }, + listAllByDnsZoneOperationSpec + ); } /** - * Lists the record sets of a specified type in a DNS zone. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByTypeNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByTypeNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByTypeNext + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @param nextLink The nextLink from the previous successful call to the ListByType method. + * @param options The options parameters. */ - listByTypeNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByTypeNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByTypeNext( + resourceGroupName: string, + zoneName: string, + recordType: RecordType, + nextLink: string, + options?: RecordSetsListByTypeNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByTypeNextOperationSpec, - callback) as Promise; + { resourceGroupName, zoneName, recordType, nextLink, options }, + listByTypeNextOperationSpec + ); } /** - * Lists all record sets in a DNS zone. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDnsZoneNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDnsZoneNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByDnsZoneNext + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param nextLink The nextLink from the previous successful call to the ListByDnsZone method. + * @param options The options parameters. */ - listByDnsZoneNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDnsZoneNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDnsZoneNext( + resourceGroupName: string, + zoneName: string, + nextLink: string, + options?: RecordSetsListByDnsZoneNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDnsZoneNextOperationSpec, - callback) as Promise; + { resourceGroupName, zoneName, nextLink, options }, + listByDnsZoneNextOperationSpec + ); } /** - * Lists all record sets in a DNS zone. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAllByDnsZoneNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAllByDnsZoneNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListAllByDnsZoneNext + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param nextLink The nextLink from the previous successful call to the ListAllByDnsZone method. + * @param options The options parameters. */ - listAllByDnsZoneNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAllByDnsZoneNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listAllByDnsZoneNext( + resourceGroupName: string, + zoneName: string, + nextLink: string, + options?: RecordSetsListAllByDnsZoneNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAllByDnsZoneNextOperationSpec, - callback) as Promise; + { resourceGroupName, zoneName, nextLink, options }, + listAllByDnsZoneNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const updateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}", httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.zoneName, - Parameters.relativeRecordSetName, - Parameters.recordType, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.ifMatch, - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RecordSet, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.RecordSet @@ -434,34 +514,28 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, Parameters.relativeRecordSetName, Parameters.recordType, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], headerParameters: [ - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.acceptLanguage + Parameters.contentType, + Parameters.accept, + Parameters.ifMatch ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RecordSet, - required: true - } - }, + mediaType: "json", + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.RecordSet @@ -473,26 +547,29 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, Parameters.relativeRecordSetName, Parameters.recordType, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], headerParameters: [ + Parameters.contentType, + Parameters.accept, Parameters.ifMatch, - Parameters.acceptLanguage + Parameters.ifNoneMatch ], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -500,25 +577,22 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, Parameters.relativeRecordSetName, Parameters.recordType, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.ifMatch], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RecordSet @@ -527,26 +601,22 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listByTypeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, + Parameters.relativeRecordSetName, Parameters.recordType, Parameters.subscriptionId ], - queryParameters: [ - Parameters.top, - Parameters.recordsetnamesuffix, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listByTypeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RecordSetListResult @@ -555,25 +625,25 @@ const listByTypeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listByDnsZoneOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/recordsets", + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.recordsetnamesuffix + ], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, + Parameters.recordType, Parameters.subscriptionId ], - queryParameters: [ - Parameters.top, - Parameters.recordsetnamesuffix, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDnsZoneOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/recordsets", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RecordSetListResult @@ -582,25 +652,24 @@ const listByDnsZoneOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listAllByDnsZoneOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/all", + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.recordsetnamesuffix + ], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.top, - Parameters.recordSetNameSuffix, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listAllByDnsZoneOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/all", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RecordSetListResult @@ -609,19 +678,23 @@ const listAllByDnsZoneOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.recordSetNameSuffix + ], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.zoneName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByTypeNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByTypeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RecordSetListResult @@ -630,19 +703,25 @@ const listByTypeNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.recordsetnamesuffix + ], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.zoneName, + Parameters.recordType, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDnsZoneNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDnsZoneNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RecordSetListResult @@ -651,19 +730,24 @@ const listByDnsZoneNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.recordsetnamesuffix + ], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.zoneName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listAllByDnsZoneNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAllByDnsZoneNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RecordSetListResult @@ -672,5 +756,18 @@ const listAllByDnsZoneNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.recordSetNameSuffix + ], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.zoneName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/dns/arm-dns/src/operations/zones.ts b/sdk/dns/arm-dns/src/operations/zones.ts index 950ecffd2349..0097cb60b7cf 100644 --- a/sdk/dns/arm-dns/src/operations/zones.ts +++ b/sdk/dns/arm-dns/src/operations/zones.ts @@ -1,111 +1,259 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/zonesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Zones } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DnsManagementClientContext } from "../dnsManagementClientContext"; +import { DnsManagementClient } from "../dnsManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Zone, + ZonesListByResourceGroupNextOptionalParams, + ZonesListByResourceGroupOptionalParams, + ZonesListNextOptionalParams, + ZonesListOptionalParams, + ZonesCreateOrUpdateOptionalParams, + ZonesCreateOrUpdateResponse, + ZonesDeleteOptionalParams, + ZonesGetOptionalParams, + ZonesGetResponse, + ZoneUpdate, + ZonesUpdateOptionalParams, + ZonesUpdateResponse, + ZonesListByResourceGroupResponse, + ZonesListResponse, + ZonesListByResourceGroupNextResponse, + ZonesListNextResponse +} from "../models"; -/** Class representing a Zones. */ -export class Zones { - private readonly client: DnsManagementClientContext; +/// +/** Class containing Zones operations. */ +export class ZonesImpl implements Zones { + private readonly client: DnsManagementClient; /** - * Create a Zones. - * @param {DnsManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Zones class. + * @param client Reference to the service client */ - constructor(client: DnsManagementClientContext) { + constructor(client: DnsManagementClient) { this.client = client; } /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. + * Lists the DNS zones within a resource group. * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, zoneName: string, parameters: Models.Zone, options?: Models.ZonesCreateOrUpdateOptionalParams): Promise; + public listByResourceGroup( + resourceGroupName: string, + options?: ZonesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ZonesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ZonesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param callback The callback + * Lists the DNS zones in all resource groups in a subscription. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, zoneName: string, parameters: Models.Zone, callback: msRest.ServiceCallback): void; + public list( + options?: ZonesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ZonesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: ZonesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** + * Creates or updates a DNS zone. Does not modify DNS records within the zone. * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, zoneName: string, parameters: Models.Zone, options: Models.ZonesCreateOrUpdateOptionalParams, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, zoneName: string, parameters: Models.Zone, options?: Models.ZonesCreateOrUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + zoneName: string, + parameters: Zone, + options?: ZonesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - zoneName, - parameters, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, zoneName, parameters, options }, + createOrUpdateOperationSpec + ); } /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation - * cannot be undone. + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot + * be undone. * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, zoneName: string, options?: Models.ZonesDeleteMethodOptionalParams): Promise { - return this.beginDeleteMethod(resourceGroupName,zoneName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDelete( + resourceGroupName: string, + zoneName: string, + options?: ZonesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, zoneName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot + * be undone. * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, zoneName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param callback The callback - */ - get(resourceGroupName: string, zoneName: string, callback: msRest.ServiceCallback): void; + async beginDeleteAndWait( + resourceGroupName: string, + zoneName: string, + options?: ZonesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(resourceGroupName, zoneName, options); + return poller.pollUntilDone(); + } + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, zoneName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, zoneName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + zoneName: string, + options?: ZonesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - zoneName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, zoneName, options }, + getOperationSpec + ); } /** @@ -113,190 +261,82 @@ export class Zones { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param parameters Parameters supplied to the Update operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update(resourceGroupName: string, zoneName: string, parameters: Models.ZoneUpdate, options?: Models.ZonesUpdateOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the Update operation. - * @param callback The callback - */ - update(resourceGroupName: string, zoneName: string, parameters: Models.ZoneUpdate, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the Update operation. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, zoneName: string, parameters: Models.ZoneUpdate, options: Models.ZonesUpdateOptionalParams, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, zoneName: string, parameters: Models.ZoneUpdate, options?: Models.ZonesUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + zoneName: string, + parameters: ZoneUpdate, + options?: ZonesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - zoneName, - parameters, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, zoneName, parameters, options }, + updateOperationSpec + ); } /** * Lists the DNS zones within a resource group. * @param resourceGroupName The name of the resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: Models.ZonesListByResourceGroupOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param callback The callback + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: Models.ZonesListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: Models.ZonesListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: ZonesListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** * Lists the DNS zones in all resource groups in a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: Models.ZonesListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(options: Models.ZonesListOptionalParams, callback: msRest.ServiceCallback): void; - list(options?: Models.ZonesListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + private _list(options?: ZonesListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation - * cannot be undone. + * ListByResourceGroupNext * @param resourceGroupName The name of the resource group. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteMethod(resourceGroupName: string, zoneName: string, options?: Models.ZonesBeginDeleteMethodOptionalParams): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - zoneName, - options - }, - beginDeleteMethodOperationSpec, - options); - } - - /** - * Lists the DNS zones within a resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ZonesListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } /** - * Lists the DNS zones in all resource groups in a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: ZonesListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.zoneName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.ifMatch, - Parameters.ifNoneMatch, - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Zone, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.Zone @@ -308,56 +348,50 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}", + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], headerParameters: [ - Parameters.acceptLanguage + Parameters.contentType, + Parameters.accept, + Parameters.ifMatch, + Parameters.ifNoneMatch ], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.Zone - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.ifMatch, - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ZoneUpdate, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.ifMatch], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Zone @@ -366,47 +400,48 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, + Parameters.zoneName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.top, - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.ZoneListResult + bodyMapper: Mappers.Zone }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Network/dnszones", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.zoneName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.top, - Parameters.apiVersion - ], headerParameters: [ - Parameters.acceptLanguage + Parameters.contentType, + Parameters.accept, + Parameters.ifMatch ], + mediaType: "json", + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ZoneListResult @@ -415,45 +450,34 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}", + queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.zoneName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.ifMatch, - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnszones", + httpMethod: "GET", responses: { - 200: {}, - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.ZoneListResult + }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ZoneListResult @@ -462,19 +486,19 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ZoneListResult @@ -483,5 +507,12 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/dns/arm-dns/src/operationsInterfaces/dnsResourceReferenceOperations.ts b/sdk/dns/arm-dns/src/operationsInterfaces/dnsResourceReferenceOperations.ts new file mode 100644 index 000000000000..397268fe0941 --- /dev/null +++ b/sdk/dns/arm-dns/src/operationsInterfaces/dnsResourceReferenceOperations.ts @@ -0,0 +1,26 @@ +/* + * 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 { + DnsResourceReferenceRequest, + DnsResourceReferenceGetByTargetResourcesOptionalParams, + DnsResourceReferenceGetByTargetResourcesResponse +} from "../models"; + +/** Interface representing a DnsResourceReferenceOperations. */ +export interface DnsResourceReferenceOperations { + /** + * Returns the DNS records specified by the referencing targetResourceIds. + * @param parameters Properties for dns resource reference request. + * @param options The options parameters. + */ + getByTargetResources( + parameters: DnsResourceReferenceRequest, + options?: DnsResourceReferenceGetByTargetResourcesOptionalParams + ): Promise; +} diff --git a/sdk/dns/arm-dns/src/operationsInterfaces/index.ts b/sdk/dns/arm-dns/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..249eca50d8e6 --- /dev/null +++ b/sdk/dns/arm-dns/src/operationsInterfaces/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./recordSets"; +export * from "./zones"; +export * from "./dnsResourceReferenceOperations"; diff --git a/sdk/dns/arm-dns/src/operationsInterfaces/recordSets.ts b/sdk/dns/arm-dns/src/operationsInterfaces/recordSets.ts new file mode 100644 index 000000000000..a3c98a9f173b --- /dev/null +++ b/sdk/dns/arm-dns/src/operationsInterfaces/recordSets.ts @@ -0,0 +1,129 @@ +/* + * 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 { + RecordSet, + RecordType, + RecordSetsListByTypeOptionalParams, + RecordSetsListByDnsZoneOptionalParams, + RecordSetsListAllByDnsZoneOptionalParams, + RecordSetsUpdateOptionalParams, + RecordSetsUpdateResponse, + RecordSetsCreateOrUpdateOptionalParams, + RecordSetsCreateOrUpdateResponse, + RecordSetsDeleteOptionalParams, + RecordSetsGetOptionalParams, + RecordSetsGetResponse +} from "../models"; + +/// +/** Interface representing a RecordSets. */ +export interface RecordSets { + /** + * Lists the record sets of a specified type in a DNS zone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @param options The options parameters. + */ + listByType( + resourceGroupName: string, + zoneName: string, + recordType: RecordType, + options?: RecordSetsListByTypeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all record sets in a DNS zone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + listByDnsZone( + resourceGroupName: string, + zoneName: string, + options?: RecordSetsListByDnsZoneOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all record sets in a DNS zone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + listAllByDnsZone( + resourceGroupName: string, + zoneName: string, + options?: RecordSetsListAllByDnsZoneOptionalParams + ): PagedAsyncIterableIterator; + /** + * Updates a record set within a DNS zone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param parameters Parameters supplied to the Update operation. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + zoneName: string, + relativeRecordSetName: string, + recordType: RecordType, + parameters: RecordSet, + options?: RecordSetsUpdateOptionalParams + ): Promise; + /** + * Creates or updates a record set within a DNS zone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated + * but not created (they are created when the DNS zone is created). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + zoneName: string, + relativeRecordSetName: string, + recordType: RecordType, + parameters: RecordSet, + options?: RecordSetsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a record set from a DNS zone. This operation cannot be undone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be + * deleted (they are deleted when the DNS zone is deleted). + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + zoneName: string, + relativeRecordSetName: string, + recordType: RecordType, + options?: RecordSetsDeleteOptionalParams + ): Promise; + /** + * Gets a record set. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param recordType The type of DNS record in this record set. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + zoneName: string, + relativeRecordSetName: string, + recordType: RecordType, + options?: RecordSetsGetOptionalParams + ): Promise; +} diff --git a/sdk/dns/arm-dns/src/operationsInterfaces/zones.ts b/sdk/dns/arm-dns/src/operationsInterfaces/zones.ts new file mode 100644 index 000000000000..2de4bd98877a --- /dev/null +++ b/sdk/dns/arm-dns/src/operationsInterfaces/zones.ts @@ -0,0 +1,103 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Zone, + ZonesListByResourceGroupOptionalParams, + ZonesListOptionalParams, + ZonesCreateOrUpdateOptionalParams, + ZonesCreateOrUpdateResponse, + ZonesDeleteOptionalParams, + ZonesGetOptionalParams, + ZonesGetResponse, + ZoneUpdate, + ZonesUpdateOptionalParams, + ZonesUpdateResponse +} from "../models"; + +/// +/** Interface representing a Zones. */ +export interface Zones { + /** + * Lists the DNS zones within a resource group. + * @param resourceGroupName The name of the resource group. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ZonesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the DNS zones in all resource groups in a subscription. + * @param options The options parameters. + */ + list(options?: ZonesListOptionalParams): PagedAsyncIterableIterator; + /** + * Creates or updates a DNS zone. Does not modify DNS records within the zone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + zoneName: string, + parameters: Zone, + options?: ZonesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot + * be undone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + zoneName: string, + options?: ZonesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot + * be undone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + zoneName: string, + options?: ZonesDeleteOptionalParams + ): Promise; + /** + * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + get( + resourceGroupName: string, + zoneName: string, + options?: ZonesGetOptionalParams + ): Promise; + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + zoneName: string, + parameters: ZoneUpdate, + options?: ZonesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/dns/arm-dns/test/sampleTest.ts b/sdk/dns/arm-dns/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/dns/arm-dns/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/dns/arm-dns/tsconfig.json b/sdk/dns/arm-dns/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/dns/arm-dns/tsconfig.json +++ b/sdk/dns/arm-dns/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/dns/ci.yml b/sdk/dns/ci.yml new file mode 100644 index 000000000000..c9dd450f5a9b --- /dev/null +++ b/sdk/dns/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/dns/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/dns/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: dns + Artifacts: + - name: azure-arm-dns + safeName: azurearmdns + \ No newline at end of file