diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index c1aa47916a97..0bdb1dfe71ee 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -902,6 +902,9 @@ dependencies: '@rush-temp/defender-easm': specifier: file:./projects/defender-easm.tgz version: file:projects/defender-easm.tgz + '@rush-temp/defender-easm-rest': + specifier: file:./projects/defender-easm-rest.tgz + version: file:projects/defender-easm-rest.tgz '@rush-temp/dev-tool': specifier: file:./projects/dev-tool.tgz version: file:projects/dev-tool.tgz @@ -3909,7 +3912,7 @@ packages: /@types/bunyan@1.8.9: resolution: {integrity: sha512-ZqS9JGpBxVOvsawzmVt30sP++gSQMTejCkIAQ3VdadOcRE8izTyW66hufvwLeH+YEGP6Js2AW7Gz+RMyvrEbmw==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/chai-as-promised@7.1.8: @@ -3949,7 +3952,7 @@ packages: /@types/cors@2.8.17: resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/debug@4.1.12: @@ -3988,7 +3991,7 @@ packages: /@types/express-serve-static-core@4.19.6: resolution: {integrity: sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 '@types/qs': 6.9.16 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -4007,7 +4010,7 @@ packages: resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/http-errors@2.0.4: @@ -4024,7 +4027,7 @@ packages: /@types/is-buffer@2.0.2: resolution: {integrity: sha512-G6OXy83Va+xEo8XgqAJYOuvOMxeey9xM5XKkvwJNmN8rVdcB+r15HvHsG86hl86JvU0y1aa7Z2ERkNFYWw9ySg==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/json-schema@7.0.15: @@ -4034,19 +4037,19 @@ packages: /@types/jsonfile@6.1.4: resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/jsonwebtoken@9.0.7: resolution: {integrity: sha512-ugo316mmTYBl2g81zDFnZ7cfxlut3o+/EQdaP7J8QN2kY6lJ22hmQYCK5EHcJHbrW+dkCGSCPgbG8JtYj6qSrg==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/jws@3.2.10: resolution: {integrity: sha512-cOevhttJmssERB88/+XvZXvsq5m9JLKZNUiGfgjUb5lcPRdV2ZQciU6dU76D/qXXFYpSqkP3PrSg4hMTiafTZw==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/linkify-it@5.0.0: @@ -4099,7 +4102,7 @@ packages: /@types/mysql@2.15.26: resolution: {integrity: sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/node-fetch@2.6.11: @@ -4150,7 +4153,7 @@ packages: /@types/pg@8.6.1: resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 pg-protocol: 1.7.0 pg-types: 2.2.0 dev: false @@ -4177,7 +4180,7 @@ packages: /@types/readdir-glob@1.1.5: resolution: {integrity: sha512-raiuEPUYqXu+nvtY2Pe8s8FEmZ3x5yAH4VkLdihcPdalvsHltomrRC9BzuStrJ9yk06470hS0Crw0f1pXqD+Hg==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/resolve@1.20.2: @@ -4228,13 +4231,13 @@ packages: /@types/stoppable@1.1.3: resolution: {integrity: sha512-7wGKIBJGE4ZxFjk9NkjAxZMLlIXroETqP1FJCdoSvKmEznwmBxQFmTB1dsCkAvVcNemuSZM5qkkd9HE/NL2JTw==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/through@0.0.33: resolution: {integrity: sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/tough-cookie@4.0.5: @@ -4268,7 +4271,7 @@ packages: /@types/ws@7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false /@types/ws@8.5.12: @@ -4291,7 +4294,7 @@ packages: resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} requiresBuild: true dependencies: - '@types/node': 18.19.57 + '@types/node': 22.7.7 dev: false optional: true @@ -4903,7 +4906,7 @@ packages: /ajv-formats@3.0.1: resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} dependencies: - ajv: 8.13.0 + ajv: 8.17.1 dev: false /ajv@6.12.6: @@ -6098,7 +6101,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.17 - '@types/node': 18.19.57 + '@types/node': 22.7.7 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.7.2 @@ -9506,7 +9509,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 18.19.57 + '@types/node': 22.7.7 long: 5.2.3 dev: false @@ -21273,6 +21276,46 @@ packages: - utf-8-validate dev: false + file:projects/defender-easm-rest.tgz: + resolution: {integrity: sha512-qZo4npf1R468T7XR6n4diYU7GglJLVC4mAdu0DU/ptFa1GWWgcLeJJd8Qo7+nB7H4eBJvpmrJvBXCzYgDJ2eQA==, tarball: file:projects/defender-easm-rest.tgz} + name: '@rush-temp/defender-easm-rest' + version: 0.0.0 + dependencies: + '@microsoft/api-extractor': 7.47.11(@types/node@18.19.57) + '@types/node': 18.19.57 + '@vitest/browser': 2.1.3(playwright@1.48.1)(typescript@5.5.4)(vitest@2.1.3) + '@vitest/coverage-istanbul': 2.1.3(vitest@2.1.3) + dotenv: 16.4.5 + eslint: 8.57.1 + mkdirp: 3.0.1 + playwright: 1.48.1 + prettier: 3.3.3 + rimraf: 5.0.10 + tshy: 1.18.0 + tslib: 2.8.0 + typescript: 5.5.4 + vitest: 2.1.3(@types/node@18.19.57)(@vitest/browser@2.1.3) + transitivePeerDependencies: + - '@edge-runtime/vm' + - '@vitest/ui' + - bufferutil + - happy-dom + - jsdom + - less + - lightningcss + - msw + - safaridriver + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - utf-8-validate + - vite + - webdriverio + dev: false + file:projects/defender-easm.tgz: resolution: {integrity: sha512-BocgBDcvhUdkw/U4W+vt8WexyU396P1FcGpgdXZOQ3Y9Fe56tzVaHr4Y2P/ju4KbFc249kjnNVvl0byCKyIczg==, tarball: file:projects/defender-easm.tgz} name: '@rush-temp/defender-easm' diff --git a/rush.json b/rush.json index 761d2c09827b..9379b69e930f 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -2291,6 +2291,11 @@ "packageName": "@azure/arm-trustedsigning", "projectFolder": "sdk/trustedsigning/arm-trustedsigning", "versionPolicyName": "management" + }, + { + "packageName": "@azure-rest/defender-easm-rest", + "projectFolder": "sdk/easm/defendereasm-rest", + "versionPolicyName": "client" } ] -} +} \ No newline at end of file diff --git a/sdk/easm/ci.yml b/sdk/easm/ci.yml index 9cdf7397ee28..36f343190f98 100644 --- a/sdk/easm/ci.yml +++ b/sdk/easm/ci.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -9,7 +9,6 @@ trigger: paths: include: - sdk/iot/ - pr: branches: include: @@ -17,10 +16,11 @@ pr: - feature/* - release/* - hotfix/* + exclude: + - feature/v4 paths: include: - sdk/easm/ - extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -28,3 +28,5 @@ extends: Artifacts: - name: azure-rest-defender-easm safeName: azurerestdefendereasm + - name: azure-rest-defender-easm-rest + safeName: azurerestdefendereasmrest diff --git a/sdk/easm/defendereasm-rest/CHANGELOG.md b/sdk/easm/defendereasm-rest/CHANGELOG.md new file mode 100644 index 000000000000..3dc4098bd8e6 --- /dev/null +++ b/sdk/easm/defendereasm-rest/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0-beta.1 (2024-10-22) + + - Initial Release diff --git a/sdk/easm/defendereasm-rest/LICENSE b/sdk/easm/defendereasm-rest/LICENSE new file mode 100644 index 000000000000..7d5934740965 --- /dev/null +++ b/sdk/easm/defendereasm-rest/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/easm/defendereasm-rest/README.md b/sdk/easm/defendereasm-rest/README.md new file mode 100644 index 000000000000..0550c8683cd6 --- /dev/null +++ b/sdk/easm/defendereasm-rest/README.md @@ -0,0 +1,57 @@ +# Azure Easm REST client library for JavaScript + +Defender EASM discovers and maps your digital attack surface to provide an "outside-in" perspective using probes to discover assets. The assets are provided with detailed metadata associated, including vulnerabilities, configurations and web components, allowing customers to view and prioritize external risk. The EASM REST API enables you to develop clients that integrate with your application. + +**Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library** + +Key links: + +- [Package (NPM)](https://www.npmjs.com/package/@azure-rest/defender-easm-rest) +- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure-rest/defender-easm-rest?view=azure-node-preview) + +## Getting started + +### Currently supported environments + +- LTS versions of Node.js + +### Prerequisites + +- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package. + +### Install the `@azure-rest/defender-easm-rest` package + +Install the Azure Easm REST client REST client library for JavaScript with `npm`: + +```bash +npm install @azure-rest/defender-easm-rest +``` + +### Create and authenticate a `EasmClient` + +To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token), +provide an instance of the desired credential type obtained from the +[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library. + +To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) + +After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use. +As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential) +can be used to authenticate the client. + +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: +AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); + +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). diff --git a/sdk/easm/defendereasm-rest/api-extractor.json b/sdk/easm/defendereasm-rest/api-extractor.json new file mode 100644 index 000000000000..1fd9bd28fd32 --- /dev/null +++ b/sdk/easm/defendereasm-rest/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist/esm/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/defender-easm-rest.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/easm/defendereasm-rest/eslint.config.mjs b/sdk/easm/defendereasm-rest/eslint.config.mjs new file mode 100644 index 000000000000..113bdc3eaf5f --- /dev/null +++ b/sdk/easm/defendereasm-rest/eslint.config.mjs @@ -0,0 +1,17 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default [ + ...azsdkEslint.configs.recommended, + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-apiextractor-json-types": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-module": "off", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn" + } + } +]; diff --git a/sdk/easm/defendereasm-rest/package.json b/sdk/easm/defendereasm-rest/package.json new file mode 100644 index 000000000000..aba1484cf7f9 --- /dev/null +++ b/sdk/easm/defendereasm-rest/package.json @@ -0,0 +1,137 @@ +{ + "name": "@azure-rest/defender-easm-rest", + "version": "1.0.0-beta.1", + "description": "A generated SDK for EasmClient.", + "engines": { + "node": ">=18.0.0" + }, + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false + }, + "type": "module", + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "files": [ + "dist", + "README.md", + "LICENSE", + "review/*", + "CHANGELOG.md" + ], + "sdk-type": "client", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/easmClient.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@azure-rest/core-client": "^2.1.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.5.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.6.2", + "@azure/core-paging": "^1.5.0" + }, + "devDependencies": { + "dotenv": "^16.0.0", + "@microsoft/api-extractor": "^7.40.3", + "@types/node": "^18.0.0", + "eslint": "^8.55.0", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "mkdirp": "^3.0.1", + "typescript": "~5.5.3", + "tshy": "^1.11.1", + "@azure/identity": "^4.2.1", + "@vitest/browser": "^2.0.5", + "@vitest/coverage-istanbul": "^2.0.5", + "playwright": "^1.41.2", + "vitest": "^2.0.5", + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0" + }, + "scripts": { + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "rimraf review && mkdirp ./review && dev-tool run extract-api", + "pack": "npm pack 2>&1", + "lint": "eslint package.json api-extractor.json src test", + "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser", + "unit-test:node": "dev-tool run test:vitest", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", + "build:samples": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "execute:samples": "echo skipped", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "generate:client": "echo skipped", + "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "build:test": "npm run clean && tshy && dev-tool run build-test", + "build": "npm run clean && tshy && mkdirp ./review && dev-tool run extract-api", + "test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "source": "./src/index.ts", + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "source": "./src/index.ts", + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "source": "./src/index.ts", + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "source": "./src/index.ts", + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts" +} \ No newline at end of file diff --git a/sdk/easm/defendereasm-rest/review/defender-easm-rest.api.md b/sdk/easm/defendereasm-rest/review/defender-easm-rest.api.md new file mode 100644 index 000000000000..d5695fd53c59 --- /dev/null +++ b/sdk/easm/defendereasm-rest/review/defender-easm-rest.api.md @@ -0,0 +1,3529 @@ +## API Report File for "@azure-rest/defender-easm-rest" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { ClientOptions } from '@azure-rest/core-client'; +import { ErrorResponse } from '@azure-rest/core-client'; +import { HttpResponse } from '@azure-rest/core-client'; +import { Paged } from '@azure/core-paging'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PathUncheckedResponse } from '@azure-rest/core-client'; +import { RawHttpHeaders } from '@azure/core-rest-pipeline'; +import { RequestParameters } from '@azure-rest/core-client'; +import { StreamableMethod } from '@azure-rest/core-client'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export interface ActionParameters { + name?: string; + value?: string; +} + +// @public +export interface ActionParametersOutput { + name?: string; + value?: string; +} + +// @public (undocumented) +export interface AlexaInfoOutput { + // (undocumented) + alexaRank?: number; + // (undocumented) + category?: string; + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + recent?: boolean; +} + +// @public (undocumented) +export interface AsAssetOutput extends InventoryAssetOutput { + // (undocumented) + adminContacts?: Array; + // (undocumented) + adminNames?: Array; + // (undocumented) + adminOrgs?: Array; + // (undocumented) + adminPhones?: Array; + // (undocumented) + asn?: number; + // (undocumented) + asNames?: Array; + // (undocumented) + count?: number; + // (undocumented) + countries?: Array; + // (undocumented) + detailedFromWhoisAt?: string; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + orgIds?: Array; + // (undocumented) + orgNames?: Array; + // (undocumented) + registrantContacts?: Array; + // (undocumented) + registrantNames?: Array; + // (undocumented) + registrantPhones?: Array; + // (undocumented) + registrarCreatedAt?: Array; + // (undocumented) + registrarNames?: Array; + // (undocumented) + registrarUpdatedAt?: Array; + // (undocumented) + registries?: Array; + // (undocumented) + sources?: Array; + // (undocumented) + technicalContacts?: Array; + // (undocumented) + technicalNames?: Array; + // (undocumented) + technicalOrgs?: Array; + // (undocumented) + technicalPhones?: Array; +} + +// @public (undocumented) +export interface AsAssetResourceOutput extends AssetResourceOutputParent { + asset: AsAssetOutput; + kind: "as"; +} + +// @public +export interface AssetChainKindSummaryResultOutput { + affectedCount: number; + kind: AssetKindOutput; +} + +// @public +export interface AssetChainRequest { + assetChainSource: AssetChainSource; + sourceIds: string[]; +} + +// @public +export type AssetChainSource = string; + +// @public +export interface AssetChainSummaryResultOutput { + affectedAssetsSummary: Array; + affectedGroupsSummary: Array; + errors?: Array; +} + +// @public +export type AssetKindOutput = string; + +// @public +export interface AssetPageResultOutput { + mark?: string; + nextLink?: string; + totalElements?: number; + value?: Array; +} + +// @public +export type AssetResourceOutput = AssetResourceOutputParent | AsAssetResourceOutput | ContactAssetResourceOutput | DomainAssetResourceOutput | HostAssetResourceOutput | IpAddressAssetResourceOutput | IpBlockAssetResourceOutput | PageAssetResourceOutput | SslCertAssetResourceOutput; + +// @public +export interface AssetResourceOutputParent { + auditTrail?: Array; + createdDate?: string; + discoGroupName?: string; + displayName?: string; + externalId?: string; + readonly id: string; + // (undocumented) + kind: string; + labels?: string[]; + name?: string; + // (undocumented) + reason?: string; + state?: AssetStateOutput; + updatedDate?: string; + uuid?: string; + wildcard?: boolean; +} + +// @public +export type AssetResponseType = string; + +// @public (undocumented) +export interface AssetSecurityPolicyOutput { + // (undocumented) + count?: number; + // (undocumented) + description?: string; + // (undocumented) + firstSeen?: string; + // (undocumented) + isAffected?: boolean; + // (undocumented) + lastSeen?: string; + // (undocumented) + policyName?: string; + // (undocumented) + recent?: boolean; + // (undocumented) + sources?: Array; +} + +// @public +export interface AssetsExportRequest { + columns: string[]; + fileName: string; +} + +// @public +export type AssetStateOutput = string; + +// @public +export interface AssetSummaryResultOutput { + children?: Array; + count?: number; + description?: string; + displayName?: string; + filter?: string; + labelName?: string; + link?: string; + metric?: string; + metricCategory?: string; + updatedAt?: string; +} + +// @public +export interface AssetUpdateData { + externalId?: string; + labels?: Record; + remediations?: Array; + state?: AssetUpdateState; + transfers?: AssetUpdateTransfers; +} + +// @public +export type AssetUpdateState = string; + +// @public +export type AssetUpdateStateOutput = string; + +// @public +export type AssetUpdateTransfers = string; + +// @public (undocumented) +export interface AttributeOutput { + // (undocumented) + attributeType?: string; + // (undocumented) + attributeValue?: string; + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + recent?: boolean; + // (undocumented) + sources?: Array; +} + +// @public +export type AuditTrailItemKindOutput = string; + +// @public +export interface AuditTrailItemOutput { + displayName?: string; + id?: string; + kind?: AuditTrailItemKindOutput; + name?: string; + reason?: string; +} + +// @public (undocumented) +export interface AzureDataExplorerDataConnectionData extends DataConnectionDataParent { + kind: "azureDataExplorer"; + properties: AzureDataExplorerDataConnectionProperties; +} + +// @public (undocumented) +export interface AzureDataExplorerDataConnectionOutput extends DataConnectionOutputParent { + kind: "azureDataExplorer"; + properties: AzureDataExplorerDataConnectionPropertiesOutput; +} + +// @public (undocumented) +export interface AzureDataExplorerDataConnectionProperties extends DataConnectionProperties { + clusterName?: string; + databaseName?: string; + region?: string; +} + +// @public (undocumented) +export interface AzureDataExplorerDataConnectionPropertiesOutput extends DataConnectionPropertiesOutput { + clusterName?: string; + databaseName?: string; + region?: string; +} + +// @public (undocumented) +export interface BannerOutput { + // (undocumented) + banner?: string; + // (undocumented) + bannerMetadata?: string; + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + port?: number; + // (undocumented) + recent?: boolean; + // (undocumented) + scanType?: string; + // (undocumented) + sha256?: string; + // (undocumented) + sources?: Array; +} + +// @public (undocumented) +export interface CancelTask { + post(options?: CancelTaskParameters): StreamableMethod; +} + +// @public +export interface CancelTask200Response extends HttpResponse { + // (undocumented) + body: TaskOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface CancelTaskDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface CancelTaskDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & CancelTaskDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type CancelTaskParameters = RequestParameters; + +// @public +export interface CisaCveResultOutput { + count: number; + readonly cveId: string; + dateAdded: string; + dueDate: string; + notes: string; + product: string; + requiredAction: string; + shortDescription: string; + updatedAt: string; + vendorProject: string; + vulnerabilityName: string; +} + +// @public (undocumented) +export interface ContactAssetOutput extends InventoryAssetOutput { + // (undocumented) + count?: number; + // (undocumented) + email?: string; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + names?: Array; + // (undocumented) + organizations?: Array; + // (undocumented) + sources?: Array; +} + +// @public (undocumented) +export interface ContactAssetResourceOutput extends AssetResourceOutputParent { + asset: ContactAssetOutput; + kind: "contact"; +} + +// @public (undocumented) +export interface CookieOutput { + // (undocumented) + cookieDomain?: string; + // (undocumented) + cookieExpiryDate?: string; + // (undocumented) + cookieName?: string; + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + recent?: boolean; +} + +// @public +function createClient(endpointParam: string, credentials: TokenCredential, { apiVersion, ...options }?: EasmClientOptions): EasmClient; +export default createClient; + +// @public +export interface CreateOrReplaceDataConnection200Response extends HttpResponse { + // (undocumented) + body: DataConnectionOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface CreateOrReplaceDataConnectionBodyParam { + body: DataConnectionData; +} + +// @public (undocumented) +export interface CreateOrReplaceDataConnectionDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface CreateOrReplaceDataConnectionDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & CreateOrReplaceDataConnectionDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type CreateOrReplaceDataConnectionParameters = CreateOrReplaceDataConnectionBodyParam & RequestParameters; + +// @public +export interface CreateOrReplaceDiscoGroup200Response extends HttpResponse { + // (undocumented) + body: DiscoGroupOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface CreateOrReplaceDiscoGroupBodyParam { + body: DiscoGroupData; +} + +// @public (undocumented) +export interface CreateOrReplaceDiscoGroupDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface CreateOrReplaceDiscoGroupDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & CreateOrReplaceDiscoGroupDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type CreateOrReplaceDiscoGroupParameters = CreateOrReplaceDiscoGroupBodyParam & RequestParameters; + +// @public +export interface CreateOrReplacePolicy200Response extends HttpResponse { + // (undocumented) + body: PolicyOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface CreateOrReplacePolicyBodyParam { + // (undocumented) + body: PolicyData; +} + +// @public (undocumented) +export interface CreateOrReplacePolicyDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface CreateOrReplacePolicyDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & CreateOrReplacePolicyDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type CreateOrReplacePolicyParameters = CreateOrReplacePolicyBodyParam & RequestParameters; + +// @public +export interface CreateOrReplaceSavedFilter200Response extends HttpResponse { + // (undocumented) + body: SavedFilterOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface CreateOrReplaceSavedFilterBodyParam { + body: SavedFilterData; +} + +// @public (undocumented) +export interface CreateOrReplaceSavedFilterDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface CreateOrReplaceSavedFilterDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & CreateOrReplaceSavedFilterDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type CreateOrReplaceSavedFilterParameters = CreateOrReplaceSavedFilterBodyParam & RequestParameters; + +// @public (undocumented) +export interface CveOutput { + // (undocumented) + cvss3Summary?: Cvss3SummaryOutput; + // (undocumented) + cvssScore?: number; + // (undocumented) + cweId?: string; + // (undocumented) + name?: string; +} + +// @public (undocumented) +export interface Cvss3SummaryOutput { + // (undocumented) + attackComplexity?: string; + // (undocumented) + attackVector?: string; + // (undocumented) + availabilityImpact?: string; + // (undocumented) + baseScore?: number; + // (undocumented) + baseSeverity?: string; + // (undocumented) + confidentialityImpact?: string; + // (undocumented) + exploitabilityScore?: number; + // (undocumented) + exploitCodeMaturity?: string; + // (undocumented) + impactScore?: number; + // (undocumented) + integrityImpact?: string; + // (undocumented) + privilegesRequired?: string; + // (undocumented) + remediationLevel?: string; + // (undocumented) + reportConfidence?: string; + // (undocumented) + scope?: string; + // (undocumented) + userInteraction?: string; + // (undocumented) + vectorString?: string; + // (undocumented) + version?: string; +} + +// @public +export interface DailyDeltaTypeResponseOutput extends DeltaTypeResponseOutput { + count: number; +} + +// @public +export type DataConnectionContent = string; + +// @public +export type DataConnectionContentOutput = string; + +// @public (undocumented) +export type DataConnectionData = DataConnectionDataParent | LogAnalyticsDataConnectionData | AzureDataExplorerDataConnectionData; + +// @public (undocumented) +export interface DataConnectionDataParent { + content?: DataConnectionContent; + frequency?: DataConnectionFrequency; + frequencyOffset?: number; + // (undocumented) + kind: string; + name?: string; +} + +// @public +export type DataConnectionFrequency = string; + +// @public +export type DataConnectionFrequencyOutput = string; + +// @public (undocumented) +export type DataConnectionOutput = DataConnectionOutputParent | LogAnalyticsDataConnectionOutput | AzureDataExplorerDataConnectionOutput; + +// @public (undocumented) +export interface DataConnectionOutputParent { + active?: boolean; + content?: DataConnectionContentOutput; + readonly createdDate?: string; + displayName?: string; + frequency?: DataConnectionFrequencyOutput; + frequencyOffset?: number; + id?: string; + readonly inactiveMessage?: string; + // (undocumented) + kind: string; + readonly name: string; + readonly updatedDate?: string; + readonly userUpdatedAt?: string; +} + +// @public +export interface DataConnectionProperties { +} + +// @public +export interface DataConnectionPropertiesOutput { +} + +// @public +export interface DeleteDataConnection204Response extends HttpResponse { + // (undocumented) + status: "204"; +} + +// @public (undocumented) +export interface DeleteDataConnectionDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface DeleteDataConnectionDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & DeleteDataConnectionDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type DeleteDataConnectionParameters = RequestParameters; + +// @public +export interface DeleteDiscoGroup204Response extends HttpResponse { + // (undocumented) + status: "204"; +} + +// @public (undocumented) +export interface DeleteDiscoGroupDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface DeleteDiscoGroupDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & DeleteDiscoGroupDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type DeleteDiscoGroupParameters = RequestParameters; + +// @public +export interface DeletePolicy204Response extends HttpResponse { + // (undocumented) + status: "204"; +} + +// @public (undocumented) +export interface DeletePolicyDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface DeletePolicyDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & DeletePolicyDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type DeletePolicyParameters = RequestParameters; + +// @public +export interface DeleteSavedFilter204Response extends HttpResponse { + // (undocumented) + status: "204"; +} + +// @public (undocumented) +export interface DeleteSavedFilterDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface DeleteSavedFilterDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & DeleteSavedFilterDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type DeleteSavedFilterParameters = RequestParameters; + +// @public +export interface DeltaDateResultOutput { + date: string; + deltas: Array; +} + +// @public +export interface DeltaDetailsRequest { + date?: string; + deltaDetailType: DeltaDetailType; + kind: GlobalAssetType; + priorDays?: number; +} + +// @public +export type DeltaDetailType = string; + +// @public (undocumented) +export interface DeltaPageResultOutput { + nextLink?: string; + totalElements?: number; + value?: Array; +} + +// @public +export interface DeltaRangeResultOutput { + added: number; + difference: number; + kindSummaries: Array; + range: number; + removed: number; +} + +// @public +export interface DeltaResultOutput { + createdAt: string; + kind: GlobalAssetTypeOutput; + name: string; + state: GlobalInventoryStateOutput; + updatedAt: string; +} + +// @public +export interface DeltaSummaryRequest { + date?: string; + priorDays?: number; +} + +// @public +export interface DeltaSummaryResultOutput { + daily: Array; + summary: DeltaRangeResultOutput; +} + +// @public +export interface DeltaTypeResponseOutput { + added: number; + difference: number; + kind: GlobalAssetTypeOutput; + removed: number; +} + +// @public (undocumented) +export interface DependentResourceOutput { + // (undocumented) + cached?: boolean; + // (undocumented) + contentType?: string; + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + firstSeenCrawlGuid?: string; + // (undocumented) + firstSeenPageGuid?: string; + // (undocumented) + firstSeenResourceGuid?: string; + // (undocumented) + host?: string; + // (undocumented) + lastObservedActualSriHash?: string; + // (undocumented) + lastObservedExpectedSriHash?: string; + // (undocumented) + lastObservedValidation?: string; + // (undocumented) + lastObservedViolation?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + lastSeenCrawlGuid?: string; + // (undocumented) + lastSeenPageGuid?: string; + // (undocumented) + lastSeenResourceGuid?: string; + // (undocumented) + md5?: string; + // (undocumented) + responseBodyMinhash?: number[]; + // (undocumented) + responseBodySize?: number; + // (undocumented) + sha256?: string; + // (undocumented) + sha384?: string; + // (undocumented) + sha512?: string; + // (undocumented) + sriChecks?: Array; + // (undocumented) + url?: string; +} + +// @public +export interface DiscoGroupData { + description?: string; + excludes?: Array; + frequencyMilliseconds?: number; + name?: string; + names?: string[]; + seeds?: Array; + templateId?: string; + tier?: string; +} + +// @public (undocumented) +export interface DiscoGroupOutput { + createdDate?: string; + description?: string; + displayName?: string; + excludes?: Array; + frequencyMilliseconds?: number; + id?: string; + latestRun?: DiscoRunResultOutput; + readonly name: string; + names?: string[]; + seeds?: Array; + templateId?: string; + tier?: string; +} + +// @public +export interface DiscoGroupSummaryResultOutput { + displayName: string; + id: string; + name: string; +} + +// @public (undocumented) +export interface DiscoRunPageResultOutput { + nextLink?: string; + totalElements?: number; + value?: Array; +} + +// @public +export interface DiscoRunResultOutput { + completedDate?: string; + excludes?: Array; + names?: string[]; + seeds?: Array; + startedDate?: string; + state?: DiscoRunStateOutput; + submittedDate?: string; + tier?: string; + totalAssetsFoundCount?: number; +} + +// @public +export type DiscoRunStateOutput = string; + +// @public +export interface DiscoSource { + kind?: DiscoSourceKind; + name?: string; +} + +// @public +export type DiscoSourceKind = string; + +// @public +export type DiscoSourceKindOutput = string; + +// @public +export interface DiscoSourceOutput { + kind?: DiscoSourceKindOutput; + name?: string; +} + +// @public +export interface DiscoTemplateOutput { + city?: string; + countryCode?: string; + displayName?: string; + readonly id: string; + industry?: string; + name?: string; + names?: string[]; + region?: string; + seeds?: Array; + stateCode?: string; +} + +// @public (undocumented) +export interface DismissAssetChain { + post(options: DismissAssetChainParameters): StreamableMethod; +} + +// @public +export interface DismissAssetChain200Response extends HttpResponse { + // (undocumented) + body: TaskOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface DismissAssetChainBodyParam { + body: AssetChainRequest; +} + +// @public (undocumented) +export interface DismissAssetChainDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface DismissAssetChainDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & DismissAssetChainDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type DismissAssetChainParameters = DismissAssetChainBodyParam & RequestParameters; + +// @public (undocumented) +export interface DomainAssetOutput { + // (undocumented) + adminContacts?: Array; + // (undocumented) + adminNames?: Array; + // (undocumented) + adminOrgs?: Array; + // (undocumented) + adminPhones?: Array; + // (undocumented) + alexaInfos?: Array; + // (undocumented) + count?: number; + // (undocumented) + detailedFromWhoisAt?: string; + // (undocumented) + domain?: string; + // (undocumented) + domainStatuses?: Array; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + mailServers?: Array; + // (undocumented) + nameServers?: Array; + // (undocumented) + parkedDomain?: Array; + // (undocumented) + registrantContacts?: Array; + // (undocumented) + registrantNames?: Array; + // (undocumented) + registrantOrgs?: Array; + // (undocumented) + registrantPhones?: Array; + // (undocumented) + registrarCreatedAt?: Array; + // (undocumented) + registrarExpiresAt?: Array; + // (undocumented) + registrarIanaIds?: Array; + // (undocumented) + registrarNames?: Array; + // (undocumented) + registrarUpdatedAt?: Array; + // (undocumented) + soaRecords?: Array; + // (undocumented) + sources?: Array; + // (undocumented) + technicalContacts?: Array; + // (undocumented) + technicalNames?: Array; + // (undocumented) + technicalOrgs?: Array; + // (undocumented) + technicalPhones?: Array; + // (undocumented) + whoisId?: number; + // (undocumented) + whoisServers?: Array; +} + +// @public (undocumented) +export interface DomainAssetResourceOutput extends AssetResourceOutputParent { + asset: DomainAssetOutput; + kind: "domain"; +} + +// @public (undocumented) +export interface DownloadTask { + post(options?: DownloadTaskParameters): StreamableMethod; +} + +// @public +export interface DownloadTask200Response extends HttpResponse { + // (undocumented) + body: TaskOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface DownloadTaskDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface DownloadTaskDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & DownloadTaskDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type DownloadTaskParameters = RequestParameters; + +// @public (undocumented) +export type EasmClient = Client & { + path: Routes; +}; + +// @public +export interface EasmClientOptions extends ClientOptions { + apiVersion?: string; +} + +// @public +export interface ErrorDetailOutput { + code: string; + details?: Array; + innererror?: InnerErrorOutput; + message: string; + target?: string; +} + +// @public +export type GetArrayType = T extends Array ? TData : never; + +// @public (undocumented) +export interface GetAssetChainSummary { + post(options: GetAssetChainSummaryParameters): StreamableMethod; +} + +// @public +export interface GetAssetChainSummary200Response extends HttpResponse { + // (undocumented) + body: AssetChainSummaryResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetAssetChainSummaryBodyParam { + body: AssetChainRequest; +} + +// @public (undocumented) +export interface GetAssetChainSummaryDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetAssetChainSummaryDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetAssetChainSummaryDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetAssetChainSummaryParameters = GetAssetChainSummaryBodyParam & RequestParameters; + +// @public (undocumented) +export interface GetAssetResource { + get(options?: GetAssetResourceParameters): StreamableMethod; +} + +// @public +export interface GetAssetResource200Response extends HttpResponse { + // (undocumented) + body: AssetResourceOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetAssetResourceDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetAssetResourceDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetAssetResourceDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetAssetResourceParameters = RequestParameters; + +// @public (undocumented) +export interface GetAssetsExport { + post(options: GetAssetsExportParameters): StreamableMethod; +} + +// @public +export interface GetAssetsExport200Response extends HttpResponse { + // (undocumented) + body: TaskOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetAssetsExportBodyParam { + body: AssetsExportRequest; +} + +// @public (undocumented) +export interface GetAssetsExportDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetAssetsExportDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetAssetsExportDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetAssetsExportParameters = GetAssetsExportQueryParam & GetAssetsExportBodyParam & RequestParameters; + +// @public (undocumented) +export interface GetAssetsExportQueryParam { + // (undocumented) + queryParameters?: GetAssetsExportQueryParamProperties; +} + +// @public (undocumented) +export interface GetAssetsExportQueryParamProperties { + filter?: string; + orderby?: string; +} + +// @public (undocumented) +export interface GetBillable { + post(options?: GetBillableParameters): StreamableMethod; +} + +// @public +export interface GetBillable200Response extends HttpResponse { + // (undocumented) + body: ReportBillableAssetSummaryResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetBillableDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetBillableDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetBillableDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetBillableParameters = RequestParameters; + +// @public (undocumented) +export interface GetCisaCve { + get(options?: GetCisaCveParameters): StreamableMethod; +} + +// @public +export interface GetCisaCve200Response extends HttpResponse { + // (undocumented) + body: CisaCveResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetCisaCveDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetCisaCveDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetCisaCveDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetCisaCveParameters = RequestParameters; + +// @public (undocumented) +export interface GetCisaCves { + get(options?: GetCisaCvesParameters): StreamableMethod; +} + +// @public +export interface GetCisaCves200Response extends HttpResponse { + // (undocumented) + body: PagedCisaCveResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetCisaCvesDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetCisaCvesDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetCisaCvesDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetCisaCvesParameters = RequestParameters; + +// @public (undocumented) +export interface GetDataConnection { + delete(options?: DeleteDataConnectionParameters): StreamableMethod; + get(options?: GetDataConnectionParameters): StreamableMethod; + put(options: CreateOrReplaceDataConnectionParameters): StreamableMethod; +} + +// @public +export interface GetDataConnection200Response extends HttpResponse { + // (undocumented) + body: DataConnectionOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetDataConnectionDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetDataConnectionDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetDataConnectionDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetDataConnectionParameters = RequestParameters; + +// @public (undocumented) +export interface GetDeltaDetails { + post(options: GetDeltaDetailsParameters): StreamableMethod; +} + +// @public +export interface GetDeltaDetails200Response extends HttpResponse { + // (undocumented) + body: DeltaPageResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetDeltaDetailsBodyParam { + body: DeltaDetailsRequest; +} + +// @public (undocumented) +export interface GetDeltaDetailsDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetDeltaDetailsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetDeltaDetailsDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetDeltaDetailsParameters = GetDeltaDetailsQueryParam & GetDeltaDetailsBodyParam & RequestParameters; + +// @public (undocumented) +export interface GetDeltaDetailsQueryParam { + // (undocumented) + queryParameters?: GetDeltaDetailsQueryParamProperties; +} + +// @public (undocumented) +export interface GetDeltaDetailsQueryParamProperties { + maxpagesize?: number; + skip?: number; +} + +// @public (undocumented) +export interface GetDeltaSummary { + post(options: GetDeltaSummaryParameters): StreamableMethod; +} + +// @public +export interface GetDeltaSummary200Response extends HttpResponse { + // (undocumented) + body: DeltaSummaryResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetDeltaSummaryBodyParam { + body: DeltaSummaryRequest; +} + +// @public (undocumented) +export interface GetDeltaSummaryDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetDeltaSummaryDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetDeltaSummaryDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetDeltaSummaryParameters = GetDeltaSummaryBodyParam & RequestParameters; + +// @public (undocumented) +export interface GetDiscoGroup { + delete(options?: DeleteDiscoGroupParameters): StreamableMethod; + get(options?: GetDiscoGroupParameters): StreamableMethod; + put(options: CreateOrReplaceDiscoGroupParameters): StreamableMethod; +} + +// @public +export interface GetDiscoGroup200Response extends HttpResponse { + // (undocumented) + body: DiscoGroupOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetDiscoGroupDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetDiscoGroupDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetDiscoGroupDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetDiscoGroupParameters = RequestParameters; + +// @public (undocumented) +export interface GetDiscoTemplate { + get(options?: GetDiscoTemplateParameters): StreamableMethod; +} + +// @public +export interface GetDiscoTemplate200Response extends HttpResponse { + // (undocumented) + body: DiscoTemplateOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetDiscoTemplateDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetDiscoTemplateDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetDiscoTemplateDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetDiscoTemplateParameters = RequestParameters; + +// @public (undocumented) +export interface GetObservations { + post(options?: GetObservationsParameters): StreamableMethod; +} + +// @public +export interface GetObservations200Response extends HttpResponse { + // (undocumented) + body: ObservationPageResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetObservationsDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetObservationsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetObservationsDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetObservationsParameters = GetObservationsQueryParam & RequestParameters; + +// @public (undocumented) +export interface GetObservationsQueryParam { + // (undocumented) + queryParameters?: GetObservationsQueryParamProperties; +} + +// @public (undocumented) +export interface GetObservationsQueryParamProperties { + filter?: string; + maxpagesize?: number; + orderby?: string; + skip?: number; +} + +// @public +export type GetPage = (pageLink: string, maxPageSize?: number) => Promise<{ + page: TPage; + nextPageLink?: string; +}>; + +// @public (undocumented) +export interface GetPolicy { + delete(options?: DeletePolicyParameters): StreamableMethod; + get(options?: GetPolicyParameters): StreamableMethod; + put(options: CreateOrReplacePolicyParameters): StreamableMethod; +} + +// @public +export interface GetPolicy200Response extends HttpResponse { + // (undocumented) + body: PolicyOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetPolicyDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetPolicyDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetPolicyDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetPolicyParameters = RequestParameters; + +// @public (undocumented) +export interface GetSavedFilter { + delete(options?: DeleteSavedFilterParameters): StreamableMethod; + get(options?: GetSavedFilterParameters): StreamableMethod; + put(options: CreateOrReplaceSavedFilterParameters): StreamableMethod; +} + +// @public +export interface GetSavedFilter200Response extends HttpResponse { + // (undocumented) + body: SavedFilterOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetSavedFilterDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetSavedFilterDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetSavedFilterDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetSavedFilterParameters = RequestParameters; + +// @public (undocumented) +export interface GetSnapshot { + post(options: GetSnapshotParameters): StreamableMethod; +} + +// @public +export interface GetSnapshot200Response extends HttpResponse { + // (undocumented) + body: ReportAssetSnapshotResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetSnapshotBodyParam { + body: ReportAssetSnapshotRequest; +} + +// @public (undocumented) +export interface GetSnapshotDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetSnapshotDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetSnapshotDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface GetSnapshotExport { + post(options: GetSnapshotExportParameters): StreamableMethod; +} + +// @public +export interface GetSnapshotExport200Response extends HttpResponse { + // (undocumented) + body: TaskOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetSnapshotExportBodyParam { + body: ReportAssetSnapshotExportRequest; +} + +// @public (undocumented) +export interface GetSnapshotExportDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetSnapshotExportDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetSnapshotExportDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetSnapshotExportParameters = GetSnapshotExportBodyParam & RequestParameters; + +// @public (undocumented) +export type GetSnapshotParameters = GetSnapshotBodyParam & RequestParameters; + +// @public (undocumented) +export interface GetSummary { + post(options: GetSummaryParameters): StreamableMethod; +} + +// @public +export interface GetSummary200Response extends HttpResponse { + // (undocumented) + body: ReportAssetSummaryResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetSummaryBodyParam { + body: ReportAssetSummaryRequest; +} + +// @public (undocumented) +export interface GetSummaryDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetSummaryDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetSummaryDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetSummaryParameters = GetSummaryBodyParam & RequestParameters; + +// @public (undocumented) +export interface GetTask { + get(options?: GetTaskParameters): StreamableMethod; +} + +// @public +export interface GetTask200Response extends HttpResponse { + // (undocumented) + body: TaskOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface GetTaskDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface GetTaskDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & GetTaskDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type GetTaskParameters = RequestParameters; + +// @public +export type GlobalAssetType = string; + +// @public +export type GlobalAssetTypeOutput = string; + +// @public +export type GlobalInventoryStateOutput = string; + +// @public (undocumented) +export interface GuidPairOutput { + // (undocumented) + crawlStateGuid?: string; + // (undocumented) + loadDate?: string; + // (undocumented) + pageGuid?: string; + // (undocumented) + recent?: boolean; +} + +// @public (undocumented) +export interface HostAssetOutput extends InventoryAssetOutput { + // (undocumented) + asns?: Array; + // (undocumented) + attributes?: Array; + // (undocumented) + banners?: Array; + // (undocumented) + childHosts?: Array; + // (undocumented) + cnames?: Array; + // (undocumented) + cookies?: Array; + // (undocumented) + count?: number; + // (undocumented) + domain?: string; + // (undocumented) + domainAsset?: DomainAssetOutput; + // (undocumented) + firstSeen?: string; + // (undocumented) + headers?: Array; + // (undocumented) + host?: string; + // (undocumented) + hostCore?: HostCoreOutput; + // (undocumented) + ipAddresses?: Array; + // (undocumented) + ipBlocks?: Array; + // (undocumented) + ipv4?: Array; + // (undocumented) + ipv6?: Array; + // (undocumented) + isWildcard?: Array; + // (undocumented) + lastSeen?: string; + // (undocumented) + location?: Array; + // (undocumented) + mxRecord?: Array; + // (undocumented) + nsRecord?: Array; + // (undocumented) + nxdomain?: Array; + // (undocumented) + parentHosts?: Array; + // (undocumented) + resourceUrls?: Array; + // (undocumented) + responseBodies?: Array; + // (undocumented) + scanMetadata?: Array; + // (undocumented) + services?: Array; + // (undocumented) + sources?: Array; + // (undocumented) + sslCerts?: Array; + // (undocumented) + sslServerConfig?: Array; + // (undocumented) + webComponents?: Array; + // (undocumented) + webserver?: Array; +} + +// @public (undocumented) +export interface HostAssetResourceOutput extends AssetResourceOutputParent { + asset: HostAssetOutput; + kind: "host"; +} + +// @public (undocumented) +export interface HostCoreOutput { + // (undocumented) + alexaRank?: number; + // (undocumented) + blacklistCauseCount?: number; + // (undocumented) + blacklistCauseFirstSeen?: string; + // (undocumented) + blacklistCauseLastSeen?: string; + // (undocumented) + blacklistResourceCount?: number; + // (undocumented) + blacklistResourceFirstSeen?: string; + // (undocumented) + blacklistResourceLastSeen?: string; + // (undocumented) + blacklistSequenceCount?: number; + // (undocumented) + blacklistSequenceFirstSeen?: string; + // (undocumented) + blacklistSequenceLastSeen?: string; + // (undocumented) + count?: number; + // (undocumented) + domain?: string; + // (undocumented) + domainMalwareReputationScore?: number; + // (undocumented) + domainPhishReputationScore?: number; + // (undocumented) + domainReputationScore?: number; + // (undocumented) + domainScamReputationScore?: number; + // (undocumented) + domainSpamReputationScore?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + host?: string; + // (undocumented) + hostMalwareReputationScore?: number; + // (undocumented) + hostPhishReputationScore?: number; + // (undocumented) + hostReputationScore?: number; + // (undocumented) + hostScamReputationScore?: number; + // (undocumented) + hostSpamReputationScore?: number; + // (undocumented) + lastSeen?: string; + // (undocumented) + malwareCauseCount?: number; + // (undocumented) + malwareResourceCount?: number; + // (undocumented) + malwareSequenceCount?: number; + // (undocumented) + phishCauseCount?: number; + // (undocumented) + phishResourceCount?: number; + // (undocumented) + phishSequenceCount?: number; + // (undocumented) + scamCauseCount?: number; + // (undocumented) + scamResourceCount?: number; + // (undocumented) + scamSequenceCount?: number; + // (undocumented) + spamCauseCount?: number; + // (undocumented) + spamResourceCount?: number; + // (undocumented) + spamSequenceCount?: number; + // (undocumented) + uuid?: string; +} + +// @public +export interface InnerErrorOutput { + code?: string; + value?: any; +} + +// @public +export interface InventoryAssetOutput { +} + +// @public (undocumented) +export interface IpAddressAssetOutput extends InventoryAssetOutput { + // (undocumented) + asns?: Array; + // (undocumented) + attributes?: Array; + // (undocumented) + banners?: Array; + // (undocumented) + cookies?: Array; + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + headers?: Array; + // (undocumented) + hosts?: Array; + // (undocumented) + ipAddress?: string; + // (undocumented) + ipBlocks?: Array; + // (undocumented) + ipv4?: boolean; + // (undocumented) + ipv6?: boolean; + // (undocumented) + lastSeen?: string; + // (undocumented) + location?: Array; + // (undocumented) + mxRecord?: Array; + // (undocumented) + netRanges?: Array; + // (undocumented) + nsRecord?: Array; + // (undocumented) + nxdomain?: Array; + // (undocumented) + reputations?: Array; + // (undocumented) + scanMetadata?: Array; + // (undocumented) + services?: Array; + // (undocumented) + sources?: Array; + // (undocumented) + sslCerts?: Array; + // (undocumented) + sslServerConfig?: Array; + // (undocumented) + webComponents?: Array; +} + +// @public (undocumented) +export interface IpAddressAssetResourceOutput extends AssetResourceOutputParent { + asset: IpAddressAssetOutput; + kind: "ipAddress"; +} + +// @public (undocumented) +export interface IpBlockAssetOutput extends InventoryAssetOutput { + // (undocumented) + adminContacts?: Array; + // (undocumented) + adminNames?: Array; + // (undocumented) + adminOrgs?: Array; + // (undocumented) + adminPhones?: Array; + // (undocumented) + asns?: Array; + // (undocumented) + bgpPrefixes?: Array; + // (undocumented) + count?: number; + // (undocumented) + detailedFromWhoisAt?: string; + // (undocumented) + endIp?: string; + // (undocumented) + firstSeen?: string; + // (undocumented) + ipBlock?: string; + // (undocumented) + ipv4?: boolean; + // (undocumented) + ipv6?: boolean; + // (undocumented) + lastSeen?: string; + // (undocumented) + location?: Array; + // (undocumented) + netNames?: Array; + // (undocumented) + netRanges?: Array; + // (undocumented) + registrantContacts?: Array; + // (undocumented) + registrantNames?: Array; + // (undocumented) + registrantOrgs?: Array; + // (undocumented) + registrantPhones?: Array; + // (undocumented) + registrarCreatedAt?: Array; + // (undocumented) + registrarExpiresAt?: Array; + // (undocumented) + registrarUpdatedAt?: Array; + // (undocumented) + reputations?: Array; + // (undocumented) + sources?: Array; + // (undocumented) + startIp?: string; + // (undocumented) + technicalContacts?: Array; + // (undocumented) + technicalNames?: Array; + // (undocumented) + technicalOrgs?: Array; + // (undocumented) + technicalPhones?: Array; +} + +// @public (undocumented) +export interface IpBlockAssetResourceOutput extends AssetResourceOutputParent { + asset: IpBlockAssetOutput; + kind: "ipBlock"; +} + +// @public (undocumented) +export interface IpBlockOutput { + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + ipBlock?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + recent?: boolean; + // (undocumented) + sources?: Array; +} + +// @public (undocumented) +export function isUnexpected(response: ListAssetResource200Response | ListAssetResourceDefaultResponse): response is ListAssetResourceDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: UpdateAssets200Response | UpdateAssetsDefaultResponse): response is UpdateAssetsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetAssetResource200Response | GetAssetResourceDefaultResponse): response is GetAssetResourceDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetAssetsExport200Response | GetAssetsExportDefaultResponse): response is GetAssetsExportDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetObservations200Response | GetObservationsDefaultResponse): response is GetObservationsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetDeltaDetails200Response | GetDeltaDetailsDefaultResponse): response is GetDeltaDetailsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetDeltaSummary200Response | GetDeltaSummaryDefaultResponse): response is GetDeltaSummaryDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ListDataConnection200Response | ListDataConnectionDefaultResponse): response is ListDataConnectionDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ValidateDataConnection200Response | ValidateDataConnectionDefaultResponse): response is ValidateDataConnectionDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetDataConnection200Response | GetDataConnectionDefaultResponse): response is GetDataConnectionDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: CreateOrReplaceDataConnection200Response | CreateOrReplaceDataConnectionDefaultResponse): response is CreateOrReplaceDataConnectionDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: DeleteDataConnection204Response | DeleteDataConnectionDefaultResponse): response is DeleteDataConnectionDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ListDiscoGroup200Response | ListDiscoGroupDefaultResponse): response is ListDiscoGroupDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ValidateDiscoGroup200Response | ValidateDiscoGroupDefaultResponse): response is ValidateDiscoGroupDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetDiscoGroup200Response | GetDiscoGroupDefaultResponse): response is GetDiscoGroupDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: CreateOrReplaceDiscoGroup200Response | CreateOrReplaceDiscoGroupDefaultResponse): response is CreateOrReplaceDiscoGroupDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: DeleteDiscoGroup204Response | DeleteDiscoGroupDefaultResponse): response is DeleteDiscoGroupDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: RunDiscoGroup204Response | RunDiscoGroupDefaultResponse): response is RunDiscoGroupDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ListRuns200Response | ListRunsDefaultResponse): response is ListRunsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetAssetChainSummary200Response | GetAssetChainSummaryDefaultResponse): response is GetAssetChainSummaryDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: DismissAssetChain200Response | DismissAssetChainDefaultResponse): response is DismissAssetChainDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ListDiscoTemplate200Response | ListDiscoTemplateDefaultResponse): response is ListDiscoTemplateDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetDiscoTemplate200Response | GetDiscoTemplateDefaultResponse): response is GetDiscoTemplateDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetBillable200Response | GetBillableDefaultResponse): response is GetBillableDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetSnapshot200Response | GetSnapshotDefaultResponse): response is GetSnapshotDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetSummary200Response | GetSummaryDefaultResponse): response is GetSummaryDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetSnapshotExport200Response | GetSnapshotExportDefaultResponse): response is GetSnapshotExportDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ListSavedFilter200Response | ListSavedFilterDefaultResponse): response is ListSavedFilterDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetSavedFilter200Response | GetSavedFilterDefaultResponse): response is GetSavedFilterDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: CreateOrReplaceSavedFilter200Response | CreateOrReplaceSavedFilterDefaultResponse): response is CreateOrReplaceSavedFilterDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: DeleteSavedFilter204Response | DeleteSavedFilterDefaultResponse): response is DeleteSavedFilterDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ListTask200Response | ListTaskDefaultResponse): response is ListTaskDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetTask200Response | GetTaskDefaultResponse): response is GetTaskDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: CancelTask200Response | CancelTaskDefaultResponse): response is CancelTaskDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: RunTask200Response | RunTaskDefaultResponse): response is RunTaskDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: DownloadTask200Response | DownloadTaskDefaultResponse): response is DownloadTaskDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetCisaCves200Response | GetCisaCvesDefaultResponse): response is GetCisaCvesDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetCisaCve200Response | GetCisaCveDefaultResponse): response is GetCisaCveDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ListPolicy200Response | ListPolicyDefaultResponse): response is ListPolicyDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: GetPolicy200Response | GetPolicyDefaultResponse): response is GetPolicyDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: CreateOrReplacePolicy200Response | CreateOrReplacePolicyDefaultResponse): response is CreateOrReplacePolicyDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: DeletePolicy204Response | DeletePolicyDefaultResponse): response is DeletePolicyDefaultResponse; + +// @public (undocumented) +export interface ListAssetResource { + get(options?: ListAssetResourceParameters): StreamableMethod; + post(options: UpdateAssetsParameters): StreamableMethod; +} + +// @public +export interface ListAssetResource200Response extends HttpResponse { + // (undocumented) + body: PagedAssetResourceOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ListAssetResourceDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ListAssetResourceDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ListAssetResourceDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ListAssetResourceParameters = ListAssetResourceQueryParam & RequestParameters; + +// @public (undocumented) +export interface ListAssetResourceQueryParam { + // (undocumented) + queryParameters?: ListAssetResourceQueryParamProperties; +} + +// @public (undocumented) +export interface ListAssetResourceQueryParamProperties { + filter?: string; + mark?: string; + maxpagesize?: number; + orderby?: string; + recentOnly?: boolean; + responseIncludes?: string[]; + responseType?: AssetResponseType; + skip?: number; +} + +// @public (undocumented) +export interface ListDataConnection { + get(options?: ListDataConnectionParameters): StreamableMethod; +} + +// @public +export interface ListDataConnection200Response extends HttpResponse { + // (undocumented) + body: PagedDataConnectionOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ListDataConnectionDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ListDataConnectionDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ListDataConnectionDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ListDataConnectionParameters = ListDataConnectionQueryParam & RequestParameters; + +// @public (undocumented) +export interface ListDataConnectionQueryParam { + // (undocumented) + queryParameters?: ListDataConnectionQueryParamProperties; +} + +// @public (undocumented) +export interface ListDataConnectionQueryParamProperties { + maxpagesize?: number; + skip?: number; +} + +// @public (undocumented) +export interface ListDiscoGroup { + get(options?: ListDiscoGroupParameters): StreamableMethod; +} + +// @public +export interface ListDiscoGroup200Response extends HttpResponse { + // (undocumented) + body: PagedDiscoGroupOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ListDiscoGroupDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ListDiscoGroupDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ListDiscoGroupDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ListDiscoGroupParameters = ListDiscoGroupQueryParam & RequestParameters; + +// @public (undocumented) +export interface ListDiscoGroupQueryParam { + // (undocumented) + queryParameters?: ListDiscoGroupQueryParamProperties; +} + +// @public (undocumented) +export interface ListDiscoGroupQueryParamProperties { + filter?: string; + maxpagesize?: number; + skip?: number; +} + +// @public (undocumented) +export interface ListDiscoTemplate { + get(options?: ListDiscoTemplateParameters): StreamableMethod; +} + +// @public +export interface ListDiscoTemplate200Response extends HttpResponse { + // (undocumented) + body: PagedDiscoTemplateOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ListDiscoTemplateDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ListDiscoTemplateDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ListDiscoTemplateDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ListDiscoTemplateParameters = ListDiscoTemplateQueryParam & RequestParameters; + +// @public (undocumented) +export interface ListDiscoTemplateQueryParam { + // (undocumented) + queryParameters?: ListDiscoTemplateQueryParamProperties; +} + +// @public (undocumented) +export interface ListDiscoTemplateQueryParamProperties { + filter?: string; + maxpagesize?: number; + skip?: number; +} + +// @public (undocumented) +export interface ListPolicy { + get(options?: ListPolicyParameters): StreamableMethod; +} + +// @public +export interface ListPolicy200Response extends HttpResponse { + // (undocumented) + body: PagedPolicyOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ListPolicyDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ListPolicyDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ListPolicyDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ListPolicyParameters = ListPolicyQueryParam & RequestParameters; + +// @public (undocumented) +export interface ListPolicyQueryParam { + // (undocumented) + queryParameters?: ListPolicyQueryParamProperties; +} + +// @public (undocumented) +export interface ListPolicyQueryParamProperties { + filter?: string; + maxpagesize?: number; + skip?: number; +} + +// @public (undocumented) +export interface ListRuns { + get(options?: ListRunsParameters): StreamableMethod; +} + +// @public +export interface ListRuns200Response extends HttpResponse { + // (undocumented) + body: DiscoRunPageResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ListRunsDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ListRunsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ListRunsDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ListRunsParameters = ListRunsQueryParam & RequestParameters; + +// @public (undocumented) +export interface ListRunsQueryParam { + // (undocumented) + queryParameters?: ListRunsQueryParamProperties; +} + +// @public (undocumented) +export interface ListRunsQueryParamProperties { + filter?: string; + maxpagesize?: number; + skip?: number; +} + +// @public (undocumented) +export interface ListSavedFilter { + get(options?: ListSavedFilterParameters): StreamableMethod; +} + +// @public +export interface ListSavedFilter200Response extends HttpResponse { + // (undocumented) + body: PagedSavedFilterOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ListSavedFilterDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ListSavedFilterDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ListSavedFilterDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ListSavedFilterParameters = ListSavedFilterQueryParam & RequestParameters; + +// @public (undocumented) +export interface ListSavedFilterQueryParam { + // (undocumented) + queryParameters?: ListSavedFilterQueryParamProperties; +} + +// @public (undocumented) +export interface ListSavedFilterQueryParamProperties { + filter?: string; + maxpagesize?: number; + skip?: number; +} + +// @public (undocumented) +export interface ListTask { + get(options?: ListTaskParameters): StreamableMethod; +} + +// @public +export interface ListTask200Response extends HttpResponse { + // (undocumented) + body: PagedTaskOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ListTaskDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ListTaskDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ListTaskDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ListTaskParameters = ListTaskQueryParam & RequestParameters; + +// @public (undocumented) +export interface ListTaskQueryParam { + // (undocumented) + queryParameters?: ListTaskQueryParamProperties; +} + +// @public (undocumented) +export interface ListTaskQueryParamProperties { + filter?: string; + maxpagesize?: number; + orderby?: string; + skip?: number; +} + +// @public (undocumented) +export interface LocationOutput { + // (undocumented) + areaCode?: number; + // (undocumented) + city?: string; + // (undocumented) + countryCode?: string; + // (undocumented) + countryName?: string; + // (undocumented) + dmaCode?: number; + // (undocumented) + latitude?: number; + // (undocumented) + longitude?: number; + // (undocumented) + metroCodeId?: number; + // (undocumented) + postalCode?: string; + // (undocumented) + region?: string; + // (undocumented) + regionName?: string; +} + +// @public (undocumented) +export interface LogAnalyticsDataConnectionData extends DataConnectionDataParent { + kind: "logAnalytics"; + properties: LogAnalyticsDataConnectionProperties; +} + +// @public (undocumented) +export interface LogAnalyticsDataConnectionOutput extends DataConnectionOutputParent { + kind: "logAnalytics"; + properties: LogAnalyticsDataConnectionPropertiesOutput; +} + +// @public (undocumented) +export interface LogAnalyticsDataConnectionProperties extends DataConnectionProperties { + apiKey?: string; + workspaceId?: string; +} + +// @public (undocumented) +export interface LogAnalyticsDataConnectionPropertiesOutput extends DataConnectionPropertiesOutput { + apiKey?: string; + workspaceId?: string; +} + +// @public +export interface ObservationPageResultOutput { + prioritySummary: Record; + totalElements: number; + value: Array; +} + +// @public +export type ObservationPriorityOutput = string; + +// @public +export interface ObservationRemediationItem { + kind?: ObservationType; + name?: string; + state?: ObservationRemediationState; +} + +// @public +export type ObservationRemediationSourceOutput = string; + +// @public +export type ObservationRemediationState = string; + +// @public +export type ObservationRemediationStateOutput = string; + +// @public +export interface ObservationResultOutput { + cvssScoreV2: number; + cvssScoreV3: number; + name: string; + priority: ObservationPriorityOutput; + remediationSource: ObservationRemediationSourceOutput; + remediationState: ObservationRemediationStateOutput; + types: ObservationTypeOutput[]; +} + +// @public +export type ObservationType = string; + +// @public +export type ObservationTypeOutput = string; + +// @public (undocumented) +export interface ObservedBooleanOutput extends ObservedValueOutput { + // (undocumented) + sources?: Array; + // (undocumented) + value?: boolean; +} + +// @public (undocumented) +export interface ObservedHeaderOutput extends ObservedValueOutput { + // (undocumented) + headerName?: string; + // (undocumented) + headerValue?: string; +} + +// @public (undocumented) +export interface ObservedIntegerOutput extends ObservedValueOutput { + // (undocumented) + sources?: Array; + // (undocumented) + value?: number; +} + +// @public (undocumented) +export interface ObservedIntegersOutput extends ObservedValueOutput { + // (undocumented) + sources?: Array; + // (undocumented) + values?: number[]; +} + +// @public (undocumented) +export interface ObservedLocationOutput extends ObservedValueOutput { + // (undocumented) + sources?: Array; + // (undocumented) + value?: LocationOutput; +} + +// @public (undocumented) +export interface ObservedLongOutput extends ObservedValueOutput { + // (undocumented) + sources?: Array; + // (undocumented) + value?: number; +} + +// @public (undocumented) +export interface ObservedPortStateOutput extends ObservedValueOutput { + // (undocumented) + port?: number; + value?: ObservedPortStateValueOutput; +} + +// @public +export type ObservedPortStateValueOutput = string; + +// @public (undocumented) +export interface ObservedStringOutput extends ObservedValueOutput { + // (undocumented) + sources?: Array; + // (undocumented) + value?: string; +} + +// @public +export interface ObservedValueOutput { + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + recent?: boolean; +} + +// @public (undocumented) +export interface PageAssetOutput extends InventoryAssetOutput { + // (undocumented) + asns?: Array; + // (undocumented) + assetSecurityPolicies?: Array; + // (undocumented) + attributes?: Array; + // (undocumented) + cause?: PageCauseOutput; + // (undocumented) + cdns?: Array; + // (undocumented) + charsets?: Array; + // (undocumented) + cnames?: Array; + // (undocumented) + contentLengths?: Array; + // (undocumented) + contentTypes?: Array; + // (undocumented) + cookies?: Array; + // (undocumented) + count?: number; + // (undocumented) + domain?: string; + // (undocumented) + domainAsset?: DomainAssetOutput; + // (undocumented) + errors?: Array; + // (undocumented) + finalAsns?: Array; + // (undocumented) + finalIpAddresses?: Array; + // (undocumented) + finalIpBlocks?: Array; + // (undocumented) + finalResponseCodes?: Array; + // (undocumented) + finalUrls?: Array; + // (undocumented) + firstSeen?: string; + // (undocumented) + frames?: Array; + // (undocumented) + fullDomMinhashSignatures?: Array; + // (undocumented) + gdprAssetSecurityPolicies?: Array; + // (undocumented) + guids?: Array; + // (undocumented) + host?: string; + // (undocumented) + httpMethod?: string; + // (undocumented) + httpResponseCodes?: Array; + // (undocumented) + httpResponseMessages?: Array; + // (undocumented) + ipAddresses?: Array; + // (undocumented) + ipBlocks?: Array; + // (undocumented) + ipv4?: Array; + // (undocumented) + ipv6?: Array; + // (undocumented) + isRootUrl?: boolean; + // (undocumented) + languages?: Array; + // (undocumented) + lastSeen?: string; + // (undocumented) + location?: Array; + // (undocumented) + nonHtmlFrames?: Array; + // (undocumented) + parkedPage?: Array; + redirectType?: PageAssetRedirectTypeOutput; + // (undocumented) + redirectUrls?: Array; + // (undocumented) + referrer?: string; + // (undocumented) + resourceUrls?: Array; + // (undocumented) + responseBodies?: Array; + // (undocumented) + responseBodyHashSignatures?: Array; + // (undocumented) + responseBodyMinhashSignatures?: Array; + // (undocumented) + responseHeaders?: Array; + // (undocumented) + responseTimes?: Array; + // (undocumented) + rootUrl?: ObservedBooleanOutput; + // (undocumented) + service?: string; + // (undocumented) + services?: Array; + // (undocumented) + siteStatus?: string; + // (undocumented) + sources?: Array; + // (undocumented) + sslCerts?: Array; + // (undocumented) + sslServerConfig?: Array; + // (undocumented) + successful?: Array; + // (undocumented) + titles?: Array; + // (undocumented) + undirectedContent?: Array; + // (undocumented) + url?: string; + // (undocumented) + webComponents?: Array; + // (undocumented) + windowNames?: Array; + // (undocumented) + windows?: Array; +} + +// @public +export type PageAssetRedirectTypeOutput = string; + +// @public (undocumented) +export interface PageAssetResourceOutput extends AssetResourceOutputParent { + asset: PageAssetOutput; + kind: "page"; +} + +// @public (undocumented) +export interface PageCauseOutput { + // (undocumented) + cause?: string; + // (undocumented) + causeElementXPath?: string; + // (undocumented) + domChangeIndex?: number; + // (undocumented) + location?: string; + // (undocumented) + loopDetected?: boolean; + // (undocumented) + possibleMatches?: number; + // (undocumented) + version?: number; +} + +// @public +export type PagedAssetResourceOutput = Paged; + +// @public +export type PagedCisaCveResultOutput = Paged; + +// @public +export type PagedDataConnectionOutput = Paged; + +// @public +export type PagedDiscoGroupOutput = Paged; + +// @public +export type PagedDiscoTemplateOutput = Paged; + +// @public +export type PagedPolicyOutput = Paged; + +// @public +export type PagedSavedFilterOutput = Paged; + +// @public +export type PagedTaskOutput = Paged; + +// @public +export function paginate(client: Client, initialResponse: TResponse, options?: PagingOptions): PagedAsyncIterableIterator>; + +// @public +export type PaginateReturn = TResult extends { + body: { + value?: infer TPage; + }; +} ? GetArrayType : Array; + +// @public +export interface PagingOptions { + customGetPage?: GetPage[]>; +} + +// @public +export type PolicyAction = string; + +// @public +export type PolicyActionOutput = string; + +// @public +export interface PolicyData { + action?: PolicyAction; + actionParameters?: ActionParameters; + description?: string; + filterName?: string; + priority?: number; +} + +// @public +export interface PolicyOutput { + action?: PolicyActionOutput; + actionParameters?: ActionParametersOutput; + createdDate?: string; + description?: string; + displayName?: string; + filterName?: string; + id?: string; + readonly name: string; + priority?: number; + updatedAssetsCount?: number; + updatedDate?: string; + user?: string; +} + +// @public (undocumented) +export interface PortOutput { + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + port?: number; +} + +// @public +export interface ReportAssetSnapshotExportRequest { + columns?: string[]; + fileName?: string; + metric?: string; +} + +// @public +export interface ReportAssetSnapshotRequest { + labelName?: string; + metric?: string; + page?: number; + size?: number; +} + +// @public +export interface ReportAssetSnapshotResultOutput { + assets?: AssetPageResultOutput; + description?: string; + displayName?: string; + labelName?: string; + metric?: string; + updatedAt?: string; +} + +// @public +export interface ReportAssetSummaryRequest { + filters?: string[]; + groupBy?: string; + labelName?: string; + metricCategories?: string[]; + metrics?: string[]; + segmentBy?: string; +} + +// @public (undocumented) +export interface ReportAssetSummaryResultOutput { + assetSummaries?: Array; +} + +// @public +export type ReportBillableAssetBreakdownKindOutput = string; + +// @public +export interface ReportBillableAssetBreakdownOutput { + count?: number; + kind?: ReportBillableAssetBreakdownKindOutput; +} + +// @public (undocumented) +export interface ReportBillableAssetSnapshotResultOutput { + assetBreakdown?: Array; + date?: string; + total?: number; +} + +// @public (undocumented) +export interface ReportBillableAssetSummaryResultOutput { + // (undocumented) + assetSummaries?: Array; +} + +// @public (undocumented) +export interface ReputationOutput { + // (undocumented) + cidr?: string; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + listName?: string; + // (undocumented) + listUpdatedAt?: string; + // (undocumented) + recent?: boolean; + // (undocumented) + threatType?: string; + // (undocumented) + trusted?: boolean; +} + +// @public (undocumented) +export interface ResourceUrlOutput { + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + recent?: boolean; + // (undocumented) + resources?: Array; + // (undocumented) + url?: string; +} + +// @public (undocumented) +export interface Routes { + (path: "/assets"): ListAssetResource; + (path: "/assets/{assetId}", assetId: string): GetAssetResource; + (path: "/assets:export"): GetAssetsExport; + (path: "/assets/{assetId}:getObservations", assetId: string): GetObservations; + (path: "/assets:getDeltaDetails"): GetDeltaDetails; + (path: "/assets:getDeltaSummary"): GetDeltaSummary; + (path: "/dataConnections"): ListDataConnection; + (path: "/dataConnections:validate"): ValidateDataConnection; + (path: "/dataConnections/{dataConnectionName}", dataConnectionName: string): GetDataConnection; + (path: "/discoGroups"): ListDiscoGroup; + (path: "/discoGroups:validate"): ValidateDiscoGroup; + (path: "/discoGroups/{groupName}", groupName: string): GetDiscoGroup; + (path: "/discoGroups/{groupName}:run", groupName: string): RunDiscoGroup; + (path: "/discoGroups/{groupName}/runs", groupName: string): ListRuns; + (path: "/discoGroups:getAssetChainSummary"): GetAssetChainSummary; + (path: "/discoGroups:dismissAssetChain"): DismissAssetChain; + (path: "/discoTemplates"): ListDiscoTemplate; + (path: "/discoTemplates/{templateId}", templateId: string): GetDiscoTemplate; + (path: "/reports/assets:getBillable"): GetBillable; + (path: "/reports/assets:getSnapshot"): GetSnapshot; + (path: "/reports/assets:getSummary"): GetSummary; + (path: "/reports/assets:getSnapshotExport"): GetSnapshotExport; + (path: "/savedFilters"): ListSavedFilter; + (path: "/savedFilters/{filterName}", filterName: string): GetSavedFilter; + (path: "/tasks"): ListTask; + (path: "/tasks/{taskId}", taskId: string): GetTask; + (path: "/tasks/{taskId}:cancel", taskId: string): CancelTask; + (path: "/tasks/{taskId}:run", taskId: string): RunTask; + (path: "/tasks/{taskId}:download", taskId: string): DownloadTask; + (path: "/cisaCves"): GetCisaCves; + (path: "/cisaCves/{cveId}", cveId: string): GetCisaCve; + (path: "/policies"): ListPolicy; + (path: "/policies/{policyName}", policyName: string): GetPolicy; +} + +// @public (undocumented) +export interface RunDiscoGroup { + post(options?: RunDiscoGroupParameters): StreamableMethod; +} + +// @public +export interface RunDiscoGroup204Response extends HttpResponse { + // (undocumented) + status: "204"; +} + +// @public (undocumented) +export interface RunDiscoGroupDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface RunDiscoGroupDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & RunDiscoGroupDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type RunDiscoGroupParameters = RequestParameters; + +// @public (undocumented) +export interface RunTask { + post(options?: RunTaskParameters): StreamableMethod; +} + +// @public +export interface RunTask200Response extends HttpResponse { + // (undocumented) + body: TaskOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface RunTaskDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface RunTaskDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & RunTaskDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type RunTaskParameters = RequestParameters; + +// @public +export interface SavedFilterData { + description: string; + filter: string; +} + +// @public (undocumented) +export interface SavedFilterOutput { + // (undocumented) + description?: string; + displayName?: string; + // (undocumented) + filter?: string; + id?: string; + readonly name: string; +} + +// @public (undocumented) +export interface ScanMetadataOutput { + // (undocumented) + bannerMetadata?: string; + // (undocumented) + endScan?: string; + // (undocumented) + port?: number; + // (undocumented) + startScan?: string; +} + +// @public (undocumented) +export interface ServiceOutput { + // (undocumented) + count?: number; + // (undocumented) + exceptions?: Array; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + port?: number; + // (undocumented) + portStates?: Array; + // (undocumented) + recent?: boolean; + // (undocumented) + scheme?: string; + // (undocumented) + sources?: Array; + // (undocumented) + sslCerts?: Array; + // (undocumented) + webComponents?: Array; +} + +// @public (undocumented) +export interface SoaRecordOutput { + // (undocumented) + count?: number; + // (undocumented) + email?: string; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + nameServer?: string; + // (undocumented) + recent?: boolean; + // (undocumented) + serialNumber?: number; +} + +// @public (undocumented) +export interface SourceOutput { + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + reason?: string; + // (undocumented) + source?: string; +} + +// @public (undocumented) +export interface SslCertAssetOutput extends InventoryAssetOutput { + // (undocumented) + certificateAuthority?: boolean; + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + invalidAfter?: string; + // (undocumented) + invalidBefore?: string; + // (undocumented) + issuerAlternativeNames?: string[]; + // (undocumented) + issuerCommonNames?: string[]; + // (undocumented) + issuerCountry?: string[]; + // (undocumented) + issuerLocality?: string[]; + // (undocumented) + issuerOrganizationalUnits?: string[]; + // (undocumented) + issuerOrganizations?: string[]; + // (undocumented) + issuerState?: string[]; + // (undocumented) + keyAlgorithm?: string; + // (undocumented) + keySize?: number; + // (undocumented) + lastSeen?: string; + // (undocumented) + organizationalUnits?: string[]; + // (undocumented) + organizations?: string[]; + // (undocumented) + recent?: boolean; + // (undocumented) + selfSigned?: boolean; + // (undocumented) + serialNumber?: string; + // (undocumented) + sha1?: string; + // (undocumented) + sigAlgName?: string; + // (undocumented) + sigAlgOid?: string; + // (undocumented) + sources?: Array; + // (undocumented) + subjectAlternativeNames?: string[]; + // (undocumented) + subjectCommonNames?: string[]; + // (undocumented) + subjectCountry?: string[]; + // (undocumented) + subjectLocality?: string[]; + // (undocumented) + subjectOrganizationalUnits?: string[]; + // (undocumented) + subjectOrganizations?: string[]; + // (undocumented) + subjectState?: string[]; + validationType?: SslCertAssetValidationTypeOutput; + // (undocumented) + version?: number; +} + +// @public (undocumented) +export interface SslCertAssetResourceOutput extends AssetResourceOutputParent { + asset: SslCertAssetOutput; + kind: "sslCert"; +} + +// @public +export type SslCertAssetValidationTypeOutput = string; + +// @public (undocumented) +export interface SslServerConfigOutput { + // (undocumented) + cipherSuites?: string[]; + // (undocumented) + count?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + sources?: Array; + // (undocumented) + tlsVersions?: string[]; +} + +// @public (undocumented) +export interface SubResourceIntegrityCheckOutput { + // (undocumented) + causePageUrl?: string; + // (undocumented) + count?: number; + // (undocumented) + crawlGuid?: string; + // (undocumented) + expectedHash?: string; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + pageGuid?: string; + // (undocumented) + resourceGuid?: string; + // (undocumented) + violation?: boolean; +} + +// @public (undocumented) +export interface TaskOutput { + completedAt?: string; + readonly id: string; + lastPolledAt?: string; + metadata?: Record; + phase?: TaskPhaseOutput; + reason?: string; + startedAt?: string; + state?: TaskStateOutput; +} + +// @public +export type TaskPhaseOutput = string; + +// @public +export type TaskStateOutput = string; + +// @public +export interface UpdateAssets200Response extends HttpResponse { + // (undocumented) + body: TaskOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface UpdateAssetsBodyParam { + body: AssetUpdateData; +} + +// @public (undocumented) +export interface UpdateAssetsDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface UpdateAssetsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & UpdateAssetsDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type UpdateAssetsParameters = UpdateAssetsQueryParam & UpdateAssetsBodyParam & RequestParameters; + +// @public (undocumented) +export interface UpdateAssetsQueryParam { + // (undocumented) + queryParameters: UpdateAssetsQueryParamProperties; +} + +// @public (undocumented) +export interface UpdateAssetsQueryParamProperties { + filter: string; +} + +// @public (undocumented) +export interface ValidateDataConnection { + post(options: ValidateDataConnectionParameters): StreamableMethod; +} + +// @public +export interface ValidateDataConnection200Response extends HttpResponse { + // (undocumented) + body: ValidateResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ValidateDataConnectionBodyParam { + body: DataConnectionData; +} + +// @public (undocumented) +export interface ValidateDataConnectionDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ValidateDataConnectionDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ValidateDataConnectionDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ValidateDataConnectionParameters = ValidateDataConnectionBodyParam & RequestParameters; + +// @public (undocumented) +export interface ValidateDiscoGroup { + post(options: ValidateDiscoGroupParameters): StreamableMethod; +} + +// @public +export interface ValidateDiscoGroup200Response extends HttpResponse { + // (undocumented) + body: ValidateResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ValidateDiscoGroupBodyParam { + body: DiscoGroupData; +} + +// @public (undocumented) +export interface ValidateDiscoGroupDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ValidateDiscoGroupDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ValidateDiscoGroupDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ValidateDiscoGroupParameters = ValidateDiscoGroupBodyParam & RequestParameters; + +// @public +export interface ValidateResultOutput { + error?: ErrorDetailOutput; +} + +// @public (undocumented) +export interface WebComponentOutput { + // (undocumented) + count?: number; + // (undocumented) + cve?: Array; + // (undocumented) + endOfLife?: number; + // (undocumented) + firstSeen?: string; + // (undocumented) + lastSeen?: string; + // (undocumented) + name?: string; + // (undocumented) + ports?: Array; + // (undocumented) + recent?: boolean; + // (undocumented) + ruleId?: string[]; + // (undocumented) + service?: string; + // (undocumented) + sources?: Array; + // (undocumented) + type?: string; + // (undocumented) + version?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/easm/defendereasm-rest/src/clientDefinitions.ts b/sdk/easm/defendereasm-rest/src/clientDefinitions.ts new file mode 100644 index 000000000000..fa071ed2e0fb --- /dev/null +++ b/sdk/easm/defendereasm-rest/src/clientDefinitions.ts @@ -0,0 +1,530 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + ListAssetResourceParameters, + UpdateAssetsParameters, + GetAssetResourceParameters, + GetAssetsExportParameters, + GetObservationsParameters, + GetDeltaDetailsParameters, + GetDeltaSummaryParameters, + ListDataConnectionParameters, + ValidateDataConnectionParameters, + GetDataConnectionParameters, + CreateOrReplaceDataConnectionParameters, + DeleteDataConnectionParameters, + ListDiscoGroupParameters, + ValidateDiscoGroupParameters, + GetDiscoGroupParameters, + CreateOrReplaceDiscoGroupParameters, + DeleteDiscoGroupParameters, + RunDiscoGroupParameters, + ListRunsParameters, + GetAssetChainSummaryParameters, + DismissAssetChainParameters, + ListDiscoTemplateParameters, + GetDiscoTemplateParameters, + GetBillableParameters, + GetSnapshotParameters, + GetSummaryParameters, + GetSnapshotExportParameters, + ListSavedFilterParameters, + GetSavedFilterParameters, + CreateOrReplaceSavedFilterParameters, + DeleteSavedFilterParameters, + ListTaskParameters, + GetTaskParameters, + CancelTaskParameters, + RunTaskParameters, + DownloadTaskParameters, + GetCisaCvesParameters, + GetCisaCveParameters, + ListPolicyParameters, + GetPolicyParameters, + CreateOrReplacePolicyParameters, + DeletePolicyParameters, +} from "./parameters.js"; +import { + ListAssetResource200Response, + ListAssetResourceDefaultResponse, + UpdateAssets200Response, + UpdateAssetsDefaultResponse, + GetAssetResource200Response, + GetAssetResourceDefaultResponse, + GetAssetsExport200Response, + GetAssetsExportDefaultResponse, + GetObservations200Response, + GetObservationsDefaultResponse, + GetDeltaDetails200Response, + GetDeltaDetailsDefaultResponse, + GetDeltaSummary200Response, + GetDeltaSummaryDefaultResponse, + ListDataConnection200Response, + ListDataConnectionDefaultResponse, + ValidateDataConnection200Response, + ValidateDataConnectionDefaultResponse, + GetDataConnection200Response, + GetDataConnectionDefaultResponse, + CreateOrReplaceDataConnection200Response, + CreateOrReplaceDataConnectionDefaultResponse, + DeleteDataConnection204Response, + DeleteDataConnectionDefaultResponse, + ListDiscoGroup200Response, + ListDiscoGroupDefaultResponse, + ValidateDiscoGroup200Response, + ValidateDiscoGroupDefaultResponse, + GetDiscoGroup200Response, + GetDiscoGroupDefaultResponse, + CreateOrReplaceDiscoGroup200Response, + CreateOrReplaceDiscoGroupDefaultResponse, + DeleteDiscoGroup204Response, + DeleteDiscoGroupDefaultResponse, + RunDiscoGroup204Response, + RunDiscoGroupDefaultResponse, + ListRuns200Response, + ListRunsDefaultResponse, + GetAssetChainSummary200Response, + GetAssetChainSummaryDefaultResponse, + DismissAssetChain200Response, + DismissAssetChainDefaultResponse, + ListDiscoTemplate200Response, + ListDiscoTemplateDefaultResponse, + GetDiscoTemplate200Response, + GetDiscoTemplateDefaultResponse, + GetBillable200Response, + GetBillableDefaultResponse, + GetSnapshot200Response, + GetSnapshotDefaultResponse, + GetSummary200Response, + GetSummaryDefaultResponse, + GetSnapshotExport200Response, + GetSnapshotExportDefaultResponse, + ListSavedFilter200Response, + ListSavedFilterDefaultResponse, + GetSavedFilter200Response, + GetSavedFilterDefaultResponse, + CreateOrReplaceSavedFilter200Response, + CreateOrReplaceSavedFilterDefaultResponse, + DeleteSavedFilter204Response, + DeleteSavedFilterDefaultResponse, + ListTask200Response, + ListTaskDefaultResponse, + GetTask200Response, + GetTaskDefaultResponse, + CancelTask200Response, + CancelTaskDefaultResponse, + RunTask200Response, + RunTaskDefaultResponse, + DownloadTask200Response, + DownloadTaskDefaultResponse, + GetCisaCves200Response, + GetCisaCvesDefaultResponse, + GetCisaCve200Response, + GetCisaCveDefaultResponse, + ListPolicy200Response, + ListPolicyDefaultResponse, + GetPolicy200Response, + GetPolicyDefaultResponse, + CreateOrReplacePolicy200Response, + CreateOrReplacePolicyDefaultResponse, + DeletePolicy204Response, + DeletePolicyDefaultResponse, +} from "./responses.js"; +import { Client, StreamableMethod } from "@azure-rest/core-client"; + +export interface ListAssetResource { + /** Retrieve a list of assets for the provided search parameters. */ + get( + options?: ListAssetResourceParameters, + ): StreamableMethod< + ListAssetResource200Response | ListAssetResourceDefaultResponse + >; + /** Update labels on assets matching the provided filter. */ + post( + options: UpdateAssetsParameters, + ): StreamableMethod; +} + +export interface GetAssetResource { + /** Retrieve an asset by assetId. */ + get( + options?: GetAssetResourceParameters, + ): StreamableMethod< + GetAssetResource200Response | GetAssetResourceDefaultResponse + >; +} + +export interface GetAssetsExport { + /** Export a list of assets for the provided search parameters. */ + post( + options: GetAssetsExportParameters, + ): StreamableMethod< + GetAssetsExport200Response | GetAssetsExportDefaultResponse + >; +} + +export interface GetObservations { + /** Retrieve observations on an asset */ + post( + options?: GetObservationsParameters, + ): StreamableMethod< + GetObservations200Response | GetObservationsDefaultResponse + >; +} + +export interface GetDeltaDetails { + /** Retrieve a list of deltas for the provided time range. */ + post( + options: GetDeltaDetailsParameters, + ): StreamableMethod< + GetDeltaDetails200Response | GetDeltaDetailsDefaultResponse + >; +} + +export interface GetDeltaSummary { + /** Retrieve a list of deltas with overall summary changes for the provided time range. */ + post( + options: GetDeltaSummaryParameters, + ): StreamableMethod< + GetDeltaSummary200Response | GetDeltaSummaryDefaultResponse + >; +} + +export interface ListDataConnection { + /** Retrieve a list of data connections. */ + get( + options?: ListDataConnectionParameters, + ): StreamableMethod< + ListDataConnection200Response | ListDataConnectionDefaultResponse + >; +} + +export interface ValidateDataConnection { + /** Validate a data connection with a given dataConnectionName. */ + post( + options: ValidateDataConnectionParameters, + ): StreamableMethod< + ValidateDataConnection200Response | ValidateDataConnectionDefaultResponse + >; +} + +export interface GetDataConnection { + /** Retrieve a data connection with a given dataConnectionName. */ + get( + options?: GetDataConnectionParameters, + ): StreamableMethod< + GetDataConnection200Response | GetDataConnectionDefaultResponse + >; + /** Create or replace a data connection with a given dataConnectionName. */ + put( + options: CreateOrReplaceDataConnectionParameters, + ): StreamableMethod< + | CreateOrReplaceDataConnection200Response + | CreateOrReplaceDataConnectionDefaultResponse + >; + /** Delete a data connection with a given dataConnectionName. */ + delete( + options?: DeleteDataConnectionParameters, + ): StreamableMethod< + DeleteDataConnection204Response | DeleteDataConnectionDefaultResponse + >; +} + +export interface ListDiscoGroup { + /** Retrieve a list of discovery group for the provided search parameters. */ + get( + options?: ListDiscoGroupParameters, + ): StreamableMethod< + ListDiscoGroup200Response | ListDiscoGroupDefaultResponse + >; +} + +export interface ValidateDiscoGroup { + /** Validate a discovery group with a given groupName. */ + post( + options: ValidateDiscoGroupParameters, + ): StreamableMethod< + ValidateDiscoGroup200Response | ValidateDiscoGroupDefaultResponse + >; +} + +export interface GetDiscoGroup { + /** Retrieve a discovery group with a given groupName. */ + get( + options?: GetDiscoGroupParameters, + ): StreamableMethod; + /** Create a discovery group with a given groupName. */ + put( + options: CreateOrReplaceDiscoGroupParameters, + ): StreamableMethod< + | CreateOrReplaceDiscoGroup200Response + | CreateOrReplaceDiscoGroupDefaultResponse + >; + /** Delete a discovery group with a given discovery group name. */ + delete( + options?: DeleteDiscoGroupParameters, + ): StreamableMethod< + DeleteDiscoGroup204Response | DeleteDiscoGroupDefaultResponse + >; +} + +export interface RunDiscoGroup { + /** Run a discovery group with a given groupName. */ + post( + options?: RunDiscoGroupParameters, + ): StreamableMethod; +} + +export interface ListRuns { + /** Retrieve a collection of discovery run results for a discovery group with a given groupName. */ + get( + options?: ListRunsParameters, + ): StreamableMethod; +} + +export interface GetAssetChainSummary { + /** Retrieve an asset chain summary. */ + post( + options: GetAssetChainSummaryParameters, + ): StreamableMethod< + GetAssetChainSummary200Response | GetAssetChainSummaryDefaultResponse + >; +} + +export interface DismissAssetChain { + /** Dismiss discovery chain for a given asset chain source */ + post( + options: DismissAssetChainParameters, + ): StreamableMethod< + DismissAssetChain200Response | DismissAssetChainDefaultResponse + >; +} + +export interface ListDiscoTemplate { + /** Retrieve a list of disco templates for the provided search parameters. */ + get( + options?: ListDiscoTemplateParameters, + ): StreamableMethod< + ListDiscoTemplate200Response | ListDiscoTemplateDefaultResponse + >; +} + +export interface GetDiscoTemplate { + /** Retrieve a disco template with a given templateId. */ + get( + options?: GetDiscoTemplateParameters, + ): StreamableMethod< + GetDiscoTemplate200Response | GetDiscoTemplateDefaultResponse + >; +} + +export interface GetBillable { + /** Get billable assets summary for the workspace. */ + post( + options?: GetBillableParameters, + ): StreamableMethod; +} + +export interface GetSnapshot { + /** Get the most recent snapshot of asset summary values for the snapshot request. */ + post( + options: GetSnapshotParameters, + ): StreamableMethod; +} + +export interface GetSummary { + /** Get asset summary details for the summary request. */ + post( + options: GetSummaryParameters, + ): StreamableMethod; +} + +export interface GetSnapshotExport { + /** Get the most recent snapshot of asset summary values for the snapshot request exported to a file. */ + post( + options: GetSnapshotExportParameters, + ): StreamableMethod< + GetSnapshotExport200Response | GetSnapshotExportDefaultResponse + >; +} + +export interface ListSavedFilter { + /** Retrieve a list of saved filters for the provided search parameters. */ + get( + options?: ListSavedFilterParameters, + ): StreamableMethod< + ListSavedFilter200Response | ListSavedFilterDefaultResponse + >; +} + +export interface GetSavedFilter { + /** Retrieve a saved filter by filterName. */ + get( + options?: GetSavedFilterParameters, + ): StreamableMethod< + GetSavedFilter200Response | GetSavedFilterDefaultResponse + >; + /** Create or replace a saved filter with a given filterName. */ + put( + options: CreateOrReplaceSavedFilterParameters, + ): StreamableMethod< + | CreateOrReplaceSavedFilter200Response + | CreateOrReplaceSavedFilterDefaultResponse + >; + /** Delete a saved filter with a given filterName. */ + delete( + options?: DeleteSavedFilterParameters, + ): StreamableMethod< + DeleteSavedFilter204Response | DeleteSavedFilterDefaultResponse + >; +} + +export interface ListTask { + /** Retrieve a list of tasks for the provided search parameters. */ + get( + options?: ListTaskParameters, + ): StreamableMethod; +} + +export interface GetTask { + /** Retrieve a task by taskId. */ + get( + options?: GetTaskParameters, + ): StreamableMethod; +} + +export interface CancelTask { + /** Cancel a task by taskId. */ + post( + options?: CancelTaskParameters, + ): StreamableMethod; +} + +export interface RunTask { + /** Run a task by taskId. */ + post( + options?: RunTaskParameters, + ): StreamableMethod; +} + +export interface DownloadTask { + /** Download a task. */ + post( + options?: DownloadTaskParameters, + ): StreamableMethod; +} + +export interface GetCisaCves { + /** Retrieve a list of CisaCves for the provided search parameters. */ + get( + options?: GetCisaCvesParameters, + ): StreamableMethod; +} + +export interface GetCisaCve { + /** Retrieve details of CisaCve by cveId */ + get( + options?: GetCisaCveParameters, + ): StreamableMethod; +} + +export interface ListPolicy { + /** Retrieve a list of policies for the provided search parameters. */ + get( + options?: ListPolicyParameters, + ): StreamableMethod; +} + +export interface GetPolicy { + /** Retrieve a policy with a given policyName. */ + get( + options?: GetPolicyParameters, + ): StreamableMethod; + /** Create or update a policy with a given policyName. */ + put( + options: CreateOrReplacePolicyParameters, + ): StreamableMethod< + CreateOrReplacePolicy200Response | CreateOrReplacePolicyDefaultResponse + >; + /** Delete a policy with a given policyName. */ + delete( + options?: DeletePolicyParameters, + ): StreamableMethod; +} + +export interface Routes { + /** Resource for '/assets' has methods for the following verbs: get, post */ + (path: "/assets"): ListAssetResource; + /** Resource for '/assets/\{assetId\}' has methods for the following verbs: get */ + (path: "/assets/{assetId}", assetId: string): GetAssetResource; + /** Resource for '/assets:export' has methods for the following verbs: post */ + (path: "/assets:export"): GetAssetsExport; + /** Resource for '/assets/\{assetId\}:getObservations' has methods for the following verbs: post */ + (path: "/assets/{assetId}:getObservations", assetId: string): GetObservations; + /** Resource for '/assets:getDeltaDetails' has methods for the following verbs: post */ + (path: "/assets:getDeltaDetails"): GetDeltaDetails; + /** Resource for '/assets:getDeltaSummary' has methods for the following verbs: post */ + (path: "/assets:getDeltaSummary"): GetDeltaSummary; + /** Resource for '/dataConnections' has methods for the following verbs: get */ + (path: "/dataConnections"): ListDataConnection; + /** Resource for '/dataConnections:validate' has methods for the following verbs: post */ + (path: "/dataConnections:validate"): ValidateDataConnection; + /** Resource for '/dataConnections/\{dataConnectionName\}' has methods for the following verbs: get, put, delete */ + ( + path: "/dataConnections/{dataConnectionName}", + dataConnectionName: string, + ): GetDataConnection; + /** Resource for '/discoGroups' has methods for the following verbs: get */ + (path: "/discoGroups"): ListDiscoGroup; + /** Resource for '/discoGroups:validate' has methods for the following verbs: post */ + (path: "/discoGroups:validate"): ValidateDiscoGroup; + /** Resource for '/discoGroups/\{groupName\}' has methods for the following verbs: get, put, delete */ + (path: "/discoGroups/{groupName}", groupName: string): GetDiscoGroup; + /** Resource for '/discoGroups/\{groupName\}:run' has methods for the following verbs: post */ + (path: "/discoGroups/{groupName}:run", groupName: string): RunDiscoGroup; + /** Resource for '/discoGroups/\{groupName\}/runs' has methods for the following verbs: get */ + (path: "/discoGroups/{groupName}/runs", groupName: string): ListRuns; + /** Resource for '/discoGroups:getAssetChainSummary' has methods for the following verbs: post */ + (path: "/discoGroups:getAssetChainSummary"): GetAssetChainSummary; + /** Resource for '/discoGroups:dismissAssetChain' has methods for the following verbs: post */ + (path: "/discoGroups:dismissAssetChain"): DismissAssetChain; + /** Resource for '/discoTemplates' has methods for the following verbs: get */ + (path: "/discoTemplates"): ListDiscoTemplate; + /** Resource for '/discoTemplates/\{templateId\}' has methods for the following verbs: get */ + (path: "/discoTemplates/{templateId}", templateId: string): GetDiscoTemplate; + /** Resource for '/reports/assets:getBillable' has methods for the following verbs: post */ + (path: "/reports/assets:getBillable"): GetBillable; + /** Resource for '/reports/assets:getSnapshot' has methods for the following verbs: post */ + (path: "/reports/assets:getSnapshot"): GetSnapshot; + /** Resource for '/reports/assets:getSummary' has methods for the following verbs: post */ + (path: "/reports/assets:getSummary"): GetSummary; + /** Resource for '/reports/assets:getSnapshotExport' has methods for the following verbs: post */ + (path: "/reports/assets:getSnapshotExport"): GetSnapshotExport; + /** Resource for '/savedFilters' has methods for the following verbs: get */ + (path: "/savedFilters"): ListSavedFilter; + /** Resource for '/savedFilters/\{filterName\}' has methods for the following verbs: get, put, delete */ + (path: "/savedFilters/{filterName}", filterName: string): GetSavedFilter; + /** Resource for '/tasks' has methods for the following verbs: get */ + (path: "/tasks"): ListTask; + /** Resource for '/tasks/\{taskId\}' has methods for the following verbs: get */ + (path: "/tasks/{taskId}", taskId: string): GetTask; + /** Resource for '/tasks/\{taskId\}:cancel' has methods for the following verbs: post */ + (path: "/tasks/{taskId}:cancel", taskId: string): CancelTask; + /** Resource for '/tasks/\{taskId\}:run' has methods for the following verbs: post */ + (path: "/tasks/{taskId}:run", taskId: string): RunTask; + /** Resource for '/tasks/\{taskId\}:download' has methods for the following verbs: post */ + (path: "/tasks/{taskId}:download", taskId: string): DownloadTask; + /** Resource for '/cisaCves' has methods for the following verbs: get */ + (path: "/cisaCves"): GetCisaCves; + /** Resource for '/cisaCves/\{cveId\}' has methods for the following verbs: get */ + (path: "/cisaCves/{cveId}", cveId: string): GetCisaCve; + /** Resource for '/policies' has methods for the following verbs: get */ + (path: "/policies"): ListPolicy; + /** Resource for '/policies/\{policyName\}' has methods for the following verbs: get, put, delete */ + (path: "/policies/{policyName}", policyName: string): GetPolicy; +} + +export type EasmClient = Client & { + path: Routes; +}; diff --git a/sdk/easm/defendereasm-rest/src/easmClient.ts b/sdk/easm/defendereasm-rest/src/easmClient.ts new file mode 100644 index 000000000000..76b0dbdbdbe4 --- /dev/null +++ b/sdk/easm/defendereasm-rest/src/easmClient.ts @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { getClient, ClientOptions } from "@azure-rest/core-client"; +import { logger } from "./logger.js"; +import { TokenCredential } from "@azure/core-auth"; +import { EasmClient } from "./clientDefinitions.js"; + +/** The optional parameters for the client */ +export interface EasmClientOptions extends ClientOptions { + /** The api version option of the client */ + apiVersion?: string; +} + +/** + * Initialize a new instance of `EasmClient` + * @param endpointParam - The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/workspaces/{workspaceName} + * @param credentials - uniquely identify client credential + * @param options - the parameter for all optional parameters + */ +export default function createClient( + endpointParam: string, + credentials: TokenCredential, + { apiVersion = "2024-10-01-preview", ...options }: EasmClientOptions = {}, +): EasmClient { + const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`; + const userAgentInfo = `azsdk-js-defender-easm-rest/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` + : `${userAgentInfo}`; + options = { + ...options, + userAgentOptions: { + userAgentPrefix, + }, + loggingOptions: { + logger: options.loggingOptions?.logger ?? logger.info, + }, + credentials: { + scopes: options.credentials?.scopes ?? [ + "https://easm.defender.microsoft.com/.default", + ], + }, + }; + const client = getClient(endpointUrl, credentials, options) as EasmClient; + + client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + client.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && apiVersion) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + + return client; +} diff --git a/sdk/easm/defendereasm-rest/src/index.ts b/sdk/easm/defendereasm-rest/src/index.ts new file mode 100644 index 000000000000..13e3f8618843 --- /dev/null +++ b/sdk/easm/defendereasm-rest/src/index.ts @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import EasmClient from "./easmClient.js"; + +export * from "./easmClient.js"; +export * from "./parameters.js"; +export * from "./responses.js"; +export * from "./clientDefinitions.js"; +export * from "./isUnexpected.js"; +export * from "./models.js"; +export * from "./outputModels.js"; +export * from "./paginateHelper.js"; + +export default EasmClient; diff --git a/sdk/easm/defendereasm-rest/src/isUnexpected.ts b/sdk/easm/defendereasm-rest/src/isUnexpected.ts new file mode 100644 index 000000000000..19589ba0f16e --- /dev/null +++ b/sdk/easm/defendereasm-rest/src/isUnexpected.ts @@ -0,0 +1,486 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + ListAssetResource200Response, + ListAssetResourceDefaultResponse, + UpdateAssets200Response, + UpdateAssetsDefaultResponse, + GetAssetResource200Response, + GetAssetResourceDefaultResponse, + GetAssetsExport200Response, + GetAssetsExportDefaultResponse, + GetObservations200Response, + GetObservationsDefaultResponse, + GetDeltaDetails200Response, + GetDeltaDetailsDefaultResponse, + GetDeltaSummary200Response, + GetDeltaSummaryDefaultResponse, + ListDataConnection200Response, + ListDataConnectionDefaultResponse, + ValidateDataConnection200Response, + ValidateDataConnectionDefaultResponse, + GetDataConnection200Response, + GetDataConnectionDefaultResponse, + CreateOrReplaceDataConnection200Response, + CreateOrReplaceDataConnectionDefaultResponse, + DeleteDataConnection204Response, + DeleteDataConnectionDefaultResponse, + ListDiscoGroup200Response, + ListDiscoGroupDefaultResponse, + ValidateDiscoGroup200Response, + ValidateDiscoGroupDefaultResponse, + GetDiscoGroup200Response, + GetDiscoGroupDefaultResponse, + CreateOrReplaceDiscoGroup200Response, + CreateOrReplaceDiscoGroupDefaultResponse, + DeleteDiscoGroup204Response, + DeleteDiscoGroupDefaultResponse, + RunDiscoGroup204Response, + RunDiscoGroupDefaultResponse, + ListRuns200Response, + ListRunsDefaultResponse, + GetAssetChainSummary200Response, + GetAssetChainSummaryDefaultResponse, + DismissAssetChain200Response, + DismissAssetChainDefaultResponse, + ListDiscoTemplate200Response, + ListDiscoTemplateDefaultResponse, + GetDiscoTemplate200Response, + GetDiscoTemplateDefaultResponse, + GetBillable200Response, + GetBillableDefaultResponse, + GetSnapshot200Response, + GetSnapshotDefaultResponse, + GetSummary200Response, + GetSummaryDefaultResponse, + GetSnapshotExport200Response, + GetSnapshotExportDefaultResponse, + ListSavedFilter200Response, + ListSavedFilterDefaultResponse, + GetSavedFilter200Response, + GetSavedFilterDefaultResponse, + CreateOrReplaceSavedFilter200Response, + CreateOrReplaceSavedFilterDefaultResponse, + DeleteSavedFilter204Response, + DeleteSavedFilterDefaultResponse, + ListTask200Response, + ListTaskDefaultResponse, + GetTask200Response, + GetTaskDefaultResponse, + CancelTask200Response, + CancelTaskDefaultResponse, + RunTask200Response, + RunTaskDefaultResponse, + DownloadTask200Response, + DownloadTaskDefaultResponse, + GetCisaCves200Response, + GetCisaCvesDefaultResponse, + GetCisaCve200Response, + GetCisaCveDefaultResponse, + ListPolicy200Response, + ListPolicyDefaultResponse, + GetPolicy200Response, + GetPolicyDefaultResponse, + CreateOrReplacePolicy200Response, + CreateOrReplacePolicyDefaultResponse, + DeletePolicy204Response, + DeletePolicyDefaultResponse, +} from "./responses.js"; + +const responseMap: Record = { + "GET /assets": ["200"], + "POST /assets": ["200"], + "GET /assets/{assetId}": ["200"], + "POST /assets:export": ["200"], + "POST /assets/{assetId}:getObservations": ["200"], + "POST /assets:getDeltaDetails": ["200"], + "POST /assets:getDeltaSummary": ["200"], + "GET /dataConnections": ["200"], + "POST /dataConnections:validate": ["200"], + "GET /dataConnections/{dataConnectionName}": ["200"], + "PUT /dataConnections/{dataConnectionName}": ["200"], + "DELETE /dataConnections/{dataConnectionName}": ["204"], + "GET /discoGroups": ["200"], + "POST /discoGroups:validate": ["200"], + "GET /discoGroups/{groupName}": ["200"], + "PUT /discoGroups/{groupName}": ["200"], + "DELETE /discoGroups/{groupName}": ["204"], + "POST /discoGroups/{groupName}:run": ["204"], + "GET /discoGroups/{groupName}/runs": ["200"], + "POST /discoGroups:getAssetChainSummary": ["200"], + "POST /discoGroups:dismissAssetChain": ["200"], + "GET /discoTemplates": ["200"], + "GET /discoTemplates/{templateId}": ["200"], + "POST /reports/assets:getBillable": ["200"], + "POST /reports/assets:getSnapshot": ["200"], + "POST /reports/assets:getSummary": ["200"], + "POST /reports/assets:getSnapshotExport": ["200"], + "GET /savedFilters": ["200"], + "GET /savedFilters/{filterName}": ["200"], + "PUT /savedFilters/{filterName}": ["200"], + "DELETE /savedFilters/{filterName}": ["204"], + "GET /tasks": ["200"], + "GET /tasks/{taskId}": ["200"], + "POST /tasks/{taskId}:cancel": ["200"], + "POST /tasks/{taskId}:run": ["200"], + "POST /tasks/{taskId}:download": ["200"], + "GET /cisaCves": ["200"], + "GET /cisaCves/{cveId}": ["200"], + "GET /policies": ["200"], + "GET /policies/{policyName}": ["200"], + "PUT /policies/{policyName}": ["200"], + "DELETE /policies/{policyName}": ["204"], +}; + +export function isUnexpected( + response: ListAssetResource200Response | ListAssetResourceDefaultResponse, +): response is ListAssetResourceDefaultResponse; +export function isUnexpected( + response: UpdateAssets200Response | UpdateAssetsDefaultResponse, +): response is UpdateAssetsDefaultResponse; +export function isUnexpected( + response: GetAssetResource200Response | GetAssetResourceDefaultResponse, +): response is GetAssetResourceDefaultResponse; +export function isUnexpected( + response: GetAssetsExport200Response | GetAssetsExportDefaultResponse, +): response is GetAssetsExportDefaultResponse; +export function isUnexpected( + response: GetObservations200Response | GetObservationsDefaultResponse, +): response is GetObservationsDefaultResponse; +export function isUnexpected( + response: GetDeltaDetails200Response | GetDeltaDetailsDefaultResponse, +): response is GetDeltaDetailsDefaultResponse; +export function isUnexpected( + response: GetDeltaSummary200Response | GetDeltaSummaryDefaultResponse, +): response is GetDeltaSummaryDefaultResponse; +export function isUnexpected( + response: ListDataConnection200Response | ListDataConnectionDefaultResponse, +): response is ListDataConnectionDefaultResponse; +export function isUnexpected( + response: + | ValidateDataConnection200Response + | ValidateDataConnectionDefaultResponse, +): response is ValidateDataConnectionDefaultResponse; +export function isUnexpected( + response: GetDataConnection200Response | GetDataConnectionDefaultResponse, +): response is GetDataConnectionDefaultResponse; +export function isUnexpected( + response: + | CreateOrReplaceDataConnection200Response + | CreateOrReplaceDataConnectionDefaultResponse, +): response is CreateOrReplaceDataConnectionDefaultResponse; +export function isUnexpected( + response: + | DeleteDataConnection204Response + | DeleteDataConnectionDefaultResponse, +): response is DeleteDataConnectionDefaultResponse; +export function isUnexpected( + response: ListDiscoGroup200Response | ListDiscoGroupDefaultResponse, +): response is ListDiscoGroupDefaultResponse; +export function isUnexpected( + response: ValidateDiscoGroup200Response | ValidateDiscoGroupDefaultResponse, +): response is ValidateDiscoGroupDefaultResponse; +export function isUnexpected( + response: GetDiscoGroup200Response | GetDiscoGroupDefaultResponse, +): response is GetDiscoGroupDefaultResponse; +export function isUnexpected( + response: + | CreateOrReplaceDiscoGroup200Response + | CreateOrReplaceDiscoGroupDefaultResponse, +): response is CreateOrReplaceDiscoGroupDefaultResponse; +export function isUnexpected( + response: DeleteDiscoGroup204Response | DeleteDiscoGroupDefaultResponse, +): response is DeleteDiscoGroupDefaultResponse; +export function isUnexpected( + response: RunDiscoGroup204Response | RunDiscoGroupDefaultResponse, +): response is RunDiscoGroupDefaultResponse; +export function isUnexpected( + response: ListRuns200Response | ListRunsDefaultResponse, +): response is ListRunsDefaultResponse; +export function isUnexpected( + response: + | GetAssetChainSummary200Response + | GetAssetChainSummaryDefaultResponse, +): response is GetAssetChainSummaryDefaultResponse; +export function isUnexpected( + response: DismissAssetChain200Response | DismissAssetChainDefaultResponse, +): response is DismissAssetChainDefaultResponse; +export function isUnexpected( + response: ListDiscoTemplate200Response | ListDiscoTemplateDefaultResponse, +): response is ListDiscoTemplateDefaultResponse; +export function isUnexpected( + response: GetDiscoTemplate200Response | GetDiscoTemplateDefaultResponse, +): response is GetDiscoTemplateDefaultResponse; +export function isUnexpected( + response: GetBillable200Response | GetBillableDefaultResponse, +): response is GetBillableDefaultResponse; +export function isUnexpected( + response: GetSnapshot200Response | GetSnapshotDefaultResponse, +): response is GetSnapshotDefaultResponse; +export function isUnexpected( + response: GetSummary200Response | GetSummaryDefaultResponse, +): response is GetSummaryDefaultResponse; +export function isUnexpected( + response: GetSnapshotExport200Response | GetSnapshotExportDefaultResponse, +): response is GetSnapshotExportDefaultResponse; +export function isUnexpected( + response: ListSavedFilter200Response | ListSavedFilterDefaultResponse, +): response is ListSavedFilterDefaultResponse; +export function isUnexpected( + response: GetSavedFilter200Response | GetSavedFilterDefaultResponse, +): response is GetSavedFilterDefaultResponse; +export function isUnexpected( + response: + | CreateOrReplaceSavedFilter200Response + | CreateOrReplaceSavedFilterDefaultResponse, +): response is CreateOrReplaceSavedFilterDefaultResponse; +export function isUnexpected( + response: DeleteSavedFilter204Response | DeleteSavedFilterDefaultResponse, +): response is DeleteSavedFilterDefaultResponse; +export function isUnexpected( + response: ListTask200Response | ListTaskDefaultResponse, +): response is ListTaskDefaultResponse; +export function isUnexpected( + response: GetTask200Response | GetTaskDefaultResponse, +): response is GetTaskDefaultResponse; +export function isUnexpected( + response: CancelTask200Response | CancelTaskDefaultResponse, +): response is CancelTaskDefaultResponse; +export function isUnexpected( + response: RunTask200Response | RunTaskDefaultResponse, +): response is RunTaskDefaultResponse; +export function isUnexpected( + response: DownloadTask200Response | DownloadTaskDefaultResponse, +): response is DownloadTaskDefaultResponse; +export function isUnexpected( + response: GetCisaCves200Response | GetCisaCvesDefaultResponse, +): response is GetCisaCvesDefaultResponse; +export function isUnexpected( + response: GetCisaCve200Response | GetCisaCveDefaultResponse, +): response is GetCisaCveDefaultResponse; +export function isUnexpected( + response: ListPolicy200Response | ListPolicyDefaultResponse, +): response is ListPolicyDefaultResponse; +export function isUnexpected( + response: GetPolicy200Response | GetPolicyDefaultResponse, +): response is GetPolicyDefaultResponse; +export function isUnexpected( + response: + | CreateOrReplacePolicy200Response + | CreateOrReplacePolicyDefaultResponse, +): response is CreateOrReplacePolicyDefaultResponse; +export function isUnexpected( + response: DeletePolicy204Response | DeletePolicyDefaultResponse, +): response is DeletePolicyDefaultResponse; +export function isUnexpected( + response: + | ListAssetResource200Response + | ListAssetResourceDefaultResponse + | UpdateAssets200Response + | UpdateAssetsDefaultResponse + | GetAssetResource200Response + | GetAssetResourceDefaultResponse + | GetAssetsExport200Response + | GetAssetsExportDefaultResponse + | GetObservations200Response + | GetObservationsDefaultResponse + | GetDeltaDetails200Response + | GetDeltaDetailsDefaultResponse + | GetDeltaSummary200Response + | GetDeltaSummaryDefaultResponse + | ListDataConnection200Response + | ListDataConnectionDefaultResponse + | ValidateDataConnection200Response + | ValidateDataConnectionDefaultResponse + | GetDataConnection200Response + | GetDataConnectionDefaultResponse + | CreateOrReplaceDataConnection200Response + | CreateOrReplaceDataConnectionDefaultResponse + | DeleteDataConnection204Response + | DeleteDataConnectionDefaultResponse + | ListDiscoGroup200Response + | ListDiscoGroupDefaultResponse + | ValidateDiscoGroup200Response + | ValidateDiscoGroupDefaultResponse + | GetDiscoGroup200Response + | GetDiscoGroupDefaultResponse + | CreateOrReplaceDiscoGroup200Response + | CreateOrReplaceDiscoGroupDefaultResponse + | DeleteDiscoGroup204Response + | DeleteDiscoGroupDefaultResponse + | RunDiscoGroup204Response + | RunDiscoGroupDefaultResponse + | ListRuns200Response + | ListRunsDefaultResponse + | GetAssetChainSummary200Response + | GetAssetChainSummaryDefaultResponse + | DismissAssetChain200Response + | DismissAssetChainDefaultResponse + | ListDiscoTemplate200Response + | ListDiscoTemplateDefaultResponse + | GetDiscoTemplate200Response + | GetDiscoTemplateDefaultResponse + | GetBillable200Response + | GetBillableDefaultResponse + | GetSnapshot200Response + | GetSnapshotDefaultResponse + | GetSummary200Response + | GetSummaryDefaultResponse + | GetSnapshotExport200Response + | GetSnapshotExportDefaultResponse + | ListSavedFilter200Response + | ListSavedFilterDefaultResponse + | GetSavedFilter200Response + | GetSavedFilterDefaultResponse + | CreateOrReplaceSavedFilter200Response + | CreateOrReplaceSavedFilterDefaultResponse + | DeleteSavedFilter204Response + | DeleteSavedFilterDefaultResponse + | ListTask200Response + | ListTaskDefaultResponse + | GetTask200Response + | GetTaskDefaultResponse + | CancelTask200Response + | CancelTaskDefaultResponse + | RunTask200Response + | RunTaskDefaultResponse + | DownloadTask200Response + | DownloadTaskDefaultResponse + | GetCisaCves200Response + | GetCisaCvesDefaultResponse + | GetCisaCve200Response + | GetCisaCveDefaultResponse + | ListPolicy200Response + | ListPolicyDefaultResponse + | GetPolicy200Response + | GetPolicyDefaultResponse + | CreateOrReplacePolicy200Response + | CreateOrReplacePolicyDefaultResponse + | DeletePolicy204Response + | DeletePolicyDefaultResponse, +): response is + | ListAssetResourceDefaultResponse + | UpdateAssetsDefaultResponse + | GetAssetResourceDefaultResponse + | GetAssetsExportDefaultResponse + | GetObservationsDefaultResponse + | GetDeltaDetailsDefaultResponse + | GetDeltaSummaryDefaultResponse + | ListDataConnectionDefaultResponse + | ValidateDataConnectionDefaultResponse + | GetDataConnectionDefaultResponse + | CreateOrReplaceDataConnectionDefaultResponse + | DeleteDataConnectionDefaultResponse + | ListDiscoGroupDefaultResponse + | ValidateDiscoGroupDefaultResponse + | GetDiscoGroupDefaultResponse + | CreateOrReplaceDiscoGroupDefaultResponse + | DeleteDiscoGroupDefaultResponse + | RunDiscoGroupDefaultResponse + | ListRunsDefaultResponse + | GetAssetChainSummaryDefaultResponse + | DismissAssetChainDefaultResponse + | ListDiscoTemplateDefaultResponse + | GetDiscoTemplateDefaultResponse + | GetBillableDefaultResponse + | GetSnapshotDefaultResponse + | GetSummaryDefaultResponse + | GetSnapshotExportDefaultResponse + | ListSavedFilterDefaultResponse + | GetSavedFilterDefaultResponse + | CreateOrReplaceSavedFilterDefaultResponse + | DeleteSavedFilterDefaultResponse + | ListTaskDefaultResponse + | GetTaskDefaultResponse + | CancelTaskDefaultResponse + | RunTaskDefaultResponse + | DownloadTaskDefaultResponse + | GetCisaCvesDefaultResponse + | GetCisaCveDefaultResponse + | ListPolicyDefaultResponse + | GetPolicyDefaultResponse + | CreateOrReplacePolicyDefaultResponse + | DeletePolicyDefaultResponse { + const lroOriginal = response.headers["x-ms-original-url"]; + const url = new URL(lroOriginal ?? response.request.url); + const method = response.request.method; + let pathDetails = responseMap[`${method} ${url.pathname}`]; + if (!pathDetails) { + pathDetails = getParametrizedPathSuccess(method, url.pathname); + } + return !pathDetails.includes(response.status); +} + +function getParametrizedPathSuccess(method: string, path: string): string[] { + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: string[] = []; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(responseMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- + ) { + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}`, + ).test(pathParts[j] || ""); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/easm/defendereasm-rest/src/logger.ts b/sdk/easm/defendereasm-rest/src/logger.ts new file mode 100644 index 000000000000..9db14b24575d --- /dev/null +++ b/sdk/easm/defendereasm-rest/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("defender-easm-rest"); diff --git a/sdk/easm/defendereasm-rest/src/models.ts b/sdk/easm/defendereasm-rest/src/models.ts new file mode 100644 index 000000000000..d854331f9398 --- /dev/null +++ b/sdk/easm/defendereasm-rest/src/models.ts @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** A request body used to update an asset. */ +export interface AssetUpdateData { + /** + * The state to update the asset to. + * + * Possible values: "candidate", "confirmed", "dismissed", "candidateInvestigate", "associatedPartner", "associatedThirdparty" + */ + state?: AssetUpdateState; + /** A string which can be used to identify the asset in external systems. */ + externalId?: string; + /** Any Labels to update the asset with. */ + labels?: Record; + /** + * A list of asset types to cascade the updates to. + * + * Possible values: "as", "contact", "domain", "host", "ipAddress", "ipBlock", "page", "sslCert" + */ + transfers?: AssetUpdateTransfers; + /** A list of observation remediations to apply to the asset. */ + remediations?: Array; +} + +/** This is an object that contains the observation remediation information that is used as part of the asset update. */ +export interface ObservationRemediationItem { + /** + * The kind of the observation to remediate. + * + * Possible values: "cve", "insight" + */ + kind?: ObservationType; + /** The name of the observation to remediate. */ + name?: string; + /** + * The state to which to update the observation. + * + * Possible values: "active", "nonApplicable" + */ + state?: ObservationRemediationState; +} + +/** A request body used to export an asset. */ +export interface AssetsExportRequest { + /** The name of the file to export. */ + fileName: string; + /** The columns to export. */ + columns: string[]; +} + +/** A request body used to retrieve a list of deltas. */ +export interface DeltaDetailsRequest { + /** + * The type of delta detail to retrieve. + * + * Possible values: "added", "removed" + */ + deltaDetailType: DeltaDetailType; + /** The number of days prior to retrieve deltas for. */ + priorDays?: number; + /** + * The type of asset + * + * Possible values: "page", "resource", "mailServer", "nameServer", "host", "domain", "ipAddress", "ipBlock", "as", "contact", "sslCert" + */ + kind: GlobalAssetType; + /** expected format to be: yyyy-MM-dd */ + date?: string; +} + +/** A request body used to retrieve a delta summary. */ +export interface DeltaSummaryRequest { + /** The number of days prior to retrieve deltas for. */ + priorDays?: number; + /** expected format to be: yyyy-MM-dd */ + date?: string; +} + +export interface LogAnalyticsDataConnectionProperties + extends DataConnectionProperties { + /** log analytics api key */ + apiKey?: string; + /** log analytics workspace id */ + workspaceId?: string; +} + +/** The properties required to establish connection to a particular service */ +export interface DataConnectionProperties {} + +export interface AzureDataExplorerDataConnectionProperties + extends DataConnectionProperties { + /** The azure data explorer cluster name */ + clusterName?: string; + /** The azure data explorer region */ + region?: string; + /** The azure data explorer database name */ + databaseName?: string; +} + +export interface DataConnectionDataParent { + /** The name of data connection */ + name?: string; + /** + * The type of data the data connection will transfer. + * + * Possible values: "assets", "attackSurfaceInsights" + */ + content?: DataConnectionContent; + /** + * The rate at which the data connection will receive updates. + * + * Possible values: "daily", "weekly", "monthly" + */ + frequency?: DataConnectionFrequency; + /** The day to update the data connection on. (1-7 for weekly, 1-31 for monthly) */ + frequencyOffset?: number; + kind: string; +} + +export interface LogAnalyticsDataConnectionData + extends DataConnectionDataParent { + /** The kind of DataConnectionData */ + kind: "logAnalytics"; + /** properties */ + properties: LogAnalyticsDataConnectionProperties; +} + +export interface AzureDataExplorerDataConnectionData + extends DataConnectionDataParent { + /** The kind of DataConnectionData */ + kind: "azureDataExplorer"; + /** properties */ + properties: AzureDataExplorerDataConnectionProperties; +} + +/** Source entity used to drive discovery. */ +export interface DiscoSource { + /** + * The kind of disco source. + * + * Possible values: "as", "attribute", "contact", "domain", "host", "ipBlock" + */ + kind?: DiscoSourceKind; + /** The name for the disco source. */ + name?: string; +} + +/** A request body used to create a discovery group. */ +export interface DiscoGroupData { + /** The name for a disco group. */ + name?: string; + /** The description for a disco group. */ + description?: string; + /** The tier for the disco group which will affect the algorithm used for the disco runs in this group. */ + tier?: string; + /** The frequency at which the disco group is supposed to be rerun in milliseconds. */ + frequencyMilliseconds?: number; + /** The list of seeds used for the disco group runs. */ + seeds?: Array; + /** The list of names used for the disco group runs. */ + names?: string[]; + /** The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. */ + excludes?: Array; + /** The unique identifier for the disco template used for the disco group creation. */ + templateId?: string; +} + +/** AssetChainRequest containing information needed for the retrieval of the asset chain summary. */ +export interface AssetChainRequest { + /** + * Asset chain source. + * + * Possible values: "DISCO_GROUP", "ASSET" + */ + assetChainSource: AssetChainSource; + /** A collection of asset chain source ids. */ + sourceIds: string[]; +} + +/** A request body used to retrieve an asset report snapshot. */ +export interface ReportAssetSnapshotRequest { + /** The metric to retrieve a snapshot for. */ + metric?: string; + /** The name of the label to retrieve a snapshot for. */ + labelName?: string; + /** The number of assets per page. */ + size?: number; + /** The page to retrieve. */ + page?: number; +} + +/** A request body used to retrieve summary asset information. One and only one collection of summary identifiers must be provided: filters, metrics, or metricCategories. */ +export interface ReportAssetSummaryRequest { + /** Categories to retrieve risk reporting data for. */ + metricCategories?: string[]; + /** Metrics to retrieve risk reporting data for. */ + metrics?: string[]; + /** Query filters to apply to the asset summary. */ + filters?: string[]; + /** A parameter to group the assets by (first level facet field), only used when the chosen summary identifier is filters. */ + groupBy?: string; + /** A parameter to segment the assets by (second level facet field), only used when the chosen summary identifier is filters. */ + segmentBy?: string; + /** Currently unused. */ + labelName?: string; +} + +/** A request body used for an asset report snapshot export. */ +export interface ReportAssetSnapshotExportRequest { + /** The metric to retrieve a snapshot for. */ + metric?: string; + /** The filename of the exported file. */ + fileName?: string; + /** The columns to include in the export */ + columns?: string[]; +} + +/** A request body used to create a saved filter. */ +export interface SavedFilterData { + /** An expression on the resource type that selects the resources to be returned. */ + filter: string; + /** A human readable description of the saved filter. */ + description: string; +} + +/** This is an object that exists to provide a common schema definition for the action parameters. */ +export interface ActionParameters { + /** The value parameter that is used by the policy action.. */ + value?: string; + /** The optional name parameter that can be used by the policy action. */ + name?: string; +} + +/** A request body used to create a policy. */ +export interface PolicyData { + /** A human readable description of what the policy should do. */ + description?: string; + /** Name of the saved filter query to be used to select assets that are to be updated by a given policy. */ + filterName?: string; + /** + * Action specifying what the policy should do. + * + * Possible values: "addResource", "removeResource", "setState", "setExternalID", "removeFromInventory" + */ + action?: PolicyAction; + /** Priority of the policy. */ + priority?: number; + /** Additional parameters needed to perform the policy action. */ + actionParameters?: ActionParameters; +} + +export type DataConnectionData = + | DataConnectionDataParent + | LogAnalyticsDataConnectionData + | AzureDataExplorerDataConnectionData; +/** Alias for AssetResponseType */ +export type AssetResponseType = string; +/** Alias for AssetUpdateState */ +export type AssetUpdateState = string; +/** Alias for AssetUpdateTransfers */ +export type AssetUpdateTransfers = string; +/** Alias for ObservationType */ +export type ObservationType = string; +/** Alias for ObservationRemediationState */ +export type ObservationRemediationState = string; +/** Alias for DeltaDetailType */ +export type DeltaDetailType = string; +/** Alias for GlobalAssetType */ +export type GlobalAssetType = string; +/** Alias for DataConnectionContent */ +export type DataConnectionContent = string; +/** Alias for DataConnectionFrequency */ +export type DataConnectionFrequency = string; +/** Alias for DiscoSourceKind */ +export type DiscoSourceKind = string; +/** Alias for AssetChainSource */ +export type AssetChainSource = string; +/** Alias for PolicyAction */ +export type PolicyAction = string; diff --git a/sdk/easm/defendereasm-rest/src/outputModels.ts b/sdk/easm/defendereasm-rest/src/outputModels.ts new file mode 100644 index 000000000000..e9094e2b9b4b --- /dev/null +++ b/sdk/easm/defendereasm-rest/src/outputModels.ts @@ -0,0 +1,1337 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Paged } from "@azure/core-paging"; +import { ErrorResponse } from "@azure-rest/core-client"; + +/** The items in the current page of results. */ +export interface AssetResourceOutputParent { + /** The system generated unique id for the resource. */ + readonly id: string; + /** The caller provided unique name for the resource. */ + name?: string; + /** The name that can be used for display purposes. */ + displayName?: string; + /** Global UUID for the asset. */ + uuid?: string; + /** The date this asset was first added to this workspace. */ + createdDate?: string; + /** The date this asset was last updated for this workspace. */ + updatedDate?: string; + /** Possible values: "archived" */ + state?: AssetStateOutput; + /** An optional customer provided identifier for this asset. */ + externalId?: string; + /** Customer labels assigned to this asset. */ + labels?: string[]; + /** An indicator of whether this asset represents a wildcard rollup of assets on this domain. */ + wildcard?: boolean; + /** The name of the DiscoGroup that brought added this asset to the workspace. */ + discoGroupName?: string; + /** The history of how this asset was pulled into the workspace through the discovery process. */ + auditTrail?: Array; + reason?: string; + kind: string; +} + +/** The history of how this asset was pulled into the workspace through the discovery process. */ +export interface AuditTrailItemOutput { + /** The system generated unique id for the resource. */ + id?: string; + /** The caller provided unique name for the resource. */ + name?: string; + /** The name that can be used for display purposes. */ + displayName?: string; + /** + * The kind of asset. + * + * Possible values: "as", "contact", "domain", "host", "ipAddress", "ipBlock", "page", "sslCert" + */ + kind?: AuditTrailItemKindOutput; + /** An explanation of why this audit trail node was discovered from the previous node. */ + reason?: string; +} + +export interface AsAssetResourceOutput extends AssetResourceOutputParent { + /** The kind of AssetResource */ + kind: "as"; + /** asset */ + asset: AsAssetOutput; +} + +export interface AsAssetOutput extends InventoryAssetOutput { + asn?: number; + asNames?: Array; + orgNames?: Array; + orgIds?: Array; + countries?: Array; + registries?: Array; + sources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; + registrarCreatedAt?: Array; + registrarUpdatedAt?: Array; + registrantContacts?: Array; + adminContacts?: Array; + technicalContacts?: Array; + registrarNames?: Array; + registrantNames?: Array; + adminNames?: Array; + technicalNames?: Array; + adminOrgs?: Array; + technicalOrgs?: Array; + registrantPhones?: Array; + adminPhones?: Array; + technicalPhones?: Array; + detailedFromWhoisAt?: string; +} + +export interface ObservedStringOutput extends ObservedValueOutput { + value?: string; + sources?: Array; +} + +export interface SourceOutput { + source?: string; + firstSeen?: string; + lastSeen?: string; + count?: number; + reason?: string; +} + +/** Template model for observed values */ +export interface ObservedValueOutput { + firstSeen?: string; + lastSeen?: string; + count?: number; + recent?: boolean; +} + +export interface ObservedLongOutput extends ObservedValueOutput { + value?: number; + sources?: Array; +} + +export interface ObservedIntegerOutput extends ObservedValueOutput { + value?: number; + sources?: Array; +} + +export interface ObservedBooleanOutput extends ObservedValueOutput { + value?: boolean; + sources?: Array; +} + +export interface ObservedHeaderOutput extends ObservedValueOutput { + headerName?: string; + headerValue?: string; +} + +export interface ObservedPortStateOutput extends ObservedValueOutput { + /** Possible values: "open", "closed", "filtered" */ + value?: ObservedPortStateValueOutput; + port?: number; +} + +export interface ObservedLocationOutput extends ObservedValueOutput { + value?: LocationOutput; + sources?: Array; +} + +export interface LocationOutput { + countryCode?: string; + countryName?: string; + region?: string; + regionName?: string; + city?: string; + areaCode?: number; + postalCode?: string; + latitude?: number; + longitude?: number; + dmaCode?: number; + metroCodeId?: number; +} + +export interface ObservedIntegersOutput extends ObservedValueOutput { + values?: number[]; + sources?: Array; +} + +/** A inventory base model created for swagger documentation purpose */ +export interface InventoryAssetOutput {} + +export interface ContactAssetOutput extends InventoryAssetOutput { + email?: string; + names?: Array; + organizations?: Array; + sources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; +} + +export interface SslCertAssetOutput extends InventoryAssetOutput { + sha1?: string; + subjectCommonNames?: string[]; + organizations?: string[]; + organizationalUnits?: string[]; + issuerCommonNames?: string[]; + sigAlgName?: string; + invalidAfter?: string; + serialNumber?: string; + subjectAlternativeNames?: string[]; + issuerAlternativeNames?: string[]; + sources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; + invalidBefore?: string; + keySize?: number; + keyAlgorithm?: string; + subjectLocality?: string[]; + subjectState?: string[]; + subjectCountry?: string[]; + issuerLocality?: string[]; + issuerState?: string[]; + issuerCountry?: string[]; + subjectOrganizations?: string[]; + subjectOrganizationalUnits?: string[]; + issuerOrganizations?: string[]; + issuerOrganizationalUnits?: string[]; + version?: number; + certificateAuthority?: boolean; + selfSigned?: boolean; + sigAlgOid?: string; + recent?: boolean; + /** Possible values: "domainValidation", "organizationValidation", "extendedValidation" */ + validationType?: SslCertAssetValidationTypeOutput; +} + +export interface HostAssetOutput extends InventoryAssetOutput { + host?: string; + domain?: string; + ipAddresses?: Array; + webComponents?: Array; + headers?: Array; + attributes?: Array; + cookies?: Array; + sslCerts?: Array; + parentHosts?: Array; + childHosts?: Array; + hostCore?: HostCoreOutput; + services?: Array; + cnames?: Array; + sources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; + resourceUrls?: Array; + scanMetadata?: Array; + asns?: Array; + ipBlocks?: Array; + responseBodies?: Array; + domainAsset?: DomainAssetOutput; + nsRecord?: Array; + mxRecord?: Array; + webserver?: Array; + location?: Array; + nxdomain?: Array; + sslServerConfig?: Array; + isWildcard?: Array; + banners?: Array; + ipv4?: Array; + ipv6?: Array; +} + +export interface WebComponentOutput { + name?: string; + type?: string; + version?: string; + ruleId?: string[]; + firstSeen?: string; + lastSeen?: string; + count?: number; + cve?: Array; + endOfLife?: number; + recent?: boolean; + ports?: Array; + sources?: Array; + service?: string; +} + +export interface CveOutput { + name?: string; + cweId?: string; + cvssScore?: number; + cvss3Summary?: Cvss3SummaryOutput; +} + +export interface Cvss3SummaryOutput { + version?: string; + vectorString?: string; + attackVector?: string; + attackComplexity?: string; + privilegesRequired?: string; + userInteraction?: string; + scope?: string; + confidentialityImpact?: string; + integrityImpact?: string; + availabilityImpact?: string; + baseScore?: number; + baseSeverity?: string; + exploitCodeMaturity?: string; + remediationLevel?: string; + reportConfidence?: string; + exploitabilityScore?: number; + impactScore?: number; +} + +export interface PortOutput { + port?: number; + firstSeen?: string; + lastSeen?: string; + count?: number; +} + +export interface AttributeOutput { + attributeType?: string; + attributeValue?: string; + sources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; + recent?: boolean; +} + +export interface CookieOutput { + cookieName?: string; + cookieDomain?: string; + firstSeen?: string; + lastSeen?: string; + count?: number; + recent?: boolean; + cookieExpiryDate?: string; +} + +export interface HostCoreOutput { + host?: string; + domain?: string; + firstSeen?: string; + lastSeen?: string; + count?: number; + blacklistCauseFirstSeen?: string; + blacklistCauseLastSeen?: string; + blacklistCauseCount?: number; + blacklistResourceFirstSeen?: string; + blacklistResourceLastSeen?: string; + blacklistResourceCount?: number; + blacklistSequenceFirstSeen?: string; + blacklistSequenceLastSeen?: string; + blacklistSequenceCount?: number; + phishCauseCount?: number; + malwareCauseCount?: number; + spamCauseCount?: number; + scamCauseCount?: number; + phishResourceCount?: number; + malwareResourceCount?: number; + spamResourceCount?: number; + scamResourceCount?: number; + phishSequenceCount?: number; + malwareSequenceCount?: number; + spamSequenceCount?: number; + scamSequenceCount?: number; + alexaRank?: number; + hostReputationScore?: number; + hostPhishReputationScore?: number; + hostMalwareReputationScore?: number; + hostSpamReputationScore?: number; + hostScamReputationScore?: number; + domainReputationScore?: number; + domainPhishReputationScore?: number; + domainMalwareReputationScore?: number; + domainSpamReputationScore?: number; + domainScamReputationScore?: number; + uuid?: string; +} + +export interface ServiceOutput { + scheme?: string; + port?: number; + webComponents?: Array; + sslCerts?: Array; + exceptions?: Array; + sources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; + recent?: boolean; + portStates?: Array; +} + +export interface ResourceUrlOutput { + url?: string; + resources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; + recent?: boolean; +} + +export interface DependentResourceOutput { + md5?: string; + responseBodySize?: number; + firstSeen?: string; + lastSeen?: string; + count?: number; + firstSeenCrawlGuid?: string; + firstSeenPageGuid?: string; + firstSeenResourceGuid?: string; + lastSeenCrawlGuid?: string; + lastSeenPageGuid?: string; + lastSeenResourceGuid?: string; + responseBodyMinhash?: number[]; + contentType?: string; + sha256?: string; + sha384?: string; + sha512?: string; + url?: string; + cached?: boolean; + sriChecks?: Array; + host?: string; + lastObservedViolation?: string; + lastObservedValidation?: string; + lastObservedActualSriHash?: string; + lastObservedExpectedSriHash?: string; +} + +export interface SubResourceIntegrityCheckOutput { + violation?: boolean; + firstSeen?: string; + lastSeen?: string; + count?: number; + causePageUrl?: string; + crawlGuid?: string; + pageGuid?: string; + resourceGuid?: string; + expectedHash?: string; +} + +export interface ScanMetadataOutput { + port?: number; + bannerMetadata?: string; + startScan?: string; + endScan?: string; +} + +export interface IpBlockOutput { + ipBlock?: string; + sources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; + recent?: boolean; +} + +export interface DomainAssetOutput { + domain?: string; + whoisId?: number; + registrarIanaIds?: Array; + registrantContacts?: Array; + registrantOrgs?: Array; + adminContacts?: Array; + technicalContacts?: Array; + alexaInfos?: Array; + nameServers?: Array; + mailServers?: Array; + whoisServers?: Array; + domainStatuses?: Array; + registrarCreatedAt?: Array; + registrarUpdatedAt?: Array; + registrarExpiresAt?: Array; + soaRecords?: Array; + detailedFromWhoisAt?: string; + registrarNames?: Array; + sources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; + parkedDomain?: Array; + registrantNames?: Array; + adminNames?: Array; + technicalNames?: Array; + adminOrgs?: Array; + technicalOrgs?: Array; + registrantPhones?: Array; + adminPhones?: Array; + technicalPhones?: Array; +} + +export interface AlexaInfoOutput { + alexaRank?: number; + category?: string; + firstSeen?: string; + lastSeen?: string; + count?: number; + recent?: boolean; +} + +export interface SoaRecordOutput { + nameServer?: string; + email?: string; + firstSeen?: string; + lastSeen?: string; + count?: number; + serialNumber?: number; + recent?: boolean; +} + +export interface SslServerConfigOutput { + tlsVersions?: string[]; + cipherSuites?: string[]; + firstSeen?: string; + lastSeen?: string; + count?: number; + sources?: Array; +} + +export interface BannerOutput { + port?: number; + banner?: string; + firstSeen?: string; + lastSeen?: string; + count?: number; + scanType?: string; + bannerMetadata?: string; + recent?: boolean; + sha256?: string; + sources?: Array; +} + +export interface IpAddressAssetOutput extends InventoryAssetOutput { + ipAddress?: string; + asns?: Array; + reputations?: Array; + webComponents?: Array; + netRanges?: Array; + headers?: Array; + attributes?: Array; + cookies?: Array; + sslCerts?: Array; + services?: Array; + ipBlocks?: Array; + sources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; + banners?: Array; + scanMetadata?: Array; + nsRecord?: Array; + mxRecord?: Array; + location?: Array; + hosts?: Array; + nxdomain?: Array; + sslServerConfig?: Array; + ipv4?: boolean; + ipv6?: boolean; +} + +export interface ReputationOutput { + listName?: string; + threatType?: string; + trusted?: boolean; + cidr?: string; + firstSeen?: string; + lastSeen?: string; + listUpdatedAt?: string; + recent?: boolean; +} + +export interface IpBlockAssetOutput extends InventoryAssetOutput { + ipBlock?: string; + asns?: Array; + bgpPrefixes?: Array; + netNames?: Array; + registrantContacts?: Array; + registrantOrgs?: Array; + adminContacts?: Array; + technicalContacts?: Array; + registrarCreatedAt?: Array; + registrarUpdatedAt?: Array; + netRanges?: Array; + startIp?: string; + endIp?: string; + reputations?: Array; + detailedFromWhoisAt?: string; + sources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; + location?: Array; + registrarExpiresAt?: Array; + registrantNames?: Array; + adminNames?: Array; + technicalNames?: Array; + adminOrgs?: Array; + technicalOrgs?: Array; + registrantPhones?: Array; + adminPhones?: Array; + technicalPhones?: Array; + ipv4?: boolean; + ipv6?: boolean; +} + +export interface PageAssetOutput extends InventoryAssetOutput { + url?: string; + httpMethod?: string; + service?: string; + ipAddresses?: Array; + successful?: Array; + httpResponseCodes?: Array; + httpResponseMessages?: Array; + responseTimes?: Array; + frames?: Array; + windows?: Array; + nonHtmlFrames?: Array; + undirectedContent?: Array; + contentTypes?: Array; + contentLengths?: Array; + windowNames?: Array; + charsets?: Array; + titles?: Array; + languages?: Array; + responseHeaders?: Array; + cookies?: Array; + webComponents?: Array; + attributes?: Array; + assetSecurityPolicies?: Array; + responseBodyMinhashSignatures?: Array; + fullDomMinhashSignatures?: Array; + responseBodyHashSignatures?: Array; + errors?: Array; + sslCerts?: Array; + sources?: Array; + firstSeen?: string; + lastSeen?: string; + count?: number; + cause?: PageCauseOutput; + referrer?: string; + redirectUrls?: Array; + /** Possible values: "httpHeader", "metaRefresh", "javascript", "final" */ + redirectType?: PageAssetRedirectTypeOutput; + finalUrls?: Array; + finalResponseCodes?: Array; + parkedPage?: Array; + resourceUrls?: Array; + guids?: Array; + finalIpAddresses?: Array; + asns?: Array; + ipBlocks?: Array; + finalAsns?: Array; + finalIpBlocks?: Array; + responseBodies?: Array; + domainAsset?: DomainAssetOutput; + rootUrl?: ObservedBooleanOutput; + isRootUrl?: boolean; + location?: Array; + services?: Array; + siteStatus?: string; + cnames?: Array; + cdns?: Array; + host?: string; + domain?: string; + sslServerConfig?: Array; + gdprAssetSecurityPolicies?: Array; + ipv4?: Array; + ipv6?: Array; +} + +export interface AssetSecurityPolicyOutput { + policyName?: string; + isAffected?: boolean; + description?: string; + firstSeen?: string; + lastSeen?: string; + count?: number; + recent?: boolean; + sources?: Array; +} + +export interface PageCauseOutput { + cause?: string; + causeElementXPath?: string; + location?: string; + possibleMatches?: number; + loopDetected?: boolean; + version?: number; + domChangeIndex?: number; +} + +export interface GuidPairOutput { + pageGuid?: string; + crawlStateGuid?: string; + loadDate?: string; + recent?: boolean; +} + +export interface ContactAssetResourceOutput extends AssetResourceOutputParent { + /** The kind of AssetResource */ + kind: "contact"; + /** asset */ + asset: ContactAssetOutput; +} + +export interface DomainAssetResourceOutput extends AssetResourceOutputParent { + /** The kind of AssetResource */ + kind: "domain"; + /** asset */ + asset: DomainAssetOutput; +} + +export interface HostAssetResourceOutput extends AssetResourceOutputParent { + /** The kind of AssetResource */ + kind: "host"; + /** asset */ + asset: HostAssetOutput; +} + +export interface IpAddressAssetResourceOutput + extends AssetResourceOutputParent { + /** The kind of AssetResource */ + kind: "ipAddress"; + /** asset */ + asset: IpAddressAssetOutput; +} + +export interface IpBlockAssetResourceOutput extends AssetResourceOutputParent { + /** The kind of AssetResource */ + kind: "ipBlock"; + /** asset */ + asset: IpBlockAssetOutput; +} + +export interface PageAssetResourceOutput extends AssetResourceOutputParent { + /** The kind of AssetResource */ + kind: "page"; + /** asset */ + asset: PageAssetOutput; +} + +export interface SslCertAssetResourceOutput extends AssetResourceOutputParent { + /** The kind of AssetResource */ + kind: "sslCert"; + /** asset */ + asset: SslCertAssetOutput; +} + +export interface TaskOutput { + /** The unique identifier of the task. */ + readonly id: string; + /** The time the task started. */ + startedAt?: string; + /** The time the task completed. */ + completedAt?: string; + /** The last time the status of the task was updated. */ + lastPolledAt?: string; + /** + * The state the task is in. + * + * Possible values: "pending", "running", "paused", "complete", "incomplete", "failed", "warning" + */ + state?: TaskStateOutput; + /** + * The phase the task is in. + * + * Possible values: "running", "polling", "complete" + */ + phase?: TaskPhaseOutput; + /** The reason the task was moved into its current state, if the task wasn't completed. */ + reason?: string; + /** Attributes unique to the task. This differs by task type. */ + metadata?: Record; +} + +/** The page result response for the observation */ +export interface ObservationPageResultOutput { + /** The total number of elements. */ + totalElements: number; + /** The summary of observation counts by priority. */ + prioritySummary: Record; + /** The list of observation results. */ + value: Array; +} + +/** The result response for the observation */ +export interface ObservationResultOutput { + /** The name of the observation. */ + name: string; + /** The list of applicable types. */ + types: ObservationTypeOutput[]; + /** + * The priority of the observation. + * + * Possible values: "high", "medium", "low", "none" + */ + priority: ObservationPriorityOutput; + /** The CVSS v2 score. */ + cvssScoreV2: number; + /** The CVSS v3 score. */ + cvssScoreV3: number; + /** + * The remediation state of the observation. + * + * Possible values: "active", "nonApplicable" + */ + remediationState: ObservationRemediationStateOutput; + /** + * The source of the remediation state of the observation. + * + * Possible values: "user", "system" + */ + remediationSource: ObservationRemediationSourceOutput; +} + +export interface DeltaPageResultOutput { + /** The total number of items available in the full result set. */ + totalElements?: number; + /** The link to access the next page of results. Not set if at the end of the result set. */ + nextLink?: string; + /** The items in the current page of results. */ + value?: Array; +} + +/** Result for each of the delta detail response */ +export interface DeltaResultOutput { + /** + * Shows the asset kind + * + * Possible values: "page", "resource", "mailServer", "nameServer", "host", "domain", "ipAddress", "ipBlock", "as", "contact", "sslCert" + */ + kind: GlobalAssetTypeOutput; + /** Shows the asset name */ + name: string; + /** Shows the date when the asset was originally created */ + createdAt: string; + /** Shows the date when the asset was last updated, usually the date the we trying to pull up the results for */ + updatedAt: string; + /** + * Shows the inventory state + * + * Possible values: "candidate", "candidateInvestigate", "confirmed", "associated", "associatedPartner", "associatedThirdParty", "archived", "dismissed", "autoconfirmed" + */ + state: GlobalInventoryStateOutput; +} + +/** Define response body for getting delta summary */ +export interface DeltaSummaryResultOutput { + /** Contains added, removed, and difference values for the whole range either 7 or 30 days */ + summary: DeltaRangeResultOutput; + /** Contains added, removed, count, and difference values for each day */ + daily: Array; +} + +/** Contains added, removed, and difference values for the whole range either 7 or 30 days */ +export interface DeltaRangeResultOutput { + /** The range of dates requested */ + range: number; + /** The total amount of assets removed over a date range */ + removed: number; + /** The total amount of assets added over a date range */ + added: number; + /** The total amount of assets changed removed over a date range */ + difference: number; + /** A list of summary changes per asset kind */ + kindSummaries: Array; +} + +/** The type of Delta response for each asset kind */ +export interface DeltaTypeResponseOutput { + /** + * The kind of asset + * + * Possible values: "page", "resource", "mailServer", "nameServer", "host", "domain", "ipAddress", "ipBlock", "as", "contact", "sslCert" + */ + kind: GlobalAssetTypeOutput; + /** The amount of assets removed for one asset kind */ + removed: number; + /** The amount of assets added for one asset kind */ + added: number; + /** The amount of assets changed for one asset kind */ + difference: number; +} + +/** Delta response for each day */ +export interface DailyDeltaTypeResponseOutput extends DeltaTypeResponseOutput { + /** The current number of assets for one asset kind */ + count: number; +} + +/** Date information for the delta response */ +export interface DeltaDateResultOutput { + /** The date that is being requested */ + date: string; + /** A list of summary counts per day */ + deltas: Array; +} + +export interface DataConnectionOutputParent { + /** The system generated unique id for the resource. */ + id?: string; + /** The caller provided unique name for the resource. */ + readonly name: string; + /** The name that can be used for display purposes. */ + displayName?: string; + /** + * The type of data the data connection will transfer + * + * Possible values: "assets", "attackSurfaceInsights" + */ + content?: DataConnectionContentOutput; + /** The date the data connection was created. */ + readonly createdDate?: string; + /** + * The rate at which the data connection will receive updates. + * + * Possible values: "daily", "weekly", "monthly" + */ + frequency?: DataConnectionFrequencyOutput; + /** The day to update the data connection on. */ + frequencyOffset?: number; + /** The date the data connection was last updated. */ + readonly updatedDate?: string; + /** The date the data connection was last updated by user. */ + readonly userUpdatedAt?: string; + /** An indicator of whether the data connection is active. */ + active?: boolean; + /** A message that specifies details about data connection if inactive. */ + readonly inactiveMessage?: string; + kind: string; +} + +export interface LogAnalyticsDataConnectionOutput + extends DataConnectionOutputParent { + /** The kind of DataConnection */ + kind: "logAnalytics"; + /** properties */ + properties: LogAnalyticsDataConnectionPropertiesOutput; +} + +export interface LogAnalyticsDataConnectionPropertiesOutput + extends DataConnectionPropertiesOutput { + /** log analytics api key */ + apiKey?: string; + /** log analytics workspace id */ + workspaceId?: string; +} + +/** The properties required to establish connection to a particular service */ +export interface DataConnectionPropertiesOutput {} + +export interface AzureDataExplorerDataConnectionPropertiesOutput + extends DataConnectionPropertiesOutput { + /** The azure data explorer cluster name */ + clusterName?: string; + /** The azure data explorer region */ + region?: string; + /** The azure data explorer database name */ + databaseName?: string; +} + +export interface AzureDataExplorerDataConnectionOutput + extends DataConnectionOutputParent { + /** The kind of DataConnection */ + kind: "azureDataExplorer"; + /** properties */ + properties: AzureDataExplorerDataConnectionPropertiesOutput; +} + +/** Validate result for validate action endpoints */ +export interface ValidateResultOutput { + /** This is the top-level error object whose code matches the x-ms-error-code response header. */ + error?: ErrorDetailOutput; +} + +/** This is the top-level error object whose code matches the x-ms-error-code response header. */ +export interface ErrorDetailOutput { + /** This is one of a server-defined set of error codes. */ + code: string; + /** This is a human-readable representation of the error. */ + message: string; + /** This is the error target. */ + target?: string; + /** This is an array of details about specific errors that led to this reported error. */ + details?: Array; + /** This is an object containing more specific information than the current object about the error. */ + innererror?: InnerErrorOutput; +} + +/** This is an object containing more specific information than the current object about the error. */ +export interface InnerErrorOutput { + /** This is a more specific error code than was provided by the containing error. */ + code?: string; + /** This is an additional field representing the value that caused the error to help with debugging. */ + value?: any; +} + +export interface DiscoGroupOutput { + /** The system generated unique id for the resource. */ + id?: string; + /** The caller provided unique name for the resource. */ + readonly name: string; + /** The name that can be used for display purposes. */ + displayName?: string; + /** The description for a disco group. */ + description?: string; + /** The tier for the disco group which will affect the algorithm used for the disco runs in this group. */ + tier?: string; + /** The frequency at which the disco group is supposed to be rerun in milliseconds. */ + frequencyMilliseconds?: number; + /** The list of seeds used for the disco group runs. */ + seeds?: Array; + /** The list of names used for the disco group runs. */ + names?: string[]; + /** The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. */ + excludes?: Array; + /** The latest run of this disco group with some limited information, null if the group has never been run. */ + latestRun?: DiscoRunResultOutput; + /** The date for the disco group was created. */ + createdDate?: string; + /** The unique identifier for the disco template used for the disco group creation. */ + templateId?: string; +} + +/** Source entity used to drive discovery. */ +export interface DiscoSourceOutput { + /** + * The kind of disco source. + * + * Possible values: "as", "attribute", "contact", "domain", "host", "ipBlock" + */ + kind?: DiscoSourceKindOutput; + /** The name for the disco source. */ + name?: string; +} + +/** The latest run of this disco group with some limited information, null if the group has never been run. */ +export interface DiscoRunResultOutput { + /** The date for when the disco run was created in the system. */ + submittedDate?: string; + /** The date for when the disco run was actually started by the system. */ + startedDate?: string; + /** The date for when the disco run was completed by the system. */ + completedDate?: string; + /** The tier which will affect the algorithm used for the disco run. */ + tier?: string; + /** + * The State of the disco run. + * + * Possible values: "pending", "running", "completed", "failed" + */ + state?: DiscoRunStateOutput; + /** The total count of assets that were found this disco run. */ + totalAssetsFoundCount?: number; + /** The list of seeds used for the disco run. */ + seeds?: Array; + /** The list of excludes used for the disco run, aka assets to exclude from the discovery algorithm. */ + excludes?: Array; + /** The list of names used for the disco run. */ + names?: string[]; +} + +export interface DiscoRunPageResultOutput { + /** The total number of items available in the full result set. */ + totalElements?: number; + /** The link to access the next page of results. Not set if at the end of the result set. */ + nextLink?: string; + /** The items in the current page of results. */ + value?: Array; +} + +/** Response for the asset chain summary. */ +export interface AssetChainSummaryResultOutput { + /** A list of asset chain summaries per asset kind */ + affectedAssetsSummary: Array; + /** A list of disco group summaries */ + affectedGroupsSummary: Array; + /** The list of exceptions */ + errors?: Array; +} + +/** A list of asset chain summaries per asset kind */ +export interface AssetChainKindSummaryResultOutput { + /** + * The kind of asset + * + * Possible values: "as", "contact", "domain", "host", "ipAddress", "ipBlock", "page", "sslCert" + */ + kind: AssetKindOutput; + /** The amount of assets affected for a given asset kind */ + affectedCount: number; +} + +/** A list of disco group summaries */ +export interface DiscoGroupSummaryResultOutput { + /** The system generated unique id for the resource. */ + id: string; + /** The caller provided unique name for the resource. */ + name: string; + /** The name that can be used for display purposes. */ + displayName: string; +} + +/** The items in the current page of results. */ +export interface DiscoTemplateOutput { + /** The system generated unique id for the resource. */ + readonly id: string; + /** The caller provided unique name for the resource. */ + name?: string; + /** The name that can be used for display purposes. */ + displayName?: string; + /** The name of the industry. */ + industry?: string; + /** The name of the region. */ + region?: string; + /** The country code. */ + countryCode?: string; + /** The state code. */ + stateCode?: string; + /** The name of the city. */ + city?: string; + /** The list of disco template seeds. */ + seeds?: Array; + /** The list of disco template names. */ + names?: string[]; +} + +export interface ReportBillableAssetSummaryResultOutput { + assetSummaries?: Array; +} + +export interface ReportBillableAssetSnapshotResultOutput { + /** The date these assets were billed on. */ + date?: string; + /** The total number of billable assets for this date. */ + total?: number; + /** The breakdown of billable asset counts for each asset type. */ + assetBreakdown?: Array; +} + +/** The breakdown of billable asset counts for each asset type. */ +export interface ReportBillableAssetBreakdownOutput { + /** + * The kind of billable asset. + * + * Possible values: "domain", "host", "ipAddress" + */ + kind?: ReportBillableAssetBreakdownKindOutput; + /** The number of assets of this type. */ + count?: number; +} + +/** A snapshot of assets captured daily for the provided metric. Asset details only contain primary properties. Detailed asset data can be retrieved from the asset endpoints. */ +export interface ReportAssetSnapshotResultOutput { + /** The name of the metric. */ + displayName?: string; + /** The unique metric name. */ + metric?: string; + /** The customer label that was filtered on, if one was provided. */ + labelName?: string; + /** The last time this asset data was updated on this metric. */ + updatedAt?: string; + /** A description of what the metric represents. */ + description?: string; + /** The page of assets that match the provided metric. */ + assets?: AssetPageResultOutput; +} + +/** The page of assets that match the provided metric. */ +export interface AssetPageResultOutput { + /** The total number of items available in the full result set. */ + totalElements?: number; + /** The cursor mark to be used on the next request. Not set if using paging. */ + mark?: string; + /** The link to access the next page of results. Not set if at the end of the result set. */ + nextLink?: string; + /** The items in the current page of results. */ + value?: Array; +} + +export interface ReportAssetSummaryResultOutput { + /** The collection of asset summaries. */ + assetSummaries?: Array; +} + +/** The collection of asset summaries. */ +export interface AssetSummaryResultOutput { + /** The name of the summary response. Depending on the request time this will either be the asset filter, risk category, or risk metric. */ + displayName?: string; + /** The description of the summary response. Filters don't have a description. */ + description?: string; + /** The last time risk categories or risk metrics were captured. Set to the current time for asset filter requests, which always pull the live asset data. */ + updatedAt?: string; + /** If the request is for a metric category, this will contain the requested unique category name. */ + metricCategory?: string; + /** If the request is for a metric, this will contain the requested unique metric name. */ + metric?: string; + /** If the request is for an asset filter, this will contain the corresponding filter. */ + filter?: string; + /** An optional label used to filter requests results. */ + labelName?: string; + /** The count of assets matching the request parameters. */ + count?: number; + /** The link to the corresponding asset details. */ + link?: string; + /** The corresponding child entities. For metric categories this will contain metrics. For filters with groupBy and segmentBy this will contain facets. */ + children?: Array; +} + +export interface SavedFilterOutput { + /** The system generated unique id for the resource. */ + id?: string; + /** The caller provided unique name for the resource. */ + readonly name: string; + /** The name that can be used for display purposes. */ + displayName?: string; + filter?: string; + description?: string; +} + +/** cisa cve in a given workspace. */ +export interface CisaCveResultOutput { + /** The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits. */ + readonly cveId: string; + /** The vendor or project name for the vulnerability. */ + vendorProject: string; + /** The vulnerability product */ + product: string; + /** The name of the vulnerability */ + vulnerabilityName: string; + /** A short description of the vulnerability */ + shortDescription: string; + /** The required action to address the vulnerability */ + requiredAction: string; + /** Any additional notes about the vulnerability */ + notes: string; + /** The date the vulnerability was added to the catalog in the format YYYY-MM-DD */ + dateAdded: string; + /** The date the required action is due in the format YYYY-MM-DD */ + dueDate: string; + /** The date the vulnerability was updated */ + updatedAt: string; + /** The number of assets affected by the vulnerability */ + count: number; +} + +/** This is an object that exists to provide a common schema definition for the priority response. */ +export interface PolicyOutput { + /** The system generated unique id for the resource. */ + id?: string; + /** The caller provided unique name for the resource. */ + readonly name: string; + /** The name that can be used for display purposes. */ + displayName?: string; + /** A human readable description of what the policy should do. */ + description?: string; + /** Name of the saved filter query to be used to select assets that are to be updated by a given policy. */ + filterName?: string; + /** + * Action specifying what the policy should do. + * + * Possible values: "addResource", "removeResource", "setState", "setExternalID", "removeFromInventory" + */ + action?: PolicyActionOutput; + /** Number of assets in inventory that have been updated by this policy. */ + updatedAssetsCount?: number; + /** The unique name of the user that created the policy user@gmail.com */ + user?: string; + /** The date this policy was created. */ + createdDate?: string; + /** The date this policy was last updated. */ + updatedDate?: string; + /** Additional parameters needed to perform the policy action. */ + actionParameters?: ActionParametersOutput; + /** Priority of the policy. */ + priority?: number; +} + +/** This is an object that exists to provide a common schema definition for the action parameters. */ +export interface ActionParametersOutput { + /** The value parameter that is used by the policy action.. */ + value?: string; + /** The optional name parameter that can be used by the policy action. */ + name?: string; +} + +/** The items in the current page of results. */ +export type AssetResourceOutput = + | AssetResourceOutputParent + | AsAssetResourceOutput + | ContactAssetResourceOutput + | DomainAssetResourceOutput + | HostAssetResourceOutput + | IpAddressAssetResourceOutput + | IpBlockAssetResourceOutput + | PageAssetResourceOutput + | SslCertAssetResourceOutput; +export type DataConnectionOutput = + | DataConnectionOutputParent + | LogAnalyticsDataConnectionOutput + | AzureDataExplorerDataConnectionOutput; +/** Paged collection of AssetResource items */ +export type PagedAssetResourceOutput = Paged; +/** Alias for AssetUpdateStateOutput */ +export type AssetUpdateStateOutput = string; +/** Alias for AssetStateOutput */ +export type AssetStateOutput = string; +/** Alias for AuditTrailItemKindOutput */ +export type AuditTrailItemKindOutput = string; +/** Alias for ObservedPortStateValueOutput */ +export type ObservedPortStateValueOutput = string; +/** Alias for SslCertAssetValidationTypeOutput */ +export type SslCertAssetValidationTypeOutput = string; +/** Alias for PageAssetRedirectTypeOutput */ +export type PageAssetRedirectTypeOutput = string; +/** Alias for ObservationTypeOutput */ +export type ObservationTypeOutput = string; +/** Alias for ObservationRemediationStateOutput */ +export type ObservationRemediationStateOutput = string; +/** Alias for TaskStateOutput */ +export type TaskStateOutput = string; +/** Alias for TaskPhaseOutput */ +export type TaskPhaseOutput = string; +/** Alias for ObservationPriorityOutput */ +export type ObservationPriorityOutput = string; +/** Alias for ObservationRemediationSourceOutput */ +export type ObservationRemediationSourceOutput = string; +/** Alias for GlobalAssetTypeOutput */ +export type GlobalAssetTypeOutput = string; +/** Alias for GlobalInventoryStateOutput */ +export type GlobalInventoryStateOutput = string; +/** Paged collection of DataConnection items */ +export type PagedDataConnectionOutput = Paged; +/** Alias for DataConnectionContentOutput */ +export type DataConnectionContentOutput = string; +/** Alias for DataConnectionFrequencyOutput */ +export type DataConnectionFrequencyOutput = string; +/** Paged collection of DiscoGroup items */ +export type PagedDiscoGroupOutput = Paged; +/** Alias for DiscoSourceKindOutput */ +export type DiscoSourceKindOutput = string; +/** Alias for DiscoRunStateOutput */ +export type DiscoRunStateOutput = string; +/** Alias for AssetKindOutput */ +export type AssetKindOutput = string; +/** Paged collection of DiscoTemplate items */ +export type PagedDiscoTemplateOutput = Paged; +/** Alias for ReportBillableAssetBreakdownKindOutput */ +export type ReportBillableAssetBreakdownKindOutput = string; +/** Paged collection of SavedFilter items */ +export type PagedSavedFilterOutput = Paged; +/** Paged collection of Task items */ +export type PagedTaskOutput = Paged; +/** Paged collection of CisaCveResult items */ +export type PagedCisaCveResultOutput = Paged; +/** Paged collection of Policy items */ +export type PagedPolicyOutput = Paged; +/** Alias for PolicyActionOutput */ +export type PolicyActionOutput = string; diff --git a/sdk/easm/defendereasm-rest/src/paginateHelper.ts b/sdk/easm/defendereasm-rest/src/paginateHelper.ts new file mode 100644 index 000000000000..94d5220235d9 --- /dev/null +++ b/sdk/easm/defendereasm-rest/src/paginateHelper.ts @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + getPagedAsyncIterator, + PagedAsyncIterableIterator, + PagedResult, +} from "@azure/core-paging"; +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; + +/** + * Helper type to extract the type of an array + */ +export type GetArrayType = T extends Array ? TData : never; + +/** + * The type of a custom function that defines how to get a page and a link to the next one if any. + */ +export type GetPage = ( + pageLink: string, + maxPageSize?: number, +) => Promise<{ + page: TPage; + nextPageLink?: string; +}>; + +/** + * Options for the paging helper + */ +export interface PagingOptions { + /** + * Custom function to extract pagination details for crating the PagedAsyncIterableIterator + */ + customGetPage?: GetPage[]>; +} + +/** + * Helper type to infer the Type of the paged elements from the response type + * This type is generated based on the swagger information for x-ms-pageable + * specifically on the itemName property which indicates the property of the response + * where the page items are found. The default value is `value`. + * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter + */ +export type PaginateReturn = TResult extends { + body: { value?: infer TPage }; +} + ? GetArrayType + : Array; + +/** + * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension + * @param client - Client to use for sending the next page requests + * @param initialResponse - Initial response containing the nextLink and current page of elements + * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results + * @returns - PagedAsyncIterableIterator to iterate the elements + */ +export function paginate( + client: Client, + initialResponse: TResponse, + options: PagingOptions = {}, +): PagedAsyncIterableIterator> { + // Extract element type from initial response + type TElement = PaginateReturn; + let firstRun = true; + const itemName = "value"; + const nextLinkName = "nextLink"; + const { customGetPage } = options; + const pagedResult: PagedResult = { + firstPageLink: "", + getPage: + typeof customGetPage === "function" + ? customGetPage + : async (pageLink: string) => { + const result = firstRun + ? initialResponse + : await client.pathUnchecked(pageLink).get(); + firstRun = false; + checkPagingRequest(result); + const nextLink = getNextLink(result.body, nextLinkName); + const values = getElements(result.body, itemName); + return { + page: values, + nextPageLink: nextLink, + }; + }, + }; + + return getPagedAsyncIterator(pagedResult); +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { + throw new Error( + `Body Property ${nextLinkName} should be a string or undefined`, + ); + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + + // value has to be an array according to the x-ms-pageable extension. + // The fact that this must be an array is used above to calculate the + // type of elements in the page in PaginateReturn + if (!Array.isArray(value)) { + throw new Error( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse): void { + const Http2xxStatusCodes = [ + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "226", + ]; + if (!Http2xxStatusCodes.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/easm/defendereasm-rest/src/parameters.ts b/sdk/easm/defendereasm-rest/src/parameters.ts new file mode 100644 index 000000000000..9f149f6e2831 --- /dev/null +++ b/sdk/easm/defendereasm-rest/src/parameters.ts @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RequestParameters } from "@azure-rest/core-client"; +import { + AssetResponseType, + AssetUpdateData, + AssetsExportRequest, + DeltaDetailsRequest, + DeltaSummaryRequest, + DataConnectionData, + DiscoGroupData, + AssetChainRequest, + ReportAssetSnapshotRequest, + ReportAssetSummaryRequest, + ReportAssetSnapshotExportRequest, + SavedFilterData, + PolicyData, +} from "./models.js"; + +export interface ListAssetResourceQueryParamProperties { + /** Filter the result list using the given expression. */ + filter?: string; + /** A list of expressions that specify the order of the returned resources. */ + orderby?: string; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; + /** Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. */ + mark?: string; + /** + * Specify the response type. The possible values are: ID, STANDARD, FULL, REDUCED + * + * Possible values: "id", "standard", "full", "reduced" + */ + responseType?: AssetResponseType; + /** The properties to include in the response. */ + responseIncludes?: string[]; + /** If it's recent only. */ + recentOnly?: boolean; +} + +export interface ListAssetResourceQueryParam { + queryParameters?: ListAssetResourceQueryParamProperties; +} + +export type ListAssetResourceParameters = ListAssetResourceQueryParam & + RequestParameters; + +export interface UpdateAssetsBodyParam { + /** Body parameter. */ + body: AssetUpdateData; +} + +export interface UpdateAssetsQueryParamProperties { + /** An expression on the resource type that selects the resources to be returned. */ + filter: string; +} + +export interface UpdateAssetsQueryParam { + queryParameters: UpdateAssetsQueryParamProperties; +} + +export type UpdateAssetsParameters = UpdateAssetsQueryParam & + UpdateAssetsBodyParam & + RequestParameters; +export type GetAssetResourceParameters = RequestParameters; + +export interface GetAssetsExportBodyParam { + /** Body parameter. */ + body: AssetsExportRequest; +} + +export interface GetAssetsExportQueryParamProperties { + /** Filter the result list using the given expression. */ + filter?: string; + /** A list of expressions that specify the order of the returned resources. */ + orderby?: string; +} + +export interface GetAssetsExportQueryParam { + queryParameters?: GetAssetsExportQueryParamProperties; +} + +export type GetAssetsExportParameters = GetAssetsExportQueryParam & + GetAssetsExportBodyParam & + RequestParameters; + +export interface GetObservationsQueryParamProperties { + /** Filter the result list using the given expression. */ + filter?: string; + /** A list of expressions that specify the order of the returned resources. */ + orderby?: string; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface GetObservationsQueryParam { + queryParameters?: GetObservationsQueryParamProperties; +} + +export type GetObservationsParameters = GetObservationsQueryParam & + RequestParameters; + +export interface GetDeltaDetailsBodyParam { + /** Body parameter. */ + body: DeltaDetailsRequest; +} + +export interface GetDeltaDetailsQueryParamProperties { + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface GetDeltaDetailsQueryParam { + queryParameters?: GetDeltaDetailsQueryParamProperties; +} + +export type GetDeltaDetailsParameters = GetDeltaDetailsQueryParam & + GetDeltaDetailsBodyParam & + RequestParameters; + +export interface GetDeltaSummaryBodyParam { + /** Body parameter. */ + body: DeltaSummaryRequest; +} + +export type GetDeltaSummaryParameters = GetDeltaSummaryBodyParam & + RequestParameters; + +export interface ListDataConnectionQueryParamProperties { + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface ListDataConnectionQueryParam { + queryParameters?: ListDataConnectionQueryParamProperties; +} + +export type ListDataConnectionParameters = ListDataConnectionQueryParam & + RequestParameters; + +export interface ValidateDataConnectionBodyParam { + /** Body parameter. */ + body: DataConnectionData; +} + +export type ValidateDataConnectionParameters = ValidateDataConnectionBodyParam & + RequestParameters; +export type GetDataConnectionParameters = RequestParameters; + +export interface CreateOrReplaceDataConnectionBodyParam { + /** Body parameter. */ + body: DataConnectionData; +} + +export type CreateOrReplaceDataConnectionParameters = + CreateOrReplaceDataConnectionBodyParam & RequestParameters; +export type DeleteDataConnectionParameters = RequestParameters; + +export interface ListDiscoGroupQueryParamProperties { + /** Filter the result list using the given expression. */ + filter?: string; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface ListDiscoGroupQueryParam { + queryParameters?: ListDiscoGroupQueryParamProperties; +} + +export type ListDiscoGroupParameters = ListDiscoGroupQueryParam & + RequestParameters; + +export interface ValidateDiscoGroupBodyParam { + /** Body parameter. */ + body: DiscoGroupData; +} + +export type ValidateDiscoGroupParameters = ValidateDiscoGroupBodyParam & + RequestParameters; +export type GetDiscoGroupParameters = RequestParameters; + +export interface CreateOrReplaceDiscoGroupBodyParam { + /** Body parameter. */ + body: DiscoGroupData; +} + +export type CreateOrReplaceDiscoGroupParameters = + CreateOrReplaceDiscoGroupBodyParam & RequestParameters; +export type RunDiscoGroupParameters = RequestParameters; + +export interface ListRunsQueryParamProperties { + /** Filter the result list using the given expression. */ + filter?: string; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface ListRunsQueryParam { + queryParameters?: ListRunsQueryParamProperties; +} + +export type ListRunsParameters = ListRunsQueryParam & RequestParameters; +export type DeleteDiscoGroupParameters = RequestParameters; + +export interface GetAssetChainSummaryBodyParam { + /** Body parameter. */ + body: AssetChainRequest; +} + +export type GetAssetChainSummaryParameters = GetAssetChainSummaryBodyParam & + RequestParameters; + +export interface DismissAssetChainBodyParam { + /** Body parameter. */ + body: AssetChainRequest; +} + +export type DismissAssetChainParameters = DismissAssetChainBodyParam & + RequestParameters; + +export interface ListDiscoTemplateQueryParamProperties { + /** Filter the result list using the given expression. */ + filter?: string; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface ListDiscoTemplateQueryParam { + queryParameters?: ListDiscoTemplateQueryParamProperties; +} + +export type ListDiscoTemplateParameters = ListDiscoTemplateQueryParam & + RequestParameters; +export type GetDiscoTemplateParameters = RequestParameters; +export type GetBillableParameters = RequestParameters; + +export interface GetSnapshotBodyParam { + /** Body parameter. */ + body: ReportAssetSnapshotRequest; +} + +export type GetSnapshotParameters = GetSnapshotBodyParam & RequestParameters; + +export interface GetSummaryBodyParam { + /** Body parameter. */ + body: ReportAssetSummaryRequest; +} + +export type GetSummaryParameters = GetSummaryBodyParam & RequestParameters; + +export interface GetSnapshotExportBodyParam { + /** Body parameter. */ + body: ReportAssetSnapshotExportRequest; +} + +export type GetSnapshotExportParameters = GetSnapshotExportBodyParam & + RequestParameters; + +export interface ListSavedFilterQueryParamProperties { + /** Filter the result list using the given expression. */ + filter?: string; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface ListSavedFilterQueryParam { + queryParameters?: ListSavedFilterQueryParamProperties; +} + +export type ListSavedFilterParameters = ListSavedFilterQueryParam & + RequestParameters; +export type GetSavedFilterParameters = RequestParameters; + +export interface CreateOrReplaceSavedFilterBodyParam { + /** Body parameter. */ + body: SavedFilterData; +} + +export type CreateOrReplaceSavedFilterParameters = + CreateOrReplaceSavedFilterBodyParam & RequestParameters; +export type DeleteSavedFilterParameters = RequestParameters; + +export interface ListTaskQueryParamProperties { + /** Filter the result list using the given expression. */ + filter?: string; + /** A list of expressions that specify the order of the returned resources. */ + orderby?: string; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface ListTaskQueryParam { + queryParameters?: ListTaskQueryParamProperties; +} + +export type ListTaskParameters = ListTaskQueryParam & RequestParameters; +export type GetTaskParameters = RequestParameters; +export type CancelTaskParameters = RequestParameters; +export type RunTaskParameters = RequestParameters; +export type DownloadTaskParameters = RequestParameters; +export type GetCisaCvesParameters = RequestParameters; +export type GetCisaCveParameters = RequestParameters; + +export interface ListPolicyQueryParamProperties { + /** Filter the result list using the given expression. */ + filter?: string; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface ListPolicyQueryParam { + queryParameters?: ListPolicyQueryParamProperties; +} + +export type ListPolicyParameters = ListPolicyQueryParam & RequestParameters; +export type GetPolicyParameters = RequestParameters; + +export interface CreateOrReplacePolicyBodyParam { + body: PolicyData; +} + +export type CreateOrReplacePolicyParameters = CreateOrReplacePolicyBodyParam & + RequestParameters; +export type DeletePolicyParameters = RequestParameters; diff --git a/sdk/easm/defendereasm-rest/src/responses.ts b/sdk/easm/defendereasm-rest/src/responses.ts new file mode 100644 index 000000000000..192db4485f67 --- /dev/null +++ b/sdk/easm/defendereasm-rest/src/responses.ts @@ -0,0 +1,743 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RawHttpHeaders } from "@azure/core-rest-pipeline"; +import { HttpResponse, ErrorResponse } from "@azure-rest/core-client"; +import { + PagedAssetResourceOutput, + TaskOutput, + AssetResourceOutput, + ObservationPageResultOutput, + DeltaPageResultOutput, + DeltaSummaryResultOutput, + PagedDataConnectionOutput, + ValidateResultOutput, + DataConnectionOutput, + PagedDiscoGroupOutput, + DiscoGroupOutput, + DiscoRunPageResultOutput, + AssetChainSummaryResultOutput, + PagedDiscoTemplateOutput, + DiscoTemplateOutput, + ReportBillableAssetSummaryResultOutput, + ReportAssetSnapshotResultOutput, + ReportAssetSummaryResultOutput, + PagedSavedFilterOutput, + SavedFilterOutput, + PagedTaskOutput, + PagedCisaCveResultOutput, + CisaCveResultOutput, + PagedPolicyOutput, + PolicyOutput, +} from "./outputModels.js"; + +/** The request has succeeded. */ +export interface ListAssetResource200Response extends HttpResponse { + status: "200"; + body: PagedAssetResourceOutput; +} + +export interface ListAssetResourceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ListAssetResourceDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ListAssetResourceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdateAssets200Response extends HttpResponse { + status: "200"; + body: TaskOutput; +} + +export interface UpdateAssetsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdateAssetsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & UpdateAssetsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetAssetResource200Response extends HttpResponse { + status: "200"; + body: AssetResourceOutput; +} + +export interface GetAssetResourceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetAssetResourceDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetAssetResourceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetAssetsExport200Response extends HttpResponse { + status: "200"; + body: TaskOutput; +} + +export interface GetAssetsExportDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetAssetsExportDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetAssetsExportDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetObservations200Response extends HttpResponse { + status: "200"; + body: ObservationPageResultOutput; +} + +export interface GetObservationsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetObservationsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetObservationsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetDeltaDetails200Response extends HttpResponse { + status: "200"; + body: DeltaPageResultOutput; +} + +export interface GetDeltaDetailsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetDeltaDetailsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetDeltaDetailsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetDeltaSummary200Response extends HttpResponse { + status: "200"; + body: DeltaSummaryResultOutput; +} + +export interface GetDeltaSummaryDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetDeltaSummaryDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetDeltaSummaryDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ListDataConnection200Response extends HttpResponse { + status: "200"; + body: PagedDataConnectionOutput; +} + +export interface ListDataConnectionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ListDataConnectionDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ListDataConnectionDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ValidateDataConnection200Response extends HttpResponse { + status: "200"; + body: ValidateResultOutput; +} + +export interface ValidateDataConnectionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ValidateDataConnectionDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ValidateDataConnectionDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetDataConnection200Response extends HttpResponse { + status: "200"; + body: DataConnectionOutput; +} + +export interface GetDataConnectionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetDataConnectionDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetDataConnectionDefaultHeaders; +} + +/** The request has succeeded. */ +export interface CreateOrReplaceDataConnection200Response extends HttpResponse { + status: "200"; + body: DataConnectionOutput; +} + +export interface CreateOrReplaceDataConnectionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateOrReplaceDataConnectionDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & CreateOrReplaceDataConnectionDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface DeleteDataConnection204Response extends HttpResponse { + status: "204"; +} + +export interface DeleteDataConnectionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteDataConnectionDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DeleteDataConnectionDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ListDiscoGroup200Response extends HttpResponse { + status: "200"; + body: PagedDiscoGroupOutput; +} + +export interface ListDiscoGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ListDiscoGroupDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ListDiscoGroupDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ValidateDiscoGroup200Response extends HttpResponse { + status: "200"; + body: ValidateResultOutput; +} + +export interface ValidateDiscoGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ValidateDiscoGroupDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ValidateDiscoGroupDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetDiscoGroup200Response extends HttpResponse { + status: "200"; + body: DiscoGroupOutput; +} + +export interface GetDiscoGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetDiscoGroupDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetDiscoGroupDefaultHeaders; +} + +/** The request has succeeded. */ +export interface CreateOrReplaceDiscoGroup200Response extends HttpResponse { + status: "200"; + body: DiscoGroupOutput; +} + +export interface CreateOrReplaceDiscoGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateOrReplaceDiscoGroupDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & CreateOrReplaceDiscoGroupDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface RunDiscoGroup204Response extends HttpResponse { + status: "204"; +} + +export interface RunDiscoGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface RunDiscoGroupDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & RunDiscoGroupDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ListRuns200Response extends HttpResponse { + status: "200"; + body: DiscoRunPageResultOutput; +} + +export interface ListRunsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ListRunsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ListRunsDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface DeleteDiscoGroup204Response extends HttpResponse { + status: "204"; +} + +export interface DeleteDiscoGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteDiscoGroupDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DeleteDiscoGroupDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetAssetChainSummary200Response extends HttpResponse { + status: "200"; + body: AssetChainSummaryResultOutput; +} + +export interface GetAssetChainSummaryDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetAssetChainSummaryDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetAssetChainSummaryDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DismissAssetChain200Response extends HttpResponse { + status: "200"; + body: TaskOutput; +} + +export interface DismissAssetChainDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DismissAssetChainDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DismissAssetChainDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ListDiscoTemplate200Response extends HttpResponse { + status: "200"; + body: PagedDiscoTemplateOutput; +} + +export interface ListDiscoTemplateDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ListDiscoTemplateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ListDiscoTemplateDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetDiscoTemplate200Response extends HttpResponse { + status: "200"; + body: DiscoTemplateOutput; +} + +export interface GetDiscoTemplateDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetDiscoTemplateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetDiscoTemplateDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetBillable200Response extends HttpResponse { + status: "200"; + body: ReportBillableAssetSummaryResultOutput; +} + +export interface GetBillableDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetBillableDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetBillableDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetSnapshot200Response extends HttpResponse { + status: "200"; + body: ReportAssetSnapshotResultOutput; +} + +export interface GetSnapshotDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetSnapshotDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetSnapshotDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetSummary200Response extends HttpResponse { + status: "200"; + body: ReportAssetSummaryResultOutput; +} + +export interface GetSummaryDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetSummaryDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetSummaryDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetSnapshotExport200Response extends HttpResponse { + status: "200"; + body: TaskOutput; +} + +export interface GetSnapshotExportDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetSnapshotExportDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetSnapshotExportDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ListSavedFilter200Response extends HttpResponse { + status: "200"; + body: PagedSavedFilterOutput; +} + +export interface ListSavedFilterDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ListSavedFilterDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ListSavedFilterDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetSavedFilter200Response extends HttpResponse { + status: "200"; + body: SavedFilterOutput; +} + +export interface GetSavedFilterDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetSavedFilterDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetSavedFilterDefaultHeaders; +} + +/** The request has succeeded. */ +export interface CreateOrReplaceSavedFilter200Response extends HttpResponse { + status: "200"; + body: SavedFilterOutput; +} + +export interface CreateOrReplaceSavedFilterDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateOrReplaceSavedFilterDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & CreateOrReplaceSavedFilterDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface DeleteSavedFilter204Response extends HttpResponse { + status: "204"; +} + +export interface DeleteSavedFilterDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteSavedFilterDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DeleteSavedFilterDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ListTask200Response extends HttpResponse { + status: "200"; + body: PagedTaskOutput; +} + +export interface ListTaskDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ListTaskDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ListTaskDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetTask200Response extends HttpResponse { + status: "200"; + body: TaskOutput; +} + +export interface GetTaskDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetTaskDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetTaskDefaultHeaders; +} + +/** The request has succeeded. */ +export interface CancelTask200Response extends HttpResponse { + status: "200"; + body: TaskOutput; +} + +export interface CancelTaskDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CancelTaskDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & CancelTaskDefaultHeaders; +} + +/** The request has succeeded. */ +export interface RunTask200Response extends HttpResponse { + status: "200"; + body: TaskOutput; +} + +export interface RunTaskDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface RunTaskDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & RunTaskDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DownloadTask200Response extends HttpResponse { + status: "200"; + body: TaskOutput; +} + +export interface DownloadTaskDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DownloadTaskDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DownloadTaskDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetCisaCves200Response extends HttpResponse { + status: "200"; + body: PagedCisaCveResultOutput; +} + +export interface GetCisaCvesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetCisaCvesDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetCisaCvesDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetCisaCve200Response extends HttpResponse { + status: "200"; + body: CisaCveResultOutput; +} + +export interface GetCisaCveDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetCisaCveDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetCisaCveDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ListPolicy200Response extends HttpResponse { + status: "200"; + body: PagedPolicyOutput; +} + +export interface ListPolicyDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ListPolicyDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ListPolicyDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetPolicy200Response extends HttpResponse { + status: "200"; + body: PolicyOutput; +} + +export interface GetPolicyDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetPolicyDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & GetPolicyDefaultHeaders; +} + +/** The request has succeeded. */ +export interface CreateOrReplacePolicy200Response extends HttpResponse { + status: "200"; + body: PolicyOutput; +} + +export interface CreateOrReplacePolicyDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateOrReplacePolicyDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & CreateOrReplacePolicyDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface DeletePolicy204Response extends HttpResponse { + status: "204"; +} + +export interface DeletePolicyDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeletePolicyDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & DeletePolicyDefaultHeaders; +} diff --git a/sdk/easm/defendereasm-rest/test/public/sampleTest.spec.ts b/sdk/easm/defendereasm-rest/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..d4919ac91ac5 --- /dev/null +++ b/sdk/easm/defendereasm-rest/test/public/sampleTest.spec.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createRecorder } from "./utils/recordedClient.js"; +import { assert, beforeEach, afterEach, it, describe } from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + beforeEach(async function () { + // recorder = await createRecorder(this); + }); + + afterEach(async function () { + // await recorder.stop(); + }); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/easm/defendereasm-rest/test/public/utils/recordedClient.ts b/sdk/easm/defendereasm-rest/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..6e425fdcfdf9 --- /dev/null +++ b/sdk/easm/defendereasm-rest/test/public/utils/recordedClient.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + Recorder, + RecorderStartOptions, + VitestTestContext, +} from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder( + context: VitestTestContext, +): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/easm/defendereasm-rest/tsconfig.browser.config.json b/sdk/easm/defendereasm-rest/tsconfig.browser.config.json new file mode 100644 index 000000000000..1b37aebc5457 --- /dev/null +++ b/sdk/easm/defendereasm-rest/tsconfig.browser.config.json @@ -0,0 +1,10 @@ +{ + "extends": "./.tshy/build.json", + "include": ["./src/**/*.ts", "./src/**/*.mts", "./test/**/*.spec.ts"], + "exclude": ["./test/**/node/**/*.ts"], + "compilerOptions": { + "outDir": "./dist-test/browser", + "rootDir": ".", + "skipLibCheck": true + } +} diff --git a/sdk/easm/defendereasm-rest/tsconfig.json b/sdk/easm/defendereasm-rest/tsconfig.json new file mode 100644 index 000000000000..a6575847a41e --- /dev/null +++ b/sdk/easm/defendereasm-rest/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../tsconfig", + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "rootDir": ".", + "skipLibCheck": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.mts", + "./src/**/*.cts", + "test/**/*.ts", + "./test/**/*.ts" + ] +} \ No newline at end of file diff --git a/sdk/easm/defendereasm-rest/tsp-location.yaml b/sdk/easm/defendereasm-rest/tsp-location.yaml new file mode 100644 index 000000000000..3e3942181fe3 --- /dev/null +++ b/sdk/easm/defendereasm-rest/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/riskiq/Easm +commit: 0027f803e255dd78a1785e6e1101bde120eabf41 +repo: /mnt/vss/_work/1/s/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/easm/defendereasm-rest/vitest.browser.config.ts b/sdk/easm/defendereasm-rest/vitest.browser.config.ts new file mode 100644 index 000000000000..5e0dc418cfa2 --- /dev/null +++ b/sdk/easm/defendereasm-rest/vitest.browser.config.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig } from "vitest/config"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; + +process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath(); + +export default defineConfig({ + define: { + "process.env": process.env, + }, + test: { + reporters: ["basic", "junit"], + outputFile: { + junit: "test-results.browser.xml", + }, + browser: { + enabled: true, + headless: true, + name: "chromium", + provider: "playwright", + }, + fakeTimers: { + toFake: ["setTimeout", "Date"], + }, + watch: false, + include: ["dist-test/browser/**/*.spec.js"], + coverage: { + include: ["dist-test/browser/**/*.spec.js"], + provider: "istanbul", + reporter: ["text", "json", "html"], + reportsDirectory: "coverage-browser", + }, + testTimeout: 1200000, + }, +}); diff --git a/sdk/easm/defendereasm-rest/vitest.config.ts b/sdk/easm/defendereasm-rest/vitest.config.ts new file mode 100644 index 000000000000..f8ab2a758bf9 --- /dev/null +++ b/sdk/easm/defendereasm-rest/vitest.config.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig } from "vitest/config"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; + +export default defineConfig({ + test: { + reporters: ["basic", "junit"], + outputFile: { + junit: "test-results.browser.xml", + }, + fakeTimers: { + toFake: ["setTimeout", "Date"], + }, + watch: false, + include: ["test/**/*.spec.ts"], + exclude: ["test/**/browser/*.spec.ts"], + coverage: { + include: ["src/**/*.ts"], + exclude: [ + "src/**/*-browser.mts", + "src/**/*-react-native.mts", + "vitest*.config.ts", + "samples-dev/**/*.ts", + ], + provider: "istanbul", + reporter: ["text", "json", "html"], + reportsDirectory: "coverage", + }, + testTimeout: 1200000, + }, +});