From d72625d0a1f5f4947d959d45f7996b8417c6ce04 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 15 Sep 2023 21:18:25 +0000 Subject: [PATCH] CodeGen from PR 25699 in Azure/azure-rest-api-specs Merge 4f202417dbd3f4f57c6c417cb7ea3378bf5d4b91 into 35bc964ad57ef9f1790436aee642d269fdfd1b35 --- common/config/rush/pnpm-lock.yaml | 144 ++++- .../arm-resourcegraph/CHANGELOG.md | 16 +- sdk/resourcegraph/arm-resourcegraph/LICENSE | 2 +- .../arm-resourcegraph/_meta.json | 10 +- .../arm-resourcegraph/package.json | 27 +- .../review/arm-resourcegraph.api.md | 162 +++++- .../arm-resourcegraph/src/models/index.ts | 266 ++++++++- .../arm-resourcegraph/src/models/mappers.ts | 532 +++++++++++++++--- .../src/models/parameters.ts | 52 +- .../arm-resourcegraph/src/operations/index.ts | 1 + .../arm-resourcegraph/src/operations/query.ts | 67 +++ .../src/operationsInterfaces/index.ts | 1 + .../src/operationsInterfaces/query.ts | 26 + .../src/resourceGraphClient.ts | 135 +++-- .../arm-resourcegraph/tsconfig.json | 10 +- 15 files changed, 1240 insertions(+), 211 deletions(-) create mode 100644 sdk/resourcegraph/arm-resourcegraph/src/operations/query.ts create mode 100644 sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/query.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 39307bde93d4..8b66ffc6202a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1903,6 +1903,18 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: false + /@isaacs/cliui@8.0.2: + resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} + engines: {node: '>=12'} + dependencies: + string-width: 5.1.2 + string-width-cjs: /string-width@4.2.3 + strip-ansi: 7.1.0 + strip-ansi-cjs: /strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: /wrap-ansi@7.0.0 + dev: false + /@istanbuljs/load-nyc-config@1.1.0: resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} @@ -2327,6 +2339,13 @@ packages: '@opentelemetry/core': 1.17.0(@opentelemetry/api@1.6.0) dev: false + /@pkgjs/parseargs@0.11.0: + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + requiresBuild: true + dev: false + optional: true + /@protobufjs/aspromise@1.1.2: resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} dev: false @@ -3397,6 +3416,11 @@ packages: engines: {node: '>=8'} dev: false + /ansi-regex@6.0.1: + resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} + engines: {node: '>=12'} + dev: false + /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -3411,6 +3435,11 @@ packages: color-convert: 2.0.1 dev: false + /ansi-styles@6.2.1: + resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + engines: {node: '>=12'} + dev: false + /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -4449,7 +4478,11 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20230914 + typescript: 5.3.0-dev.20230915 + dev: false + + /eastasianwidth@0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: false /ecdsa-sig-formatter@1.0.11: @@ -4478,6 +4511,10 @@ packages: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: false + /emoji-regex@9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + dev: false + /encodeurl@1.0.2: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} engines: {node: '>= 0.8'} @@ -5230,6 +5267,14 @@ packages: signal-exit: 3.0.7 dev: false + /foreground-child@3.1.1: + resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} + engines: {node: '>=14'} + dependencies: + cross-spawn: 7.0.3 + signal-exit: 4.1.0 + dev: false + /form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} @@ -5410,13 +5455,25 @@ packages: resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} dev: false + /glob@10.3.4: + resolution: {integrity: sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==} + engines: {node: '>=16 || 14 >=14.17'} + hasBin: true + dependencies: + foreground-child: 3.1.1 + jackspeak: 2.3.3 + minimatch: 9.0.3 + minipass: 7.0.3 + path-scurry: 1.10.1 + dev: false + /glob@7.1.3: resolution: {integrity: sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==} dependencies: 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 @@ -6111,6 +6168,15 @@ packages: istanbul-lib-report: 3.0.1 dev: false + /jackspeak@2.3.3: + resolution: {integrity: sha512-R2bUw+kVZFS/h1AZqBKrSgDmdmjApzgY0AlCPumopFiAlbUxE2gf+SCuBzQ0cP5hHmUmFYF5yw55T97Th5Kstg==} + engines: {node: '>=14'} + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + dev: false + /jju@1.4.0: resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} dev: false @@ -6636,6 +6702,11 @@ packages: get-func-name: 2.0.0 dev: false + /lru-cache@10.0.1: + resolution: {integrity: sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==} + engines: {node: 14 || >=16.14} + dev: false + /lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} dependencies: @@ -6885,6 +6956,13 @@ packages: brace-expansion: 2.0.1 dev: false + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: false + /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} dev: false @@ -6894,6 +6972,11 @@ packages: engines: {node: '>=8'} dev: false + /minipass@7.0.3: + resolution: {integrity: sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==} + engines: {node: '>=16 || 14 >=14.17'} + dev: false + /mitt@3.0.0: resolution: {integrity: sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==} dev: false @@ -7574,6 +7657,14 @@ packages: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: false + /path-scurry@1.10.1: + resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + lru-cache: 10.0.1 + minipass: 7.0.3 + dev: false + /path-scurry@1.6.3: resolution: {integrity: sha512-RAmB+n30SlN+HnNx6EbcpoDy9nwdpcGPnEKrJnu6GZoDWBdIjo1UQMVtW2ybtC7LC2oKLcMq8y5g8WnKLiod9g==} engines: {node: '>=16 || 14 >=14.17'} @@ -8162,6 +8253,14 @@ packages: glob: 7.2.3 dev: false + /rimraf@5.0.1: + resolution: {integrity: sha512-OfFZdwtd3lZ+XZzYP/6gTACubwFcHdLRqS9UX3UwpU2dnGQYkPFISRwvM3w9IiB2w7bW5qGo/uAwE4SmXXSKvg==} + engines: {node: '>=14'} + hasBin: true + dependencies: + glob: 10.3.4 + dev: false + /rollup-plugin-polyfill-node@0.12.0(rollup@2.79.1): resolution: {integrity: sha512-PWEVfDxLEKt8JX1nZ0NkUAgXpkZMTb85rO/Ru9AQ69wYW8VUCfDgP4CGRXXWYni5wDF0vIeR1UoF3Jmw/Lt3Ug==} peerDependencies: @@ -8420,6 +8519,11 @@ packages: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: false + /signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + dev: false + /simple-concat@1.0.1: resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} dev: false @@ -8613,6 +8717,15 @@ packages: strip-ansi: 6.0.1 dev: false + /string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + dependencies: + eastasianwidth: 0.2.0 + emoji-regex: 9.2.2 + strip-ansi: 7.1.0 + dev: false + /string.prototype.padend@3.1.5: resolution: {integrity: sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==} engines: {node: '>= 0.4'} @@ -8684,6 +8797,13 @@ packages: ansi-regex: 5.0.1 dev: false + /strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + dependencies: + ansi-regex: 6.0.1 + dev: false + /strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} @@ -9090,8 +9210,8 @@ packages: hasBin: true dev: false - /typescript@5.3.0-dev.20230914: - resolution: {integrity: sha512-fLOsSwW/WYEdqhxDb4iaJ2IkPmxMM6di8p++ey3SlOTaK0sdczIYVl9tlCxkajWOp0UnvBfO6Bxe+g9xxZMypw==} + /typescript@5.3.0-dev.20230915: + resolution: {integrity: sha512-GQr8dkpN44ywddczAzV80zSPckUfqUbxmCi2SXJ0SvOMOk7TXMUrcptoHQm7HqFggTUS41AUEr+a8RmyPApw4Q==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -9369,6 +9489,15 @@ packages: strip-ansi: 6.0.1 dev: false + /wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + dependencies: + ansi-styles: 6.2.1 + string-width: 5.1.2 + strip-ansi: 7.1.0 + dev: false + /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: false @@ -15579,7 +15708,7 @@ packages: dev: false file:projects/arm-resourcegraph.tgz: - resolution: {integrity: sha512-EoVtqOWPub8QQmeIZ8elPGNSmkWSDMlhBGlW7NHoMHl7dd0F2Dj37G1j0A7zr0kW6QXK81DyukRNwZkMkGuE0w==, tarball: file:projects/arm-resourcegraph.tgz} + resolution: {integrity: sha512-SdYp8D7oUogTy0OQ+eflqPZrkm2DkPRFnePBo+IupUBaCWoxrgN6q5eXdIUrK3e8EQAGO4/XUcPnwinmpicnmg==, tarball: file:projects/arm-resourcegraph.tgz} name: '@rush-temp/arm-resourcegraph' version: 0.0.0 dependencies: @@ -15593,9 +15722,10 @@ packages: '@types/node': 14.18.59 chai: 4.3.8 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + mkdirp: 2.1.6 mocha: 7.2.0 - rimraf: 3.0.2 + rimraf: 5.0.1 rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3(@types/node@14.18.59)(rollup@2.79.1) ts-node: 10.9.1(@types/node@14.18.59)(typescript@5.0.4) diff --git a/sdk/resourcegraph/arm-resourcegraph/CHANGELOG.md b/sdk/resourcegraph/arm-resourcegraph/CHANGELOG.md index 165e88d3d91e..e8365724a134 100644 --- a/sdk/resourcegraph/arm-resourcegraph/CHANGELOG.md +++ b/sdk/resourcegraph/arm-resourcegraph/CHANGELOG.md @@ -1,18 +1,8 @@ # Release History + +## 5.0.0-beta.4 (2023-09-15) -## 5.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 5.0.0-beta.3 (2022-12-07) - -The package of @azure/arm-resourcegraph is using our next generation design principles since version 5.0.0-beta.3, which contains breaking changes. +The package of @azure/arm-resourcegraph is using our next generation design principles since version 5.0.0-beta.4, which contains breaking changes. To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). diff --git a/sdk/resourcegraph/arm-resourcegraph/LICENSE b/sdk/resourcegraph/arm-resourcegraph/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/resourcegraph/arm-resourcegraph/LICENSE +++ b/sdk/resourcegraph/arm-resourcegraph/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/resourcegraph/arm-resourcegraph/_meta.json b/sdk/resourcegraph/arm-resourcegraph/_meta.json index 5f28e10d3afd..5577e3b2b2aa 100644 --- a/sdk/resourcegraph/arm-resourcegraph/_meta.json +++ b/sdk/resourcegraph/arm-resourcegraph/_meta.json @@ -1,8 +1,8 @@ { - "commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf", - "readme": "specification\\resourcegraph\\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\\resourcegraph\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.4 --generate-sample=true", + "commit": "f202606253721abb0ec94c35a61e1e56bc37da6a", + "readme": "specification/resourcegraph/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --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/resourcegraph/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.2", - "use": "@autorest/typescript@6.0.0-rc.4" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/resourcegraph/arm-resourcegraph/package.json b/sdk/resourcegraph/arm-resourcegraph/package.json index 5ff827bbafa4..1a382fb4f4d3 100644 --- a/sdk/resourcegraph/arm-resourcegraph/package.json +++ b/sdk/resourcegraph/arm-resourcegraph/package.json @@ -9,9 +9,9 @@ }, "dependencies": { "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -31,12 +31,13 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -45,10 +46,9 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", - "@azure/dev-tool": "^1.0.0", - "ts-node": "^10.0.0" + "ts-node": "^10.0.0", + "@azure/dev-tool": "^1.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcegraph/arm-resourcegraph", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -82,7 +82,7 @@ "extract-api": "api-extractor run --local", "lint": "echo skipped", "audit": "echo skipped", - "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -110,12 +110,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resourcegraph?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcegraph/arm-resourcegraph" +} \ No newline at end of file diff --git a/sdk/resourcegraph/arm-resourcegraph/review/arm-resourcegraph.api.md b/sdk/resourcegraph/arm-resourcegraph/review/arm-resourcegraph.api.md index c9b51b93ed30..37a510c736b8 100644 --- a/sdk/resourcegraph/arm-resourcegraph/review/arm-resourcegraph.api.md +++ b/sdk/resourcegraph/arm-resourcegraph/review/arm-resourcegraph.api.md @@ -11,6 +11,12 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging'; // @public export type AuthorizationScopeFilter = "AtScopeAndBelow" | "AtScopeAndAbove" | "AtScopeExact" | "AtScopeAboveAndBelow"; +// @public +export type ChangeCategory = "User" | "System"; + +// @public +export type ChangeType = "Create" | "Update" | "Delete"; + // @public export interface Column { name: string; @@ -88,6 +94,30 @@ export type FacetUnion = Facet | FacetResult | FacetError; // @public export function getContinuationToken(page: unknown): string | undefined; +// @public +export interface HistoryContext { + content: string; + role: Role; +} + +// @public +export enum KnownRole { + Assistant = "assistant", + System = "system", + User = "user" +} + +// @public +export enum KnownStatusCategory { + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownVersions { + V20230901Preview = "2023-09-01-preview" +} + // @public export interface Operation { display?: OperationDisplay; @@ -120,6 +150,33 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption // @public export type OperationsListResponse = OperationListResult; +// @public +export type PropertyChangeType = "Insert" | "Update" | "Remove"; + +// @public +export interface Query { + generateQuery(body: QueryGenerationRequest, options?: QueryGenerateQueryOptionalParams): Promise; +} + +// @public +export interface QueryGenerateQueryOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type QueryGenerateQueryResponse = QueryGenerationResponse; + +// @public +export interface QueryGenerationRequest { + history?: HistoryContext[]; + prompt: string; +} + +// @public +export interface QueryGenerationResponse { + query: string; + status: StatusResponse; +} + // @public export interface QueryRequest { facets?: FacetRequest[]; @@ -149,26 +206,95 @@ export interface QueryResponse { totalRecords: number; } +// @public +export interface ResourceChangeData { + afterSnapshot: ResourceChangeDataAfterSnapshot; + beforeSnapshot: ResourceChangeDataBeforeSnapshot; + changeId: string; + changeType?: ChangeType; + propertyChanges?: ResourcePropertyChange[]; + resourceId?: string; +} + +// @public +export interface ResourceChangeDataAfterSnapshot extends ResourceSnapshotData { +} + +// @public +export interface ResourceChangeDataBeforeSnapshot extends ResourceSnapshotData { +} + +// @public +export interface ResourceChangeDetailsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ResourceChangeDetailsRequestParameters { + changeIds: string[]; + resourceIds: string[]; +} + +// @public +export type ResourceChangeDetailsResponse = ResourceChangeData[]; + +// @public +export interface ResourceChangeList { + changes?: ResourceChangeData[]; + skipToken?: any; +} + +// @public +export interface ResourceChangesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ResourceChangesRequestParameters { + fetchPropertyChanges?: boolean; + fetchSnapshots?: boolean; + interval: ResourceChangesRequestParametersInterval; + resourceIds?: string[]; + skipToken?: string; + subscriptionId?: string; + table?: string; + top?: number; +} + +// @public +export interface ResourceChangesRequestParametersInterval extends DateTimeInterval { +} + +// @public +export type ResourceChangesResponse = ResourceChangeList; + // @public (undocumented) export class ResourceGraphClient extends coreClient.ServiceClient { // (undocumented) $host: string; - constructor(credentials: coreAuth.TokenCredential, options?: ResourceGraphClientOptionalParams); - // (undocumented) - apiVersion: string; + constructor(credentials: coreAuth.TokenCredential, $host: string, options?: ResourceGraphClientOptionalParams); // (undocumented) operations: Operations; + // (undocumented) + query: Query; + resourceChangeDetails(parameters: ResourceChangeDetailsRequestParameters, options?: ResourceChangeDetailsOptionalParams): Promise; + resourceChanges(parameters: ResourceChangesRequestParameters, options?: ResourceChangesOptionalParams): Promise; resources(query: QueryRequest, options?: ResourcesOptionalParams): Promise; resourcesHistory(request: ResourcesHistoryRequest, options?: ResourcesHistoryOptionalParams): Promise; } // @public export interface ResourceGraphClientOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; - apiVersion?: string; endpoint?: string; } +// @public +export interface ResourcePropertyChange { + afterValue?: string; + beforeValue?: string; + changeCategory: ChangeCategory; + propertyChangeType: PropertyChangeType; + propertyName: string; +} + // @public export interface ResourcesHistoryOptionalParams extends coreClient.OperationOptions { } @@ -191,7 +317,16 @@ export interface ResourcesHistoryRequestOptions { } // @public -export type ResourcesHistoryResponse = Record; +export type ResourcesHistoryResponse = { + [propertyName: string]: any; +}; + +// @public +export interface ResourceSnapshotData { + content?: Record; + snapshotId?: string; + timestamp: Date; +} // @public export interface ResourcesOptionalParams extends coreClient.OperationOptions { @@ -206,12 +341,27 @@ export type ResultFormat = "table" | "objectArray"; // @public export type ResultTruncated = "true" | "false"; +// @public +export type Role = string; + +// @public +export type StatusCategory = string; + +// @public +export interface StatusResponse { + category: StatusCategory; + message: string; +} + // @public export interface Table { columns: Column[]; rows: Record[][]; } +// @public +export type Versions = string; + // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/resourcegraph/arm-resourcegraph/src/models/index.ts b/sdk/resourcegraph/arm-resourcegraph/src/models/index.ts index 4723cd8e275a..01940b97398d 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/models/index.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/models/index.ts @@ -10,6 +10,64 @@ import * as coreClient from "@azure/core-client"; export type FacetUnion = Facet | FacetResult | FacetError; +/** Query Generation Request */ +export interface QueryGenerationRequest { + /** A collection of chat history to provide context in query generation */ + history?: HistoryContext[]; + /** Prompt text from user */ + prompt: string; +} + +/** History content generated by a user, assistant or system role */ +export interface HistoryContext { + /** Content generated by a given role */ + content: string; + /** Role which generates the content e.g., user, assistant or system */ + role: Role; +} + +/** Query Generation Response */ +export interface QueryGenerationResponse { + /** Query generated for a given user prompt text */ + query: string; + /** Status for the query generation result */ + status: StatusResponse; +} + +/** Status */ +export interface StatusResponse { + /** Status category for query generation result */ + category: StatusCategory; + /** Status message for query generation result */ + message: string; +} + +/** An error response from the API. */ +export interface ErrorResponse { + /** Error information. */ + error: ErrorModel; +} + +/** Error details. */ +export interface ErrorModel { + /** Error code identifying the specific error. */ + code: string; + /** A human readable error message. */ + message: string; + /** Error details */ + details?: ErrorDetails[]; +} + +/** Error details. */ +export interface ErrorDetails { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** Error code identifying the specific error. */ + code: string; + /** A human readable error message. */ + message: string; +} + /** Describes a query to be executed. */ export interface QueryRequest { /** Azure subscriptions against which to execute the query. */ @@ -84,32 +142,6 @@ export interface Facet { expression: string; } -/** An error response from the API. */ -export interface ErrorResponse { - /** Error information. */ - error: ErrorModel; -} - -/** Error details. */ -export interface ErrorModel { - /** Error code identifying the specific error. */ - code: string; - /** A human readable error message. */ - message: string; - /** Error details */ - details?: ErrorDetails[]; -} - -/** Error details. */ -export interface ErrorDetails { - /** Describes unknown properties. The value of an unknown property can be of "any" type. */ - [property: string]: any; - /** Error code identifying the specific error. */ - code: string; - /** A human readable error message. */ - message: string; -} - /** Result of the request to list Resource Graph operations. It contains a list of operations and a URL link to get the next set of results. */ export interface OperationListResult { /** List of Resource Graph operations supported by the Resource Graph resource provider. */ @@ -172,6 +204,91 @@ export interface DateTimeInterval { end: Date; } +/** The parameters for a specific changes request. */ +export interface ResourceChangesRequestParameters { + /** Specifies the list of resources for a changes request. */ + resourceIds?: string[]; + /** The subscription id of resources to query the changes from. */ + subscriptionId?: string; + /** Specifies the date and time interval for a changes request. */ + interval: ResourceChangesRequestParametersInterval; + /** Acts as the continuation token for paged responses. */ + skipToken?: string; + /** The maximum number of changes the client can accept in a paged response. */ + top?: number; + /** The table name to query resources from. */ + table?: string; + /** The flag if set to true will fetch property changes */ + fetchPropertyChanges?: boolean; + /** The flag if set to true will fetch change snapshots */ + fetchSnapshots?: boolean; +} + +/** A list of changes associated with a resource over a specific time interval. */ +export interface ResourceChangeList { + /** + * The pageable value returned by the operation, i.e. a list of changes to the resource. + * + * - The list is ordered from the most recent changes to the least recent changes. + * - This list will be empty if there were no changes during the requested interval. + * - The `Before` snapshot timestamp value of the oldest change can be outside of the specified time interval. + */ + changes?: ResourceChangeData[]; + /** Skip token that encodes the skip information while executing the current request */ + skipToken?: any; +} + +/** Data on a specific change, represented by a pair of before and after resource snapshots. */ +export interface ResourceChangeData { + /** The resource for a change. */ + resourceId?: string; + /** The change ID. Valid and unique within the specified resource only. */ + changeId: string; + /** The snapshot before the change. */ + beforeSnapshot: ResourceChangeDataBeforeSnapshot; + /** The snapshot after the change. */ + afterSnapshot: ResourceChangeDataAfterSnapshot; + /** The change type for snapshot. PropertyChanges will be provided in case of Update change type */ + changeType?: ChangeType; + /** An array of resource property change */ + propertyChanges?: ResourcePropertyChange[]; +} + +/** Data on a specific resource snapshot. */ +export interface ResourceSnapshotData { + /** The ID of the snapshot. */ + snapshotId?: string; + /** + * The time when the snapshot was created. + * The snapshot timestamp provides an approximation as to when a modification to a resource was detected. There can be a difference between the actual modification time and the detection time. This is due to differences in how operations that modify a resource are processed, versus how operation that record resource snapshots are processed. + */ + timestamp: Date; + /** The resource snapshot content (in resourceChangeDetails response only). */ + content?: Record; +} + +/** The resource property change */ +export interface ResourcePropertyChange { + /** The property name */ + propertyName: string; + /** The property value in before snapshot */ + beforeValue?: string; + /** The property value in after snapshot */ + afterValue?: string; + /** The change category. */ + changeCategory: ChangeCategory; + /** The property change Type */ + propertyChangeType: PropertyChangeType; +} + +/** The parameters for a specific change details request. */ +export interface ResourceChangeDetailsRequestParameters { + /** Specifies the list of resources for a change details request. */ + resourceIds: string[]; + /** Specifies the list of change IDs for a change details request. */ + changeIds: string[]; +} + /** Query output in tabular format. */ export interface Table { /** Query result column descriptors. */ @@ -208,6 +325,70 @@ export interface FacetError extends Facet { errors: ErrorDetails[]; } +/** Specifies the date and time interval for a changes request. */ +export interface ResourceChangesRequestParametersInterval + extends DateTimeInterval {} + +/** The snapshot before the change. */ +export interface ResourceChangeDataBeforeSnapshot + extends ResourceSnapshotData {} + +/** The snapshot after the change. */ +export interface ResourceChangeDataAfterSnapshot extends ResourceSnapshotData {} + +/** Known values of {@link Role} that the service accepts. */ +export enum KnownRole { + /** If a message was generated by a human, the role should be assigned user */ + User = "user", + /** If a message was generated by ARG Query Generation service, then the role should be assistant */ + Assistant = "assistant", + /** If a message provides high level instructions for the query generation, then the role should be system */ + System = "system" +} + +/** + * Defines values for Role. \ + * {@link KnownRole} can be used interchangeably with Role, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user**: If a message was generated by a human, the role should be assigned user \ + * **assistant**: If a message was generated by ARG Query Generation service, then the role should be assistant \ + * **system**: If a message provides high level instructions for the query generation, then the role should be system + */ +export type Role = string; + +/** Known values of {@link StatusCategory} that the service accepts. */ +export enum KnownStatusCategory { + /** Succeeded when query was generated successfully */ + Succeeded = "Succeeded", + /** Failed when query was not generated */ + Failed = "Failed" +} + +/** + * Defines values for StatusCategory. \ + * {@link KnownStatusCategory} can be used interchangeably with StatusCategory, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Succeeded when query was generated successfully \ + * **Failed**: Failed when query was not generated + */ +export type StatusCategory = string; + +/** Known values of {@link Versions} that the service accepts. */ +export enum KnownVersions { + /** The 2023-09-01-preview version. */ + V20230901Preview = "2023-09-01-preview" +} + +/** + * Defines values for Versions. \ + * {@link KnownVersions} can be used interchangeably with Versions, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **2023-09-01-preview**: The 2023-09-01-preview version. + */ +export type Versions = string; /** Defines values for ResultFormat. */ export type ResultFormat = "table" | "objectArray"; /** Defines values for AuthorizationScopeFilter. */ @@ -220,6 +401,12 @@ export type AuthorizationScopeFilter = export type FacetSortOrder = "asc" | "desc"; /** Defines values for ResultTruncated. */ export type ResultTruncated = "true" | "false"; +/** Defines values for ChangeType. */ +export type ChangeType = "Create" | "Update" | "Delete"; +/** Defines values for ChangeCategory. */ +export type ChangeCategory = "User" | "System"; +/** Defines values for PropertyChangeType. */ +export type PropertyChangeType = "Insert" | "Update" | "Remove"; /** Defines values for ColumnDataType. */ export type ColumnDataType = | "string" @@ -229,6 +416,13 @@ export type ColumnDataType = | "object" | "datetime"; +/** Optional parameters. */ +export interface QueryGenerateQueryOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the generateQuery operation. */ +export type QueryGenerateQueryResponse = QueryGenerationResponse; + /** Optional parameters. */ export interface ResourcesOptionalParams extends coreClient.OperationOptions {} @@ -240,7 +434,21 @@ export interface ResourcesHistoryOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the resourcesHistory operation. */ -export type ResourcesHistoryResponse = Record; +export type ResourcesHistoryResponse = { [propertyName: string]: any }; + +/** Optional parameters. */ +export interface ResourceChangesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the resourceChanges operation. */ +export type ResourceChangesResponse = ResourceChangeList; + +/** Optional parameters. */ +export interface ResourceChangeDetailsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the resourceChangeDetails operation. */ +export type ResourceChangeDetailsResponse = ResourceChangeData[]; /** Optional parameters. */ export interface OperationsListOptionalParams @@ -252,10 +460,6 @@ export type OperationsListResponse = OperationListResult; /** Optional parameters. */ export interface ResourceGraphClientOptionalParams extends coreClient.ServiceClientOptions { - /** server parameter */ - $host?: string; - /** Api Version */ - apiVersion?: string; /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/resourcegraph/arm-resourcegraph/src/models/mappers.ts b/sdk/resourcegraph/arm-resourcegraph/src/models/mappers.ts index 1d45b2a7e03a..fae9db1ae37f 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/models/mappers.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/models/mappers.ts @@ -8,6 +8,178 @@ import * as coreClient from "@azure/core-client"; +export const QueryGenerationRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QueryGenerationRequest", + modelProperties: { + history: { + serializedName: "history", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HistoryContext" + } + } + } + }, + prompt: { + serializedName: "prompt", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const HistoryContext: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HistoryContext", + modelProperties: { + content: { + serializedName: "content", + required: true, + type: { + name: "String" + } + }, + role: { + serializedName: "role", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const QueryGenerationResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QueryGenerationResponse", + modelProperties: { + query: { + serializedName: "query", + required: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "Composite", + className: "StatusResponse" + } + } + } + } +}; + +export const StatusResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StatusResponse", + modelProperties: { + category: { + serializedName: "category", + required: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + } +}; + +export const ErrorModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + code: { + serializedName: "code", + required: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + required: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetails" + } + } + } + } + } + } +}; + +export const ErrorDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetails", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + code: { + serializedName: "code", + required: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const QueryRequest: coreClient.CompositeMapper = { type: { name: "Composite", @@ -273,81 +445,6 @@ export const Facet: coreClient.CompositeMapper = { } }; -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorModel" - } - } - } - } -}; - -export const ErrorModel: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorModel", - modelProperties: { - code: { - serializedName: "code", - required: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - required: true, - type: { - name: "String" - } - }, - details: { - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetails" - } - } - } - } - } - } -}; - -export const ErrorDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetails", - additionalProperties: { type: { name: "Object" } }, - modelProperties: { - code: { - serializedName: "code", - required: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - required: true, - type: { - name: "String" - } - } - } - } -}; - export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -545,6 +642,261 @@ export const DateTimeInterval: coreClient.CompositeMapper = { } }; +export const ResourceChangesRequestParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceChangesRequestParameters", + modelProperties: { + resourceIds: { + serializedName: "resourceIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + subscriptionId: { + serializedName: "subscriptionId", + type: { + name: "String" + } + }, + interval: { + serializedName: "interval", + type: { + name: "Composite", + className: "ResourceChangesRequestParametersInterval" + } + }, + skipToken: { + serializedName: "$skipToken", + type: { + name: "String" + } + }, + top: { + constraints: { + InclusiveMaximum: 1000, + InclusiveMinimum: 1 + }, + serializedName: "$top", + type: { + name: "Number" + } + }, + table: { + serializedName: "table", + type: { + name: "String" + } + }, + fetchPropertyChanges: { + serializedName: "fetchPropertyChanges", + type: { + name: "Boolean" + } + }, + fetchSnapshots: { + serializedName: "fetchSnapshots", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ResourceChangeList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceChangeList", + modelProperties: { + changes: { + serializedName: "changes", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceChangeData" + } + } + } + }, + skipToken: { + serializedName: "$skipToken", + type: { + name: "any" + } + } + } + } +}; + +export const ResourceChangeData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceChangeData", + modelProperties: { + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + changeId: { + serializedName: "changeId", + required: true, + type: { + name: "String" + } + }, + beforeSnapshot: { + serializedName: "beforeSnapshot", + type: { + name: "Composite", + className: "ResourceChangeDataBeforeSnapshot" + } + }, + afterSnapshot: { + serializedName: "afterSnapshot", + type: { + name: "Composite", + className: "ResourceChangeDataAfterSnapshot" + } + }, + changeType: { + serializedName: "changeType", + type: { + name: "Enum", + allowedValues: ["Create", "Update", "Delete"] + } + }, + propertyChanges: { + serializedName: "propertyChanges", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourcePropertyChange" + } + } + } + } + } + } +}; + +export const ResourceSnapshotData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceSnapshotData", + modelProperties: { + snapshotId: { + serializedName: "snapshotId", + type: { + name: "String" + } + }, + timestamp: { + serializedName: "timestamp", + required: true, + type: { + name: "DateTime" + } + }, + content: { + serializedName: "content", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const ResourcePropertyChange: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourcePropertyChange", + modelProperties: { + propertyName: { + serializedName: "propertyName", + required: true, + type: { + name: "String" + } + }, + beforeValue: { + serializedName: "beforeValue", + type: { + name: "String" + } + }, + afterValue: { + serializedName: "afterValue", + type: { + name: "String" + } + }, + changeCategory: { + serializedName: "changeCategory", + required: true, + type: { + name: "Enum", + allowedValues: ["User", "System"] + } + }, + propertyChangeType: { + serializedName: "propertyChangeType", + required: true, + type: { + name: "Enum", + allowedValues: ["Insert", "Update", "Remove"] + } + } + } + } +}; + +export const ResourceChangeDetailsRequestParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceChangeDetailsRequestParameters", + modelProperties: { + resourceIds: { + serializedName: "resourceIds", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + changeIds: { + serializedName: "changeIds", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + export const Table: coreClient.CompositeMapper = { type: { name: "Composite", @@ -677,6 +1029,36 @@ export const FacetError: coreClient.CompositeMapper = { } }; +export const ResourceChangesRequestParametersInterval: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceChangesRequestParametersInterval", + modelProperties: { + ...DateTimeInterval.type.modelProperties + } + } +}; + +export const ResourceChangeDataBeforeSnapshot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceChangeDataBeforeSnapshot", + modelProperties: { + ...ResourceSnapshotData.type.modelProperties + } + } +}; + +export const ResourceChangeDataAfterSnapshot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceChangeDataAfterSnapshot", + modelProperties: { + ...ResourceSnapshotData.type.modelProperties + } + } +}; + export let discriminators = { Facet: Facet, "Facet.FacetResult": FacetResult, diff --git a/sdk/resourcegraph/arm-resourcegraph/src/models/parameters.ts b/sdk/resourcegraph/arm-resourcegraph/src/models/parameters.ts index 1a4e73d15e5c..a7211ae33ceb 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/models/parameters.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/models/parameters.ts @@ -12,8 +12,11 @@ import { OperationQueryParameter } from "@azure/core-client"; import { + QueryGenerationRequest as QueryGenerationRequestMapper, QueryRequest as QueryRequestMapper, - ResourcesHistoryRequest as ResourcesHistoryRequestMapper + ResourcesHistoryRequest as ResourcesHistoryRequestMapper, + ResourceChangesRequestParameters as ResourceChangesRequestParametersMapper, + ResourceChangeDetailsRequestParameters as ResourceChangeDetailsRequestParametersMapper } from "../models/mappers"; export const contentType: OperationParameter = { @@ -28,9 +31,9 @@ export const contentType: OperationParameter = { } }; -export const query: OperationParameter = { - parameterPath: "query", - mapper: QueryRequestMapper +export const body: OperationParameter = { + parameterPath: "body", + mapper: QueryGenerationRequestMapper }; export const accept: OperationParameter = { @@ -60,7 +63,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-06-01-preview", + defaultValue: "2023-09-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -69,7 +72,46 @@ export const apiVersion: OperationQueryParameter = { } }; +export const query: OperationParameter = { + parameterPath: "query", + mapper: QueryRequestMapper +}; + export const request: OperationParameter = { parameterPath: "request", mapper: ResourcesHistoryRequestMapper }; + +export const apiVersion1: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-06-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: ResourceChangesRequestParametersMapper +}; + +export const apiVersion2: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2020-09-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: ResourceChangeDetailsRequestParametersMapper +}; diff --git a/sdk/resourcegraph/arm-resourcegraph/src/operations/index.ts b/sdk/resourcegraph/arm-resourcegraph/src/operations/index.ts index afc67b73542c..617d9c071da6 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/operations/index.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/operations/index.ts @@ -6,4 +6,5 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./query"; export * from "./operations"; diff --git a/sdk/resourcegraph/arm-resourcegraph/src/operations/query.ts b/sdk/resourcegraph/arm-resourcegraph/src/operations/query.ts new file mode 100644 index 000000000000..0ce9a78f4c47 --- /dev/null +++ b/sdk/resourcegraph/arm-resourcegraph/src/operations/query.ts @@ -0,0 +1,67 @@ +/* + * 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 { Query } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ResourceGraphClient } from "../resourceGraphClient"; +import { + QueryGenerationRequest, + QueryGenerateQueryOptionalParams, + QueryGenerateQueryResponse +} from "../models"; + +/** Class containing Query operations. */ +export class QueryImpl implements Query { + private readonly client: ResourceGraphClient; + + /** + * Initialize a new instance of the class Query class. + * @param client Reference to the service client + */ + constructor(client: ResourceGraphClient) { + this.client = client; + } + + /** + * Generates ARG query for a given user prompt. + * @param body Query Generation Request + * @param options The options parameters. + */ + generateQuery( + body: QueryGenerationRequest, + options?: QueryGenerateQueryOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { body, options }, + generateQueryOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const generateQueryOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceGraph/generateQuery", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.QueryGenerationResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; diff --git a/sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/index.ts b/sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/index.ts index afc67b73542c..617d9c071da6 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/index.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/index.ts @@ -6,4 +6,5 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./query"; export * from "./operations"; diff --git a/sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/query.ts b/sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/query.ts new file mode 100644 index 000000000000..c55e9512e162 --- /dev/null +++ b/sdk/resourcegraph/arm-resourcegraph/src/operationsInterfaces/query.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + QueryGenerationRequest, + QueryGenerateQueryOptionalParams, + QueryGenerateQueryResponse +} from "../models"; + +/** Interface representing a Query. */ +export interface Query { + /** + * Generates ARG query for a given user prompt. + * @param body Query Generation Request + * @param options The options parameters. + */ + generateQuery( + body: QueryGenerationRequest, + options?: QueryGenerateQueryOptionalParams + ): Promise; +} diff --git a/sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClient.ts b/sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClient.ts index 973eea7a8eb2..a782df17fcf7 100644 --- a/sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClient.ts +++ b/sdk/resourcegraph/arm-resourcegraph/src/resourceGraphClient.ts @@ -8,14 +8,9 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import { - PipelineRequest, - PipelineResponse, - SendRequest -} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { OperationsImpl } from "./operations"; -import { Operations } from "./operationsInterfaces"; +import { QueryImpl, OperationsImpl } from "./operations"; +import { Query, Operations } from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; import { @@ -25,25 +20,35 @@ import { ResourcesResponse, ResourcesHistoryRequest, ResourcesHistoryOptionalParams, - ResourcesHistoryResponse + ResourcesHistoryResponse, + ResourceChangesRequestParameters, + ResourceChangesOptionalParams, + ResourceChangesResponse, + ResourceChangeDetailsRequestParameters, + ResourceChangeDetailsOptionalParams, + ResourceChangeDetailsResponse } from "./models"; export class ResourceGraphClient extends coreClient.ServiceClient { $host: string; - apiVersion: string; /** * Initializes a new instance of the ResourceGraphClient class. * @param credentials Subscription credentials which uniquely identify client subscription. + * @param $host server parameter * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, + $host: string, options?: ResourceGraphClientOptionalParams ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } // Initializing default values for options if (!options) { @@ -102,40 +107,10 @@ export class ResourceGraphClient extends coreClient.ServiceClient { }) ); } - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-06-01-preview"; + // Parameter assignments + this.$host = $host; + this.query = new QueryImpl(this); this.operations = new OperationsImpl(this); - this.addCustomApiVersionPolicy(options.apiVersion); - } - - /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ - private addCustomApiVersionPolicy(apiVersion?: string) { - if (!apiVersion) { - return; - } - const apiVersionPolicy = { - name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest - ): Promise { - const param = request.url.split("?"); - if (param.length > 1) { - const newParams = param[1].split("&").map((item) => { - if (item.indexOf("api-version") > -1) { - return "api-version=" + apiVersion; - } else { - return item; - } - }); - request.url = param[0] + "?" + newParams.join("&"); - } - return next(request); - } - }; - this.pipeline.addPolicy(apiVersionPolicy); } /** @@ -168,6 +143,37 @@ export class ResourceGraphClient extends coreClient.ServiceClient { ); } + /** + * List changes to a resource for a given time interval. + * @param parameters the parameters for this request for changes. + * @param options The options parameters. + */ + resourceChanges( + parameters: ResourceChangesRequestParameters, + options?: ResourceChangesOptionalParams + ): Promise { + return this.sendOperationRequest( + { parameters, options }, + resourceChangesOperationSpec + ); + } + + /** + * Get resource change details. + * @param parameters The parameters for this request for resource change details. + * @param options The options parameters. + */ + resourceChangeDetails( + parameters: ResourceChangeDetailsRequestParameters, + options?: ResourceChangeDetailsOptionalParams + ): Promise { + return this.sendOperationRequest( + { parameters, options }, + resourceChangeDetailsOperationSpec + ); + } + + query: Query; operations: Operations; } // Operation Specifications @@ -205,7 +211,50 @@ const resourcesHistoryOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.request, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const resourceChangesOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceGraph/resourceChanges", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ResourceChangeList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion2], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const resourceChangeDetailsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceGraph/resourceChangeDetails", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: { + type: { + name: "Sequence", + element: { + type: { name: "Composite", className: "ResourceChangeData" } + } + } + } + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", diff --git a/sdk/resourcegraph/arm-resourcegraph/tsconfig.json b/sdk/resourcegraph/arm-resourcegraph/tsconfig.json index a3decb7f3969..3e6ae96443f3 100644 --- a/sdk/resourcegraph/arm-resourcegraph/tsconfig.json +++ b/sdk/resourcegraph/arm-resourcegraph/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-resourcegraph": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"