From 22aacbab1621ebf54fd725648e920e689df07827 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 17 May 2023 06:03:55 +0000 Subject: [PATCH] CodeGen from PR 24027 in Azure/azure-rest-api-specs Merge 3f74606b001469feb5b68d0196a1f4e925cda94a into 5d2adf9b7fda669b4a2538c65e937ee74fe3f966 --- common/config/rush/pnpm-lock.yaml | 64 ++++++++-------- .../arm-graphservices/CHANGELOG.md | 15 ---- .../arm-graphservices/_meta.json | 8 +- .../arm-graphservices/assets.json | 6 -- .../arm-graphservices/package.json | 14 +--- .../accountCreateAndUpdateSample.ts | 48 ------------ .../samples-dev/accountDeleteSample.ts | 40 ---------- .../samples-dev/accountGetSample.ts | 40 ---------- .../samples-dev/accountUpdateSample.ts | 47 ------------ .../accountsListByResourceGroupSample.ts | 44 ----------- .../accountsListBySubscriptionSample.ts | 40 ---------- .../samples-dev/operationListSample.ts | 40 ---------- .../samples/v1-beta/javascript/README.md | 62 --------------- .../accountCreateAndUpdateSample.js | 44 ----------- .../v1-beta/javascript/accountDeleteSample.js | 36 --------- .../v1-beta/javascript/accountGetSample.js | 36 --------- .../v1-beta/javascript/accountUpdateSample.js | 39 ---------- .../accountsListByResourceGroupSample.js | 38 ---------- .../accountsListBySubscriptionSample.js | 37 --------- .../v1-beta/javascript/operationListSample.js | 37 --------- .../samples/v1-beta/javascript/package.json | 32 -------- .../samples/v1-beta/javascript/sample.env | 4 - .../samples/v1-beta/typescript/README.md | 75 ------------------- .../samples/v1-beta/typescript/package.json | 41 ---------- .../samples/v1-beta/typescript/sample.env | 4 - .../src/accountCreateAndUpdateSample.ts | 48 ------------ .../typescript/src/accountDeleteSample.ts | 40 ---------- .../typescript/src/accountGetSample.ts | 40 ---------- .../typescript/src/accountUpdateSample.ts | 47 ------------ .../src/accountsListByResourceGroupSample.ts | 44 ----------- .../src/accountsListBySubscriptionSample.ts | 40 ---------- .../typescript/src/operationListSample.ts | 40 ---------- .../samples/v1-beta/typescript/tsconfig.json | 17 ----- .../graphservices_operations_test.spec.ts | 64 ---------------- .../arm-graphservices/test/sampleTest.ts | 43 +++++++++++ .../arm-graphservices/tsconfig.json | 10 +-- 36 files changed, 84 insertions(+), 1240 deletions(-) delete mode 100644 sdk/graphservices/arm-graphservices/CHANGELOG.md delete mode 100644 sdk/graphservices/arm-graphservices/assets.json delete mode 100644 sdk/graphservices/arm-graphservices/samples-dev/accountCreateAndUpdateSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples-dev/accountDeleteSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples-dev/accountGetSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples-dev/accountUpdateSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples-dev/accountsListByResourceGroupSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples-dev/accountsListBySubscriptionSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples-dev/operationListSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/README.md delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountCreateAndUpdateSample.js delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountDeleteSample.js delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountGetSample.js delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountUpdateSample.js delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListByResourceGroupSample.js delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListBySubscriptionSample.js delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/operationListSample.js delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/package.json delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/sample.env delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/README.md delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/package.json delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/sample.env delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountCreateAndUpdateSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountDeleteSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountGetSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountUpdateSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListByResourceGroupSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListBySubscriptionSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/operationListSample.ts delete mode 100644 sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/tsconfig.json delete mode 100644 sdk/graphservices/arm-graphservices/test/graphservices_operations_test.spec.ts create mode 100644 sdk/graphservices/arm-graphservices/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index a0121f606644..37da703fabb8 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2188,7 +2188,7 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/chai-as-promised/7.1.5: @@ -2210,7 +2210,7 @@ packages: /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/cookie/0.4.1: @@ -2220,7 +2220,7 @@ packages: /@types/cors/2.8.13: resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/debug/4.1.7: @@ -2232,7 +2232,7 @@ packages: /@types/decompress/4.2.4: resolution: {integrity: sha512-/C8kTMRTNiNuWGl5nEyKbPiMv6HA+0RbEXzFhFBEzASM6+oa4tJro9b8nj7eRlOFfuLdzUU+DS/GPDlvvzMOhA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/eslint/8.4.10: @@ -2253,7 +2253,7 @@ packages: /@types/express-serve-static-core/4.17.34: resolution: {integrity: sha512-fvr49XlCGoUj2Pp730AItckfjat4WNb0lb3kfrLWffd+RLeoGAMsq7UOy04PAPtoL01uKwcp6u8nhzpgpDYr3w==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 '@types/send': 0.17.1 @@ -2271,13 +2271,13 @@ packages: /@types/fs-extra/8.1.2: resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/inquirer/8.2.6: @@ -2290,7 +2290,7 @@ packages: /@types/is-buffer/2.0.0: resolution: {integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/json-schema/7.0.11: @@ -2304,13 +2304,13 @@ packages: /@types/jsonwebtoken/9.0.2: resolution: {integrity: sha512-drE6uz7QBKq1fYqqoFKTDRdFCPHd5TCub75BM+D+cMx7NU9hUz7SESLfC2fSCXVFMO5Yj8sOWHuGqPgjc+fz0Q==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/jws/3.2.5: resolution: {integrity: sha512-xGTxZH34xOryaTN8CMsvhh9lfNqFuHiMoRvsLYWQdBJHqiECyfInXVl2eK8Jz2emxZWMIn5RBlmr3oDVPeWujw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/linkify-it/3.0.2: @@ -2361,13 +2361,13 @@ packages: /@types/mysql/2.15.19: resolution: {integrity: sha512-wSRg2QZv14CWcZXkgdvHbbV2ACufNy5EgI8mBBxnJIptchv7DBy/h53VMa2jDhyo0C9MO4iowE6z9vF8Ja1DkQ==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/node-fetch/2.6.3: resolution: {integrity: sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 form-data: 3.0.1 dev: false @@ -2392,7 +2392,7 @@ packages: /@types/pg/8.6.1: resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 pg-protocol: 1.6.0 pg-types: 2.2.0 dev: false @@ -2420,7 +2420,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/semaphore/1.1.1: @@ -2439,14 +2439,14 @@ packages: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} dependencies: '@types/mime': 1.3.2 - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/serve-static/1.15.1: resolution: {integrity: sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==} dependencies: '@types/mime': 3.0.1 - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/sinon/10.0.14: @@ -2468,13 +2468,13 @@ packages: /@types/stoppable/1.1.1: resolution: {integrity: sha512-b8N+fCADRIYYrGZOcmOR8ZNBOqhktWTB/bMUl5LvGtT201QKJZOOH5UsFyI3qtteM6ZAJbJqZoBcLqqxKIwjhw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/through/0.0.30: resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/tough-cookie/4.0.2: @@ -2488,7 +2488,7 @@ packages: /@types/tunnel/0.0.3: resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/underscore/1.11.4: @@ -2506,19 +2506,19 @@ packages: /@types/ws/7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/ws/8.5.4: resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/xml2js/0.4.11: resolution: {integrity: sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/yargs-parser/21.0.0: @@ -2535,7 +2535,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false optional: true @@ -3540,7 +3540,7 @@ packages: resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) dependencies: - ms: 2.1.1 + ms: 2.1.3 dev: false /debug/3.2.7: @@ -3771,7 +3771,7 @@ packages: dependencies: semver: 7.5.0 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230511 + typescript: 5.2.0-dev.20230516 dev: false /ecdsa-sig-formatter/1.0.11: @@ -3822,7 +3822,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.13 - '@types/node': 14.18.46 + '@types/node': 16.18.28 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -4746,7 +4746,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: false @@ -7043,7 +7043,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 14.18.46 + '@types/node': 16.18.28 long: 5.2.3 dev: false @@ -8315,8 +8315,8 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230511: - resolution: {integrity: sha512-T/GsNgbl4YWUZwSxCrj9uq2aIj7OC/5EyXqj4exIhRbwZEpjPIflv2TEqm6K5fFQhqKQpFATE8OBvY0Qzu8D1A==} + /typescript/5.2.0-dev.20230516: + resolution: {integrity: sha512-DGK8md4PQgA6QG9JnvC6LecNnBstc1h6zrg71isrlZTsRFVl3EsID6D2Exrh4ULbxynA61PE13M+uOmLFWOu4w==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -11783,7 +11783,7 @@ packages: dev: false file:projects/arm-graphservices.tgz: - resolution: {integrity: sha512-OW5UhSftXDjAzsPuFQSatE6ea6fn5l43indhtDxbVhhZXlFnRi8RJl0s+Wvq1II1HbuKn9BRFnCFNDO2HgW5Dw==, tarball: file:projects/arm-graphservices.tgz} + resolution: {integrity: sha512-W4Mpd/2C0oFq2ylu1h0QbdANHiy70H5DmfFjBxsY/9xE4X9IV9DlihvCO6i+VJNC0X7BTlvGmfa9JLVgFLjqxg==, tarball: file:projects/arm-graphservices.tgz} name: '@rush-temp/arm-graphservices' version: 0.0.0 dependencies: @@ -11804,7 +11804,7 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_m742s5qpci6ulntpyriekwplh4 tslib: 2.5.0 - typescript: 5.0.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - supports-color diff --git a/sdk/graphservices/arm-graphservices/CHANGELOG.md b/sdk/graphservices/arm-graphservices/CHANGELOG.md deleted file mode 100644 index c2880fe1dcb5..000000000000 --- a/sdk/graphservices/arm-graphservices/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Release History - -## 1.0.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.1 (2023-03-14) - -The package of @azure/arm-graphservices 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/graphservices/arm-graphservices/_meta.json b/sdk/graphservices/arm-graphservices/_meta.json index 2330ff75e9a7..11fa84442cdd 100644 --- a/sdk/graphservices/arm-graphservices/_meta.json +++ b/sdk/graphservices/arm-graphservices/_meta.json @@ -1,8 +1,8 @@ { - "commit": "d4dfb3388ab40185cf302512268ad1406f666d64", + "commit": "4e5216b0d32a3e041d2fbee8cb5c5d5fff3dd50b", "readme": "specification/graphservicesprod/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\graphservicesprod\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.9 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --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/graphservicesprod/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.9" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/graphservices/arm-graphservices/assets.json b/sdk/graphservices/arm-graphservices/assets.json deleted file mode 100644 index 98b3f5d85ed7..000000000000 --- a/sdk/graphservices/arm-graphservices/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/graphservices/arm-graphservices", - "Tag": "js/graphservices/arm-graphservices_93a384eb55" -} diff --git a/sdk/graphservices/arm-graphservices/package.json b/sdk/graphservices/arm-graphservices/package.json index 53f27a7d6bc7..ad029e190ae6 100644 --- a/sdk/graphservices/arm-graphservices/package.json +++ b/sdk/graphservices/arm-graphservices/package.json @@ -36,7 +36,7 @@ "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~5.0.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "dotenv": "^16.0.0", @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-graphservices?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices" +} \ No newline at end of file diff --git a/sdk/graphservices/arm-graphservices/samples-dev/accountCreateAndUpdateSample.ts b/sdk/graphservices/arm-graphservices/samples-dev/accountCreateAndUpdateSample.ts deleted file mode 100644 index 467e025fe747..000000000000 --- a/sdk/graphservices/arm-graphservices/samples-dev/accountCreateAndUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AccountResource, GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update account resource. - * - * @summary Create or update account resource. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Create.json - */ -async function createAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-1111111111111"; - const accountResource: AccountResource = { - properties: { appId: "11111111-aaaa-1111-bbbb-111111111111" }, - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.beginCreateAndUpdateAndWait( - resourceGroupName, - resourceName, - accountResource - ); - console.log(result); -} - -async function main() { - createAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples-dev/accountDeleteSample.ts b/sdk/graphservices/arm-graphservices/samples-dev/accountDeleteSample.ts deleted file mode 100644 index 26f5373ec70a..000000000000 --- a/sdk/graphservices/arm-graphservices/samples-dev/accountDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a account resource. - * - * @summary Deletes a account resource. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Delete.json - */ -async function deleteAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "11111111-aaaa-1111-bbbb-111111111111"; - const resourceGroupName = - process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-111111111111"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.delete(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - deleteAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples-dev/accountGetSample.ts b/sdk/graphservices/arm-graphservices/samples-dev/accountGetSample.ts deleted file mode 100644 index 4c03f71691ea..000000000000 --- a/sdk/graphservices/arm-graphservices/samples-dev/accountGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns account resource for a given name. - * - * @summary Returns account resource for a given name. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Get.json - */ -async function getAccounts() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-111111111111"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.get(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - getAccounts(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples-dev/accountUpdateSample.ts b/sdk/graphservices/arm-graphservices/samples-dev/accountUpdateSample.ts deleted file mode 100644 index 9b6f1299abbe..000000000000 --- a/sdk/graphservices/arm-graphservices/samples-dev/accountUpdateSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AccountPatchResource, GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update account details. - * - * @summary Update account details. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Update.json - */ -async function updateAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-111111111111"; - const accountResource: AccountPatchResource = { - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.update( - resourceGroupName, - resourceName, - accountResource - ); - console.log(result); -} - -async function main() { - updateAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples-dev/accountsListByResourceGroupSample.ts b/sdk/graphservices/arm-graphservices/samples-dev/accountsListByResourceGroupSample.ts deleted file mode 100644 index 323f26f16c9c..000000000000 --- a/sdk/graphservices/arm-graphservices/samples-dev/accountsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns list of accounts apps. - * - * @summary Returns list of accounts apps. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List.json - */ -async function createOrUpdateAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - createOrUpdateAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples-dev/accountsListBySubscriptionSample.ts b/sdk/graphservices/arm-graphservices/samples-dev/accountsListBySubscriptionSample.ts deleted file mode 100644 index 40a0e91d82cc..000000000000 --- a/sdk/graphservices/arm-graphservices/samples-dev/accountsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns list of accounts belonging to a subscription. - * - * @summary Returns list of accounts belonging to a subscription. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List_Sub.json - */ -async function getListOfAccountsBySubscription() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfAccountsBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples-dev/operationListSample.ts b/sdk/graphservices/arm-graphservices/samples-dev/operationListSample.ts deleted file mode 100644 index 746d094498f8..000000000000 --- a/sdk/graphservices/arm-graphservices/samples-dev/operationListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns list of operations. - * - * @summary Returns list of operations. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Operations_List.json - */ -async function getListOfOperations() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operationOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfOperations(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/README.md b/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/README.md deleted file mode 100644 index 70a02cd4967f..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accountCreateAndUpdateSample.js][accountcreateandupdatesample] | Create or update account resource. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Create.json | -| [accountDeleteSample.js][accountdeletesample] | Deletes a account resource. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Delete.json | -| [accountGetSample.js][accountgetsample] | Returns account resource for a given name. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Get.json | -| [accountUpdateSample.js][accountupdatesample] | Update account details. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Update.json | -| [accountsListByResourceGroupSample.js][accountslistbyresourcegroupsample] | Returns list of accounts apps. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List.json | -| [accountsListBySubscriptionSample.js][accountslistbysubscriptionsample] | Returns list of accounts belonging to a subscription. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List_Sub.json | -| [operationListSample.js][operationlistsample] | Returns list of operations. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Operations_List.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node accountCreateAndUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env GRAPHSERVICES_SUBSCRIPTION_ID="" GRAPHSERVICES_RESOURCE_GROUP="" node accountCreateAndUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[accountcreateandupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountCreateAndUpdateSample.js -[accountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountDeleteSample.js -[accountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountGetSample.js -[accountupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountUpdateSample.js -[accountslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListByResourceGroupSample.js -[accountslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListBySubscriptionSample.js -[operationlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/operationListSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-graphservices?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices/README.md diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountCreateAndUpdateSample.js b/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountCreateAndUpdateSample.js deleted file mode 100644 index 36d4d29aa6a1..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountCreateAndUpdateSample.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { GraphServices } = require("@azure/arm-graphservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create or update account resource. - * - * @summary Create or update account resource. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Create.json - */ -async function createAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-1111111111111"; - const accountResource = { - properties: { appId: "11111111-aaaa-1111-bbbb-111111111111" }, - tags: { tag1: "value1", tag2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.beginCreateAndUpdateAndWait( - resourceGroupName, - resourceName, - accountResource - ); - console.log(result); -} - -async function main() { - createAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountDeleteSample.js b/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountDeleteSample.js deleted file mode 100644 index 04e1e7a4130c..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { GraphServices } = require("@azure/arm-graphservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a account resource. - * - * @summary Deletes a account resource. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Delete.json - */ -async function deleteAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "11111111-aaaa-1111-bbbb-111111111111"; - const resourceGroupName = process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-111111111111"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.delete(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - deleteAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountGetSample.js b/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountGetSample.js deleted file mode 100644 index b94efcbe8cc9..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { GraphServices } = require("@azure/arm-graphservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns account resource for a given name. - * - * @summary Returns account resource for a given name. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Get.json - */ -async function getAccounts() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-111111111111"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.get(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - getAccounts(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountUpdateSample.js b/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountUpdateSample.js deleted file mode 100644 index ebd179fa3376..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountUpdateSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { GraphServices } = require("@azure/arm-graphservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update account details. - * - * @summary Update account details. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Update.json - */ -async function updateAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-111111111111"; - const accountResource = { - tags: { tag1: "value1", tag2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.update(resourceGroupName, resourceName, accountResource); - console.log(result); -} - -async function main() { - updateAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListByResourceGroupSample.js b/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListByResourceGroupSample.js deleted file mode 100644 index fe2284986d25..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { GraphServices } = require("@azure/arm-graphservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns list of accounts apps. - * - * @summary Returns list of accounts apps. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List.json - */ -async function createOrUpdateAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - createOrUpdateAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListBySubscriptionSample.js b/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListBySubscriptionSample.js deleted file mode 100644 index b88d04a8a2e1..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/accountsListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { GraphServices } = require("@azure/arm-graphservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns list of accounts belonging to a subscription. - * - * @summary Returns list of accounts belonging to a subscription. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List_Sub.json - */ -async function getListOfAccountsBySubscription() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfAccountsBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/operationListSample.js b/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/operationListSample.js deleted file mode 100644 index 45e984151c74..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/operationListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { GraphServices } = require("@azure/arm-graphservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns list of operations. - * - * @summary Returns list of operations. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Operations_List.json - */ -async function getListOfOperations() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operationOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfOperations(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/package.json b/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/package.json deleted file mode 100644 index ea5580bb578d..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-graphservices-js-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript (Beta)", - "engines": { - "node": ">=14.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/graphservices/arm-graphservices" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices", - "dependencies": { - "@azure/arm-graphservices": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/sample.env b/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/README.md b/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/README.md deleted file mode 100644 index 769f9f65a730..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accountCreateAndUpdateSample.ts][accountcreateandupdatesample] | Create or update account resource. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Create.json | -| [accountDeleteSample.ts][accountdeletesample] | Deletes a account resource. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Delete.json | -| [accountGetSample.ts][accountgetsample] | Returns account resource for a given name. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Get.json | -| [accountUpdateSample.ts][accountupdatesample] | Update account details. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Update.json | -| [accountsListByResourceGroupSample.ts][accountslistbyresourcegroupsample] | Returns list of accounts apps. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List.json | -| [accountsListBySubscriptionSample.ts][accountslistbysubscriptionsample] | Returns list of accounts belonging to a subscription. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List_Sub.json | -| [operationListSample.ts][operationlistsample] | Returns list of operations. x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Operations_List.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/accountCreateAndUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env GRAPHSERVICES_SUBSCRIPTION_ID="" GRAPHSERVICES_RESOURCE_GROUP="" node dist/accountCreateAndUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[accountcreateandupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountCreateAndUpdateSample.ts -[accountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountDeleteSample.ts -[accountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountGetSample.ts -[accountupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountUpdateSample.ts -[accountslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListByResourceGroupSample.ts -[accountslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListBySubscriptionSample.ts -[operationlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/operationListSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-graphservices?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/package.json b/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/package.json deleted file mode 100644 index ee474e9d6f7f..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-graphservices-ts-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript (Beta)", - "engines": { - "node": ">=14.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/graphservices/arm-graphservices" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices", - "dependencies": { - "@azure/arm-graphservices": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^14.0.0", - "typescript": "~5.0.0", - "rimraf": "latest" - } -} diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/sample.env b/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountCreateAndUpdateSample.ts b/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountCreateAndUpdateSample.ts deleted file mode 100644 index 467e025fe747..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountCreateAndUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AccountResource, GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update account resource. - * - * @summary Create or update account resource. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Create.json - */ -async function createAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-1111111111111"; - const accountResource: AccountResource = { - properties: { appId: "11111111-aaaa-1111-bbbb-111111111111" }, - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.beginCreateAndUpdateAndWait( - resourceGroupName, - resourceName, - accountResource - ); - console.log(result); -} - -async function main() { - createAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountDeleteSample.ts b/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountDeleteSample.ts deleted file mode 100644 index 26f5373ec70a..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a account resource. - * - * @summary Deletes a account resource. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Delete.json - */ -async function deleteAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "11111111-aaaa-1111-bbbb-111111111111"; - const resourceGroupName = - process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-111111111111"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.delete(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - deleteAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountGetSample.ts b/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountGetSample.ts deleted file mode 100644 index 4c03f71691ea..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns account resource for a given name. - * - * @summary Returns account resource for a given name. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Get.json - */ -async function getAccounts() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-111111111111"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.get(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - getAccounts(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountUpdateSample.ts b/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountUpdateSample.ts deleted file mode 100644 index 9b6f1299abbe..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountUpdateSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AccountPatchResource, GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update account details. - * - * @summary Update account details. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_Update.json - */ -async function updateAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const resourceName = "11111111-aaaa-1111-bbbb-111111111111"; - const accountResource: AccountPatchResource = { - tags: { tag1: "value1", tag2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const result = await client.account.update( - resourceGroupName, - resourceName, - accountResource - ); - console.log(result); -} - -async function main() { - updateAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListByResourceGroupSample.ts b/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListByResourceGroupSample.ts deleted file mode 100644 index 323f26f16c9c..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns list of accounts apps. - * - * @summary Returns list of accounts apps. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List.json - */ -async function createOrUpdateAccountResource() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["GRAPHSERVICES_RESOURCE_GROUP"] || "testResourceGroupGRAM"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - createOrUpdateAccountResource(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListBySubscriptionSample.ts b/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListBySubscriptionSample.ts deleted file mode 100644 index 40a0e91d82cc..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/accountsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns list of accounts belonging to a subscription. - * - * @summary Returns list of accounts belonging to a subscription. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Accounts_List_Sub.json - */ -async function getListOfAccountsBySubscription() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfAccountsBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/operationListSample.ts b/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/operationListSample.ts deleted file mode 100644 index 746d094498f8..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/src/operationListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { GraphServices } from "@azure/arm-graphservices"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns list of operations. - * - * @summary Returns list of operations. - * x-ms-original-file: specification/graphservicesprod/resource-manager/Microsoft.GraphServices/preview/2022-09-22-preview/examples/Operations_List.json - */ -async function getListOfOperations() { - const subscriptionId = - process.env["GRAPHSERVICES_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new GraphServices(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operationOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfOperations(); -} - -main().catch(console.error); diff --git a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/tsconfig.json b/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/graphservices/arm-graphservices/samples/v1-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/graphservices/arm-graphservices/test/graphservices_operations_test.spec.ts b/sdk/graphservices/arm-graphservices/test/graphservices_operations_test.spec.ts deleted file mode 100644 index 2982c946fce2..000000000000 --- a/sdk/graphservices/arm-graphservices/test/graphservices_operations_test.spec.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { GraphServices } from "../src/graphServices"; - -const replaceableVariables: Record = { - 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" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("GraphServices test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: GraphServices; - let location: string; - let resourceGroup: string; - let resourcename: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new GraphServices(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "czwjstest"; - resourcename = "resourcetest"; - - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("operation list test", async function () { - const res = await client.operationOperations.list(); - }); -}) diff --git a/sdk/graphservices/arm-graphservices/test/sampleTest.ts b/sdk/graphservices/arm-graphservices/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/graphservices/arm-graphservices/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + 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" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/graphservices/arm-graphservices/tsconfig.json b/sdk/graphservices/arm-graphservices/tsconfig.json index 526f9cfd2ae0..3e6ae96443f3 100644 --- a/sdk/graphservices/arm-graphservices/tsconfig.json +++ b/sdk/graphservices/arm-graphservices/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-graphservices": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"