From 60ac52502fd08bd77563070eccd7172d1a69c588 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 16 May 2023 02:03:57 +0000 Subject: [PATCH] CodeGen from PR 24001 in Azure/azure-rest-api-specs Merge 038eda23f472331b274f48054a8e1c4b107697df into 18a9e6dc1dbf076a43f15da76c7d6f393b50a7c7 --- common/config/rush/pnpm-lock.yaml | 64 ++-- .../arm-graphservices/CHANGELOG.md | 14 +- sdk/graphservices/arm-graphservices/README.md | 2 +- .../arm-graphservices/_meta.json | 8 +- .../arm-graphservices/assets.json | 6 - .../arm-graphservices/package.json | 16 +- .../review/arm-graphservices.api.md | 82 +++-- .../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 - .../arm-graphservices/src/graphServices.ts | 18 +- .../arm-graphservices/src/models/index.ts | 49 +-- .../src/models/parameters.ts | 26 +- .../src/operations/account.ts | 295 ------------------ .../src/operations/accounts.ts | 263 ++++++++++++++++ .../arm-graphservices/src/operations/index.ts | 3 +- .../{operationOperations.ts => operations.ts} | 32 +- .../src/operationsInterfaces/account.ts | 90 ------ .../src/operationsInterfaces/accounts.ts | 77 ++++- .../src/operationsInterfaces/index.ts | 3 +- .../{operationOperations.ts => operations.ts} | 8 +- .../graphservices_operations_test.spec.ts | 64 ---- .../arm-graphservices/test/sampleTest.ts | 43 +++ .../arm-graphservices/tsconfig.json | 10 +- 49 files changed, 531 insertions(+), 1742 deletions(-) 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/src/operations/account.ts rename sdk/graphservices/arm-graphservices/src/operations/{operationOperations.ts => operations.ts} (83%) delete mode 100644 sdk/graphservices/arm-graphservices/src/operationsInterfaces/account.ts rename sdk/graphservices/arm-graphservices/src/operationsInterfaces/{operationOperations.ts => operations.ts} (70%) 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..1a2361dda37f 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.1.0-dev.20230515 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.1.0-dev.20230515: + resolution: {integrity: sha512-yn0MGsy6U0QAVF+lXW6LPupQmuRsyA0xUJetqw2tDqa+49231BpkhTuY6oEwLsc98tiEzCfIw7hzbLsiwVGFaA==} 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 index c2880fe1dcb5..4ddd135bc850 100644 --- a/sdk/graphservices/arm-graphservices/CHANGELOG.md +++ b/sdk/graphservices/arm-graphservices/CHANGELOG.md @@ -1,15 +1,5 @@ # Release History - -## 1.0.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.1 (2023-03-14) + +## 1.0.0 (2023-05-16) 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/README.md b/sdk/graphservices/arm-graphservices/README.md index 81afb38d4d9e..f982b7f4569d 100644 --- a/sdk/graphservices/arm-graphservices/README.md +++ b/sdk/graphservices/arm-graphservices/README.md @@ -6,7 +6,7 @@ Self service experience for Microsoft Graph metered services [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/graphservices/arm-graphservices) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-graphservices) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-graphservices?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-graphservices) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/graphservices/arm-graphservices/_meta.json b/sdk/graphservices/arm-graphservices/_meta.json index 2330ff75e9a7..6c20df3c4399 100644 --- a/sdk/graphservices/arm-graphservices/_meta.json +++ b/sdk/graphservices/arm-graphservices/_meta.json @@ -1,8 +1,8 @@ { - "commit": "d4dfb3388ab40185cf302512268ad1406f666d64", + "commit": "f4f89f1baf008a573b727804b61732eb87ee266c", "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..67b1b22dd3d8 100644 --- a/sdk/graphservices/arm-graphservices/package.json +++ b/sdk/graphservices/arm-graphservices/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for GraphServices.", - "version": "1.0.0-beta.2", + "version": "1.0.0", "engines": { "node": ">=14.0.0" }, @@ -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/review/arm-graphservices.api.md b/sdk/graphservices/arm-graphservices/review/arm-graphservices.api.md index ddd1bbbb87c6..7642c7965f0d 100644 --- a/sdk/graphservices/arm-graphservices/review/arm-graphservices.api.md +++ b/sdk/graphservices/arm-graphservices/review/arm-graphservices.api.md @@ -10,35 +10,6 @@ import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { SimplePollerLike } from '@azure/core-lro'; -// @public -export interface Account { - beginCreateAndUpdate(resourceGroupName: string, resourceName: string, accountResource: AccountResource, options?: AccountCreateAndUpdateOptionalParams): Promise, AccountCreateAndUpdateResponse>>; - beginCreateAndUpdateAndWait(resourceGroupName: string, resourceName: string, accountResource: AccountResource, options?: AccountCreateAndUpdateOptionalParams): Promise; - delete(resourceGroupName: string, resourceName: string, options?: AccountDeleteOptionalParams): Promise; - get(resourceGroupName: string, resourceName: string, options?: AccountGetOptionalParams): Promise; - update(resourceGroupName: string, resourceName: string, accountResource: AccountPatchResource, options?: AccountUpdateOptionalParams): Promise; -} - -// @public -export interface AccountCreateAndUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type AccountCreateAndUpdateResponse = AccountResource; - -// @public -export interface AccountDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface AccountGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AccountGetResponse = AccountResource; - // @public export interface AccountPatchResource extends TagUpdate { } @@ -72,10 +43,35 @@ export interface AccountResourceSystemData { // @public export interface Accounts { + beginCreateAndUpdate(resourceGroupName: string, resourceName: string, accountResource: AccountResource, options?: AccountsCreateAndUpdateOptionalParams): Promise, AccountsCreateAndUpdateResponse>>; + beginCreateAndUpdateAndWait(resourceGroupName: string, resourceName: string, accountResource: AccountResource, options?: AccountsCreateAndUpdateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, options?: AccountsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, options?: AccountsGetOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: AccountsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, resourceName: string, accountResource: AccountPatchResource, options?: AccountsUpdateOptionalParams): Promise; +} + +// @public +export interface AccountsCreateAndUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } +// @public +export type AccountsCreateAndUpdateResponse = AccountResource; + +// @public +export interface AccountsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface AccountsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsGetResponse = AccountResource; + // @public export interface AccountsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { } @@ -105,11 +101,11 @@ export interface AccountsListBySubscriptionOptionalParams extends coreClient.Ope export type AccountsListBySubscriptionResponse = AccountResourceList; // @public -export interface AccountUpdateOptionalParams extends coreClient.OperationOptions { +export interface AccountsUpdateOptionalParams extends coreClient.OperationOptions { } // @public -export type AccountUpdateResponse = AccountResource; +export type AccountsUpdateResponse = AccountResource; // @public export type ActionType = string; @@ -146,13 +142,11 @@ export class GraphServices extends coreClient.ServiceClient { $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: GraphServicesOptionalParams); // (undocumented) - account: Account; - // (undocumented) accounts: Accounts; // (undocumented) apiVersion: string; // (undocumented) - operationOperations: OperationOperations; + operations: Operations; // (undocumented) subscriptionId: string; } @@ -209,29 +203,29 @@ export interface OperationDisplay { } // @public -export interface OperationListNextOptionalParams extends coreClient.OperationOptions { +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; } // @public -export type OperationListNextResponse = OperationListResult; +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} // @public -export interface OperationListOptionalParams extends coreClient.OperationOptions { +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { } // @public -export type OperationListResponse = OperationListResult; +export type OperationsListNextResponse = OperationListResult; // @public -export interface OperationListResult { - readonly nextLink?: string; - readonly value?: Operation[]; +export interface OperationsListOptionalParams extends coreClient.OperationOptions { } // @public -export interface OperationOperations { - list(options?: OperationListOptionalParams): PagedAsyncIterableIterator; -} +export type OperationsListResponse = OperationListResult; // @public export type Origin = string; 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/src/graphServices.ts b/sdk/graphservices/arm-graphservices/src/graphServices.ts index 2efa2cacb98a..856d3bca8a03 100644 --- a/sdk/graphservices/arm-graphservices/src/graphServices.ts +++ b/sdk/graphservices/arm-graphservices/src/graphServices.ts @@ -14,12 +14,8 @@ import { SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { - AccountsImpl, - AccountImpl, - OperationOperationsImpl -} from "./operations"; -import { Accounts, Account, OperationOperations } from "./operationsInterfaces"; +import { AccountsImpl, OperationsImpl } from "./operations"; +import { Accounts, Operations } from "./operationsInterfaces"; import { GraphServicesOptionalParams } from "./models"; export class GraphServices extends coreClient.ServiceClient { @@ -54,7 +50,7 @@ export class GraphServices extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-graphservices/1.0.0-beta.2`; + const packageDetails = `azsdk-js-arm-graphservices/1.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -107,10 +103,9 @@ export class GraphServices extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-09-22-preview"; + this.apiVersion = options.apiVersion || "2023-04-13"; this.accounts = new AccountsImpl(this); - this.account = new AccountImpl(this); - this.operationOperations = new OperationOperationsImpl(this); + this.operations = new OperationsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -143,6 +138,5 @@ export class GraphServices extends coreClient.ServiceClient { } accounts: Accounts; - account: Account; - operationOperations: OperationOperations; + operations: Operations; } diff --git a/sdk/graphservices/arm-graphservices/src/models/index.ts b/sdk/graphservices/arm-graphservices/src/models/index.ts index d8051dfc9125..9ca85e1a5bbf 100644 --- a/sdk/graphservices/arm-graphservices/src/models/index.ts +++ b/sdk/graphservices/arm-graphservices/src/models/index.ts @@ -296,27 +296,14 @@ export interface AccountsListBySubscriptionOptionalParams export type AccountsListBySubscriptionResponse = AccountResourceList; /** Optional parameters. */ -export interface AccountsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type AccountsListByResourceGroupNextResponse = AccountResourceList; - -/** Optional parameters. */ -export interface AccountsListBySubscriptionNextOptionalParams +export interface AccountsGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listBySubscriptionNext operation. */ -export type AccountsListBySubscriptionNextResponse = AccountResourceList; - -/** Optional parameters. */ -export interface AccountGetOptionalParams extends coreClient.OperationOptions {} - /** Contains response data for the get operation. */ -export type AccountGetResponse = AccountResource; +export type AccountsGetResponse = AccountResource; /** Optional parameters. */ -export interface AccountCreateAndUpdateOptionalParams +export interface AccountsCreateAndUpdateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -325,32 +312,46 @@ export interface AccountCreateAndUpdateOptionalParams } /** Contains response data for the createAndUpdate operation. */ -export type AccountCreateAndUpdateResponse = AccountResource; +export type AccountsCreateAndUpdateResponse = AccountResource; /** Optional parameters. */ -export interface AccountUpdateOptionalParams +export interface AccountsUpdateOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the update operation. */ -export type AccountUpdateResponse = AccountResource; +export type AccountsUpdateResponse = AccountResource; /** Optional parameters. */ -export interface AccountDeleteOptionalParams +export interface AccountsDeleteOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface OperationListOptionalParams +export interface AccountsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type AccountsListByResourceGroupNextResponse = AccountResourceList; + +/** Optional parameters. */ +export interface AccountsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type AccountsListBySubscriptionNextResponse = AccountResourceList; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type OperationListResponse = OperationListResult; +export type OperationsListResponse = OperationListResult; /** Optional parameters. */ -export interface OperationListNextOptionalParams +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type OperationListNextResponse = OperationListResult; +export type OperationsListNextResponse = OperationListResult; /** Optional parameters. */ export interface GraphServicesOptionalParams diff --git a/sdk/graphservices/arm-graphservices/src/models/parameters.ts b/sdk/graphservices/arm-graphservices/src/models/parameters.ts index 1f58ec857eed..e0f82cd78f5c 100644 --- a/sdk/graphservices/arm-graphservices/src/models/parameters.ts +++ b/sdk/graphservices/arm-graphservices/src/models/parameters.ts @@ -43,7 +43,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-09-22-preview", + defaultValue: "2023-04-13", isConstant: true, serializedName: "api-version", type: { @@ -81,18 +81,6 @@ export const resourceGroupName: OperationURLParameter = { } }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - export const resourceName: OperationURLParameter = { parameterPath: "resourceName", mapper: { @@ -125,3 +113,15 @@ export const accountResource1: OperationParameter = { parameterPath: "accountResource", mapper: AccountPatchResourceMapper }; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; diff --git a/sdk/graphservices/arm-graphservices/src/operations/account.ts b/sdk/graphservices/arm-graphservices/src/operations/account.ts deleted file mode 100644 index 1f5ef2c5bb6f..000000000000 --- a/sdk/graphservices/arm-graphservices/src/operations/account.ts +++ /dev/null @@ -1,295 +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 { Account } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { GraphServices } from "../graphServices"; -import { - SimplePollerLike, - OperationState, - createHttpPoller -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - AccountGetOptionalParams, - AccountGetResponse, - AccountResource, - AccountCreateAndUpdateOptionalParams, - AccountCreateAndUpdateResponse, - AccountPatchResource, - AccountUpdateOptionalParams, - AccountUpdateResponse, - AccountDeleteOptionalParams -} from "../models"; - -/** Class containing Account operations. */ -export class AccountImpl implements Account { - private readonly client: GraphServices; - - /** - * Initialize a new instance of the class Account class. - * @param client Reference to the service client - */ - constructor(client: GraphServices) { - this.client = client; - } - - /** - * Returns account resource for a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - resourceName: string, - options?: AccountGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, options }, - getOperationSpec - ); - } - - /** - * Create or update account resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param accountResource Account details. - * @param options The options parameters. - */ - async beginCreateAndUpdate( - resourceGroupName: string, - resourceName: string, - accountResource: AccountResource, - options?: AccountCreateAndUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - AccountCreateAndUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, resourceName, accountResource, options }, - spec: createAndUpdateOperationSpec - }); - const poller = await createHttpPoller< - AccountCreateAndUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" - }); - await poller.poll(); - return poller; - } - - /** - * Create or update account resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param accountResource Account details. - * @param options The options parameters. - */ - async beginCreateAndUpdateAndWait( - resourceGroupName: string, - resourceName: string, - accountResource: AccountResource, - options?: AccountCreateAndUpdateOptionalParams - ): Promise { - const poller = await this.beginCreateAndUpdate( - resourceGroupName, - resourceName, - accountResource, - options - ); - return poller.pollUntilDone(); - } - - /** - * Update account details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param accountResource Account patch details. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - resourceName: string, - accountResource: AccountPatchResource, - options?: AccountUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, accountResource, options }, - updateOperationSpec - ); - } - - /** - * Deletes a account resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - options?: AccountDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, options }, - deleteOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccountResource - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - headerParameters: [Parameters.accept], - serializer -}; -const createAndUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.AccountResource - }, - 201: { - bodyMapper: Mappers.AccountResource - }, - 202: { - bodyMapper: Mappers.AccountResource - }, - 204: { - bodyMapper: Mappers.AccountResource - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.accountResource, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.AccountResource - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.accountResource1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/graphservices/arm-graphservices/src/operations/accounts.ts b/sdk/graphservices/arm-graphservices/src/operations/accounts.ts index ceff731a8c6d..6784293cba16 100644 --- a/sdk/graphservices/arm-graphservices/src/operations/accounts.ts +++ b/sdk/graphservices/arm-graphservices/src/operations/accounts.ts @@ -13,6 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { GraphServices } from "../graphServices"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { AccountResource, AccountsListByResourceGroupNextOptionalParams, @@ -21,6 +27,14 @@ import { AccountsListBySubscriptionNextOptionalParams, AccountsListBySubscriptionOptionalParams, AccountsListBySubscriptionResponse, + AccountsGetOptionalParams, + AccountsGetResponse, + AccountsCreateAndUpdateOptionalParams, + AccountsCreateAndUpdateResponse, + AccountPatchResource, + AccountsUpdateOptionalParams, + AccountsUpdateResponse, + AccountsDeleteOptionalParams, AccountsListByResourceGroupNextResponse, AccountsListBySubscriptionNextResponse } from "../models"; @@ -189,6 +203,155 @@ export class AccountsImpl implements Accounts { ); } + /** + * Returns account resource for a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: AccountsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + getOperationSpec + ); + } + + /** + * Create or update account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param accountResource Account details. + * @param options The options parameters. + */ + async beginCreateAndUpdate( + resourceGroupName: string, + resourceName: string, + accountResource: AccountResource, + options?: AccountsCreateAndUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + AccountsCreateAndUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, resourceName, accountResource, options }, + spec: createAndUpdateOperationSpec + }); + const poller = await createHttpPoller< + AccountsCreateAndUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create or update account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param accountResource Account details. + * @param options The options parameters. + */ + async beginCreateAndUpdateAndWait( + resourceGroupName: string, + resourceName: string, + accountResource: AccountResource, + options?: AccountsCreateAndUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateAndUpdate( + resourceGroupName, + resourceName, + accountResource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update account details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param accountResource Account patch details. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + accountResource: AccountPatchResource, + options?: AccountsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, accountResource, options }, + updateOperationSpec + ); + } + + /** + * Deletes a account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + options?: AccountsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + deleteOperationSpec + ); + } + /** * ListByResourceGroupNext * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -262,6 +425,106 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createAndUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AccountResource + }, + 201: { + bodyMapper: Mappers.AccountResource + }, + 202: { + bodyMapper: Mappers.AccountResource + }, + 204: { + bodyMapper: Mappers.AccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.accountResource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.AccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.accountResource1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", diff --git a/sdk/graphservices/arm-graphservices/src/operations/index.ts b/sdk/graphservices/arm-graphservices/src/operations/index.ts index db63b2eb9c1e..25b00da20bb3 100644 --- a/sdk/graphservices/arm-graphservices/src/operations/index.ts +++ b/sdk/graphservices/arm-graphservices/src/operations/index.ts @@ -7,5 +7,4 @@ */ export * from "./accounts"; -export * from "./account"; -export * from "./operationOperations"; +export * from "./operations"; diff --git a/sdk/graphservices/arm-graphservices/src/operations/operationOperations.ts b/sdk/graphservices/arm-graphservices/src/operations/operations.ts similarity index 83% rename from sdk/graphservices/arm-graphservices/src/operations/operationOperations.ts rename to sdk/graphservices/arm-graphservices/src/operations/operations.ts index a8a84b3ca4ef..1c9ddcc5660a 100644 --- a/sdk/graphservices/arm-graphservices/src/operations/operationOperations.ts +++ b/sdk/graphservices/arm-graphservices/src/operations/operations.ts @@ -8,26 +8,26 @@ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "../pagingHelper"; -import { OperationOperations } from "../operationsInterfaces"; +import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { GraphServices } from "../graphServices"; import { Operation, - OperationListNextOptionalParams, - OperationListOptionalParams, - OperationListResponse, - OperationListNextResponse + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse } from "../models"; /// -/** Class containing OperationOperations operations. */ -export class OperationOperationsImpl implements OperationOperations { +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { private readonly client: GraphServices; /** - * Initialize a new instance of the class OperationOperations class. + * Initialize a new instance of the class Operations class. * @param client Reference to the service client */ constructor(client: GraphServices) { @@ -39,7 +39,7 @@ export class OperationOperationsImpl implements OperationOperations { * @param options The options parameters. */ public list( - options?: OperationListOptionalParams + options?: OperationsListOptionalParams ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -59,10 +59,10 @@ export class OperationOperationsImpl implements OperationOperations { } private async *listPagingPage( - options?: OperationListOptionalParams, + options?: OperationsListOptionalParams, settings?: PageSettings ): AsyncIterableIterator { - let result: OperationListResponse; + let result: OperationsListResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { result = await this._list(options); @@ -81,7 +81,7 @@ export class OperationOperationsImpl implements OperationOperations { } private async *listPagingAll( - options?: OperationListOptionalParams + options?: OperationsListOptionalParams ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,8 +93,8 @@ export class OperationOperationsImpl implements OperationOperations { * @param options The options parameters. */ private _list( - options?: OperationListOptionalParams - ): Promise { + options?: OperationsListOptionalParams + ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,8 +105,8 @@ export class OperationOperationsImpl implements OperationOperations { */ private _listNext( nextLink: string, - options?: OperationListNextOptionalParams - ): Promise { + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( { nextLink, options }, listNextOperationSpec diff --git a/sdk/graphservices/arm-graphservices/src/operationsInterfaces/account.ts b/sdk/graphservices/arm-graphservices/src/operationsInterfaces/account.ts deleted file mode 100644 index 7f7720a6e4ea..000000000000 --- a/sdk/graphservices/arm-graphservices/src/operationsInterfaces/account.ts +++ /dev/null @@ -1,90 +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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - AccountGetOptionalParams, - AccountGetResponse, - AccountResource, - AccountCreateAndUpdateOptionalParams, - AccountCreateAndUpdateResponse, - AccountPatchResource, - AccountUpdateOptionalParams, - AccountUpdateResponse, - AccountDeleteOptionalParams -} from "../models"; - -/** Interface representing a Account. */ -export interface Account { - /** - * Returns account resource for a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - resourceName: string, - options?: AccountGetOptionalParams - ): Promise; - /** - * Create or update account resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param accountResource Account details. - * @param options The options parameters. - */ - beginCreateAndUpdate( - resourceGroupName: string, - resourceName: string, - accountResource: AccountResource, - options?: AccountCreateAndUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - AccountCreateAndUpdateResponse - > - >; - /** - * Create or update account resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param accountResource Account details. - * @param options The options parameters. - */ - beginCreateAndUpdateAndWait( - resourceGroupName: string, - resourceName: string, - accountResource: AccountResource, - options?: AccountCreateAndUpdateOptionalParams - ): Promise; - /** - * Update account details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param accountResource Account patch details. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - resourceName: string, - accountResource: AccountPatchResource, - options?: AccountUpdateOptionalParams - ): Promise; - /** - * Deletes a account resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - options?: AccountDeleteOptionalParams - ): Promise; -} diff --git a/sdk/graphservices/arm-graphservices/src/operationsInterfaces/accounts.ts b/sdk/graphservices/arm-graphservices/src/operationsInterfaces/accounts.ts index 839f356dc462..0b0f8657a4b9 100644 --- a/sdk/graphservices/arm-graphservices/src/operationsInterfaces/accounts.ts +++ b/sdk/graphservices/arm-graphservices/src/operationsInterfaces/accounts.ts @@ -7,10 +7,19 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { AccountResource, AccountsListByResourceGroupOptionalParams, - AccountsListBySubscriptionOptionalParams + AccountsListBySubscriptionOptionalParams, + AccountsGetOptionalParams, + AccountsGetResponse, + AccountsCreateAndUpdateOptionalParams, + AccountsCreateAndUpdateResponse, + AccountPatchResource, + AccountsUpdateOptionalParams, + AccountsUpdateResponse, + AccountsDeleteOptionalParams } from "../models"; /// @@ -32,4 +41,70 @@ export interface Accounts { listBySubscription( options?: AccountsListBySubscriptionOptionalParams ): PagedAsyncIterableIterator; + /** + * Returns account resource for a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: AccountsGetOptionalParams + ): Promise; + /** + * Create or update account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param accountResource Account details. + * @param options The options parameters. + */ + beginCreateAndUpdate( + resourceGroupName: string, + resourceName: string, + accountResource: AccountResource, + options?: AccountsCreateAndUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + AccountsCreateAndUpdateResponse + > + >; + /** + * Create or update account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param accountResource Account details. + * @param options The options parameters. + */ + beginCreateAndUpdateAndWait( + resourceGroupName: string, + resourceName: string, + accountResource: AccountResource, + options?: AccountsCreateAndUpdateOptionalParams + ): Promise; + /** + * Update account details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param accountResource Account patch details. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + accountResource: AccountPatchResource, + options?: AccountsUpdateOptionalParams + ): Promise; + /** + * Deletes a account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + options?: AccountsDeleteOptionalParams + ): Promise; } diff --git a/sdk/graphservices/arm-graphservices/src/operationsInterfaces/index.ts b/sdk/graphservices/arm-graphservices/src/operationsInterfaces/index.ts index db63b2eb9c1e..25b00da20bb3 100644 --- a/sdk/graphservices/arm-graphservices/src/operationsInterfaces/index.ts +++ b/sdk/graphservices/arm-graphservices/src/operationsInterfaces/index.ts @@ -7,5 +7,4 @@ */ export * from "./accounts"; -export * from "./account"; -export * from "./operationOperations"; +export * from "./operations"; diff --git a/sdk/graphservices/arm-graphservices/src/operationsInterfaces/operationOperations.ts b/sdk/graphservices/arm-graphservices/src/operationsInterfaces/operations.ts similarity index 70% rename from sdk/graphservices/arm-graphservices/src/operationsInterfaces/operationOperations.ts rename to sdk/graphservices/arm-graphservices/src/operationsInterfaces/operations.ts index 4512d71bd7de..0c50b09b459e 100644 --- a/sdk/graphservices/arm-graphservices/src/operationsInterfaces/operationOperations.ts +++ b/sdk/graphservices/arm-graphservices/src/operationsInterfaces/operations.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { Operation, OperationListOptionalParams } from "../models"; +import { Operation, OperationsListOptionalParams } from "../models"; /// -/** Interface representing a OperationOperations. */ -export interface OperationOperations { +/** Interface representing a Operations. */ +export interface Operations { /** * Returns list of operations. * @param options The options parameters. */ list( - options?: OperationListOptionalParams + options?: OperationsListOptionalParams ): PagedAsyncIterableIterator; } 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"