From eacf39c48816651c4fdc46b2868ee2715d0e67d7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 28 Apr 2022 07:25:18 +0000 Subject: [PATCH] CodeGen from PR 18746 in Azure/azure-rest-api-specs update-resources-typescript.md (#18746) --- common/config/rush/pnpm-lock.yaml | 167 +++++----- rush.json | 9 +- sdk/changes/arm-changes/CHANGELOG.md | 5 + sdk/changes/arm-changes/LICENSE | 21 ++ sdk/changes/arm-changes/README.md | 98 ++++++ sdk/changes/arm-changes/_meta.json | 8 + sdk/changes/arm-changes/api-extractor.json | 31 ++ sdk/changes/arm-changes/package.json | 100 ++++++ .../arm-changes/review/arm-changes.api.md | 139 ++++++++ sdk/changes/arm-changes/rollup.config.js | 188 +++++++++++ sdk/changes/arm-changes/src/changesClient.ts | 76 +++++ sdk/changes/arm-changes/src/index.ts | 12 + sdk/changes/arm-changes/src/models/index.ts | 213 ++++++++++++ sdk/changes/arm-changes/src/models/mappers.ts | 307 ++++++++++++++++++ .../arm-changes/src/models/parameters.ts | 152 +++++++++ .../arm-changes/src/operations/changes.ts | 297 +++++++++++++++++ .../arm-changes/src/operations/index.ts | 9 + .../src/operationsInterfaces/changes.ts | 52 +++ .../src/operationsInterfaces/index.ts | 9 + sdk/changes/arm-changes/test/sampleTest.ts | 48 +++ sdk/changes/arm-changes/tsconfig.json | 35 ++ sdk/changes/ci.mgmt.yml | 38 +++ 22 files changed, 1939 insertions(+), 75 deletions(-) create mode 100644 sdk/changes/arm-changes/CHANGELOG.md create mode 100644 sdk/changes/arm-changes/LICENSE create mode 100644 sdk/changes/arm-changes/README.md create mode 100644 sdk/changes/arm-changes/_meta.json create mode 100644 sdk/changes/arm-changes/api-extractor.json create mode 100644 sdk/changes/arm-changes/package.json create mode 100644 sdk/changes/arm-changes/review/arm-changes.api.md create mode 100644 sdk/changes/arm-changes/rollup.config.js create mode 100644 sdk/changes/arm-changes/src/changesClient.ts create mode 100644 sdk/changes/arm-changes/src/index.ts create mode 100644 sdk/changes/arm-changes/src/models/index.ts create mode 100644 sdk/changes/arm-changes/src/models/mappers.ts create mode 100644 sdk/changes/arm-changes/src/models/parameters.ts create mode 100644 sdk/changes/arm-changes/src/operations/changes.ts create mode 100644 sdk/changes/arm-changes/src/operations/index.ts create mode 100644 sdk/changes/arm-changes/src/operationsInterfaces/changes.ts create mode 100644 sdk/changes/arm-changes/src/operationsInterfaces/index.ts create mode 100644 sdk/changes/arm-changes/test/sampleTest.ts create mode 100644 sdk/changes/arm-changes/tsconfig.json create mode 100644 sdk/changes/ci.mgmt.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 6102a61c687d..5aca9cb03a74 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -30,6 +30,7 @@ specifiers: '@rush-temp/arm-botservice': file:./projects/arm-botservice.tgz '@rush-temp/arm-cdn': file:./projects/arm-cdn.tgz '@rush-temp/arm-changeanalysis': file:./projects/arm-changeanalysis.tgz + '@rush-temp/arm-changes': file:./projects/arm-changes.tgz '@rush-temp/arm-cognitiveservices': file:./projects/arm-cognitiveservices.tgz '@rush-temp/arm-commerce': file:./projects/arm-commerce.tgz '@rush-temp/arm-commerce-profile-2020-09-01-hybrid': file:./projects/arm-commerce-profile-2020-09-01-hybrid.tgz @@ -305,6 +306,7 @@ dependencies: '@rush-temp/arm-botservice': file:projects/arm-botservice.tgz '@rush-temp/arm-cdn': file:projects/arm-cdn.tgz '@rush-temp/arm-changeanalysis': file:projects/arm-changeanalysis.tgz + '@rush-temp/arm-changes': file:projects/arm-changes.tgz '@rush-temp/arm-cognitiveservices': file:projects/arm-cognitiveservices.tgz '@rush-temp/arm-commerce': file:projects/arm-commerce.tgz '@rush-temp/arm-commerce-profile-2020-09-01-hybrid': file:projects/arm-commerce-profile-2020-09-01-hybrid.tgz @@ -9840,6 +9842,33 @@ packages: - supports-color dev: false + file:projects/arm-changes.tgz: + resolution: {integrity: sha512-2A3RshQ4JTcTE9Nkayn1IQM2pgu52hs8/HSJ+JHKFr4z84jSTOjUnmLz6I+sAbB1ueKjSlKGGRgBRfNoK7igMA==, tarball: file:projects/arm-changes.tgz} + name: '@rush-temp/arm-changes' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@azure/identity': 2.0.4 + '@microsoft/api-extractor': 7.22.1 + '@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.15.4 + transitivePeerDependencies: + - debug + - encoding + - supports-color + dev: false + file:projects/arm-cognitiveservices.tgz: resolution: {integrity: sha512-qRWhhPLtY+lfmRCzhOu3ZmyHFqghatlowWp5E0tWr0ck8fae0/EqwGhJT2lmpRoyMD8GwPoj/c0Fy6wLaiblKg==, tarball: file:projects/arm-cognitiveservices.tgz} name: '@rush-temp/arm-cognitiveservices' @@ -10149,7 +10178,7 @@ packages: dev: false file:projects/arm-containerservice.tgz: - resolution: {integrity: sha512-MM6SBcyllKbFydeqZTykiHih27ja4Ioj7mavWtZ4NVj7nK88flo7uelRlLlu+uUpJ3ZQLpPARq+VQ3dulZKaMA==, tarball: file:projects/arm-containerservice.tgz} + resolution: {integrity: sha512-ydzxfNP0RKW/IMAJIOMPMAr38GWiOKPriHKATazJlcETiAn2mfHAXrPj/5YZTe7/Cvh4anicieTseoA2LUf7Nw==, tarball: file:projects/arm-containerservice.tgz} name: '@rush-temp/arm-containerservice' version: 0.0.0 dependencies: @@ -10902,28 +10931,27 @@ packages: dev: false file:projects/arm-features.tgz: - resolution: {integrity: sha512-koQB0eiTj4i4mpQQo+oM4b7D4L/dLlBH5MVN4B+P6W+q+aZb2gJXnUtqsisvl+hqMHUP6hPxKN9MyuhACUZTng==, tarball: file:projects/arm-features.tgz} + resolution: {integrity: sha512-seh2WpPJ8BoEP/3UtSi8DrBkSDW5k41eLs8d/Qxed25F/AmcwMZEP9fyDHxbFE0n8YhE3tjtS3EmGYwZy83pHw==, tarball: file:projects/arm-features.tgz} name: '@rush-temp/arm-features' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 + '@microsoft/api-extractor': 7.22.1 + '@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: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + 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.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color @@ -11407,28 +11435,27 @@ packages: dev: false file:projects/arm-links.tgz: - resolution: {integrity: sha512-aKiMEyhgNzp2uO6X9Axy3v8+I94B2o5DAa1v3+HWsDc8A/5XbBs3Jned7WOm/4ngqlziQA4vFywQ9QeEvtzQFQ==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-u5K/78lQo8Mea0XUlUL+GETL0pWC64zJ2Rj0ZyVpyPC5w/TC4FWMnVOqkrXDadQV7iBl3xXHx6Y9ueTztz3VFA==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 + '@microsoft/api-extractor': 7.22.1 + '@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: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + 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.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color @@ -11491,28 +11518,27 @@ packages: dev: false file:projects/arm-locks.tgz: - resolution: {integrity: sha512-7KM4vQCCbyWcab2W8c20NoCTeCgCyUoFok1I1SHyiCbizm+tH6K46AD0tYHJM/kxmqudivJzxM247ESyo4odTg==, tarball: file:projects/arm-locks.tgz} + resolution: {integrity: sha512-KLDGpZVb12CRM+s+KKScSssY0Y0P2NxJb1v/4IXGOtOBahYpbmUgqvphUOB3DPhNH52LyQ/jqoJeGiV1Ohkx2w==, tarball: file:projects/arm-locks.tgz} name: '@rush-temp/arm-locks' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 + '@microsoft/api-extractor': 7.22.1 + '@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: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + 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.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color @@ -11630,28 +11656,27 @@ packages: dev: false file:projects/arm-managedapplications.tgz: - resolution: {integrity: sha512-Ae7b+w5w8IF29B7dfC1xaVlwO+1CLRSI1agwbPv2hBu/lchiHJuOmYKPS8/6myIM2MZltBqjLicn/chIzHXRgQ==, tarball: file:projects/arm-managedapplications.tgz} + resolution: {integrity: sha512-ESNBiXG4ME4FyO7omVHkss9ZQQ0Xs1idGQj7+ROOsAcHZY9ZDQqqeDGBzlW7j3luhZU7kq7lTDw/x6iHkuDAIQ==, tarball: file:projects/arm-managedapplications.tgz} name: '@rush-temp/arm-managedapplications' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 + '@microsoft/api-extractor': 7.22.1 + '@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: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + 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.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color @@ -12323,28 +12348,27 @@ packages: dev: false file:projects/arm-policy.tgz: - resolution: {integrity: sha512-iSUVJXAlWs5sKsoQ4uu0TcF3D9AjFq8Kf3m6SCxefLvh+j3wWPJ6vLcGE8rXgVoi5Pyl+pgJZ//n4YfNS5K4/w==, tarball: file:projects/arm-policy.tgz} + resolution: {integrity: sha512-EG0S5PlxbR8ocu9bOg8uK7reHAGpLft+pomreXRrKEK8UG8OKmKUF7oYZ90M7VwND7sYhyyfglAvWpYazsM6Rw==, tarball: file:projects/arm-policy.tgz} name: '@rush-temp/arm-policy' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 + '@microsoft/api-extractor': 7.22.1 + '@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: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + 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.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color @@ -12896,56 +12920,54 @@ packages: dev: false file:projects/arm-resources-subscriptions.tgz: - resolution: {integrity: sha512-ajIKIo1wNiuaRAE2pzPY8FkB6TfD2oQQyj5Lso9u3ccmqoJiFmIF4xEbOIYQ32rkBuAzWiVLfGoWgLNSVzHASQ==, tarball: file:projects/arm-resources-subscriptions.tgz} + resolution: {integrity: sha512-M0QFJRWxjf9yZbEnC2khio6l/l7Yn2S9AlmzQwzguJESYpUoyV5TXOpsKqcQ8HU5qbE0oBpLXqYX/f82GZoTGQ==, tarball: file:projects/arm-resources-subscriptions.tgz} name: '@rush-temp/arm-resources-subscriptions' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 + '@microsoft/api-extractor': 7.22.1 + '@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: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + 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.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color dev: false file:projects/arm-resources.tgz: - resolution: {integrity: sha512-epl4txrifrImepCL/xH7kk1Xo2X10yGZJOFBm0C6gRiuF7smFfbqqUQm+7aEbh3QC8f1FM6Wb97zESnQRwzqAA==, tarball: file:projects/arm-resources.tgz} + resolution: {integrity: sha512-aLyB9+Cme0GYjVkv6MUgwJHkgJCujzuu+fZZnUE/0On3Ac73AizM0R9zkL8nfVPzzGJBh00UaGZPR5B9NEFWxg==, tarball: file:projects/arm-resources.tgz} name: '@rush-temp/arm-resources' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 + '@microsoft/api-extractor': 7.22.1 + '@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: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + 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.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color @@ -13582,28 +13604,27 @@ packages: dev: false file:projects/arm-templatespecs.tgz: - resolution: {integrity: sha512-nCCIxGrlUhe08M2vSmRUolW0g+aoL8z9UHPnVCbpCUm9/PT2rxbS3zkOC8uy3DZm6wqNXpMTvM8PET33BxH0UQ==, tarball: file:projects/arm-templatespecs.tgz} + resolution: {integrity: sha512-rmVk8IeXhRp7wolZMEv5+Le3zR+eNVJru/hrRrFB45tJ+trrc9F3xiDzM/K2U4VL8DmqJaI+panvcv53ZHfoZA==, tarball: file:projects/arm-templatespecs.tgz} name: '@rush-temp/arm-templatespecs' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 + '@microsoft/api-extractor': 7.22.1 + '@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: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + 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.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color diff --git a/rush.json b/rush.json index bd411d069611..607492be7300 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -1685,6 +1685,11 @@ "packageName": "@azure/arm-azureadexternalidentities", "projectFolder": "sdk/azureadexternalidentities/arm-azureadexternalidentities", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-changes", + "projectFolder": "sdk/changes/arm-changes", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/changes/arm-changes/CHANGELOG.md b/sdk/changes/arm-changes/CHANGELOG.md new file mode 100644 index 000000000000..af030a4f40b6 --- /dev/null +++ b/sdk/changes/arm-changes/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0 (2022-04-28) + +The package of @azure/arm-changes is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/changes/arm-changes/LICENSE b/sdk/changes/arm-changes/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/changes/arm-changes/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/changes/arm-changes/README.md b/sdk/changes/arm-changes/README.md new file mode 100644 index 000000000000..ad1f75c1a530 --- /dev/null +++ b/sdk/changes/arm-changes/README.md @@ -0,0 +1,98 @@ +# Azure Changes client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Changes client. + +The Resource Changes Client + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/changes/arm-changes) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-changes) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-changes) | +[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. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-changes` package + +Install the Azure Changes client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-changes +``` + +### Create and authenticate a `ChangesClient` + +To create a client object to access the Azure Changes API, you will need the `endpoint` of your Azure Changes resource and a `credential`. The Azure Changes client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Changes resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure Changes** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { ChangesClient } = require("@azure/arm-changes"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ChangesClient(new DefaultAzureCredential(), subscriptionId); +``` + + +### 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 + +### ChangesClient + +`ChangesClient` is the primary interface for developers using the Azure Changes client library. Explore the methods on this client object to understand the different features of the Azure Changes 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) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fchanges%2Farm-changes%2FREADME.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/changes/arm-changes/_meta.json b/sdk/changes/arm-changes/_meta.json new file mode 100644 index 000000000000..10811a95f14a --- /dev/null +++ b/sdk/changes/arm-changes/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "49908d3350037fff4c52a04b577f7849f5663cdb", + "readme": "specification/resources/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" +} \ No newline at end of file diff --git a/sdk/changes/arm-changes/api-extractor.json b/sdk/changes/arm-changes/api-extractor.json new file mode 100644 index 000000000000..56ec3ae5911b --- /dev/null +++ b/sdk/changes/arm-changes/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$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-changes.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/changes/arm-changes/package.json b/sdk/changes/arm-changes/package.json new file mode 100644 index 000000000000..ad38d61a8b31 --- /dev/null +++ b/sdk/changes/arm-changes/package.json @@ -0,0 +1,100 @@ +{ + "name": "@azure/arm-changes", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for ChangesClient.", + "version": "1.0.0", + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "@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" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-changes.d.ts", + "devDependencies": { + "@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", + "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/changes/arm-changes", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.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", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "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 +} \ No newline at end of file diff --git a/sdk/changes/arm-changes/review/arm-changes.api.md b/sdk/changes/arm-changes/review/arm-changes.api.md new file mode 100644 index 000000000000..e0c44a59b547 --- /dev/null +++ b/sdk/changes/arm-changes/review/arm-changes.api.md @@ -0,0 +1,139 @@ +## API Report File for "@azure/arm-changes" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; + +// @public +export interface ChangeAttributes { + readonly changesCount?: number; + readonly correlationId?: string; + readonly newResourceSnapshotId?: string; + readonly previousResourceSnapshotId?: string; + readonly timestamp?: string; +} + +// @public +export interface ChangeBase { + readonly changeCategory?: ChangeCategory; + readonly newValue?: string; + readonly previousValue?: string; + readonly propertyChangeType?: PropertyChangeType; +} + +// @public +export type ChangeCategory = "User" | "System"; + +// @public +export interface ChangeProperties { + changeAttributes?: ChangeAttributes; + changes?: { + [propertyName: string]: ChangeBase; + }; + readonly changeType?: ChangeType; + readonly targetResourceId?: string; + readonly targetResourceType?: string; +} + +// @public +export interface ChangeResourceListResult { + nextLink?: string; + value?: ChangeResourceResult[]; +} + +// @public +export type ChangeResourceResult = Resource & { + properties?: ChangeProperties; +}; + +// @public +export interface Changes { + get(resourceGroupName: string, resourceProviderNamespace: string, resourceType: string, resourceName: string, changeResourceId: string, options?: ChangesGetOptionalParams): Promise; + list(resourceGroupName: string, resourceProviderNamespace: string, resourceType: string, resourceName: string, options?: ChangesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public (undocumented) +export class ChangesClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ChangesClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + changes: Changes; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface ChangesClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface ChangesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ChangesGetResponse = ChangeResourceResult; + +// @public +export interface ChangesListNextOptionalParams extends coreClient.OperationOptions { + skipToken?: string; + top?: number; +} + +// @public +export type ChangesListNextResponse = ChangeResourceListResult; + +// @public +export interface ChangesListOptionalParams extends coreClient.OperationOptions { + skipToken?: string; + top?: number; +} + +// @public +export type ChangesListResponse = ChangeResourceListResult; + +// @public +export type ChangeType = "Update" | "Delete" | "Create"; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export type PropertyChangeType = "Update" | "Insert" | "Remove"; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/changes/arm-changes/rollup.config.js b/sdk/changes/arm-changes/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/changes/arm-changes/rollup.config.js @@ -0,0 +1,188 @@ +/* + * 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 + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export 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/changes/arm-changes/src/changesClient.ts b/sdk/changes/arm-changes/src/changesClient.ts new file mode 100644 index 000000000000..d05f38487a42 --- /dev/null +++ b/sdk/changes/arm-changes/src/changesClient.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { ChangesImpl } from "./operations"; +import { Changes } from "./operationsInterfaces"; +import { ChangesClientOptionalParams } from "./models"; + +export class ChangesClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the ChangesClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000) + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: ChangesClientOptionalParams + ) { + 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: ChangesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-changes/1.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + 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 || "2022-05-01"; + this.changes = new ChangesImpl(this); + } + + changes: Changes; +} diff --git a/sdk/changes/arm-changes/src/index.ts b/sdk/changes/arm-changes/src/index.ts new file mode 100644 index 000000000000..7822d9ec3252 --- /dev/null +++ b/sdk/changes/arm-changes/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 { ChangesClient } from "./changesClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/changes/arm-changes/src/models/index.ts b/sdk/changes/arm-changes/src/models/index.ts new file mode 100644 index 000000000000..94550c004b2f --- /dev/null +++ b/sdk/changes/arm-changes/src/models/index.ts @@ -0,0 +1,213 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +/** The list of resources */ +export interface ChangeResourceListResult { + /** The link used to get the next page of Change Resources */ + nextLink?: string; + /** The list of resources */ + value?: ChangeResourceResult[]; +} + +/** The properties of a change */ +export interface ChangeProperties { + /** + * The fully qualified ID of the target resource that was changed + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetResourceId?: string; + /** + * The namespace and type of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetResourceType?: string; + /** + * The type of change that was captured in the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly changeType?: ChangeType; + /** Details about the change resource */ + changeAttributes?: ChangeAttributes; + /** A dictionary with changed property name as a key and the change details as the value */ + changes?: { [propertyName: string]: ChangeBase }; +} + +/** Details about the change resource */ +export interface ChangeAttributes { + /** + * The ARM correlation ID of the change resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly correlationId?: string; + /** + * The time the change(s) on the target resource ocurred + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly timestamp?: string; + /** + * The number of changes this resource captures + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly changesCount?: number; + /** + * The GUID of the previous snapshot + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly previousResourceSnapshotId?: string; + /** + * The GUID of the new snapshot + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly newResourceSnapshotId?: string; +} + +/** An individual change on the target resource */ +export interface ChangeBase { + /** + * The type of change that occurred + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly propertyChangeType?: PropertyChangeType; + /** + * The entity that made the change + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly changeCategory?: ChangeCategory; + /** + * The target resource property value before the change + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly previousValue?: string; + /** + * The target resource property value after the change + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly newValue?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** Change Resource */ +export type ChangeResourceResult = Resource & { + /** The properties of a change */ + properties?: ChangeProperties; +}; +/** Defines values for ChangeType. */ +export type ChangeType = "Update" | "Delete" | "Create"; +/** Defines values for PropertyChangeType. */ +export type PropertyChangeType = "Update" | "Insert" | "Remove"; +/** Defines values for ChangeCategory. */ +export type ChangeCategory = "User" | "System"; + +/** Optional parameters. */ +export interface ChangesListOptionalParams extends coreClient.OperationOptions { + /** (Optional) Set the maximum number of results per response. */ + top?: number; + /** (Optional) The page-continuation token */ + skipToken?: string; +} + +/** Contains response data for the list operation. */ +export type ChangesListResponse = ChangeResourceListResult; + +/** Optional parameters. */ +export interface ChangesGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ChangesGetResponse = ChangeResourceResult; + +/** Optional parameters. */ +export interface ChangesListNextOptionalParams + extends coreClient.OperationOptions { + /** (Optional) Set the maximum number of results per response. */ + top?: number; + /** (Optional) The page-continuation token */ + skipToken?: string; +} + +/** Contains response data for the listNext operation. */ +export type ChangesListNextResponse = ChangeResourceListResult; + +/** Optional parameters. */ +export interface ChangesClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/changes/arm-changes/src/models/mappers.ts b/sdk/changes/arm-changes/src/models/mappers.ts new file mode 100644 index 000000000000..440d71224353 --- /dev/null +++ b/sdk/changes/arm-changes/src/models/mappers.ts @@ -0,0 +1,307 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +export const ChangeResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChangeResourceListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ChangeResourceResult" + } + } + } + } + } + } +}; + +export const ChangeProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChangeProperties", + modelProperties: { + targetResourceId: { + serializedName: "targetResourceId", + readOnly: true, + type: { + name: "String" + } + }, + targetResourceType: { + serializedName: "targetResourceType", + readOnly: true, + type: { + name: "String" + } + }, + changeType: { + serializedName: "changeType", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Update", "Delete", "Create"] + } + }, + changeAttributes: { + serializedName: "changeAttributes", + type: { + name: "Composite", + className: "ChangeAttributes" + } + }, + changes: { + serializedName: "changes", + type: { + name: "Dictionary", + value: { type: { name: "Composite", className: "ChangeBase" } } + } + } + } + } +}; + +export const ChangeAttributes: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChangeAttributes", + modelProperties: { + correlationId: { + serializedName: "correlationId", + readOnly: true, + type: { + name: "String" + } + }, + timestamp: { + serializedName: "timestamp", + readOnly: true, + type: { + name: "String" + } + }, + changesCount: { + serializedName: "changesCount", + readOnly: true, + type: { + name: "Number" + } + }, + previousResourceSnapshotId: { + serializedName: "previousResourceSnapshotId", + readOnly: true, + type: { + name: "String" + } + }, + newResourceSnapshotId: { + serializedName: "newResourceSnapshotId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ChangeBase: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChangeBase", + modelProperties: { + propertyChangeType: { + serializedName: "propertyChangeType", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Update", "Insert", "Remove"] + } + }, + changeCategory: { + serializedName: "changeCategory", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["User", "System"] + } + }, + previousValue: { + serializedName: "previousValue", + readOnly: true, + type: { + name: "String" + } + }, + newValue: { + serializedName: "newValue", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const ChangeResourceResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChangeResourceResult", + modelProperties: { + ...Resource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ChangeProperties" + } + } + } + } +}; diff --git a/sdk/changes/arm-changes/src/models/parameters.ts b/sdk/changes/arm-changes/src/models/parameters.ts new file mode 100644 index 000000000000..8d270640fffc --- /dev/null +++ b/sdk/changes/arm-changes/src/models/parameters.ts @@ -0,0 +1,152 @@ +/* + * 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 { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceProviderNamespace: OperationURLParameter = { + parameterPath: "resourceProviderNamespace", + mapper: { + serializedName: "resourceProviderNamespace", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceType: OperationURLParameter = { + parameterPath: "resourceType", + mapper: { + serializedName: "resourceType", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceName: OperationURLParameter = { + parameterPath: "resourceName", + mapper: { + serializedName: "resourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-05-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], + mapper: { + defaultValue: 100, + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, + serializedName: "$top", + type: { + name: "Number" + } + } +}; + +export const skipToken: OperationQueryParameter = { + parameterPath: ["options", "skipToken"], + mapper: { + serializedName: "$skipToken", + type: { + name: "String" + } + } +}; + +export const changeResourceId: OperationURLParameter = { + parameterPath: "changeResourceId", + mapper: { + serializedName: "changeResourceId", + required: true, + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; diff --git a/sdk/changes/arm-changes/src/operations/changes.ts b/sdk/changes/arm-changes/src/operations/changes.ts new file mode 100644 index 000000000000..60ddbb71005f --- /dev/null +++ b/sdk/changes/arm-changes/src/operations/changes.ts @@ -0,0 +1,297 @@ +/* + * 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 { Changes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ChangesClient } from "../changesClient"; +import { + ChangeResourceResult, + ChangesListNextOptionalParams, + ChangesListOptionalParams, + ChangesListResponse, + ChangesGetOptionalParams, + ChangesGetResponse, + ChangesListNextResponse +} from "../models"; + +/// +/** Class containing Changes operations. */ +export class ChangesImpl implements Changes { + private readonly client: ChangesClient; + + /** + * Initialize a new instance of the class Changes class. + * @param client Reference to the service client + */ + constructor(client: ChangesClient) { + this.client = client; + } + + /** + * Obtains a list of change resources from the past 14 days for the target resource + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The name of the resource provider namespace. + * @param resourceType The name of the resource type. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + resourceProviderNamespace: string, + resourceType: string, + resourceName: string, + options?: ChangesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + resourceProviderNamespace: string, + resourceType: string, + resourceName: string, + options?: ChangesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + resourceProviderNamespace: string, + resourceType: string, + resourceName: string, + options?: ChangesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + options + )) { + yield* page; + } + } + + /** + * Obtains a list of change resources from the past 14 days for the target resource + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The name of the resource provider namespace. + * @param resourceType The name of the resource type. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + resourceProviderNamespace: string, + resourceType: string, + resourceName: string, + options?: ChangesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + options + }, + listOperationSpec + ); + } + + /** + * Obtains the specified change resource for the target resource + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The name of the resource provider namespace. + * @param resourceType The name of the resource type. + * @param resourceName The name of the resource. + * @param changeResourceId The ID of the change resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceProviderNamespace: string, + resourceType: string, + resourceName: string, + changeResourceId: string, + options?: ChangesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + changeResourceId, + options + }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The name of the resource provider namespace. + * @param resourceType The name of the resource type. + * @param resourceName The name of the resource. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + resourceProviderNamespace: string, + resourceType: string, + resourceName: string, + nextLink: string, + options?: ChangesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + nextLink, + options + }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ChangeResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.resourceType, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes/{changeResourceId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ChangeResourceResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.resourceType, + Parameters.resourceName, + Parameters.changeResourceId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ChangeResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.resourceType, + Parameters.resourceName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/changes/arm-changes/src/operations/index.ts b/sdk/changes/arm-changes/src/operations/index.ts new file mode 100644 index 000000000000..c59e4d102e7e --- /dev/null +++ b/sdk/changes/arm-changes/src/operations/index.ts @@ -0,0 +1,9 @@ +/* + * 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 "./changes"; diff --git a/sdk/changes/arm-changes/src/operationsInterfaces/changes.ts b/sdk/changes/arm-changes/src/operationsInterfaces/changes.ts new file mode 100644 index 000000000000..b873985b4b21 --- /dev/null +++ b/sdk/changes/arm-changes/src/operationsInterfaces/changes.ts @@ -0,0 +1,52 @@ +/* + * 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 { + ChangeResourceResult, + ChangesListOptionalParams, + ChangesGetOptionalParams, + ChangesGetResponse +} from "../models"; + +/// +/** Interface representing a Changes. */ +export interface Changes { + /** + * Obtains a list of change resources from the past 14 days for the target resource + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The name of the resource provider namespace. + * @param resourceType The name of the resource type. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceProviderNamespace: string, + resourceType: string, + resourceName: string, + options?: ChangesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Obtains the specified change resource for the target resource + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The name of the resource provider namespace. + * @param resourceType The name of the resource type. + * @param resourceName The name of the resource. + * @param changeResourceId The ID of the change resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceProviderNamespace: string, + resourceType: string, + resourceName: string, + changeResourceId: string, + options?: ChangesGetOptionalParams + ): Promise; +} diff --git a/sdk/changes/arm-changes/src/operationsInterfaces/index.ts b/sdk/changes/arm-changes/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..c59e4d102e7e --- /dev/null +++ b/sdk/changes/arm-changes/src/operationsInterfaces/index.ts @@ -0,0 +1,9 @@ +/* + * 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 "./changes"; diff --git a/sdk/changes/arm-changes/test/sampleTest.ts b/sdk/changes/arm-changes/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/changes/arm-changes/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/changes/arm-changes/tsconfig.json b/sdk/changes/arm-changes/tsconfig.json new file mode 100644 index 000000000000..1d8c9012bfbd --- /dev/null +++ b/sdk/changes/arm-changes/tsconfig.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/changes/ci.mgmt.yml b/sdk/changes/ci.mgmt.yml new file mode 100644 index 000000000000..a0696f6a6ef4 --- /dev/null +++ b/sdk/changes/ci.mgmt.yml @@ -0,0 +1,38 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/changes/arm-changes + - sdk/changes/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/changes/arm-changes + - sdk/changes/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: changes + Artifacts: + - name: azure-arm-changes + safeName: azurearmchanges + \ No newline at end of file