From b85233e8c56ef5d8b365b1c754f758d61b065515 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 15 May 2024 06:00:08 +0000 Subject: [PATCH] CodeGen from PR 29107 in Azure/azure-rest-api-specs Merge f0ed73bcb0d7a61a58568075801c4422fc660735 into 9061674ac55af0ec23e12e4f9f505010ab428935 --- sdk/vision/ai-vision-face-rest/.eslintrc.json | 11 + sdk/vision/ai-vision-face-rest/CHANGELOG.md | 3 + sdk/vision/ai-vision-face-rest/README.md | 59 + .../ai-vision-face-rest/api-extractor.json | 31 + sdk/vision/ai-vision-face-rest/karma.conf.js | 133 ++ sdk/vision/ai-vision-face-rest/package.json | 112 + .../src/clientDefinitions.ts | 1840 ++++++++++++++++ .../ai-vision-face-rest/src/faceClient.ts | 59 + sdk/vision/ai-vision-face-rest/src/index.ts | 15 + .../ai-vision-face-rest/src/isUnexpected.ts | 1184 +++++++++++ sdk/vision/ai-vision-face-rest/src/logger.ts | 5 + sdk/vision/ai-vision-face-rest/src/models.ts | 76 + .../ai-vision-face-rest/src/outputModels.ts | 711 +++++++ .../ai-vision-face-rest/src/parameters.ts | 993 +++++++++ .../ai-vision-face-rest/src/pollingHelper.ts | 205 ++ .../ai-vision-face-rest/src/responses.ts | 1888 +++++++++++++++++ .../test/public/sampleTest.spec.ts | 21 + .../test/public/utils/env.browser.ts | 2 + .../test/public/utils/env.ts | 6 + .../test/public/utils/recordedClient.ts | 29 + .../tsconfig.browser.config.json | 10 + sdk/vision/ai-vision-face-rest/tsconfig.json | 15 + .../ai-vision-face-rest/tsp-location.yaml | 5 + .../vitest.browser.config.ts | 33 + .../ai-vision-face-rest/vitest.config.ts | 31 + sdk/vision/ci.yml | 32 +- 26 files changed, 7494 insertions(+), 15 deletions(-) create mode 100644 sdk/vision/ai-vision-face-rest/.eslintrc.json create mode 100644 sdk/vision/ai-vision-face-rest/CHANGELOG.md create mode 100644 sdk/vision/ai-vision-face-rest/README.md create mode 100644 sdk/vision/ai-vision-face-rest/api-extractor.json create mode 100644 sdk/vision/ai-vision-face-rest/karma.conf.js create mode 100644 sdk/vision/ai-vision-face-rest/package.json create mode 100644 sdk/vision/ai-vision-face-rest/src/clientDefinitions.ts create mode 100644 sdk/vision/ai-vision-face-rest/src/faceClient.ts create mode 100644 sdk/vision/ai-vision-face-rest/src/index.ts create mode 100644 sdk/vision/ai-vision-face-rest/src/isUnexpected.ts create mode 100644 sdk/vision/ai-vision-face-rest/src/logger.ts create mode 100644 sdk/vision/ai-vision-face-rest/src/models.ts create mode 100644 sdk/vision/ai-vision-face-rest/src/outputModels.ts create mode 100644 sdk/vision/ai-vision-face-rest/src/parameters.ts create mode 100644 sdk/vision/ai-vision-face-rest/src/pollingHelper.ts create mode 100644 sdk/vision/ai-vision-face-rest/src/responses.ts create mode 100644 sdk/vision/ai-vision-face-rest/test/public/sampleTest.spec.ts create mode 100644 sdk/vision/ai-vision-face-rest/test/public/utils/env.browser.ts create mode 100644 sdk/vision/ai-vision-face-rest/test/public/utils/env.ts create mode 100644 sdk/vision/ai-vision-face-rest/test/public/utils/recordedClient.ts create mode 100644 sdk/vision/ai-vision-face-rest/tsconfig.browser.config.json create mode 100644 sdk/vision/ai-vision-face-rest/tsconfig.json create mode 100644 sdk/vision/ai-vision-face-rest/tsp-location.yaml create mode 100644 sdk/vision/ai-vision-face-rest/vitest.browser.config.ts create mode 100644 sdk/vision/ai-vision-face-rest/vitest.config.ts diff --git a/sdk/vision/ai-vision-face-rest/.eslintrc.json b/sdk/vision/ai-vision-face-rest/.eslintrc.json new file mode 100644 index 000000000000..619797ac39b6 --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/.eslintrc.json @@ -0,0 +1,11 @@ +{ + "plugins": ["@azure/azure-sdk"], + "extends": ["plugin:@azure/azure-sdk/azure-sdk-base"], + "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", + "tsdoc/syntax": "warn" + } +} diff --git a/sdk/vision/ai-vision-face-rest/CHANGELOG.md b/sdk/vision/ai-vision-face-rest/CHANGELOG.md new file mode 100644 index 000000000000..1335475fb4db --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0-beta.1 (2024-05-15) + + - Initial Release diff --git a/sdk/vision/ai-vision-face-rest/README.md b/sdk/vision/ai-vision-face-rest/README.md new file mode 100644 index 000000000000..9884e2ef1801 --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/README.md @@ -0,0 +1,59 @@ +# Azure Face REST client library for JavaScript + +Face API REST Client + +**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: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/vision/ai-vision-face-rest) +- [Package (NPM)](https://www.npmjs.com/package/@azure-rest/ai-vision-face) +- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure-rest/ai-vision-face?view=azure-node-preview) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/vision/ai-vision-face-rest/samples) + +## 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/ai-vision-face` package + +Install the Azure Face REST client REST client library for JavaScript with `npm`: + +```bash +npm install @azure-rest/ai-vision-face +``` + +### Create and authenticate a `FaceClient` + +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/vision/ai-vision-face-rest/api-extractor.json b/sdk/vision/ai-vision-face-rest/api-extractor.json new file mode 100644 index 000000000000..f45cda543122 --- /dev/null +++ b/sdk/vision/ai-vision-face-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/ai-vision-face.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/vision/ai-vision-face-rest/karma.conf.js b/sdk/vision/ai-vision-face-rest/karma.conf.js new file mode 100644 index 000000000000..a9d5f1b5fc59 --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/karma.conf.js @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +// https://github.com/karma-runner/karma-chrome-launcher +process.env.CHROME_BIN = require("puppeteer").executablePath(); +require("dotenv").config(); +const { relativeRecordingsPath } = require("@azure-tools/test-recorder"); +process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath(); + +module.exports = function (config) { + config.set({ + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: "./", + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ["source-map-support", "mocha"], + + plugins: [ + "karma-mocha", + "karma-mocha-reporter", + "karma-chrome-launcher", + "karma-firefox-launcher", + "karma-env-preprocessor", + "karma-coverage", + "karma-sourcemap-loader", + "karma-junit-reporter", + "karma-source-map-support", + ], + + // list of files / patterns to load in the browser + files: [ + "dist-test/index.browser.js", + { + pattern: "dist-test/index.browser.js.map", + type: "html", + included: false, + served: true, + }, + ], + + // list of files / patterns to exclude + exclude: [], + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + "**/*.js": ["sourcemap", "env"], + // IMPORTANT: COMMENT following line if you want to debug in your browsers!! + // Preprocess source file to calculate code coverage, however this will make source file unreadable + // "dist-test/index.js": ["coverage"] + }, + + envPreprocessor: [ + "TEST_MODE", + "ENDPOINT", + "AZURE_CLIENT_SECRET", + "AZURE_CLIENT_ID", + "AZURE_TENANT_ID", + "SUBSCRIPTION_ID", + "RECORDINGS_RELATIVE_PATH", + ], + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ["mocha", "coverage", "junit"], + + coverageReporter: { + // specify a common output directory + dir: "coverage-browser/", + reporters: [ + { type: "json", subdir: ".", file: "coverage.json" }, + { type: "lcovonly", subdir: ".", file: "lcov.info" }, + { type: "html", subdir: "html" }, + { type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" }, + ], + }, + + junitReporter: { + outputDir: "", // results will be saved as $outputDir/$browserName.xml + outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile + suite: "", // suite will become the package name attribute in xml testsuite element + useBrowserName: false, // add browser name to report and classes names + nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element + classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element + properties: {}, // key value pair of properties to add to the section of the report + }, + + // web server port + port: 9876, + + // enable / disable colors in the output (reporters and logs) + colors: true, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, + + // --no-sandbox allows our tests to run in Linux without having to change the system. + // --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex. + browsers: ["ChromeHeadlessNoSandbox"], + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: "ChromeHeadless", + flags: ["--no-sandbox", "--disable-web-security"], + }, + }, + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: 1, + + browserNoActivityTimeout: 60000000, + browserDisconnectTimeout: 10000, + browserDisconnectTolerance: 3, + + client: { + mocha: { + // change Karma's debug.html to the mocha web reporter + reporter: "html", + timeout: "600000", + }, + }, + }); +}; diff --git a/sdk/vision/ai-vision-face-rest/package.json b/sdk/vision/ai-vision-face-rest/package.json new file mode 100644 index 000000000000..7c67eb2aa1bf --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/package.json @@ -0,0 +1,112 @@ +{ + "name": "@azure-rest/ai-vision-face", + "version": "1.0.0-beta.1", + "description": "Face API REST Client", + "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/*" + ], + "sdk-type": "client", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/vision/ai-vision-face-rest/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/faceClient.ts", + "prefix": "package-version" + } + ] + }, + "dependencies": { + "@azure-rest/core-client": "^2.0.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-lro": "^2.5.4", + "@azure/abort-controller": "^1.0.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.4.5", + "tshy": "^1.11.1", + "@azure/core-util": "^1.0.0", + "@azure-tools/test-credential": "^1.0.0", + "@azure/identity": "^4.0.1", + "@azure-tools/test-recorder": "^3.0.0", + "@vitest/browser": "^1.3.1", + "@vitest/coverage-istanbul": "^1.3.1", + "playwright": "^1.41.2", + "vitest": "^1.3.1", + "@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 --ext .ts --ext .cts --ext .mts", + "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts --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 --no-test-proxy --browser", + "unit-test:node": "dev-tool run test:vitest --no-test-proxy", + "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": "dev-tool samples publish --force", + "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": "dev-tool samples run samples-dev", + "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" + } +} \ No newline at end of file diff --git a/sdk/vision/ai-vision-face-rest/src/clientDefinitions.ts b/sdk/vision/ai-vision-face-rest/src/clientDefinitions.ts new file mode 100644 index 000000000000..b01c2e89ce8f --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/src/clientDefinitions.ts @@ -0,0 +1,1840 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + GetOperationResultParameters, + DetectFromUrlParameters, + DetectParameters, + FindSimilarParameters, + FindSimilarFromFaceListParameters, + FindSimilarFromLargeFaceListParameters, + IdentifyFromPersonGroupParameters, + IdentifyFromLargePersonGroupParameters, + IdentifyFromPersonDirectoryParameters, + IdentifyFromDynamicPersonGroupParameters, + VerifyFaceToFaceParameters, + VerifyFromPersonGroupParameters, + VerifyFromLargePersonGroupParameters, + VerifyFromPersonDirectoryParameters, + GroupParameters, + CreateFaceListParameters, + DeleteFaceListParameters, + GetFaceListParameters, + UpdateFaceListParameters, + GetFaceListsParameters, + AddFaceListFaceFromUrlParameters, + AddFaceListFaceParameters, + DeleteFaceListFaceParameters, + CreateLargeFaceListParameters, + DeleteLargeFaceListParameters, + GetLargeFaceListParameters, + UpdateLargeFaceListParameters, + GetLargeFaceListsParameters, + GetLargeFaceListTrainingStatusParameters, + TrainLargeFaceListParameters, + AddLargeFaceListFaceFromUrlParameters, + AddLargeFaceListFaceParameters, + GetLargeFaceListFacesParameters, + DeleteLargeFaceListFaceParameters, + GetLargeFaceListFaceParameters, + UpdateLargeFaceListFaceParameters, + CreatePersonGroupParameters, + DeletePersonGroupParameters, + GetPersonGroupParameters, + UpdatePersonGroupParameters, + GetPersonGroupsParameters, + GetPersonGroupTrainingStatusParameters, + TrainPersonGroupParameters, + CreatePersonGroupPersonParameters, + GetPersonGroupPersonsParameters, + DeletePersonGroupPersonParameters, + GetPersonGroupPersonParameters, + UpdatePersonGroupPersonParameters, + AddPersonGroupPersonFaceFromUrlParameters, + AddPersonGroupPersonFaceParameters, + DeletePersonGroupPersonFaceParameters, + GetPersonGroupPersonFaceParameters, + UpdatePersonGroupPersonFaceParameters, + CreateLargePersonGroupParameters, + DeleteLargePersonGroupParameters, + GetLargePersonGroupParameters, + UpdateLargePersonGroupParameters, + GetLargePersonGroupsParameters, + GetLargePersonGroupTrainingStatusParameters, + TrainLargePersonGroupParameters, + CreateLargePersonGroupPersonParameters, + GetLargePersonGroupPersonsParameters, + DeleteLargePersonGroupPersonParameters, + GetLargePersonGroupPersonParameters, + UpdateLargePersonGroupPersonParameters, + AddLargePersonGroupPersonFaceFromUrlParameters, + AddLargePersonGroupPersonFaceParameters, + DeleteLargePersonGroupPersonFaceParameters, + GetLargePersonGroupPersonFaceParameters, + UpdateLargePersonGroupPersonFaceParameters, + CreatePersonParameters, + GetPersonsParameters, + DeletePersonParameters, + GetPersonParameters, + UpdatePersonParameters, + GetDynamicPersonGroupReferencesParameters, + AddPersonFaceParameters, + AddPersonFaceFromUrlParameters, + GetPersonFacesParameters, + DeletePersonFaceParameters, + GetPersonFaceParameters, + UpdatePersonFaceParameters, + CreateDynamicPersonGroupWithPersonParameters, + CreateDynamicPersonGroupParameters, + DeleteDynamicPersonGroupParameters, + GetDynamicPersonGroupParameters, + UpdateDynamicPersonGroupWithPersonChangesParameters, + UpdateDynamicPersonGroupParameters, + GetDynamicPersonGroupsParameters, + GetDynamicPersonGroupPersonsParameters, + CreateLivenessSessionParameters, + GetLivenessSessionsParameters, + DeleteLivenessSessionParameters, + GetLivenessSessionResultParameters, + GetLivenessSessionAuditEntriesParameters, + CreateLivenessWithVerifySessionWithVerifyImageParameters, + CreateLivenessWithVerifySessionParameters, + GetLivenessWithVerifySessionsParameters, + DeleteLivenessWithVerifySessionParameters, + GetLivenessWithVerifySessionResultParameters, + GetLivenessWithVerifySessionAuditEntriesParameters, +} from "./parameters.js"; +import { + GetOperationResult200Response, + GetOperationResultDefaultResponse, + DetectFromUrl200Response, + DetectFromUrlDefaultResponse, + Detect200Response, + DetectDefaultResponse, + FindSimilar200Response, + FindSimilarDefaultResponse, + FindSimilarFromFaceList200Response, + FindSimilarFromFaceListDefaultResponse, + FindSimilarFromLargeFaceList200Response, + FindSimilarFromLargeFaceListDefaultResponse, + IdentifyFromPersonGroup200Response, + IdentifyFromPersonGroupDefaultResponse, + IdentifyFromLargePersonGroup200Response, + IdentifyFromLargePersonGroupDefaultResponse, + IdentifyFromPersonDirectory200Response, + IdentifyFromPersonDirectoryDefaultResponse, + IdentifyFromDynamicPersonGroup200Response, + IdentifyFromDynamicPersonGroupDefaultResponse, + VerifyFaceToFace200Response, + VerifyFaceToFaceDefaultResponse, + VerifyFromPersonGroup200Response, + VerifyFromPersonGroupDefaultResponse, + VerifyFromLargePersonGroup200Response, + VerifyFromLargePersonGroupDefaultResponse, + VerifyFromPersonDirectory200Response, + VerifyFromPersonDirectoryDefaultResponse, + Group200Response, + GroupDefaultResponse, + CreateFaceList200Response, + CreateFaceListDefaultResponse, + DeleteFaceList200Response, + DeleteFaceListDefaultResponse, + GetFaceList200Response, + GetFaceListDefaultResponse, + UpdateFaceList200Response, + UpdateFaceListDefaultResponse, + GetFaceLists200Response, + GetFaceListsDefaultResponse, + AddFaceListFaceFromUrl200Response, + AddFaceListFaceFromUrlDefaultResponse, + AddFaceListFace200Response, + AddFaceListFaceDefaultResponse, + DeleteFaceListFace200Response, + DeleteFaceListFaceDefaultResponse, + CreateLargeFaceList200Response, + CreateLargeFaceListDefaultResponse, + DeleteLargeFaceList200Response, + DeleteLargeFaceListDefaultResponse, + GetLargeFaceList200Response, + GetLargeFaceListDefaultResponse, + UpdateLargeFaceList200Response, + UpdateLargeFaceListDefaultResponse, + GetLargeFaceLists200Response, + GetLargeFaceListsDefaultResponse, + GetLargeFaceListTrainingStatus200Response, + GetLargeFaceListTrainingStatusDefaultResponse, + TrainLargeFaceList202Response, + TrainLargeFaceListDefaultResponse, + AddLargeFaceListFaceFromUrl200Response, + AddLargeFaceListFaceFromUrlDefaultResponse, + AddLargeFaceListFace200Response, + AddLargeFaceListFaceDefaultResponse, + GetLargeFaceListFaces200Response, + GetLargeFaceListFacesDefaultResponse, + DeleteLargeFaceListFace200Response, + DeleteLargeFaceListFaceDefaultResponse, + GetLargeFaceListFace200Response, + GetLargeFaceListFaceDefaultResponse, + UpdateLargeFaceListFace200Response, + UpdateLargeFaceListFaceDefaultResponse, + CreatePersonGroup200Response, + CreatePersonGroupDefaultResponse, + DeletePersonGroup200Response, + DeletePersonGroupDefaultResponse, + GetPersonGroup200Response, + GetPersonGroupDefaultResponse, + UpdatePersonGroup200Response, + UpdatePersonGroupDefaultResponse, + GetPersonGroups200Response, + GetPersonGroupsDefaultResponse, + GetPersonGroupTrainingStatus200Response, + GetPersonGroupTrainingStatusDefaultResponse, + TrainPersonGroup202Response, + TrainPersonGroupDefaultResponse, + CreatePersonGroupPerson200Response, + CreatePersonGroupPersonDefaultResponse, + GetPersonGroupPersons200Response, + GetPersonGroupPersonsDefaultResponse, + DeletePersonGroupPerson200Response, + DeletePersonGroupPersonDefaultResponse, + GetPersonGroupPerson200Response, + GetPersonGroupPersonDefaultResponse, + UpdatePersonGroupPerson200Response, + UpdatePersonGroupPersonDefaultResponse, + AddPersonGroupPersonFaceFromUrl200Response, + AddPersonGroupPersonFaceFromUrlDefaultResponse, + AddPersonGroupPersonFace200Response, + AddPersonGroupPersonFaceDefaultResponse, + DeletePersonGroupPersonFace200Response, + DeletePersonGroupPersonFaceDefaultResponse, + GetPersonGroupPersonFace200Response, + GetPersonGroupPersonFaceDefaultResponse, + UpdatePersonGroupPersonFace200Response, + UpdatePersonGroupPersonFaceDefaultResponse, + CreateLargePersonGroup200Response, + CreateLargePersonGroupDefaultResponse, + DeleteLargePersonGroup200Response, + DeleteLargePersonGroupDefaultResponse, + GetLargePersonGroup200Response, + GetLargePersonGroupDefaultResponse, + UpdateLargePersonGroup200Response, + UpdateLargePersonGroupDefaultResponse, + GetLargePersonGroups200Response, + GetLargePersonGroupsDefaultResponse, + GetLargePersonGroupTrainingStatus200Response, + GetLargePersonGroupTrainingStatusDefaultResponse, + TrainLargePersonGroup202Response, + TrainLargePersonGroupDefaultResponse, + CreateLargePersonGroupPerson200Response, + CreateLargePersonGroupPersonDefaultResponse, + GetLargePersonGroupPersons200Response, + GetLargePersonGroupPersonsDefaultResponse, + DeleteLargePersonGroupPerson200Response, + DeleteLargePersonGroupPersonDefaultResponse, + GetLargePersonGroupPerson200Response, + GetLargePersonGroupPersonDefaultResponse, + UpdateLargePersonGroupPerson200Response, + UpdateLargePersonGroupPersonDefaultResponse, + AddLargePersonGroupPersonFaceFromUrl200Response, + AddLargePersonGroupPersonFaceFromUrlDefaultResponse, + AddLargePersonGroupPersonFace200Response, + AddLargePersonGroupPersonFaceDefaultResponse, + DeleteLargePersonGroupPersonFace200Response, + DeleteLargePersonGroupPersonFaceDefaultResponse, + GetLargePersonGroupPersonFace200Response, + GetLargePersonGroupPersonFaceDefaultResponse, + UpdateLargePersonGroupPersonFace200Response, + UpdateLargePersonGroupPersonFaceDefaultResponse, + CreatePerson202Response, + CreatePersonDefaultResponse, + GetPersons200Response, + GetPersonsDefaultResponse, + DeletePerson202Response, + DeletePersonDefaultResponse, + GetPerson200Response, + GetPersonDefaultResponse, + UpdatePerson200Response, + UpdatePersonDefaultResponse, + GetDynamicPersonGroupReferences200Response, + GetDynamicPersonGroupReferencesDefaultResponse, + AddPersonFace202Response, + AddPersonFaceDefaultResponse, + AddPersonFaceFromUrl202Response, + AddPersonFaceFromUrlDefaultResponse, + GetPersonFaces200Response, + GetPersonFacesDefaultResponse, + DeletePersonFace202Response, + DeletePersonFaceDefaultResponse, + GetPersonFace200Response, + GetPersonFaceDefaultResponse, + UpdatePersonFace200Response, + UpdatePersonFaceDefaultResponse, + CreateDynamicPersonGroupWithPerson202Response, + CreateDynamicPersonGroupWithPersonDefaultResponse, + CreateDynamicPersonGroup200Response, + CreateDynamicPersonGroupDefaultResponse, + DeleteDynamicPersonGroup202Response, + DeleteDynamicPersonGroupDefaultResponse, + GetDynamicPersonGroup200Response, + GetDynamicPersonGroupDefaultResponse, + UpdateDynamicPersonGroupWithPersonChanges202Response, + UpdateDynamicPersonGroupWithPersonChangesDefaultResponse, + UpdateDynamicPersonGroup200Response, + UpdateDynamicPersonGroupDefaultResponse, + GetDynamicPersonGroups200Response, + GetDynamicPersonGroupsDefaultResponse, + GetDynamicPersonGroupPersons200Response, + GetDynamicPersonGroupPersonsDefaultResponse, + CreateLivenessSession200Response, + CreateLivenessSessionDefaultResponse, + GetLivenessSessions200Response, + GetLivenessSessionsDefaultResponse, + DeleteLivenessSession200Response, + DeleteLivenessSessionDefaultResponse, + GetLivenessSessionResult200Response, + GetLivenessSessionResultDefaultResponse, + GetLivenessSessionAuditEntries200Response, + GetLivenessSessionAuditEntriesDefaultResponse, + CreateLivenessWithVerifySessionWithVerifyImage200Response, + CreateLivenessWithVerifySessionWithVerifyImageDefaultResponse, + CreateLivenessWithVerifySession200Response, + CreateLivenessWithVerifySessionDefaultResponse, + GetLivenessWithVerifySessions200Response, + GetLivenessWithVerifySessionsDefaultResponse, + DeleteLivenessWithVerifySession200Response, + DeleteLivenessWithVerifySessionDefaultResponse, + GetLivenessWithVerifySessionResult200Response, + GetLivenessWithVerifySessionResultDefaultResponse, + GetLivenessWithVerifySessionAuditEntries200Response, + GetLivenessWithVerifySessionAuditEntriesDefaultResponse, +} from "./responses.js"; +import { RecognitionModel } from "./models.js"; +import { Client, StreamableMethod } from "@azure-rest/core-client"; + +export interface GetOperationResult { + /** Get status of a long running operation. */ + get( + options?: GetOperationResultParameters, + ): StreamableMethod< + GetOperationResult200Response | GetOperationResultDefaultResponse + >; +} + +export interface DetectFromUrl { + /** + * > [!IMPORTANT] + * > To mitigate potential misuse that can subject people to stereotyping, discrimination, or unfair denial of services, we are retiring Face API attributes that predict emotion, gender, age, smile, facial hair, hair, and makeup. Read more about this decision https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. + * + * * + * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. + * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific attributes may not be highly accurate. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. + * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. + * * 'detection_03': Face attributes (mask and headPose only) and landmarks are supported if you choose this detection model. + * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. More details, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + */ + post( + options: DetectFromUrlParameters, + ): StreamableMethod; + /** + * > [!IMPORTANT] + * > To mitigate potential misuse that can subject people to stereotyping, discrimination, or unfair denial of services, we are retiring Face API attributes that predict emotion, gender, age, smile, facial hair, hair, and makeup. Read more about this decision https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. + * + * * + * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. + * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific attributes may not be highly accurate. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. + * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. + * * 'detection_03': Face attributes (mask and headPose only) and landmarks are supported if you choose this detection model. + * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. More details, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + */ + post( + options: DetectParameters, + ): StreamableMethod; +} + +export interface FindSimilar { + /** + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the target faceId array. + */ + post( + options?: FindSimilarParameters, + ): StreamableMethod; + /** + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the target Face List. + */ + post( + options?: FindSimilarFromFaceListParameters, + ): StreamableMethod< + FindSimilarFromFaceList200Response | FindSimilarFromFaceListDefaultResponse + >; + /** + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the target Large Face List. + */ + post( + options?: FindSimilarFromLargeFaceListParameters, + ): StreamableMethod< + | FindSimilarFromLargeFaceList200Response + | FindSimilarFromLargeFaceListDefaultResponse + >; +} + +export interface IdentifyFromPersonGroup { + /** + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the faces in the Person Group (given by personGroupId), and return candidate person(s) for that face ranked by similarity confidence. The Person Group should be trained to make it ready for identification. See more in "Train Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the 'recognitionModel' used by the target Person Group. + */ + post( + options?: IdentifyFromPersonGroupParameters, + ): StreamableMethod< + IdentifyFromPersonGroup200Response | IdentifyFromPersonGroupDefaultResponse + >; + /** + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the faces in the Large Person Group (given by largePersonGroupId), and return candidate person(s) for that face ranked by similarity confidence. The Large Person Group should be trained to make it ready for identification. See more in "Train Large Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a Person Group/Large Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the 'recognitionModel' used by the target Person Group or Large Person Group. + */ + post( + options?: IdentifyFromLargePersonGroupParameters, + ): StreamableMethod< + | IdentifyFromLargePersonGroup200Response + | IdentifyFromLargePersonGroupDefaultResponse + >; + /** + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the faces in the Person Directory Persons (given by personIds), and return candidate person(s) for that face ranked by similarity confidence. + * Passing personIds with an array with one element "*" can perform the operation over entire person directory. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated with the query faces. + */ + post( + options?: IdentifyFromPersonDirectoryParameters, + ): StreamableMethod< + | IdentifyFromPersonDirectory200Response + | IdentifyFromPersonDirectoryDefaultResponse + >; + /** + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the faces in the Dynamic Person Group (given by dynamicPersonGroupId), and return candidate person(s) for that face ranked by similarity confidence. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated with the query faces. + */ + post( + options?: IdentifyFromDynamicPersonGroupParameters, + ): StreamableMethod< + | IdentifyFromDynamicPersonGroup200Response + | IdentifyFromDynamicPersonGroupDefaultResponse + >; +} + +export interface VerifyFaceToFace { + /** + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the both faces should be the same. + */ + post( + options?: VerifyFaceToFaceParameters, + ): StreamableMethod< + VerifyFaceToFace200Response | VerifyFaceToFaceDefaultResponse + >; + /** + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by the Person Group. + */ + post( + options?: VerifyFromPersonGroupParameters, + ): StreamableMethod< + VerifyFromPersonGroup200Response | VerifyFromPersonGroupDefaultResponse + >; + /** + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by the Large Person Group. + */ + post( + options?: VerifyFromLargePersonGroupParameters, + ): StreamableMethod< + | VerifyFromLargePersonGroup200Response + | VerifyFromLargePersonGroupDefaultResponse + >; + /** + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The Verify operation can only match faces obtained with the same recognition model, that is associated with the query face. + */ + post( + options?: VerifyFromPersonDirectoryParameters, + ): StreamableMethod< + | VerifyFromPersonDirectory200Response + | VerifyFromPersonDirectoryDefaultResponse + >; +} + +export interface Group { + /** + * > + * * + * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice that faces belonging to a same person might be split into several groups in the result. + * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original faces. The messyGroup will not appear in the result if all faces found their counterparts. + * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you only have 2 candidate faces. + * * The 'recognitionModel' associated with the query faces' faceIds should be the same. + */ + post( + options?: GroupParameters, + ): StreamableMethod; +} + +export interface CreateFaceList { + /** + * Up to 64 Face Lists are allowed in one subscription. + * + * Face List is a list of faces, up to 1,000 faces, and used by "Find Similar From Face List". + * + * After creation, user should use "Add Face List Face" to import the faces. No image will be stored. Only the extracted face feature(s) will be stored on server until "Delete Face List" is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way face identification. But if the actual use is to identify person, please use Person Group / Large Person Group and "Identify". + * + * Please consider Large Face List when the face number is large. It can support up to 1,000,000 faces. + */ + put( + options?: CreateFaceListParameters, + ): StreamableMethod< + CreateFaceList200Response | CreateFaceListDefaultResponse + >; + /** Delete a specified Face List. */ + delete( + options?: DeleteFaceListParameters, + ): StreamableMethod< + DeleteFaceList200Response | DeleteFaceListDefaultResponse + >; + /** Retrieve a Face List's faceListId, name, userData, recognitionModel and faces in the Face List. */ + get( + options?: GetFaceListParameters, + ): StreamableMethod; + /** Update information of a Face List, including name and userData. */ + patch( + options?: UpdateFaceListParameters, + ): StreamableMethod< + UpdateFaceList200Response | UpdateFaceListDefaultResponse + >; +} + +export interface GetFaceLists { + /** + * List Face Lists' faceListId, name, userData and recognitionModel. + * + * To get face information inside Face List use "Get Face List". + */ + get( + options?: GetFaceListsParameters, + ): StreamableMethod; +} + +export interface AddFaceListFaceFromUrl { + /** + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + */ + post( + options?: AddFaceListFaceFromUrlParameters, + ): StreamableMethod< + AddFaceListFaceFromUrl200Response | AddFaceListFaceFromUrlDefaultResponse + >; + /** + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + */ + post( + options: AddFaceListFaceParameters, + ): StreamableMethod< + AddFaceListFace200Response | AddFaceListFaceDefaultResponse + >; +} + +export interface DeleteFaceListFace { + /** Adding/deleting faces to/from a same Face List are processed sequentially and to/from different Face Lists are in parallel. */ + delete( + options?: DeleteFaceListFaceParameters, + ): StreamableMethod< + DeleteFaceListFace200Response | DeleteFaceListFaceDefaultResponse + >; +} + +export interface CreateLargeFaceList { + /** + * Large Face List is a list of faces, up to 1,000,000 faces, and used by "Find Similar From Large Face List". + * + * After creation, user should use Add Large Face List Face to import the faces and Train Large Face List to make it ready for "Find Similar". No image will be stored. Only the extracted face feature(s) will be stored on server until Delete Large Face List is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way face identification. But if the actual use is to identify person, please use Person Group / Large Person Group and "Identify". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 64 Large Face Lists. + * > * S0-tier subscription quota: 1,000,000 Large Face Lists. + */ + put( + options?: CreateLargeFaceListParameters, + ): StreamableMethod< + CreateLargeFaceList200Response | CreateLargeFaceListDefaultResponse + >; + /** Adding/deleting faces to/from a same Large Face List are processed sequentially and to/from different Large Face Lists are in parallel. */ + delete( + options?: DeleteLargeFaceListParameters, + ): StreamableMethod< + DeleteLargeFaceList200Response | DeleteLargeFaceListDefaultResponse + >; + /** Retrieve a Large Face List's largeFaceListId, name, userData and recognitionModel. */ + get( + options?: GetLargeFaceListParameters, + ): StreamableMethod< + GetLargeFaceList200Response | GetLargeFaceListDefaultResponse + >; + /** Update information of a Large Face List, including name and userData. */ + patch( + options?: UpdateLargeFaceListParameters, + ): StreamableMethod< + UpdateLargeFaceList200Response | UpdateLargeFaceListDefaultResponse + >; +} + +export interface GetLargeFaceLists { + /** + * To get face information inside largeFaceList use "Get Large Face List Face". + * + * Large Face Lists are stored in alphabetical order of largeFaceListId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + */ + get( + options?: GetLargeFaceListsParameters, + ): StreamableMethod< + GetLargeFaceLists200Response | GetLargeFaceListsDefaultResponse + >; +} + +export interface GetLargeFaceListTrainingStatus { + /** + * To check the Large Face List training status completed or still ongoing. Large Face List training is an asynchronous operation triggered by "Train Large Face List". + * + * Training time depends on the number of face entries in a Large Face List. It could be in seconds, or up to half an hour for 1,000,000 faces. + */ + get( + options?: GetLargeFaceListTrainingStatusParameters, + ): StreamableMethod< + | GetLargeFaceListTrainingStatus200Response + | GetLargeFaceListTrainingStatusDefaultResponse + >; +} + +export interface TrainLargeFaceList { + /** + * Training is a crucial step that only a trained Large Face List can be used by "Find Similar From Large Face List". + * + * The training task is an asynchronous task. Training time depends on the number of face entries in a Large Face List. It could be in seconds, or up to half an hour for 1,000,000 faces. To check training completion, please use "Get Large Face List Training Status". + */ + post( + options?: TrainLargeFaceListParameters, + ): StreamableMethod< + TrainLargeFaceList202Response | TrainLargeFaceListDefaultResponse + >; +} + +export interface AddLargeFaceListFaceFromUrl { + /** + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + */ + post( + options?: AddLargeFaceListFaceFromUrlParameters, + ): StreamableMethod< + | AddLargeFaceListFaceFromUrl200Response + | AddLargeFaceListFaceFromUrlDefaultResponse + >; + /** + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + */ + post( + options: AddLargeFaceListFaceParameters, + ): StreamableMethod< + AddLargeFaceListFace200Response | AddLargeFaceListFaceDefaultResponse + >; + /** + * Faces are stored in alphabetical order of persistedFaceId created in "Add Large Face List Face". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + */ + get( + options?: GetLargeFaceListFacesParameters, + ): StreamableMethod< + GetLargeFaceListFaces200Response | GetLargeFaceListFacesDefaultResponse + >; +} + +export interface DeleteLargeFaceListFace { + /** Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. */ + delete( + options?: DeleteLargeFaceListFaceParameters, + ): StreamableMethod< + DeleteLargeFaceListFace200Response | DeleteLargeFaceListFaceDefaultResponse + >; + /** Retrieve persisted face in Large Face List by largeFaceListId and persistedFaceId. */ + get( + options?: GetLargeFaceListFaceParameters, + ): StreamableMethod< + GetLargeFaceListFace200Response | GetLargeFaceListFaceDefaultResponse + >; + /** Update a specified face's userData field in a Large Face List by its persistedFaceId. */ + patch( + options?: UpdateLargeFaceListFaceParameters, + ): StreamableMethod< + UpdateLargeFaceListFace200Response | UpdateLargeFaceListFaceDefaultResponse + >; +} + +export interface CreatePersonGroup { + /** + * A Person Group is a container holding the uploaded person data, including face recognition features. + * + * After creation, use "Create Person Group Person" to add persons into the group, and then call "Train Person Group" to get this group ready for "Identify From Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until "Delete Person Group Person" or "Delete Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Person Group. The default value for 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need in this parameter. New faces that are added to an existing Person Group will use the recognition model that's already associated with the collection. Existing face feature(s) in a Person Group can't be updated to features extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Person Groups. Each holds up to 1,000 persons. + * > * S0-tier subscription quota: 1,000,000 Person Groups. Each holds up to 10,000 persons. + * > * to handle larger scale face identification problem, please consider using Large Person Group. + */ + put( + options?: CreatePersonGroupParameters, + ): StreamableMethod< + CreatePersonGroup200Response | CreatePersonGroupDefaultResponse + >; + /** Delete an existing Person Group with specified personGroupId. Persisted data in this Person Group will be deleted. */ + delete( + options?: DeletePersonGroupParameters, + ): StreamableMethod< + DeletePersonGroup200Response | DeletePersonGroupDefaultResponse + >; + /** Retrieve Person Group name, userData and recognitionModel. To get person information under this personGroup, use "Get Person Group Persons". */ + get( + options?: GetPersonGroupParameters, + ): StreamableMethod< + GetPersonGroup200Response | GetPersonGroupDefaultResponse + >; + /** Update an existing Person Group's name and userData. The properties keep unchanged if they are not in request body. */ + patch( + options?: UpdatePersonGroupParameters, + ): StreamableMethod< + UpdatePersonGroup200Response | UpdatePersonGroupDefaultResponse + >; +} + +export interface GetPersonGroups { + /** + * Person Groups are stored in alphabetical order of personGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + */ + get( + options?: GetPersonGroupsParameters, + ): StreamableMethod< + GetPersonGroups200Response | GetPersonGroupsDefaultResponse + >; +} + +export interface GetPersonGroupTrainingStatus { + /** To check Person Group training status completed or still ongoing. Person Group training is an asynchronous operation triggered by "Train Person Group" API. */ + get( + options?: GetPersonGroupTrainingStatusParameters, + ): StreamableMethod< + | GetPersonGroupTrainingStatus200Response + | GetPersonGroupTrainingStatusDefaultResponse + >; +} + +export interface TrainPersonGroup { + /** The training task is an asynchronous task. Training time depends on the number of person entries, and their faces in a Person Group. It could be several seconds to minutes. To check training status, please use "Get Person Group Training Status". */ + post( + options?: TrainPersonGroupParameters, + ): StreamableMethod< + TrainPersonGroup202Response | TrainPersonGroupDefaultResponse + >; +} + +export interface CreatePersonGroupPerson { + /** + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Person Groups. + * > * S0-tier subscription quota: + * > * 10,000 persons per Person Group. + * > * 1,000,000 Person Groups. + * > * 100,000,000 persons in all Person Groups. + */ + post( + options?: CreatePersonGroupPersonParameters, + ): StreamableMethod< + CreatePersonGroupPerson200Response | CreatePersonGroupPersonDefaultResponse + >; + /** + * Persons are stored in alphabetical order of personId created in "Create Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + */ + get( + options?: GetPersonGroupPersonsParameters, + ): StreamableMethod< + GetPersonGroupPersons200Response | GetPersonGroupPersonsDefaultResponse + >; +} + +export interface DeletePersonGroupPerson { + /** Delete an existing person from a Person Group. The persistedFaceId, userData, person name and face feature(s) in the person entry will all be deleted. */ + delete( + options?: DeletePersonGroupPersonParameters, + ): StreamableMethod< + DeletePersonGroupPerson200Response | DeletePersonGroupPersonDefaultResponse + >; + /** Retrieve a person's name and userData, and the persisted faceIds representing the registered person face feature(s). */ + get( + options?: GetPersonGroupPersonParameters, + ): StreamableMethod< + GetPersonGroupPerson200Response | GetPersonGroupPersonDefaultResponse + >; + /** Update name or userData of a person. */ + patch( + options?: UpdatePersonGroupPersonParameters, + ): StreamableMethod< + UpdatePersonGroupPerson200Response | UpdatePersonGroupPersonDefaultResponse + >; +} + +export interface AddPersonGroupPersonFaceFromUrl { + /** + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + */ + post( + options?: AddPersonGroupPersonFaceFromUrlParameters, + ): StreamableMethod< + | AddPersonGroupPersonFaceFromUrl200Response + | AddPersonGroupPersonFaceFromUrlDefaultResponse + >; + /** + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + */ + post( + options: AddPersonGroupPersonFaceParameters, + ): StreamableMethod< + | AddPersonGroupPersonFace200Response + | AddPersonGroupPersonFaceDefaultResponse + >; +} + +export interface DeletePersonGroupPersonFace { + /** Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel. */ + delete( + options?: DeletePersonGroupPersonFaceParameters, + ): StreamableMethod< + | DeletePersonGroupPersonFace200Response + | DeletePersonGroupPersonFaceDefaultResponse + >; + /** Retrieve person face information. The persisted person face is specified by its personGroupId, personId and persistedFaceId. */ + get( + options?: GetPersonGroupPersonFaceParameters, + ): StreamableMethod< + | GetPersonGroupPersonFace200Response + | GetPersonGroupPersonFaceDefaultResponse + >; + /** Update a person persisted face's userData field. */ + patch( + options?: UpdatePersonGroupPersonFaceParameters, + ): StreamableMethod< + | UpdatePersonGroupPersonFace200Response + | UpdatePersonGroupPersonFaceDefaultResponse + >; +} + +export interface CreateLargePersonGroup { + /** + * A Large Person Group is a container holding the uploaded person data, including the face recognition features. It can hold up to 1,000,000 entities. + * + * After creation, use "Create Large Person Group Person" to add person into the group, and call "Train Large Person Group" to get this group ready for "Identify From Large Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until "Delete Large Person Group Person" or "Delete Large Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Large Person Group. The default value for 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need in this parameter. New faces that are added to an existing Large Person Group will use the recognition model that's already associated with the collection. Existing face feature(s) in a Large Person Group can't be updated to features extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Large Person Groups. + * > * S0-tier subscription quota: 1,000,000 Large Person Groups. + */ + put( + options?: CreateLargePersonGroupParameters, + ): StreamableMethod< + CreateLargePersonGroup200Response | CreateLargePersonGroupDefaultResponse + >; + /** Delete an existing Large Person Group with specified personGroupId. Persisted data in this Large Person Group will be deleted. */ + delete( + options?: DeleteLargePersonGroupParameters, + ): StreamableMethod< + DeleteLargePersonGroup200Response | DeleteLargePersonGroupDefaultResponse + >; + /** Retrieve the information of a Large Person Group, including its name, userData and recognitionModel. This API returns Large Person Group information only, use "Get Large Person Group Persons" instead to retrieve person information under the Large Person Group. */ + get( + options?: GetLargePersonGroupParameters, + ): StreamableMethod< + GetLargePersonGroup200Response | GetLargePersonGroupDefaultResponse + >; + /** Update an existing Large Person Group's name and userData. The properties keep unchanged if they are not in request body. */ + patch( + options?: UpdateLargePersonGroupParameters, + ): StreamableMethod< + UpdateLargePersonGroup200Response | UpdateLargePersonGroupDefaultResponse + >; +} + +export interface GetLargePersonGroups { + /** + * Large Person Groups are stored in alphabetical order of largePersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + */ + get( + options?: GetLargePersonGroupsParameters, + ): StreamableMethod< + GetLargePersonGroups200Response | GetLargePersonGroupsDefaultResponse + >; +} + +export interface GetLargePersonGroupTrainingStatus { + /** Training time depends on the number of person entries, and their faces in a Large Person Group. It could be in seconds, or up to half an hour for 1,000,000 persons. */ + get( + options?: GetLargePersonGroupTrainingStatusParameters, + ): StreamableMethod< + | GetLargePersonGroupTrainingStatus200Response + | GetLargePersonGroupTrainingStatusDefaultResponse + >; +} + +export interface TrainLargePersonGroup { + /** The training task is an asynchronous task. Training time depends on the number of person entries, and their faces in a Large Person Group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check training status, please use "Get Large Person Group Training Status". */ + post( + options?: TrainLargePersonGroupParameters, + ): StreamableMethod< + TrainLargePersonGroup202Response | TrainLargePersonGroupDefaultResponse + >; +} + +export interface CreateLargePersonGroupPerson { + /** + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Large Person Groups. + * > * S0-tier subscription quota: + * > * 1,000,000 persons per Large Person Group. + * > * 1,000,000 Large Person Groups. + * > * 1,000,000,000 persons in all Large Person Groups. + */ + post( + options?: CreateLargePersonGroupPersonParameters, + ): StreamableMethod< + | CreateLargePersonGroupPerson200Response + | CreateLargePersonGroupPersonDefaultResponse + >; + /** + * Persons are stored in alphabetical order of personId created in "Create Large Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + */ + get( + options?: GetLargePersonGroupPersonsParameters, + ): StreamableMethod< + | GetLargePersonGroupPersons200Response + | GetLargePersonGroupPersonsDefaultResponse + >; +} + +export interface DeleteLargePersonGroupPerson { + /** Delete an existing person from a Large Person Group. The persistedFaceId, userData, person name and face feature(s) in the person entry will all be deleted. */ + delete( + options?: DeleteLargePersonGroupPersonParameters, + ): StreamableMethod< + | DeleteLargePersonGroupPerson200Response + | DeleteLargePersonGroupPersonDefaultResponse + >; + /** Retrieve a person's name and userData, and the persisted faceIds representing the registered person face feature(s). */ + get( + options?: GetLargePersonGroupPersonParameters, + ): StreamableMethod< + | GetLargePersonGroupPerson200Response + | GetLargePersonGroupPersonDefaultResponse + >; + /** Update name or userData of a person. */ + patch( + options?: UpdateLargePersonGroupPersonParameters, + ): StreamableMethod< + | UpdateLargePersonGroupPerson200Response + | UpdateLargePersonGroupPersonDefaultResponse + >; +} + +export interface AddLargePersonGroupPersonFaceFromUrl { + /** + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + */ + post( + options?: AddLargePersonGroupPersonFaceFromUrlParameters, + ): StreamableMethod< + | AddLargePersonGroupPersonFaceFromUrl200Response + | AddLargePersonGroupPersonFaceFromUrlDefaultResponse + >; + /** + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + */ + post( + options: AddLargePersonGroupPersonFaceParameters, + ): StreamableMethod< + | AddLargePersonGroupPersonFace200Response + | AddLargePersonGroupPersonFaceDefaultResponse + >; +} + +export interface DeleteLargePersonGroupPersonFace { + /** Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel. */ + delete( + options?: DeleteLargePersonGroupPersonFaceParameters, + ): StreamableMethod< + | DeleteLargePersonGroupPersonFace200Response + | DeleteLargePersonGroupPersonFaceDefaultResponse + >; + /** Retrieve person face information. The persisted person face is specified by its largePersonGroupId, personId and persistedFaceId. */ + get( + options?: GetLargePersonGroupPersonFaceParameters, + ): StreamableMethod< + | GetLargePersonGroupPersonFace200Response + | GetLargePersonGroupPersonFaceDefaultResponse + >; + /** Update a person persisted face's userData field. */ + patch( + options?: UpdateLargePersonGroupPersonFaceParameters, + ): StreamableMethod< + | UpdateLargePersonGroupPersonFace200Response + | UpdateLargePersonGroupPersonFaceDefaultResponse + >; +} + +export interface CreatePerson { + /** Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person Face". */ + post( + options?: CreatePersonParameters, + ): StreamableMethod; + /** + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + */ + get( + options?: GetPersonsParameters, + ): StreamableMethod; +} + +export interface DeletePerson { + /** Delete an existing person from Person Directory. The persistedFaceId(s), userData, person name and face feature(s) in the person entry will all be deleted. */ + delete( + options?: DeletePersonParameters, + ): StreamableMethod; + /** Retrieve a person's name and userData from Person Directory. */ + get( + options?: GetPersonParameters, + ): StreamableMethod; + /** Update name or userData of a person. */ + patch( + options?: UpdatePersonParameters, + ): StreamableMethod; +} + +export interface GetDynamicPersonGroupReferences { + /** + * Dynamic Person Groups are stored in alphabetical order of Dynamic Person Group ID created in Person Directory "Create Dynamic Person Group". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + */ + get( + options?: GetDynamicPersonGroupReferencesParameters, + ): StreamableMethod< + | GetDynamicPersonGroupReferences200Response + | GetDynamicPersonGroupReferencesDefaultResponse + >; +} + +export interface AddPersonFace { + /** + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace operation has successfully propagated for future requests to "Identify". For further information about Operation-Locations see "Get Face Operation Status". + */ + post( + options: AddPersonFaceParameters, + ): StreamableMethod; + /** + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace operation has successfully propagated for future requests to "Identify". For further information about Operation-Locations see "Get Face Operation Status". + */ + post( + options?: AddPersonFaceFromUrlParameters, + ): StreamableMethod< + AddPersonFaceFromUrl202Response | AddPersonFaceFromUrlDefaultResponse + >; + /** Retrieve a person's persistedFaceIds representing the registered person face feature(s). */ + get( + options?: GetPersonFacesParameters, + ): StreamableMethod< + GetPersonFaces200Response | GetPersonFacesDefaultResponse + >; +} + +export interface DeletePersonFace { + /** Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel. */ + delete( + options?: DeletePersonFaceParameters, + ): StreamableMethod< + DeletePersonFace202Response | DeletePersonFaceDefaultResponse + >; + /** Retrieve person face information. The persisted person face is specified by its personId. recognitionModel, and persistedFaceId. */ + get( + options?: GetPersonFaceParameters, + ): StreamableMethod; + /** Update a persisted face's userData field of a person. */ + patch( + options?: UpdatePersonFaceParameters, + ): StreamableMethod< + UpdatePersonFace200Response | UpdatePersonFaceDefaultResponse + >; +} + +export interface CreateDynamicPersonGroupWithPerson { + /** + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided during "Identify" determine the 'recognitionModel' used. + */ + put( + options?: CreateDynamicPersonGroupWithPersonParameters, + ): StreamableMethod< + | CreateDynamicPersonGroupWithPerson202Response + | CreateDynamicPersonGroupWithPersonDefaultResponse + >; + /** + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided during "Identify" determine the 'recognitionModel' used. + */ + put( + options?: CreateDynamicPersonGroupParameters, + ): StreamableMethod< + | CreateDynamicPersonGroup200Response + | CreateDynamicPersonGroupDefaultResponse + >; + /** Deleting this Dynamic Person Group only delete the references to persons data. To delete actual person see Person Directory "Delete Person". */ + delete( + options?: DeleteDynamicPersonGroupParameters, + ): StreamableMethod< + | DeleteDynamicPersonGroup202Response + | DeleteDynamicPersonGroupDefaultResponse + >; + /** This API returns Dynamic Person Group information only, use Person Directory "Get Dynamic Person Group Persons" instead to retrieve person information under the Dynamic Person Group. */ + get( + options?: GetDynamicPersonGroupParameters, + ): StreamableMethod< + GetDynamicPersonGroup200Response | GetDynamicPersonGroupDefaultResponse + >; + /** The properties keep unchanged if they are not in request body. */ + patch( + options?: UpdateDynamicPersonGroupWithPersonChangesParameters, + ): StreamableMethod< + | UpdateDynamicPersonGroupWithPersonChanges202Response + | UpdateDynamicPersonGroupWithPersonChangesDefaultResponse + >; + /** The properties keep unchanged if they are not in request body. */ + patch( + options?: UpdateDynamicPersonGroupParameters, + ): StreamableMethod< + | UpdateDynamicPersonGroup200Response + | UpdateDynamicPersonGroupDefaultResponse + >; +} + +export interface GetDynamicPersonGroups { + /** + * Dynamic Person Groups are stored in alphabetical order of dynamicPersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + */ + get( + options?: GetDynamicPersonGroupsParameters, + ): StreamableMethod< + GetDynamicPersonGroups200Response | GetDynamicPersonGroupsDefaultResponse + >; +} + +export interface GetDynamicPersonGroupPersons { + /** + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + */ + get( + options?: GetDynamicPersonGroupPersonsParameters, + ): StreamableMethod< + | GetDynamicPersonGroupPersons200Response + | GetDynamicPersonGroupPersonsDefaultResponse + >; +} + +export interface CreateLivenessSession { + /** + * A session is best for client device scenarios where developers want to authorize a client device to perform only a liveness detection without granting full access to their resource. Created sessions have a limited life span and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLiveness/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your resource, use the List Liveness Session Audit Entries. + */ + post( + options?: CreateLivenessSessionParameters, + ): StreamableMethod< + CreateLivenessSession200Response | CreateLivenessSessionDefaultResponse + >; + /** + * List sessions from the last sessionId greater than the 'start'. + * + * The result should be ordered by sessionId in ascending order. + */ + get( + options?: GetLivenessSessionsParameters, + ): StreamableMethod< + GetLivenessSessions200Response | GetLivenessSessionsDefaultResponse + >; +} + +export interface DeleteLivenessSession { + /** + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth Token. While this can be used to remove any access for that token, those requests will still count towards overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is misused. + */ + delete( + options?: DeleteLivenessSessionParameters, + ): StreamableMethod< + DeleteLivenessSession200Response | DeleteLivenessSessionDefaultResponse + >; + /** Get session result of detectLiveness/singleModal call. */ + get( + options?: GetLivenessSessionResultParameters, + ): StreamableMethod< + | GetLivenessSessionResult200Response + | GetLivenessSessionResultDefaultResponse + >; +} + +export interface GetLivenessSessionAuditEntries { + /** Gets session requests and response body for the session. */ + get( + options?: GetLivenessSessionAuditEntriesParameters, + ): StreamableMethod< + | GetLivenessSessionAuditEntries200Response + | GetLivenessSessionAuditEntriesDefaultResponse + >; +} + +export interface CreateLivenessWithVerifySessionWithVerifyImage { + /** + * A session is best for client device scenarios where developers want to authorize a client device to perform only a liveness detection without granting full access to their resource. Created sessions have a limited life span and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With Verify Session Audit Entries. + * + * Recommended Option: VerifyImage is provided during session creation. + */ + post( + options: CreateLivenessWithVerifySessionWithVerifyImageParameters, + ): StreamableMethod< + | CreateLivenessWithVerifySessionWithVerifyImage200Response + | CreateLivenessWithVerifySessionWithVerifyImageDefaultResponse + >; + /** + * A session is best for client device scenarios where developers want to authorize a client device to perform only a liveness detection without granting full access to their resource. Created sessions have a limited life span and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With Verify Session Audit Entries. + * + * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. + * > [!NOTE] + * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + */ + post( + options?: CreateLivenessWithVerifySessionParameters, + ): StreamableMethod< + | CreateLivenessWithVerifySession200Response + | CreateLivenessWithVerifySessionDefaultResponse + >; + /** + * List sessions from the last sessionId greater than the "start". + * + * The result should be ordered by sessionId in ascending order. + */ + get( + options?: GetLivenessWithVerifySessionsParameters, + ): StreamableMethod< + | GetLivenessWithVerifySessions200Response + | GetLivenessWithVerifySessionsDefaultResponse + >; +} + +export interface DeleteLivenessWithVerifySession { + /** + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth Token. While this can be used to remove any access for that token, those requests will still count towards overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is misused. + */ + delete( + options?: DeleteLivenessWithVerifySessionParameters, + ): StreamableMethod< + | DeleteLivenessWithVerifySession200Response + | DeleteLivenessWithVerifySessionDefaultResponse + >; + /** Get session result of detectLivenessWithVerify/singleModal call. */ + get( + options?: GetLivenessWithVerifySessionResultParameters, + ): StreamableMethod< + | GetLivenessWithVerifySessionResult200Response + | GetLivenessWithVerifySessionResultDefaultResponse + >; +} + +export interface GetLivenessWithVerifySessionAuditEntries { + /** Gets session requests and response body for the session. */ + get( + options?: GetLivenessWithVerifySessionAuditEntriesParameters, + ): StreamableMethod< + | GetLivenessWithVerifySessionAuditEntries200Response + | GetLivenessWithVerifySessionAuditEntriesDefaultResponse + >; +} + +export interface Routes { + /** Resource for '/operations/\{operationId\}' has methods for the following verbs: get */ + (path: "/operations/{operationId}", operationId: string): GetOperationResult; + /** Resource for '/detect' has methods for the following verbs: post */ + (path: "/detect"): DetectFromUrl; + /** Resource for '/findsimilars' has methods for the following verbs: post */ + (path: "/findsimilars"): FindSimilar; + /** Resource for '/identify' has methods for the following verbs: post */ + (path: "/identify"): IdentifyFromPersonGroup; + /** Resource for '/verify' has methods for the following verbs: post */ + (path: "/verify"): VerifyFaceToFace; + /** Resource for '/group' has methods for the following verbs: post */ + (path: "/group"): Group; + /** Resource for '/facelists/\{faceListId\}' has methods for the following verbs: put, delete, get, patch */ + (path: "/facelists/{faceListId}", faceListId: string): CreateFaceList; + /** Resource for '/facelists' has methods for the following verbs: get */ + (path: "/facelists"): GetFaceLists; + /** Resource for '/facelists/\{faceListId\}/persistedfaces' has methods for the following verbs: post */ + ( + path: "/facelists/{faceListId}/persistedfaces", + faceListId: string, + ): AddFaceListFaceFromUrl; + /** Resource for '/facelists/\{faceListId\}/persistedfaces/\{persistedFaceId\}' has methods for the following verbs: delete */ + ( + path: "/facelists/{faceListId}/persistedfaces/{persistedFaceId}", + faceListId: string, + persistedFaceId: string, + ): DeleteFaceListFace; + /** Resource for '/largefacelists/\{largeFaceListId\}' has methods for the following verbs: put, delete, get, patch */ + ( + path: "/largefacelists/{largeFaceListId}", + largeFaceListId: string, + ): CreateLargeFaceList; + /** Resource for '/largefacelists' has methods for the following verbs: get */ + (path: "/largefacelists"): GetLargeFaceLists; + /** Resource for '/largefacelists/\{largeFaceListId\}/training' has methods for the following verbs: get */ + ( + path: "/largefacelists/{largeFaceListId}/training", + largeFaceListId: string, + ): GetLargeFaceListTrainingStatus; + /** Resource for '/largefacelists/\{largeFaceListId\}/train' has methods for the following verbs: post */ + ( + path: "/largefacelists/{largeFaceListId}/train", + largeFaceListId: string, + ): TrainLargeFaceList; + /** Resource for '/largefacelists/\{largeFaceListId\}/persistedfaces' has methods for the following verbs: post, get */ + ( + path: "/largefacelists/{largeFaceListId}/persistedfaces", + largeFaceListId: string, + ): AddLargeFaceListFaceFromUrl; + /** Resource for '/largefacelists/\{largeFaceListId\}/persistedfaces/\{persistedFaceId\}' has methods for the following verbs: delete, get, patch */ + ( + path: "/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}", + largeFaceListId: string, + persistedFaceId: string, + ): DeleteLargeFaceListFace; + /** Resource for '/persongroups/\{personGroupId\}' has methods for the following verbs: put, delete, get, patch */ + ( + path: "/persongroups/{personGroupId}", + personGroupId: string, + ): CreatePersonGroup; + /** Resource for '/persongroups' has methods for the following verbs: get */ + (path: "/persongroups"): GetPersonGroups; + /** Resource for '/persongroups/\{personGroupId\}/training' has methods for the following verbs: get */ + ( + path: "/persongroups/{personGroupId}/training", + personGroupId: string, + ): GetPersonGroupTrainingStatus; + /** Resource for '/persongroups/\{personGroupId\}/train' has methods for the following verbs: post */ + ( + path: "/persongroups/{personGroupId}/train", + personGroupId: string, + ): TrainPersonGroup; + /** Resource for '/persongroups/\{personGroupId\}/persons' has methods for the following verbs: post, get */ + ( + path: "/persongroups/{personGroupId}/persons", + personGroupId: string, + ): CreatePersonGroupPerson; + /** Resource for '/persongroups/\{personGroupId\}/persons/\{personId\}' has methods for the following verbs: delete, get, patch */ + ( + path: "/persongroups/{personGroupId}/persons/{personId}", + personGroupId: string, + personId: string, + ): DeletePersonGroupPerson; + /** Resource for '/persongroups/\{personGroupId\}/persons/\{personId\}/persistedfaces' has methods for the following verbs: post */ + ( + path: "/persongroups/{personGroupId}/persons/{personId}/persistedfaces", + personGroupId: string, + personId: string, + ): AddPersonGroupPersonFaceFromUrl; + /** Resource for '/persongroups/\{personGroupId\}/persons/\{personId\}/persistedfaces/\{persistedFaceId\}' has methods for the following verbs: delete, get, patch */ + ( + path: "/persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}", + personGroupId: string, + personId: string, + persistedFaceId: string, + ): DeletePersonGroupPersonFace; + /** Resource for '/largepersongroups/\{largePersonGroupId\}' has methods for the following verbs: put, delete, get, patch */ + ( + path: "/largepersongroups/{largePersonGroupId}", + largePersonGroupId: string, + ): CreateLargePersonGroup; + /** Resource for '/largepersongroups' has methods for the following verbs: get */ + (path: "/largepersongroups"): GetLargePersonGroups; + /** Resource for '/largepersongroups/\{largePersonGroupId\}/training' has methods for the following verbs: get */ + ( + path: "/largepersongroups/{largePersonGroupId}/training", + largePersonGroupId: string, + ): GetLargePersonGroupTrainingStatus; + /** Resource for '/largepersongroups/\{largePersonGroupId\}/train' has methods for the following verbs: post */ + ( + path: "/largepersongroups/{largePersonGroupId}/train", + largePersonGroupId: string, + ): TrainLargePersonGroup; + /** Resource for '/largepersongroups/\{largePersonGroupId\}/persons' has methods for the following verbs: post, get */ + ( + path: "/largepersongroups/{largePersonGroupId}/persons", + largePersonGroupId: string, + ): CreateLargePersonGroupPerson; + /** Resource for '/largepersongroups/\{largePersonGroupId\}/persons/\{personId\}' has methods for the following verbs: delete, get, patch */ + ( + path: "/largepersongroups/{largePersonGroupId}/persons/{personId}", + largePersonGroupId: string, + personId: string, + ): DeleteLargePersonGroupPerson; + /** Resource for '/largepersongroups/\{largePersonGroupId\}/persons/\{personId\}/persistedfaces' has methods for the following verbs: post */ + ( + path: "/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces", + largePersonGroupId: string, + personId: string, + ): AddLargePersonGroupPersonFaceFromUrl; + /** Resource for '/largepersongroups/\{largePersonGroupId\}/persons/\{personId\}/persistedfaces/\{persistedFaceId\}' has methods for the following verbs: delete, get, patch */ + ( + path: "/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}", + largePersonGroupId: string, + personId: string, + persistedFaceId: string, + ): DeleteLargePersonGroupPersonFace; + /** Resource for '/persons' has methods for the following verbs: post, get */ + (path: "/persons"): CreatePerson; + /** Resource for '/persons/\{personId\}' has methods for the following verbs: delete, get, patch */ + (path: "/persons/{personId}", personId: string): DeletePerson; + /** Resource for '/persons/\{personId\}/dynamicPersonGroupReferences' has methods for the following verbs: get */ + ( + path: "/persons/{personId}/dynamicPersonGroupReferences", + personId: string, + ): GetDynamicPersonGroupReferences; + /** Resource for '/persons/\{personId\}/recognitionModels/\{recognitionModel\}/persistedfaces' has methods for the following verbs: post, get */ + ( + path: "/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces", + personId: string, + recognitionModel: RecognitionModel, + ): AddPersonFace; + /** Resource for '/persons/\{personId\}/recognitionModels/\{recognitionModel\}/persistedfaces/\{persistedFaceId\}' has methods for the following verbs: delete, get, patch */ + ( + path: "/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces/{persistedFaceId}", + personId: string, + recognitionModel: RecognitionModel, + persistedFaceId: string, + ): DeletePersonFace; + /** Resource for '/dynamicpersongroups/\{dynamicPersonGroupId\}' has methods for the following verbs: put, delete, get, patch */ + ( + path: "/dynamicpersongroups/{dynamicPersonGroupId}", + dynamicPersonGroupId: string, + ): CreateDynamicPersonGroupWithPerson; + /** Resource for '/dynamicpersongroups' has methods for the following verbs: get */ + (path: "/dynamicpersongroups"): GetDynamicPersonGroups; + /** Resource for '/dynamicpersongroups/\{dynamicPersonGroupId\}/persons' has methods for the following verbs: get */ + ( + path: "/dynamicpersongroups/{dynamicPersonGroupId}/persons", + dynamicPersonGroupId: string, + ): GetDynamicPersonGroupPersons; + /** Resource for '/detectLiveness/singleModal/sessions' has methods for the following verbs: post, get */ + (path: "/detectLiveness/singleModal/sessions"): CreateLivenessSession; + /** Resource for '/detectLiveness/singleModal/sessions/\{sessionId\}' has methods for the following verbs: delete, get */ + ( + path: "/detectLiveness/singleModal/sessions/{sessionId}", + sessionId: string, + ): DeleteLivenessSession; + /** Resource for '/detectLiveness/singleModal/sessions/\{sessionId\}/audit' has methods for the following verbs: get */ + ( + path: "/detectLiveness/singleModal/sessions/{sessionId}/audit", + sessionId: string, + ): GetLivenessSessionAuditEntries; + /** Resource for '/detectLivenessWithVerify/singleModal/sessions' has methods for the following verbs: post, get */ + ( + path: "/detectLivenessWithVerify/singleModal/sessions", + ): CreateLivenessWithVerifySessionWithVerifyImage; + /** Resource for '/detectLivenessWithVerify/singleModal/sessions/\{sessionId\}' has methods for the following verbs: delete, get */ + ( + path: "/detectLivenessWithVerify/singleModal/sessions/{sessionId}", + sessionId: string, + ): DeleteLivenessWithVerifySession; + /** Resource for '/detectLivenessWithVerify/singleModal/sessions/\{sessionId\}/audit' has methods for the following verbs: get */ + ( + path: "/detectLivenessWithVerify/singleModal/sessions/{sessionId}/audit", + sessionId: string, + ): GetLivenessWithVerifySessionAuditEntries; +} + +export type FaceClient = Client & { + path: Routes; +}; diff --git a/sdk/vision/ai-vision-face-rest/src/faceClient.ts b/sdk/vision/ai-vision-face-rest/src/faceClient.ts new file mode 100644 index 000000000000..4a2c70de2fba --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/src/faceClient.ts @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { getClient, ClientOptions } from "@azure-rest/core-client"; +import { logger } from "./logger.js"; +import { TokenCredential, KeyCredential } from "@azure/core-auth"; +import { FaceClient } from "./clientDefinitions.js"; +import { Versions } from "./models.js"; + +export interface FaceClientOptions extends ClientOptions { + apiVersion?: Versions; +} + +/** + * Initialize a new instance of `FaceClient` + * @param endpointParam - Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param credentials - uniquely identify client credential + * @param options - the parameter for all optional parameters + */ +export default function createClient( + endpointParam: string, + credentials: TokenCredential | KeyCredential, + options: FaceClientOptions = {}, +): FaceClient { + const apiVersion = options.apiVersion ?? "v1.1-preview.1"; + const endpointUrl = + options.endpoint ?? + options.baseUrl ?? + `${endpointParam}/face/${apiVersion}`; + + const userAgentInfo = `azsdk-js-ai-vision-face-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://cognitiveservices.azure.com/.default", + ], + apiKeyHeaderName: + options.credentials?.apiKeyHeaderName ?? "Ocp-Apim-Subscription-Key", + }, + }; + + const client = getClient(endpointUrl, credentials, options) as FaceClient; + + client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + + return client; +} diff --git a/sdk/vision/ai-vision-face-rest/src/index.ts b/sdk/vision/ai-vision-face-rest/src/index.ts new file mode 100644 index 000000000000..d0493cbdb979 --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/src/index.ts @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import FaceClient from "./faceClient.js"; + +export * from "./faceClient.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 "./pollingHelper.js"; + +export default FaceClient; diff --git a/sdk/vision/ai-vision-face-rest/src/isUnexpected.ts b/sdk/vision/ai-vision-face-rest/src/isUnexpected.ts new file mode 100644 index 000000000000..1578d548020f --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/src/isUnexpected.ts @@ -0,0 +1,1184 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + GetOperationResult200Response, + GetOperationResultDefaultResponse, + DetectFromUrl200Response, + DetectFromUrlDefaultResponse, + Detect200Response, + DetectDefaultResponse, + FindSimilar200Response, + FindSimilarDefaultResponse, + FindSimilarFromFaceList200Response, + FindSimilarFromFaceListDefaultResponse, + FindSimilarFromLargeFaceList200Response, + FindSimilarFromLargeFaceListDefaultResponse, + IdentifyFromPersonGroup200Response, + IdentifyFromPersonGroupDefaultResponse, + IdentifyFromLargePersonGroup200Response, + IdentifyFromLargePersonGroupDefaultResponse, + IdentifyFromPersonDirectory200Response, + IdentifyFromPersonDirectoryDefaultResponse, + IdentifyFromDynamicPersonGroup200Response, + IdentifyFromDynamicPersonGroupDefaultResponse, + VerifyFaceToFace200Response, + VerifyFaceToFaceDefaultResponse, + VerifyFromPersonGroup200Response, + VerifyFromPersonGroupDefaultResponse, + VerifyFromLargePersonGroup200Response, + VerifyFromLargePersonGroupDefaultResponse, + VerifyFromPersonDirectory200Response, + VerifyFromPersonDirectoryDefaultResponse, + Group200Response, + GroupDefaultResponse, + CreateFaceList200Response, + CreateFaceListDefaultResponse, + DeleteFaceList200Response, + DeleteFaceListDefaultResponse, + GetFaceList200Response, + GetFaceListDefaultResponse, + UpdateFaceList200Response, + UpdateFaceListDefaultResponse, + GetFaceLists200Response, + GetFaceListsDefaultResponse, + AddFaceListFaceFromUrl200Response, + AddFaceListFaceFromUrlDefaultResponse, + AddFaceListFace200Response, + AddFaceListFaceDefaultResponse, + DeleteFaceListFace200Response, + DeleteFaceListFaceDefaultResponse, + CreateLargeFaceList200Response, + CreateLargeFaceListDefaultResponse, + DeleteLargeFaceList200Response, + DeleteLargeFaceListDefaultResponse, + GetLargeFaceList200Response, + GetLargeFaceListDefaultResponse, + UpdateLargeFaceList200Response, + UpdateLargeFaceListDefaultResponse, + GetLargeFaceLists200Response, + GetLargeFaceListsDefaultResponse, + GetLargeFaceListTrainingStatus200Response, + GetLargeFaceListTrainingStatusDefaultResponse, + TrainLargeFaceList202Response, + TrainLargeFaceListLogicalResponse, + TrainLargeFaceListDefaultResponse, + AddLargeFaceListFaceFromUrl200Response, + AddLargeFaceListFaceFromUrlDefaultResponse, + AddLargeFaceListFace200Response, + AddLargeFaceListFaceDefaultResponse, + GetLargeFaceListFaces200Response, + GetLargeFaceListFacesDefaultResponse, + DeleteLargeFaceListFace200Response, + DeleteLargeFaceListFaceDefaultResponse, + GetLargeFaceListFace200Response, + GetLargeFaceListFaceDefaultResponse, + UpdateLargeFaceListFace200Response, + UpdateLargeFaceListFaceDefaultResponse, + CreatePersonGroup200Response, + CreatePersonGroupDefaultResponse, + DeletePersonGroup200Response, + DeletePersonGroupDefaultResponse, + GetPersonGroup200Response, + GetPersonGroupDefaultResponse, + UpdatePersonGroup200Response, + UpdatePersonGroupDefaultResponse, + GetPersonGroups200Response, + GetPersonGroupsDefaultResponse, + GetPersonGroupTrainingStatus200Response, + GetPersonGroupTrainingStatusDefaultResponse, + TrainPersonGroup202Response, + TrainPersonGroupLogicalResponse, + TrainPersonGroupDefaultResponse, + CreatePersonGroupPerson200Response, + CreatePersonGroupPersonDefaultResponse, + GetPersonGroupPersons200Response, + GetPersonGroupPersonsDefaultResponse, + DeletePersonGroupPerson200Response, + DeletePersonGroupPersonDefaultResponse, + GetPersonGroupPerson200Response, + GetPersonGroupPersonDefaultResponse, + UpdatePersonGroupPerson200Response, + UpdatePersonGroupPersonDefaultResponse, + AddPersonGroupPersonFaceFromUrl200Response, + AddPersonGroupPersonFaceFromUrlDefaultResponse, + AddPersonGroupPersonFace200Response, + AddPersonGroupPersonFaceDefaultResponse, + DeletePersonGroupPersonFace200Response, + DeletePersonGroupPersonFaceDefaultResponse, + GetPersonGroupPersonFace200Response, + GetPersonGroupPersonFaceDefaultResponse, + UpdatePersonGroupPersonFace200Response, + UpdatePersonGroupPersonFaceDefaultResponse, + CreateLargePersonGroup200Response, + CreateLargePersonGroupDefaultResponse, + DeleteLargePersonGroup200Response, + DeleteLargePersonGroupDefaultResponse, + GetLargePersonGroup200Response, + GetLargePersonGroupDefaultResponse, + UpdateLargePersonGroup200Response, + UpdateLargePersonGroupDefaultResponse, + GetLargePersonGroups200Response, + GetLargePersonGroupsDefaultResponse, + GetLargePersonGroupTrainingStatus200Response, + GetLargePersonGroupTrainingStatusDefaultResponse, + TrainLargePersonGroup202Response, + TrainLargePersonGroupLogicalResponse, + TrainLargePersonGroupDefaultResponse, + CreateLargePersonGroupPerson200Response, + CreateLargePersonGroupPersonDefaultResponse, + GetLargePersonGroupPersons200Response, + GetLargePersonGroupPersonsDefaultResponse, + DeleteLargePersonGroupPerson200Response, + DeleteLargePersonGroupPersonDefaultResponse, + GetLargePersonGroupPerson200Response, + GetLargePersonGroupPersonDefaultResponse, + UpdateLargePersonGroupPerson200Response, + UpdateLargePersonGroupPersonDefaultResponse, + AddLargePersonGroupPersonFaceFromUrl200Response, + AddLargePersonGroupPersonFaceFromUrlDefaultResponse, + AddLargePersonGroupPersonFace200Response, + AddLargePersonGroupPersonFaceDefaultResponse, + DeleteLargePersonGroupPersonFace200Response, + DeleteLargePersonGroupPersonFaceDefaultResponse, + GetLargePersonGroupPersonFace200Response, + GetLargePersonGroupPersonFaceDefaultResponse, + UpdateLargePersonGroupPersonFace200Response, + UpdateLargePersonGroupPersonFaceDefaultResponse, + CreatePerson202Response, + CreatePersonLogicalResponse, + CreatePersonDefaultResponse, + GetPersons200Response, + GetPersonsDefaultResponse, + DeletePerson202Response, + DeletePersonLogicalResponse, + DeletePersonDefaultResponse, + GetPerson200Response, + GetPersonDefaultResponse, + UpdatePerson200Response, + UpdatePersonDefaultResponse, + GetDynamicPersonGroupReferences200Response, + GetDynamicPersonGroupReferencesDefaultResponse, + AddPersonFace202Response, + AddPersonFaceLogicalResponse, + AddPersonFaceDefaultResponse, + AddPersonFaceFromUrl202Response, + AddPersonFaceFromUrlLogicalResponse, + AddPersonFaceFromUrlDefaultResponse, + GetPersonFaces200Response, + GetPersonFacesDefaultResponse, + DeletePersonFace202Response, + DeletePersonFaceLogicalResponse, + DeletePersonFaceDefaultResponse, + GetPersonFace200Response, + GetPersonFaceDefaultResponse, + UpdatePersonFace200Response, + UpdatePersonFaceDefaultResponse, + CreateDynamicPersonGroupWithPerson202Response, + CreateDynamicPersonGroupWithPersonLogicalResponse, + CreateDynamicPersonGroupWithPersonDefaultResponse, + CreateDynamicPersonGroup200Response, + CreateDynamicPersonGroupDefaultResponse, + DeleteDynamicPersonGroup202Response, + DeleteDynamicPersonGroupLogicalResponse, + DeleteDynamicPersonGroupDefaultResponse, + GetDynamicPersonGroup200Response, + GetDynamicPersonGroupDefaultResponse, + UpdateDynamicPersonGroupWithPersonChanges202Response, + UpdateDynamicPersonGroupWithPersonChangesLogicalResponse, + UpdateDynamicPersonGroupWithPersonChangesDefaultResponse, + UpdateDynamicPersonGroup200Response, + UpdateDynamicPersonGroupDefaultResponse, + GetDynamicPersonGroups200Response, + GetDynamicPersonGroupsDefaultResponse, + GetDynamicPersonGroupPersons200Response, + GetDynamicPersonGroupPersonsDefaultResponse, + CreateLivenessSession200Response, + CreateLivenessSessionDefaultResponse, + GetLivenessSessions200Response, + GetLivenessSessionsDefaultResponse, + DeleteLivenessSession200Response, + DeleteLivenessSessionDefaultResponse, + GetLivenessSessionResult200Response, + GetLivenessSessionResultDefaultResponse, + GetLivenessSessionAuditEntries200Response, + GetLivenessSessionAuditEntriesDefaultResponse, + CreateLivenessWithVerifySessionWithVerifyImage200Response, + CreateLivenessWithVerifySessionWithVerifyImageDefaultResponse, + CreateLivenessWithVerifySession200Response, + CreateLivenessWithVerifySessionDefaultResponse, + GetLivenessWithVerifySessions200Response, + GetLivenessWithVerifySessionsDefaultResponse, + DeleteLivenessWithVerifySession200Response, + DeleteLivenessWithVerifySessionDefaultResponse, + GetLivenessWithVerifySessionResult200Response, + GetLivenessWithVerifySessionResultDefaultResponse, + GetLivenessWithVerifySessionAuditEntries200Response, + GetLivenessWithVerifySessionAuditEntriesDefaultResponse, +} from "./responses.js"; + +const responseMap: Record = { + "GET /operations/{operationId}": ["200"], + "POST /detect": ["200"], + "POST /findsimilars": ["200"], + "POST /identify": ["200"], + "POST /verify": ["200"], + "POST /group": ["200"], + "PUT /facelists/{faceListId}": ["200"], + "DELETE /facelists/{faceListId}": ["200"], + "GET /facelists/{faceListId}": ["200"], + "PATCH /facelists/{faceListId}": ["200"], + "GET /facelists": ["200"], + "POST /facelists/{faceListId}/persistedfaces": ["200"], + "DELETE /facelists/{faceListId}/persistedfaces/{persistedFaceId}": ["200"], + "PUT /largefacelists/{largeFaceListId}": ["200"], + "DELETE /largefacelists/{largeFaceListId}": ["200"], + "GET /largefacelists/{largeFaceListId}": ["200"], + "PATCH /largefacelists/{largeFaceListId}": ["200"], + "GET /largefacelists": ["200"], + "GET /largefacelists/{largeFaceListId}/training": ["200"], + "GET /largefacelists/{largeFaceListId}/train": ["200", "202"], + "POST /largefacelists/{largeFaceListId}/train": ["202"], + "POST /largefacelists/{largeFaceListId}/persistedfaces": ["200"], + "GET /largefacelists/{largeFaceListId}/persistedfaces": ["200"], + "DELETE /largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}": [ + "200", + ], + "GET /largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}": [ + "200", + ], + "PATCH /largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}": [ + "200", + ], + "PUT /persongroups/{personGroupId}": ["200"], + "DELETE /persongroups/{personGroupId}": ["200"], + "GET /persongroups/{personGroupId}": ["200"], + "PATCH /persongroups/{personGroupId}": ["200"], + "GET /persongroups": ["200"], + "GET /persongroups/{personGroupId}/training": ["200"], + "GET /persongroups/{personGroupId}/train": ["200", "202"], + "POST /persongroups/{personGroupId}/train": ["202"], + "POST /persongroups/{personGroupId}/persons": ["200"], + "GET /persongroups/{personGroupId}/persons": ["200"], + "DELETE /persongroups/{personGroupId}/persons/{personId}": ["200"], + "GET /persongroups/{personGroupId}/persons/{personId}": ["200"], + "PATCH /persongroups/{personGroupId}/persons/{personId}": ["200"], + "POST /persongroups/{personGroupId}/persons/{personId}/persistedfaces": [ + "200", + ], + "DELETE /persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}": + ["200"], + "GET /persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}": + ["200"], + "PATCH /persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}": + ["200"], + "PUT /largepersongroups/{largePersonGroupId}": ["200"], + "DELETE /largepersongroups/{largePersonGroupId}": ["200"], + "GET /largepersongroups/{largePersonGroupId}": ["200"], + "PATCH /largepersongroups/{largePersonGroupId}": ["200"], + "GET /largepersongroups": ["200"], + "GET /largepersongroups/{largePersonGroupId}/training": ["200"], + "GET /largepersongroups/{largePersonGroupId}/train": ["200", "202"], + "POST /largepersongroups/{largePersonGroupId}/train": ["202"], + "POST /largepersongroups/{largePersonGroupId}/persons": ["200"], + "GET /largepersongroups/{largePersonGroupId}/persons": ["200"], + "DELETE /largepersongroups/{largePersonGroupId}/persons/{personId}": ["200"], + "GET /largepersongroups/{largePersonGroupId}/persons/{personId}": ["200"], + "PATCH /largepersongroups/{largePersonGroupId}/persons/{personId}": ["200"], + "POST /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces": + ["200"], + "DELETE /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}": + ["200"], + "GET /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}": + ["200"], + "PATCH /largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}": + ["200"], + "GET /persons": ["200"], + "POST /persons": ["202"], + "GET /persons/{personId}": ["200"], + "DELETE /persons/{personId}": ["202"], + "PATCH /persons/{personId}": ["200"], + "GET /persons/{personId}/dynamicPersonGroupReferences": ["200"], + "GET /persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces": + ["200"], + "POST /persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces": + ["202"], + "GET /persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces/{persistedFaceId}": + ["200"], + "DELETE /persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces/{persistedFaceId}": + ["202"], + "PATCH /persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces/{persistedFaceId}": + ["200"], + "GET /dynamicpersongroups/{dynamicPersonGroupId}": ["200"], + "PUT /dynamicpersongroups/{dynamicPersonGroupId}": ["202", "200"], + "DELETE /dynamicpersongroups/{dynamicPersonGroupId}": ["202"], + "PATCH /dynamicpersongroups/{dynamicPersonGroupId}": ["202", "200"], + "GET /dynamicpersongroups": ["200"], + "GET /dynamicpersongroups/{dynamicPersonGroupId}/persons": ["200"], + "POST /detectLiveness/singleModal/sessions": ["200"], + "GET /detectLiveness/singleModal/sessions": ["200"], + "DELETE /detectLiveness/singleModal/sessions/{sessionId}": ["200"], + "GET /detectLiveness/singleModal/sessions/{sessionId}": ["200"], + "GET /detectLiveness/singleModal/sessions/{sessionId}/audit": ["200"], + "POST /detectLivenessWithVerify/singleModal/sessions": ["200"], + "GET /detectLivenessWithVerify/singleModal/sessions": ["200"], + "DELETE /detectLivenessWithVerify/singleModal/sessions/{sessionId}": ["200"], + "GET /detectLivenessWithVerify/singleModal/sessions/{sessionId}": ["200"], + "GET /detectLivenessWithVerify/singleModal/sessions/{sessionId}/audit": [ + "200", + ], +}; + +export function isUnexpected( + response: GetOperationResult200Response | GetOperationResultDefaultResponse, +): response is GetOperationResultDefaultResponse; +export function isUnexpected( + response: DetectFromUrl200Response | DetectFromUrlDefaultResponse, +): response is DetectFromUrlDefaultResponse; +export function isUnexpected( + response: Detect200Response | DetectDefaultResponse, +): response is DetectDefaultResponse; +export function isUnexpected( + response: FindSimilar200Response | FindSimilarDefaultResponse, +): response is FindSimilarDefaultResponse; +export function isUnexpected( + response: + | FindSimilarFromFaceList200Response + | FindSimilarFromFaceListDefaultResponse, +): response is FindSimilarFromFaceListDefaultResponse; +export function isUnexpected( + response: + | FindSimilarFromLargeFaceList200Response + | FindSimilarFromLargeFaceListDefaultResponse, +): response is FindSimilarFromLargeFaceListDefaultResponse; +export function isUnexpected( + response: + | IdentifyFromPersonGroup200Response + | IdentifyFromPersonGroupDefaultResponse, +): response is IdentifyFromPersonGroupDefaultResponse; +export function isUnexpected( + response: + | IdentifyFromLargePersonGroup200Response + | IdentifyFromLargePersonGroupDefaultResponse, +): response is IdentifyFromLargePersonGroupDefaultResponse; +export function isUnexpected( + response: + | IdentifyFromPersonDirectory200Response + | IdentifyFromPersonDirectoryDefaultResponse, +): response is IdentifyFromPersonDirectoryDefaultResponse; +export function isUnexpected( + response: + | IdentifyFromDynamicPersonGroup200Response + | IdentifyFromDynamicPersonGroupDefaultResponse, +): response is IdentifyFromDynamicPersonGroupDefaultResponse; +export function isUnexpected( + response: VerifyFaceToFace200Response | VerifyFaceToFaceDefaultResponse, +): response is VerifyFaceToFaceDefaultResponse; +export function isUnexpected( + response: + | VerifyFromPersonGroup200Response + | VerifyFromPersonGroupDefaultResponse, +): response is VerifyFromPersonGroupDefaultResponse; +export function isUnexpected( + response: + | VerifyFromLargePersonGroup200Response + | VerifyFromLargePersonGroupDefaultResponse, +): response is VerifyFromLargePersonGroupDefaultResponse; +export function isUnexpected( + response: + | VerifyFromPersonDirectory200Response + | VerifyFromPersonDirectoryDefaultResponse, +): response is VerifyFromPersonDirectoryDefaultResponse; +export function isUnexpected( + response: Group200Response | GroupDefaultResponse, +): response is GroupDefaultResponse; +export function isUnexpected( + response: CreateFaceList200Response | CreateFaceListDefaultResponse, +): response is CreateFaceListDefaultResponse; +export function isUnexpected( + response: DeleteFaceList200Response | DeleteFaceListDefaultResponse, +): response is DeleteFaceListDefaultResponse; +export function isUnexpected( + response: GetFaceList200Response | GetFaceListDefaultResponse, +): response is GetFaceListDefaultResponse; +export function isUnexpected( + response: UpdateFaceList200Response | UpdateFaceListDefaultResponse, +): response is UpdateFaceListDefaultResponse; +export function isUnexpected( + response: GetFaceLists200Response | GetFaceListsDefaultResponse, +): response is GetFaceListsDefaultResponse; +export function isUnexpected( + response: + | AddFaceListFaceFromUrl200Response + | AddFaceListFaceFromUrlDefaultResponse, +): response is AddFaceListFaceFromUrlDefaultResponse; +export function isUnexpected( + response: AddFaceListFace200Response | AddFaceListFaceDefaultResponse, +): response is AddFaceListFaceDefaultResponse; +export function isUnexpected( + response: DeleteFaceListFace200Response | DeleteFaceListFaceDefaultResponse, +): response is DeleteFaceListFaceDefaultResponse; +export function isUnexpected( + response: CreateLargeFaceList200Response | CreateLargeFaceListDefaultResponse, +): response is CreateLargeFaceListDefaultResponse; +export function isUnexpected( + response: DeleteLargeFaceList200Response | DeleteLargeFaceListDefaultResponse, +): response is DeleteLargeFaceListDefaultResponse; +export function isUnexpected( + response: GetLargeFaceList200Response | GetLargeFaceListDefaultResponse, +): response is GetLargeFaceListDefaultResponse; +export function isUnexpected( + response: UpdateLargeFaceList200Response | UpdateLargeFaceListDefaultResponse, +): response is UpdateLargeFaceListDefaultResponse; +export function isUnexpected( + response: GetLargeFaceLists200Response | GetLargeFaceListsDefaultResponse, +): response is GetLargeFaceListsDefaultResponse; +export function isUnexpected( + response: + | GetLargeFaceListTrainingStatus200Response + | GetLargeFaceListTrainingStatusDefaultResponse, +): response is GetLargeFaceListTrainingStatusDefaultResponse; +export function isUnexpected( + response: + | TrainLargeFaceList202Response + | TrainLargeFaceListLogicalResponse + | TrainLargeFaceListDefaultResponse, +): response is TrainLargeFaceListDefaultResponse; +export function isUnexpected( + response: + | AddLargeFaceListFaceFromUrl200Response + | AddLargeFaceListFaceFromUrlDefaultResponse, +): response is AddLargeFaceListFaceFromUrlDefaultResponse; +export function isUnexpected( + response: + | AddLargeFaceListFace200Response + | AddLargeFaceListFaceDefaultResponse, +): response is AddLargeFaceListFaceDefaultResponse; +export function isUnexpected( + response: + | GetLargeFaceListFaces200Response + | GetLargeFaceListFacesDefaultResponse, +): response is GetLargeFaceListFacesDefaultResponse; +export function isUnexpected( + response: + | DeleteLargeFaceListFace200Response + | DeleteLargeFaceListFaceDefaultResponse, +): response is DeleteLargeFaceListFaceDefaultResponse; +export function isUnexpected( + response: + | GetLargeFaceListFace200Response + | GetLargeFaceListFaceDefaultResponse, +): response is GetLargeFaceListFaceDefaultResponse; +export function isUnexpected( + response: + | UpdateLargeFaceListFace200Response + | UpdateLargeFaceListFaceDefaultResponse, +): response is UpdateLargeFaceListFaceDefaultResponse; +export function isUnexpected( + response: CreatePersonGroup200Response | CreatePersonGroupDefaultResponse, +): response is CreatePersonGroupDefaultResponse; +export function isUnexpected( + response: DeletePersonGroup200Response | DeletePersonGroupDefaultResponse, +): response is DeletePersonGroupDefaultResponse; +export function isUnexpected( + response: GetPersonGroup200Response | GetPersonGroupDefaultResponse, +): response is GetPersonGroupDefaultResponse; +export function isUnexpected( + response: UpdatePersonGroup200Response | UpdatePersonGroupDefaultResponse, +): response is UpdatePersonGroupDefaultResponse; +export function isUnexpected( + response: GetPersonGroups200Response | GetPersonGroupsDefaultResponse, +): response is GetPersonGroupsDefaultResponse; +export function isUnexpected( + response: + | GetPersonGroupTrainingStatus200Response + | GetPersonGroupTrainingStatusDefaultResponse, +): response is GetPersonGroupTrainingStatusDefaultResponse; +export function isUnexpected( + response: + | TrainPersonGroup202Response + | TrainPersonGroupLogicalResponse + | TrainPersonGroupDefaultResponse, +): response is TrainPersonGroupDefaultResponse; +export function isUnexpected( + response: + | CreatePersonGroupPerson200Response + | CreatePersonGroupPersonDefaultResponse, +): response is CreatePersonGroupPersonDefaultResponse; +export function isUnexpected( + response: + | GetPersonGroupPersons200Response + | GetPersonGroupPersonsDefaultResponse, +): response is GetPersonGroupPersonsDefaultResponse; +export function isUnexpected( + response: + | DeletePersonGroupPerson200Response + | DeletePersonGroupPersonDefaultResponse, +): response is DeletePersonGroupPersonDefaultResponse; +export function isUnexpected( + response: + | GetPersonGroupPerson200Response + | GetPersonGroupPersonDefaultResponse, +): response is GetPersonGroupPersonDefaultResponse; +export function isUnexpected( + response: + | UpdatePersonGroupPerson200Response + | UpdatePersonGroupPersonDefaultResponse, +): response is UpdatePersonGroupPersonDefaultResponse; +export function isUnexpected( + response: + | AddPersonGroupPersonFaceFromUrl200Response + | AddPersonGroupPersonFaceFromUrlDefaultResponse, +): response is AddPersonGroupPersonFaceFromUrlDefaultResponse; +export function isUnexpected( + response: + | AddPersonGroupPersonFace200Response + | AddPersonGroupPersonFaceDefaultResponse, +): response is AddPersonGroupPersonFaceDefaultResponse; +export function isUnexpected( + response: + | DeletePersonGroupPersonFace200Response + | DeletePersonGroupPersonFaceDefaultResponse, +): response is DeletePersonGroupPersonFaceDefaultResponse; +export function isUnexpected( + response: + | GetPersonGroupPersonFace200Response + | GetPersonGroupPersonFaceDefaultResponse, +): response is GetPersonGroupPersonFaceDefaultResponse; +export function isUnexpected( + response: + | UpdatePersonGroupPersonFace200Response + | UpdatePersonGroupPersonFaceDefaultResponse, +): response is UpdatePersonGroupPersonFaceDefaultResponse; +export function isUnexpected( + response: + | CreateLargePersonGroup200Response + | CreateLargePersonGroupDefaultResponse, +): response is CreateLargePersonGroupDefaultResponse; +export function isUnexpected( + response: + | DeleteLargePersonGroup200Response + | DeleteLargePersonGroupDefaultResponse, +): response is DeleteLargePersonGroupDefaultResponse; +export function isUnexpected( + response: GetLargePersonGroup200Response | GetLargePersonGroupDefaultResponse, +): response is GetLargePersonGroupDefaultResponse; +export function isUnexpected( + response: + | UpdateLargePersonGroup200Response + | UpdateLargePersonGroupDefaultResponse, +): response is UpdateLargePersonGroupDefaultResponse; +export function isUnexpected( + response: + | GetLargePersonGroups200Response + | GetLargePersonGroupsDefaultResponse, +): response is GetLargePersonGroupsDefaultResponse; +export function isUnexpected( + response: + | GetLargePersonGroupTrainingStatus200Response + | GetLargePersonGroupTrainingStatusDefaultResponse, +): response is GetLargePersonGroupTrainingStatusDefaultResponse; +export function isUnexpected( + response: + | TrainLargePersonGroup202Response + | TrainLargePersonGroupLogicalResponse + | TrainLargePersonGroupDefaultResponse, +): response is TrainLargePersonGroupDefaultResponse; +export function isUnexpected( + response: + | CreateLargePersonGroupPerson200Response + | CreateLargePersonGroupPersonDefaultResponse, +): response is CreateLargePersonGroupPersonDefaultResponse; +export function isUnexpected( + response: + | GetLargePersonGroupPersons200Response + | GetLargePersonGroupPersonsDefaultResponse, +): response is GetLargePersonGroupPersonsDefaultResponse; +export function isUnexpected( + response: + | DeleteLargePersonGroupPerson200Response + | DeleteLargePersonGroupPersonDefaultResponse, +): response is DeleteLargePersonGroupPersonDefaultResponse; +export function isUnexpected( + response: + | GetLargePersonGroupPerson200Response + | GetLargePersonGroupPersonDefaultResponse, +): response is GetLargePersonGroupPersonDefaultResponse; +export function isUnexpected( + response: + | UpdateLargePersonGroupPerson200Response + | UpdateLargePersonGroupPersonDefaultResponse, +): response is UpdateLargePersonGroupPersonDefaultResponse; +export function isUnexpected( + response: + | AddLargePersonGroupPersonFaceFromUrl200Response + | AddLargePersonGroupPersonFaceFromUrlDefaultResponse, +): response is AddLargePersonGroupPersonFaceFromUrlDefaultResponse; +export function isUnexpected( + response: + | AddLargePersonGroupPersonFace200Response + | AddLargePersonGroupPersonFaceDefaultResponse, +): response is AddLargePersonGroupPersonFaceDefaultResponse; +export function isUnexpected( + response: + | DeleteLargePersonGroupPersonFace200Response + | DeleteLargePersonGroupPersonFaceDefaultResponse, +): response is DeleteLargePersonGroupPersonFaceDefaultResponse; +export function isUnexpected( + response: + | GetLargePersonGroupPersonFace200Response + | GetLargePersonGroupPersonFaceDefaultResponse, +): response is GetLargePersonGroupPersonFaceDefaultResponse; +export function isUnexpected( + response: + | UpdateLargePersonGroupPersonFace200Response + | UpdateLargePersonGroupPersonFaceDefaultResponse, +): response is UpdateLargePersonGroupPersonFaceDefaultResponse; +export function isUnexpected( + response: + | CreatePerson202Response + | CreatePersonLogicalResponse + | CreatePersonDefaultResponse, +): response is CreatePersonDefaultResponse; +export function isUnexpected( + response: GetPersons200Response | GetPersonsDefaultResponse, +): response is GetPersonsDefaultResponse; +export function isUnexpected( + response: + | DeletePerson202Response + | DeletePersonLogicalResponse + | DeletePersonDefaultResponse, +): response is DeletePersonDefaultResponse; +export function isUnexpected( + response: GetPerson200Response | GetPersonDefaultResponse, +): response is GetPersonDefaultResponse; +export function isUnexpected( + response: UpdatePerson200Response | UpdatePersonDefaultResponse, +): response is UpdatePersonDefaultResponse; +export function isUnexpected( + response: + | GetDynamicPersonGroupReferences200Response + | GetDynamicPersonGroupReferencesDefaultResponse, +): response is GetDynamicPersonGroupReferencesDefaultResponse; +export function isUnexpected( + response: + | AddPersonFace202Response + | AddPersonFaceLogicalResponse + | AddPersonFaceDefaultResponse, +): response is AddPersonFaceDefaultResponse; +export function isUnexpected( + response: + | AddPersonFaceFromUrl202Response + | AddPersonFaceFromUrlLogicalResponse + | AddPersonFaceFromUrlDefaultResponse, +): response is AddPersonFaceFromUrlDefaultResponse; +export function isUnexpected( + response: GetPersonFaces200Response | GetPersonFacesDefaultResponse, +): response is GetPersonFacesDefaultResponse; +export function isUnexpected( + response: + | DeletePersonFace202Response + | DeletePersonFaceLogicalResponse + | DeletePersonFaceDefaultResponse, +): response is DeletePersonFaceDefaultResponse; +export function isUnexpected( + response: GetPersonFace200Response | GetPersonFaceDefaultResponse, +): response is GetPersonFaceDefaultResponse; +export function isUnexpected( + response: UpdatePersonFace200Response | UpdatePersonFaceDefaultResponse, +): response is UpdatePersonFaceDefaultResponse; +export function isUnexpected( + response: + | CreateDynamicPersonGroupWithPerson202Response + | CreateDynamicPersonGroupWithPersonLogicalResponse + | CreateDynamicPersonGroupWithPersonDefaultResponse, +): response is CreateDynamicPersonGroupWithPersonDefaultResponse; +export function isUnexpected( + response: + | CreateDynamicPersonGroup200Response + | CreateDynamicPersonGroupDefaultResponse, +): response is CreateDynamicPersonGroupDefaultResponse; +export function isUnexpected( + response: + | DeleteDynamicPersonGroup202Response + | DeleteDynamicPersonGroupLogicalResponse + | DeleteDynamicPersonGroupDefaultResponse, +): response is DeleteDynamicPersonGroupDefaultResponse; +export function isUnexpected( + response: + | GetDynamicPersonGroup200Response + | GetDynamicPersonGroupDefaultResponse, +): response is GetDynamicPersonGroupDefaultResponse; +export function isUnexpected( + response: + | UpdateDynamicPersonGroupWithPersonChanges202Response + | UpdateDynamicPersonGroupWithPersonChangesLogicalResponse + | UpdateDynamicPersonGroupWithPersonChangesDefaultResponse, +): response is UpdateDynamicPersonGroupWithPersonChangesDefaultResponse; +export function isUnexpected( + response: + | UpdateDynamicPersonGroup200Response + | UpdateDynamicPersonGroupDefaultResponse, +): response is UpdateDynamicPersonGroupDefaultResponse; +export function isUnexpected( + response: + | GetDynamicPersonGroups200Response + | GetDynamicPersonGroupsDefaultResponse, +): response is GetDynamicPersonGroupsDefaultResponse; +export function isUnexpected( + response: + | GetDynamicPersonGroupPersons200Response + | GetDynamicPersonGroupPersonsDefaultResponse, +): response is GetDynamicPersonGroupPersonsDefaultResponse; +export function isUnexpected( + response: + | CreateLivenessSession200Response + | CreateLivenessSessionDefaultResponse, +): response is CreateLivenessSessionDefaultResponse; +export function isUnexpected( + response: GetLivenessSessions200Response | GetLivenessSessionsDefaultResponse, +): response is GetLivenessSessionsDefaultResponse; +export function isUnexpected( + response: + | DeleteLivenessSession200Response + | DeleteLivenessSessionDefaultResponse, +): response is DeleteLivenessSessionDefaultResponse; +export function isUnexpected( + response: + | GetLivenessSessionResult200Response + | GetLivenessSessionResultDefaultResponse, +): response is GetLivenessSessionResultDefaultResponse; +export function isUnexpected( + response: + | GetLivenessSessionAuditEntries200Response + | GetLivenessSessionAuditEntriesDefaultResponse, +): response is GetLivenessSessionAuditEntriesDefaultResponse; +export function isUnexpected( + response: + | CreateLivenessWithVerifySessionWithVerifyImage200Response + | CreateLivenessWithVerifySessionWithVerifyImageDefaultResponse, +): response is CreateLivenessWithVerifySessionWithVerifyImageDefaultResponse; +export function isUnexpected( + response: + | CreateLivenessWithVerifySession200Response + | CreateLivenessWithVerifySessionDefaultResponse, +): response is CreateLivenessWithVerifySessionDefaultResponse; +export function isUnexpected( + response: + | GetLivenessWithVerifySessions200Response + | GetLivenessWithVerifySessionsDefaultResponse, +): response is GetLivenessWithVerifySessionsDefaultResponse; +export function isUnexpected( + response: + | DeleteLivenessWithVerifySession200Response + | DeleteLivenessWithVerifySessionDefaultResponse, +): response is DeleteLivenessWithVerifySessionDefaultResponse; +export function isUnexpected( + response: + | GetLivenessWithVerifySessionResult200Response + | GetLivenessWithVerifySessionResultDefaultResponse, +): response is GetLivenessWithVerifySessionResultDefaultResponse; +export function isUnexpected( + response: + | GetLivenessWithVerifySessionAuditEntries200Response + | GetLivenessWithVerifySessionAuditEntriesDefaultResponse, +): response is GetLivenessWithVerifySessionAuditEntriesDefaultResponse; +export function isUnexpected( + response: + | GetOperationResult200Response + | GetOperationResultDefaultResponse + | DetectFromUrl200Response + | DetectFromUrlDefaultResponse + | Detect200Response + | DetectDefaultResponse + | FindSimilar200Response + | FindSimilarDefaultResponse + | FindSimilarFromFaceList200Response + | FindSimilarFromFaceListDefaultResponse + | FindSimilarFromLargeFaceList200Response + | FindSimilarFromLargeFaceListDefaultResponse + | IdentifyFromPersonGroup200Response + | IdentifyFromPersonGroupDefaultResponse + | IdentifyFromLargePersonGroup200Response + | IdentifyFromLargePersonGroupDefaultResponse + | IdentifyFromPersonDirectory200Response + | IdentifyFromPersonDirectoryDefaultResponse + | IdentifyFromDynamicPersonGroup200Response + | IdentifyFromDynamicPersonGroupDefaultResponse + | VerifyFaceToFace200Response + | VerifyFaceToFaceDefaultResponse + | VerifyFromPersonGroup200Response + | VerifyFromPersonGroupDefaultResponse + | VerifyFromLargePersonGroup200Response + | VerifyFromLargePersonGroupDefaultResponse + | VerifyFromPersonDirectory200Response + | VerifyFromPersonDirectoryDefaultResponse + | Group200Response + | GroupDefaultResponse + | CreateFaceList200Response + | CreateFaceListDefaultResponse + | DeleteFaceList200Response + | DeleteFaceListDefaultResponse + | GetFaceList200Response + | GetFaceListDefaultResponse + | UpdateFaceList200Response + | UpdateFaceListDefaultResponse + | GetFaceLists200Response + | GetFaceListsDefaultResponse + | AddFaceListFaceFromUrl200Response + | AddFaceListFaceFromUrlDefaultResponse + | AddFaceListFace200Response + | AddFaceListFaceDefaultResponse + | DeleteFaceListFace200Response + | DeleteFaceListFaceDefaultResponse + | CreateLargeFaceList200Response + | CreateLargeFaceListDefaultResponse + | DeleteLargeFaceList200Response + | DeleteLargeFaceListDefaultResponse + | GetLargeFaceList200Response + | GetLargeFaceListDefaultResponse + | UpdateLargeFaceList200Response + | UpdateLargeFaceListDefaultResponse + | GetLargeFaceLists200Response + | GetLargeFaceListsDefaultResponse + | GetLargeFaceListTrainingStatus200Response + | GetLargeFaceListTrainingStatusDefaultResponse + | TrainLargeFaceList202Response + | TrainLargeFaceListLogicalResponse + | TrainLargeFaceListDefaultResponse + | AddLargeFaceListFaceFromUrl200Response + | AddLargeFaceListFaceFromUrlDefaultResponse + | AddLargeFaceListFace200Response + | AddLargeFaceListFaceDefaultResponse + | GetLargeFaceListFaces200Response + | GetLargeFaceListFacesDefaultResponse + | DeleteLargeFaceListFace200Response + | DeleteLargeFaceListFaceDefaultResponse + | GetLargeFaceListFace200Response + | GetLargeFaceListFaceDefaultResponse + | UpdateLargeFaceListFace200Response + | UpdateLargeFaceListFaceDefaultResponse + | CreatePersonGroup200Response + | CreatePersonGroupDefaultResponse + | DeletePersonGroup200Response + | DeletePersonGroupDefaultResponse + | GetPersonGroup200Response + | GetPersonGroupDefaultResponse + | UpdatePersonGroup200Response + | UpdatePersonGroupDefaultResponse + | GetPersonGroups200Response + | GetPersonGroupsDefaultResponse + | GetPersonGroupTrainingStatus200Response + | GetPersonGroupTrainingStatusDefaultResponse + | TrainPersonGroup202Response + | TrainPersonGroupLogicalResponse + | TrainPersonGroupDefaultResponse + | CreatePersonGroupPerson200Response + | CreatePersonGroupPersonDefaultResponse + | GetPersonGroupPersons200Response + | GetPersonGroupPersonsDefaultResponse + | DeletePersonGroupPerson200Response + | DeletePersonGroupPersonDefaultResponse + | GetPersonGroupPerson200Response + | GetPersonGroupPersonDefaultResponse + | UpdatePersonGroupPerson200Response + | UpdatePersonGroupPersonDefaultResponse + | AddPersonGroupPersonFaceFromUrl200Response + | AddPersonGroupPersonFaceFromUrlDefaultResponse + | AddPersonGroupPersonFace200Response + | AddPersonGroupPersonFaceDefaultResponse + | DeletePersonGroupPersonFace200Response + | DeletePersonGroupPersonFaceDefaultResponse + | GetPersonGroupPersonFace200Response + | GetPersonGroupPersonFaceDefaultResponse + | UpdatePersonGroupPersonFace200Response + | UpdatePersonGroupPersonFaceDefaultResponse + | CreateLargePersonGroup200Response + | CreateLargePersonGroupDefaultResponse + | DeleteLargePersonGroup200Response + | DeleteLargePersonGroupDefaultResponse + | GetLargePersonGroup200Response + | GetLargePersonGroupDefaultResponse + | UpdateLargePersonGroup200Response + | UpdateLargePersonGroupDefaultResponse + | GetLargePersonGroups200Response + | GetLargePersonGroupsDefaultResponse + | GetLargePersonGroupTrainingStatus200Response + | GetLargePersonGroupTrainingStatusDefaultResponse + | TrainLargePersonGroup202Response + | TrainLargePersonGroupLogicalResponse + | TrainLargePersonGroupDefaultResponse + | CreateLargePersonGroupPerson200Response + | CreateLargePersonGroupPersonDefaultResponse + | GetLargePersonGroupPersons200Response + | GetLargePersonGroupPersonsDefaultResponse + | DeleteLargePersonGroupPerson200Response + | DeleteLargePersonGroupPersonDefaultResponse + | GetLargePersonGroupPerson200Response + | GetLargePersonGroupPersonDefaultResponse + | UpdateLargePersonGroupPerson200Response + | UpdateLargePersonGroupPersonDefaultResponse + | AddLargePersonGroupPersonFaceFromUrl200Response + | AddLargePersonGroupPersonFaceFromUrlDefaultResponse + | AddLargePersonGroupPersonFace200Response + | AddLargePersonGroupPersonFaceDefaultResponse + | DeleteLargePersonGroupPersonFace200Response + | DeleteLargePersonGroupPersonFaceDefaultResponse + | GetLargePersonGroupPersonFace200Response + | GetLargePersonGroupPersonFaceDefaultResponse + | UpdateLargePersonGroupPersonFace200Response + | UpdateLargePersonGroupPersonFaceDefaultResponse + | CreatePerson202Response + | CreatePersonLogicalResponse + | CreatePersonDefaultResponse + | GetPersons200Response + | GetPersonsDefaultResponse + | DeletePerson202Response + | DeletePersonLogicalResponse + | DeletePersonDefaultResponse + | GetPerson200Response + | GetPersonDefaultResponse + | UpdatePerson200Response + | UpdatePersonDefaultResponse + | GetDynamicPersonGroupReferences200Response + | GetDynamicPersonGroupReferencesDefaultResponse + | AddPersonFace202Response + | AddPersonFaceLogicalResponse + | AddPersonFaceDefaultResponse + | AddPersonFaceFromUrl202Response + | AddPersonFaceFromUrlLogicalResponse + | AddPersonFaceFromUrlDefaultResponse + | GetPersonFaces200Response + | GetPersonFacesDefaultResponse + | DeletePersonFace202Response + | DeletePersonFaceLogicalResponse + | DeletePersonFaceDefaultResponse + | GetPersonFace200Response + | GetPersonFaceDefaultResponse + | UpdatePersonFace200Response + | UpdatePersonFaceDefaultResponse + | CreateDynamicPersonGroupWithPerson202Response + | CreateDynamicPersonGroupWithPersonLogicalResponse + | CreateDynamicPersonGroupWithPersonDefaultResponse + | CreateDynamicPersonGroup200Response + | CreateDynamicPersonGroupDefaultResponse + | DeleteDynamicPersonGroup202Response + | DeleteDynamicPersonGroupLogicalResponse + | DeleteDynamicPersonGroupDefaultResponse + | GetDynamicPersonGroup200Response + | GetDynamicPersonGroupDefaultResponse + | UpdateDynamicPersonGroupWithPersonChanges202Response + | UpdateDynamicPersonGroupWithPersonChangesLogicalResponse + | UpdateDynamicPersonGroupWithPersonChangesDefaultResponse + | UpdateDynamicPersonGroup200Response + | UpdateDynamicPersonGroupDefaultResponse + | GetDynamicPersonGroups200Response + | GetDynamicPersonGroupsDefaultResponse + | GetDynamicPersonGroupPersons200Response + | GetDynamicPersonGroupPersonsDefaultResponse + | CreateLivenessSession200Response + | CreateLivenessSessionDefaultResponse + | GetLivenessSessions200Response + | GetLivenessSessionsDefaultResponse + | DeleteLivenessSession200Response + | DeleteLivenessSessionDefaultResponse + | GetLivenessSessionResult200Response + | GetLivenessSessionResultDefaultResponse + | GetLivenessSessionAuditEntries200Response + | GetLivenessSessionAuditEntriesDefaultResponse + | CreateLivenessWithVerifySessionWithVerifyImage200Response + | CreateLivenessWithVerifySessionWithVerifyImageDefaultResponse + | CreateLivenessWithVerifySession200Response + | CreateLivenessWithVerifySessionDefaultResponse + | GetLivenessWithVerifySessions200Response + | GetLivenessWithVerifySessionsDefaultResponse + | DeleteLivenessWithVerifySession200Response + | DeleteLivenessWithVerifySessionDefaultResponse + | GetLivenessWithVerifySessionResult200Response + | GetLivenessWithVerifySessionResultDefaultResponse + | GetLivenessWithVerifySessionAuditEntries200Response + | GetLivenessWithVerifySessionAuditEntriesDefaultResponse, +): response is + | GetOperationResultDefaultResponse + | DetectFromUrlDefaultResponse + | DetectDefaultResponse + | FindSimilarDefaultResponse + | FindSimilarFromFaceListDefaultResponse + | FindSimilarFromLargeFaceListDefaultResponse + | IdentifyFromPersonGroupDefaultResponse + | IdentifyFromLargePersonGroupDefaultResponse + | IdentifyFromPersonDirectoryDefaultResponse + | IdentifyFromDynamicPersonGroupDefaultResponse + | VerifyFaceToFaceDefaultResponse + | VerifyFromPersonGroupDefaultResponse + | VerifyFromLargePersonGroupDefaultResponse + | VerifyFromPersonDirectoryDefaultResponse + | GroupDefaultResponse + | CreateFaceListDefaultResponse + | DeleteFaceListDefaultResponse + | GetFaceListDefaultResponse + | UpdateFaceListDefaultResponse + | GetFaceListsDefaultResponse + | AddFaceListFaceFromUrlDefaultResponse + | AddFaceListFaceDefaultResponse + | DeleteFaceListFaceDefaultResponse + | CreateLargeFaceListDefaultResponse + | DeleteLargeFaceListDefaultResponse + | GetLargeFaceListDefaultResponse + | UpdateLargeFaceListDefaultResponse + | GetLargeFaceListsDefaultResponse + | GetLargeFaceListTrainingStatusDefaultResponse + | TrainLargeFaceListDefaultResponse + | AddLargeFaceListFaceFromUrlDefaultResponse + | AddLargeFaceListFaceDefaultResponse + | GetLargeFaceListFacesDefaultResponse + | DeleteLargeFaceListFaceDefaultResponse + | GetLargeFaceListFaceDefaultResponse + | UpdateLargeFaceListFaceDefaultResponse + | CreatePersonGroupDefaultResponse + | DeletePersonGroupDefaultResponse + | GetPersonGroupDefaultResponse + | UpdatePersonGroupDefaultResponse + | GetPersonGroupsDefaultResponse + | GetPersonGroupTrainingStatusDefaultResponse + | TrainPersonGroupDefaultResponse + | CreatePersonGroupPersonDefaultResponse + | GetPersonGroupPersonsDefaultResponse + | DeletePersonGroupPersonDefaultResponse + | GetPersonGroupPersonDefaultResponse + | UpdatePersonGroupPersonDefaultResponse + | AddPersonGroupPersonFaceFromUrlDefaultResponse + | AddPersonGroupPersonFaceDefaultResponse + | DeletePersonGroupPersonFaceDefaultResponse + | GetPersonGroupPersonFaceDefaultResponse + | UpdatePersonGroupPersonFaceDefaultResponse + | CreateLargePersonGroupDefaultResponse + | DeleteLargePersonGroupDefaultResponse + | GetLargePersonGroupDefaultResponse + | UpdateLargePersonGroupDefaultResponse + | GetLargePersonGroupsDefaultResponse + | GetLargePersonGroupTrainingStatusDefaultResponse + | TrainLargePersonGroupDefaultResponse + | CreateLargePersonGroupPersonDefaultResponse + | GetLargePersonGroupPersonsDefaultResponse + | DeleteLargePersonGroupPersonDefaultResponse + | GetLargePersonGroupPersonDefaultResponse + | UpdateLargePersonGroupPersonDefaultResponse + | AddLargePersonGroupPersonFaceFromUrlDefaultResponse + | AddLargePersonGroupPersonFaceDefaultResponse + | DeleteLargePersonGroupPersonFaceDefaultResponse + | GetLargePersonGroupPersonFaceDefaultResponse + | UpdateLargePersonGroupPersonFaceDefaultResponse + | CreatePersonDefaultResponse + | GetPersonsDefaultResponse + | DeletePersonDefaultResponse + | GetPersonDefaultResponse + | UpdatePersonDefaultResponse + | GetDynamicPersonGroupReferencesDefaultResponse + | AddPersonFaceDefaultResponse + | AddPersonFaceFromUrlDefaultResponse + | GetPersonFacesDefaultResponse + | DeletePersonFaceDefaultResponse + | GetPersonFaceDefaultResponse + | UpdatePersonFaceDefaultResponse + | CreateDynamicPersonGroupWithPersonDefaultResponse + | CreateDynamicPersonGroupDefaultResponse + | DeleteDynamicPersonGroupDefaultResponse + | GetDynamicPersonGroupDefaultResponse + | UpdateDynamicPersonGroupWithPersonChangesDefaultResponse + | UpdateDynamicPersonGroupDefaultResponse + | GetDynamicPersonGroupsDefaultResponse + | GetDynamicPersonGroupPersonsDefaultResponse + | CreateLivenessSessionDefaultResponse + | GetLivenessSessionsDefaultResponse + | DeleteLivenessSessionDefaultResponse + | GetLivenessSessionResultDefaultResponse + | GetLivenessSessionAuditEntriesDefaultResponse + | CreateLivenessWithVerifySessionWithVerifyImageDefaultResponse + | CreateLivenessWithVerifySessionDefaultResponse + | GetLivenessWithVerifySessionsDefaultResponse + | DeleteLivenessWithVerifySessionDefaultResponse + | GetLivenessWithVerifySessionResultDefaultResponse + | GetLivenessWithVerifySessionAuditEntriesDefaultResponse { + 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/vision/ai-vision-face-rest/src/logger.ts b/sdk/vision/ai-vision-face-rest/src/logger.ts new file mode 100644 index 000000000000..8ed216c08f33 --- /dev/null +++ b/sdk/vision/ai-vision-face-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("ai-vision-face"); diff --git a/sdk/vision/ai-vision-face-rest/src/models.ts b/sdk/vision/ai-vision-face-rest/src/models.ts new file mode 100644 index 000000000000..3ca48332ad04 --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/src/models.ts @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** Request for creating liveness session. */ +export interface CreateLivenessSessionContent { + /** Type of liveness mode the client should follow. */ + livenessOperationMode: LivenessOperationMode; + /** Whether or not to allow a '200 - Success' response body to be sent to the client, which may be undesirable for security reasons. Default is false, clients will receive a '204 - NoContent' empty body response. Regardless of selection, calling Session GetResult will always contain a response body enabling business logic to be implemented. */ + sendResultsToClient?: boolean; + /** Whether or not to allow client to set their own 'deviceCorrelationId' via the Vision SDK. Default is false, and 'deviceCorrelationId' must be set in this request body. */ + deviceCorrelationIdSetInClient?: boolean; + /** Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null. */ + deviceCorrelationId?: string; + /** Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. */ + authTokenTimeToLiveInSeconds?: number; +} + +export interface CreateLivenessWithVerifySessionContentParametersPartDescriptor { + name: "Parameters"; + body: CreateLivenessSessionContent; +} + +export interface CreateLivenessWithVerifySessionContentVerifyImagePartDescriptor { + name: "VerifyImage"; + body: + | string + | Uint8Array + | ReadableStream + | NodeJS.ReadableStream + | File; + filename?: string; + contentType?: string; +} + +/** Alias for DetectionModel */ +export type DetectionModel = + | string + | "detection_01" + | "detection_02" + | "detection_03"; +/** Alias for RecognitionModel */ +export type RecognitionModel = + | string + | "recognition_01" + | "recognition_02" + | "recognition_03" + | "recognition_04"; +/** Alias for FaceAttributeType */ +export type FaceAttributeType = + | string + | "headPose" + | "glasses" + | "occlusion" + | "accessories" + | "blur" + | "exposure" + | "noise" + | "mask" + | "qualityForRecognition" + | "age" + | "smile" + | "facialHair" + | "hair"; +/** Alias for FindSimilarMatchMode */ +export type FindSimilarMatchMode = string | "matchPerson" | "matchFace"; +/** Alias for LivenessOperationMode */ +export type LivenessOperationMode = string | "Passive"; +/** Request of liveness with verify session creation. */ +export type CreateLivenessWithVerifySessionContent = + | FormData + | Array< + | CreateLivenessWithVerifySessionContentParametersPartDescriptor + | CreateLivenessWithVerifySessionContentVerifyImagePartDescriptor + >; +/** API versions for Azure AI Face API. */ +export type Versions = "v1.1-preview.1"; diff --git a/sdk/vision/ai-vision-face-rest/src/outputModels.ts b/sdk/vision/ai-vision-face-rest/src/outputModels.ts new file mode 100644 index 000000000000..1b143df430fa --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/src/outputModels.ts @@ -0,0 +1,711 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** Long running operation resource for person directory. */ +export interface OperationResultOutput { + /** Operation ID of the operation. */ + readonly operationId: string; + /** Current status of the operation. */ + status: OperationStatusOutput; + /** Date and time the operation was created. */ + createdTime: string; + /** Date and time the operation was last updated. */ + lastActionTime?: string; + /** Date and time the operation was finished. */ + finishedTime?: string; + /** Message for the operation. */ + message?: string; +} + +/** A response containing error details. */ +export interface FaceErrorResponseOutput { + /** The error object. */ + error: FaceErrorOutput; +} + +/** The error object. For comprehensive details on error codes and messages returned by the Face Service, please refer to the following link: https://aka.ms/face-error-codes-and-messages. */ +export interface FaceErrorOutput { + /** One of a server-defined set of error codes. */ + code: string; + /** A human-readable representation of the error. */ + message: string; +} + +/** Response for detect API. */ +export interface FaceDetectionResultOutput { + /** Unique faceId of the detected face, created by detection API and it will expire 24 hours after the detection call. To return this, it requires 'returnFaceId' parameter to be true. */ + faceId?: string; + /** The 'recognitionModel' associated with this faceId. This is only returned when 'returnRecognitionModel' is explicitly set as true. */ + recognitionModel?: RecognitionModelOutput; + /** A rectangle area for the face location on image. */ + faceRectangle: FaceRectangleOutput; + /** An array of 27-point face landmarks pointing to the important positions of face components. To return this, it requires 'returnFaceLandmarks' parameter to be true. */ + faceLandmarks?: FaceLandmarksOutput; + /** Face attributes for detected face. */ + faceAttributes?: FaceAttributesOutput; +} + +/** A rectangle within which a face can be found. */ +export interface FaceRectangleOutput { + /** The distance from the top edge if the image to the top edge of the rectangle, in pixels. */ + top: number; + /** The distance from the left edge if the image to the left edge of the rectangle, in pixels. */ + left: number; + /** The width of the rectangle, in pixels. */ + width: number; + /** The height of the rectangle, in pixels. */ + height: number; +} + +/** A collection of 27-point face landmarks pointing to the important positions of face components. */ +export interface FaceLandmarksOutput { + /** The coordinates of the left eye pupil. */ + pupilLeft: LandmarkCoordinateOutput; + /** The coordinates of the right eye pupil. */ + pupilRight: LandmarkCoordinateOutput; + /** The coordinates of the nose tip. */ + noseTip: LandmarkCoordinateOutput; + /** The coordinates of the mouth left. */ + mouthLeft: LandmarkCoordinateOutput; + /** The coordinates of the mouth right. */ + mouthRight: LandmarkCoordinateOutput; + /** The coordinates of the left eyebrow outer. */ + eyebrowLeftOuter: LandmarkCoordinateOutput; + /** The coordinates of the left eyebrow inner. */ + eyebrowLeftInner: LandmarkCoordinateOutput; + /** The coordinates of the left eye outer. */ + eyeLeftOuter: LandmarkCoordinateOutput; + /** The coordinates of the left eye top. */ + eyeLeftTop: LandmarkCoordinateOutput; + /** The coordinates of the left eye bottom. */ + eyeLeftBottom: LandmarkCoordinateOutput; + /** The coordinates of the left eye inner. */ + eyeLeftInner: LandmarkCoordinateOutput; + /** The coordinates of the right eyebrow inner. */ + eyebrowRightInner: LandmarkCoordinateOutput; + /** The coordinates of the right eyebrow outer. */ + eyebrowRightOuter: LandmarkCoordinateOutput; + /** The coordinates of the right eye inner. */ + eyeRightInner: LandmarkCoordinateOutput; + /** The coordinates of the right eye top. */ + eyeRightTop: LandmarkCoordinateOutput; + /** The coordinates of the right eye bottom. */ + eyeRightBottom: LandmarkCoordinateOutput; + /** The coordinates of the right eye outer. */ + eyeRightOuter: LandmarkCoordinateOutput; + /** The coordinates of the nose root left. */ + noseRootLeft: LandmarkCoordinateOutput; + /** The coordinates of the nose root right. */ + noseRootRight: LandmarkCoordinateOutput; + /** The coordinates of the nose left alar top. */ + noseLeftAlarTop: LandmarkCoordinateOutput; + /** The coordinates of the nose right alar top. */ + noseRightAlarTop: LandmarkCoordinateOutput; + /** The coordinates of the nose left alar out tip. */ + noseLeftAlarOutTip: LandmarkCoordinateOutput; + /** The coordinates of the nose right alar out tip. */ + noseRightAlarOutTip: LandmarkCoordinateOutput; + /** The coordinates of the upper lip top. */ + upperLipTop: LandmarkCoordinateOutput; + /** The coordinates of the upper lip bottom. */ + upperLipBottom: LandmarkCoordinateOutput; + /** The coordinates of the under lip top. */ + underLipTop: LandmarkCoordinateOutput; + /** The coordinates of the under lip bottom. */ + underLipBottom: LandmarkCoordinateOutput; +} + +/** Landmark coordinates within an image. */ +export interface LandmarkCoordinateOutput { + /** The horizontal component, in pixels. */ + x: number; + /** The vertical component, in pixels. */ + y: number; +} + +/** Face attributes for the detected face. */ +export interface FaceAttributesOutput { + /** Age in years. */ + age?: number; + /** Smile intensity, a number between [0,1]. */ + smile?: number; + /** Properties describing facial hair attributes. */ + facialHair?: FacialHairOutput; + /** Glasses type if any of the face. */ + glasses?: GlassesTypeOutput; + /** 3-D roll/yaw/pitch angles for face direction. */ + headPose?: HeadPoseOutput; + /** Properties describing hair attributes. */ + hair?: HairPropertiesOutput; + /** Properties describing occlusions on a given face. */ + occlusion?: OcclusionPropertiesOutput; + /** Properties describing any accessories on a given face. */ + accessories?: Array; + /** Properties describing any presence of blur within the image. */ + blur?: BlurPropertiesOutput; + /** Properties describing exposure level of the image. */ + exposure?: ExposurePropertiesOutput; + /** Properties describing noise level of the image. */ + noise?: NoisePropertiesOutput; + /** Properties describing the presence of a mask on a given face. */ + mask?: MaskPropertiesOutput; + /** Properties describing the overall image quality regarding whether the image being used in the detection is of sufficient quality to attempt face recognition on. */ + qualityForRecognition?: QualityForRecognitionOutput; +} + +/** Properties describing facial hair attributes. */ +export interface FacialHairOutput { + /** A number ranging from 0 to 1 indicating a level of confidence associated with a property. */ + moustache: number; + /** A number ranging from 0 to 1 indicating a level of confidence associated with a property. */ + beard: number; + /** A number ranging from 0 to 1 indicating a level of confidence associated with a property. */ + sideburns: number; +} + +/** 3-D roll/yaw/pitch angles for face direction. */ +export interface HeadPoseOutput { + /** Value of angles. */ + pitch: number; + /** Value of angles. */ + roll: number; + /** Value of angles. */ + yaw: number; +} + +/** Properties describing hair attributes. */ +export interface HairPropertiesOutput { + /** A number describing confidence level of whether the person is bald. */ + bald: number; + /** A boolean value describing whether the hair is visible in the image. */ + invisible: boolean; + /** An array of candidate colors and confidence level in the presence of each. */ + hairColor: Array; +} + +/** An array of candidate colors and confidence level in the presence of each. */ +export interface HairColorOutput { + /** Name of the hair color. */ + color: HairColorTypeOutput; + /** Confidence level of the color. Range between [0,1]. */ + confidence: number; +} + +/** Properties describing occlusions on a given face. */ +export interface OcclusionPropertiesOutput { + /** A boolean value indicating whether forehead is occluded. */ + foreheadOccluded: boolean; + /** A boolean value indicating whether eyes are occluded. */ + eyeOccluded: boolean; + /** A boolean value indicating whether the mouth is occluded. */ + mouthOccluded: boolean; +} + +/** Accessory item and corresponding confidence level. */ +export interface AccessoryItemOutput { + /** Type of the accessory. */ + type: AccessoryTypeOutput; + /** Confidence level of the accessory type. Range between [0,1]. */ + confidence: number; +} + +/** Properties describing any presence of blur within the image. */ +export interface BlurPropertiesOutput { + /** An enum value indicating level of blurriness. */ + blurLevel: BlurLevelOutput; + /** A number indicating level of blurriness ranging from 0 to 1. */ + value: number; +} + +/** Properties describing exposure level of the image. */ +export interface ExposurePropertiesOutput { + /** An enum value indicating level of exposure. */ + exposureLevel: ExposureLevelOutput; + /** A number indicating level of exposure level ranging from 0 to 1. [0, 0.25) is under exposure. [0.25, 0.75) is good exposure. [0.75, 1] is over exposure. */ + value: number; +} + +/** Properties describing noise level of the image. */ +export interface NoisePropertiesOutput { + /** An enum value indicating level of noise. */ + noiseLevel: NoiseLevelOutput; + /** A number indicating level of noise level ranging from 0 to 1. [0, 0.25) is under exposure. [0.25, 0.75) is good exposure. [0.75, 1] is over exposure. [0, 0.3) is low noise level. [0.3, 0.7) is medium noise level. [0.7, 1] is high noise level. */ + value: number; +} + +/** Properties describing the presence of a mask on a given face. */ +export interface MaskPropertiesOutput { + /** A boolean value indicating whether nose and mouth are covered. */ + noseAndMouthCovered: boolean; + /** Type of the mask. */ + type: MaskTypeOutput; +} + +/** Response body for find similar face operation. */ +export interface FindSimilarResultOutput { + /** Confidence value of the candidate. The higher confidence, the more similar. Range between [0,1]. */ + confidence: number; + /** faceId of candidate face when find by faceIds. faceId is created by "Detect" and will expire 24 hours after the detection call. */ + faceId?: string; + /** persistedFaceId of candidate face when find by faceListId or largeFaceListId. persistedFaceId in face list/large face list is persisted and will not expire. */ + persistedFaceId?: string; +} + +/** Identify result. */ +export interface IdentificationResultOutput { + /** faceId of the query face. */ + faceId: string; + /** Identified person candidates for that face (ranked by confidence). Array size should be no larger than input maxNumOfCandidatesReturned. If no person is identified, will return an empty array. */ + candidates: Array; +} + +/** Candidate for identify call. */ +export interface IdentificationCandidateOutput { + /** personId of candidate person. */ + personId: string; + /** Confidence value of the candidate. The higher confidence, the more similar. Range between [0,1]. */ + confidence: number; +} + +/** Verify result. */ +export interface VerificationResultOutput { + /** True if the two faces belong to the same person or the face belongs to the person, otherwise false. */ + isIdentical: boolean; + /** A number indicates the similarity confidence of whether two faces belong to the same person, or whether the face belongs to the person. By default, isIdentical is set to True if similarity confidence is greater than or equal to 0.5. This is useful for advanced users to override 'isIdentical' and fine-tune the result on their own data. */ + confidence: number; +} + +/** Response body for group face operation. */ +export interface GroupingResultOutput { + /** A partition of the original faces based on face similarity. Groups are ranked by number of faces. */ + groups: string[][]; + /** Face ids array of faces that cannot find any similar faces from original faces. */ + messyGroup: string[]; +} + +/** Face list is a list of faces, up to 1,000 faces. */ +export interface FaceListOutput { + /** User defined name, maximum length is 128. */ + name: string; + /** Optional user defined data. Length should not exceed 16K. */ + userData?: string; + /** Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds. */ + recognitionModel?: RecognitionModelOutput; + /** Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. */ + readonly faceListId: string; + /** Face ids of registered faces in the face list. */ + persistedFaces?: Array; +} + +/** Face resource for face list. */ +export interface FaceListFaceOutput { + /** Face ID of the face. */ + readonly persistedFaceId: string; + /** User-provided data attached to the face. The length limit is 1K. */ + userData?: string; +} + +/** Face list item for list face list. */ +export interface FaceListItemOutput { + /** User defined name, maximum length is 128. */ + name: string; + /** Optional user defined data. Length should not exceed 16K. */ + userData?: string; + /** Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds. */ + recognitionModel?: RecognitionModelOutput; + /** Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. */ + faceListId: string; +} + +/** Response body for adding face. */ +export interface AddFaceResultOutput { + /** Persisted Face ID of the added face, which is persisted and will not expire. Different from faceId which is created in "Detect" and will expire in 24 hours after the detection call. */ + persistedFaceId: string; +} + +/** Large face list is a list of faces, up to 1,000,000 faces. */ +export interface LargeFaceListOutput { + /** User defined name, maximum length is 128. */ + name: string; + /** Optional user defined data. Length should not exceed 16K. */ + userData?: string; + /** Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds. */ + recognitionModel?: RecognitionModelOutput; + /** Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. */ + readonly largeFaceListId: string; +} + +/** Training result of a container */ +export interface TrainingResultOutput { + /** Training status of the container. */ + status: OperationStatusOutput; + /** A combined UTC date and time string that describes the created time of the person group, large person group or large face list. */ + createdDateTime: string; + /** A combined UTC date and time string that describes the last modify time of the person group, large person group or large face list, could be null value when the group is not successfully trained. */ + lastActionDateTime: string; + /** A combined UTC date and time string that describes the last successful training time of the person group, large person group or large face list. */ + lastSuccessfulTrainingDateTime: string; + /** Show failure message when training failed (omitted when training succeed). */ + message?: string; +} + +/** Face resource for large face list. */ +export interface LargeFaceListFaceOutput { + /** Face ID of the face. */ + readonly persistedFaceId: string; + /** User-provided data attached to the face. The length limit is 1K. */ + userData?: string; +} + +/** The container of the uploaded person data, including face recognition feature, and up to 10,000 persons. To handle larger scale face identification problem, please consider using Large Person Group. */ +export interface PersonGroupOutput { + /** User defined name, maximum length is 128. */ + name: string; + /** Optional user defined data. Length should not exceed 16K. */ + userData?: string; + /** Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds. */ + recognitionModel?: RecognitionModelOutput; + /** ID of the container. */ + readonly personGroupId: string; +} + +/** Response of create person. */ +export interface CreatePersonResultOutput { + /** Person ID of the person. */ + personId: string; +} + +/** The person in a specified person group. To add face to this person, please call "Add Large Person Group Person Face". */ +export interface PersonGroupPersonOutput { + /** ID of the person. */ + readonly personId: string; + /** User defined name, maximum length is 128. */ + name: string; + /** Optional user defined data. Length should not exceed 16K. */ + userData?: string; + /** Face ids of registered faces in the person. */ + persistedFaceIds?: string[]; +} + +/** Face resource for person group person. */ +export interface PersonGroupPersonFaceOutput { + /** Face ID of the face. */ + readonly persistedFaceId: string; + /** User-provided data attached to the face. The length limit is 1K. */ + userData?: string; +} + +/** The container of the uploaded person data, including face recognition feature, and up to 1,000,000 people. */ +export interface LargePersonGroupOutput { + /** User defined name, maximum length is 128. */ + name: string; + /** Optional user defined data. Length should not exceed 16K. */ + userData?: string; + /** Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds. */ + recognitionModel?: RecognitionModelOutput; + /** ID of the container. */ + readonly largePersonGroupId: string; +} + +/** The person in a specified large person group. To add face to this person, please call "Add Large Person Group Person Face". */ +export interface LargePersonGroupPersonOutput { + /** ID of the person. */ + readonly personId: string; + /** User defined name, maximum length is 128. */ + name: string; + /** Optional user defined data. Length should not exceed 16K. */ + userData?: string; + /** Face ids of registered faces in the person. */ + persistedFaceIds?: string[]; +} + +/** Face resource for large person group person. */ +export interface LargePersonGroupPersonFaceOutput { + /** Face ID of the face. */ + readonly persistedFaceId: string; + /** User-provided data attached to the face. The length limit is 1K. */ + userData?: string; +} + +/** Person resource for person directory */ +export interface PersonDirectoryPersonOutput { + /** Person ID of the person. */ + readonly personId: string; + /** User defined name, maximum length is 128. */ + name: string; + /** Optional user defined data. Length should not exceed 16K. */ + userData?: string; +} + +/** Response of list dynamic person group of person. */ +export interface ListGroupReferenceResultOutput { + /** Array of PersonDirectory DynamicPersonGroup ids. */ + dynamicPersonGroupIds: string[]; +} + +/** Face resource for person directory person. */ +export interface PersonDirectoryFaceOutput { + /** Face ID of the face. */ + readonly persistedFaceId: string; + /** User-provided data attached to the face. The length limit is 1K. */ + userData?: string; +} + +/** Response of list face of person. */ +export interface ListFaceResultOutput { + /** Id of person. */ + personId: string; + /** Array of persisted face ids. */ + persistedFaceIds: string[]; +} + +/** A container that references Person Directory "Create Person". */ +export interface DynamicPersonGroupOutput { + /** ID of the dynamic person group. */ + readonly dynamicPersonGroupId: string; + /** User defined name, maximum length is 128. */ + name: string; + /** Optional user defined data. Length should not exceed 16K. */ + userData?: string; +} + +/** Response of list dynamic person group person. */ +export interface ListPersonResultOutput { + /** Array of PersonDirectory Person ids. */ + personIds: string[]; +} + +/** Response of liveness session creation. */ +export interface CreateLivenessSessionResultOutput { + /** The unique session ID of the created session. It will expire 48 hours after it was created or may be deleted sooner using the corresponding Session DELETE operation. */ + sessionId: string; + /** Bearer token to provide authentication for the Vision SDK running on a client application. This Bearer token has limited permissions to perform only the required action and expires after the TTL time. It is also auditable. */ + authToken: string; +} + +/** Session result of detect liveness. */ +export interface LivenessSessionOutput { + /** The unique ID to reference this session. */ + readonly id: string; + /** DateTime when this session was created. */ + createdDateTime: string; + /** DateTime when this session was started by the client. */ + sessionStartDateTime?: string; + /** Whether or not the session is expired. */ + sessionExpired: boolean; + /** Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null. */ + deviceCorrelationId?: string; + /** Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. */ + authTokenTimeToLiveInSeconds?: number; + /** The current status of the session. */ + status: FaceSessionStatusOutput; + /** The latest session audit result only populated if status == 'ResultAvailable'. */ + result?: LivenessSessionAuditEntryOutput; +} + +/** Audit entry for a request in session. */ +export interface LivenessSessionAuditEntryOutput { + /** The unique id to refer to this audit request. Use this id with the 'start' query parameter to continue on to the next page of audit results. */ + id: number; + /** The unique sessionId of the created session. It will expire 48 hours after it was created or may be deleted sooner using the corresponding session DELETE operation. */ + sessionId: string; + /** The unique requestId that is returned by the service to the client in the 'apim-request-id' header. */ + requestId: string; + /** The unique clientRequestId that is sent by the client in the 'client-request-id' header. */ + clientRequestId: string; + /** The UTC DateTime that the request was received. */ + receivedDateTime: string; + /** The request of this entry. */ + request: AuditRequestInfoOutput; + /** The response of this entry. */ + response: AuditLivenessResponseInfoOutput; + /** The server calculated digest for this request. If the client reported digest differs from the server calculated digest, then the message integrity between the client and service has been compromised and the result should not be trusted. For more information, see how to guides on how to leverage this value to secure your end-to-end solution. */ + digest: string; +} + +/** Audit entry for a request in the session. */ +export interface AuditRequestInfoOutput { + /** The relative URL and query of the liveness request. */ + url: string; + /** The HTTP method of the request (i.e., GET, POST, DELETE). */ + method: string; + /** The length of the request body in bytes. */ + contentLength?: number; + /** The content type of the request. */ + contentType: string; + /** The user agent used to submit the request. */ + userAgent?: string; +} + +/** Audit entry for a response in the session. */ +export interface AuditLivenessResponseInfoOutput { + /** The response body. The schema of this field will depend on the request.url and request.method used by the client. */ + body: LivenessResponseBodyOutput; + /** The HTTP status code returned to the client. */ + statusCode: number; + /** The server measured latency for this request in milliseconds. */ + latencyInMilliseconds: number; +} + +/** The response body of detect liveness API call. */ +export interface LivenessResponseBodyOutput extends Record { + /** The liveness classification for the target face. */ + livenessDecision?: LivenessDecisionOutput; + /** Specific targets used for liveness classification. */ + target?: LivenessOutputsTargetOutput; + /** The model version used for liveness classification. */ + modelVersionUsed?: LivenessModelOutput; + /** The face verification output. Only available when the request is liveness with verify. */ + verifyResult?: LivenessWithVerifyOutputsOutput; +} + +/** The liveness classification for target face. */ +export interface LivenessOutputsTargetOutput { + /** The face region where the liveness classification was made on. */ + faceRectangle: FaceRectangleOutput; + /** The file name which contains the face rectangle where the liveness classification was made on. */ + fileName: string; + /** The time offset within the file of the frame which contains the face rectangle where the liveness classification was made on. */ + timeOffsetWithinFile: number; + /** The image type which contains the face rectangle where the liveness classification was made on. */ + imageType: ImageTypeOutput; +} + +/** The face verification output. */ +export interface LivenessWithVerifyOutputsOutput { + /** The detail of face for verification. */ + verifyImage: LivenessWithVerifyImageOutput; + /** The target face liveness face and comparison image face verification confidence. */ + matchConfidence: number; + /** Whether the target liveness face and comparison image face match. */ + isIdentical: boolean; +} + +/** The detail of face for verification. */ +export interface LivenessWithVerifyImageOutput { + /** The face region where the comparison image's classification was made. */ + faceRectangle: FaceRectangleOutput; + /** Quality of face image for recognition. */ + qualityForRecognition: QualityForRecognitionOutput; +} + +/** Session data returned for enumeration. */ +export interface LivenessSessionItemOutput { + /** The unique ID to reference this session. */ + readonly id: string; + /** DateTime when this session was created. */ + createdDateTime: string; + /** DateTime when this session was started by the client. */ + sessionStartDateTime?: string; + /** Whether or not the session is expired. */ + sessionExpired: boolean; + /** Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null. */ + deviceCorrelationId?: string; + /** Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. */ + authTokenTimeToLiveInSeconds?: number; +} + +/** Response of liveness session with verify creation with verify image provided. */ +export interface CreateLivenessWithVerifySessionResultOutput { + /** The unique session ID of the created session. It will expire 48 hours after it was created or may be deleted sooner using the corresponding Session DELETE operation. */ + sessionId: string; + /** Bearer token to provide authentication for the Vision SDK running on a client application. This Bearer token has limited permissions to perform only the required action and expires after the TTL time. It is also auditable. */ + authToken: string; + /** The detail of face for verification. */ + verifyImage?: LivenessWithVerifyImageOutput; +} + +/** Session result of detect liveness with verify. */ +export interface LivenessWithVerifySessionOutput { + /** The unique ID to reference this session. */ + readonly id: string; + /** DateTime when this session was created. */ + createdDateTime: string; + /** DateTime when this session was started by the client. */ + sessionStartDateTime?: string; + /** Whether or not the session is expired. */ + sessionExpired: boolean; + /** Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null. */ + deviceCorrelationId?: string; + /** Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. */ + authTokenTimeToLiveInSeconds?: number; + /** The current status of the session. */ + status: FaceSessionStatusOutput; + /** The latest session audit result only populated if status == 'ResultAvailable'. */ + result?: LivenessSessionAuditEntryOutput; +} + +/** Alias for OperationStatusOutput */ +export type OperationStatusOutput = + | string + | "notStarted" + | "running" + | "succeeded" + | "failed"; +/** Alias for RecognitionModelOutput */ +export type RecognitionModelOutput = + | string + | "recognition_01" + | "recognition_02" + | "recognition_03" + | "recognition_04"; +/** Alias for GlassesTypeOutput */ +export type GlassesTypeOutput = + | string + | "noGlasses" + | "readingGlasses" + | "sunglasses" + | "swimmingGoggles"; +/** Alias for HairColorTypeOutput */ +export type HairColorTypeOutput = + | string + | "unknown" + | "white" + | "gray" + | "blond" + | "brown" + | "red" + | "black" + | "other"; +/** Alias for AccessoryTypeOutput */ +export type AccessoryTypeOutput = string | "headwear" | "glasses" | "mask"; +/** Alias for BlurLevelOutput */ +export type BlurLevelOutput = string | "low" | "medium" | "high"; +/** Alias for ExposureLevelOutput */ +export type ExposureLevelOutput = + | string + | "underExposure" + | "goodExposure" + | "overExposure"; +/** Alias for NoiseLevelOutput */ +export type NoiseLevelOutput = string | "low" | "medium" | "high"; +/** Alias for MaskTypeOutput */ +export type MaskTypeOutput = + | string + | "faceMask" + | "noMask" + | "otherMaskOrOcclusion" + | "uncertain"; +/** Alias for QualityForRecognitionOutput */ +export type QualityForRecognitionOutput = string | "low" | "medium" | "high"; +/** Alias for FaceSessionStatusOutput */ +export type FaceSessionStatusOutput = + | string + | "NotStarted" + | "Started" + | "ResultAvailable"; +/** Alias for LivenessDecisionOutput */ +export type LivenessDecisionOutput = + | string + | "uncertain" + | "realface" + | "spoofface"; +/** Alias for ImageTypeOutput */ +export type ImageTypeOutput = string | "Color" | "Infrared" | "Depth"; +/** Alias for LivenessModelOutput */ +export type LivenessModelOutput = + | string + | "2020-02-15-preview.01" + | "2021-11-12-preview.03" + | "2022-10-15-preview.04" + | "2023-03-02-preview.05"; diff --git a/sdk/vision/ai-vision-face-rest/src/parameters.ts b/sdk/vision/ai-vision-face-rest/src/parameters.ts new file mode 100644 index 000000000000..a3efccbb084e --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/src/parameters.ts @@ -0,0 +1,993 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { RequestParameters } from "@azure-rest/core-client"; +import { + DetectionModel, + RecognitionModel, + FaceAttributeType, + FindSimilarMatchMode, + CreateLivenessSessionContent, + CreateLivenessWithVerifySessionContent, +} from "./models.js"; + +export type GetOperationResultParameters = RequestParameters; + +export interface DetectFromUrlBodyParam { + body?: { url: string }; +} + +export interface DetectFromUrlQueryParamProperties { + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** The 'recognitionModel' associated with the detected faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. */ + recognitionModel?: RecognitionModel; + /** Return faceIds of the detected faces or not. The default value is true. */ + returnFaceId?: boolean; + /** Analyze and return the one or more specified face attributes in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face attribute analysis has additional computational and time cost. */ + returnFaceAttributes?: FaceAttributeType[]; + /** Return face landmarks of the detected faces or not. The default value is false. */ + returnFaceLandmarks?: boolean; + /** Return 'recognitionModel' or not. The default value is false. This is only applicable when returnFaceId = true. */ + returnRecognitionModel?: boolean; + /** The number of seconds for the face ID being cached. Supported range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours). */ + faceIdTimeToLive?: number; +} + +export interface DetectFromUrlQueryParam { + queryParameters?: DetectFromUrlQueryParamProperties; +} + +export interface DetectFromUrlMediaTypesParam { + /** The format of the HTTP payload. */ + contentType: "application/json"; +} + +export type DetectFromUrlParameters = DetectFromUrlQueryParam & + DetectFromUrlMediaTypesParam & + DetectFromUrlBodyParam & + RequestParameters; + +export interface DetectBodyParam { + /** + * The input image binary. + * + * Value may contain any sequence of octets + */ + body: + | string + | Uint8Array + | ReadableStream + | NodeJS.ReadableStream; +} + +export interface DetectQueryParamProperties { + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** The 'recognitionModel' associated with the detected faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. */ + recognitionModel?: RecognitionModel; + /** Return faceIds of the detected faces or not. The default value is true. */ + returnFaceId?: boolean; + /** Analyze and return the one or more specified face attributes in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face attribute analysis has additional computational and time cost. */ + returnFaceAttributes?: FaceAttributeType[]; + /** Return face landmarks of the detected faces or not. The default value is false. */ + returnFaceLandmarks?: boolean; + /** Return 'recognitionModel' or not. The default value is false. This is only applicable when returnFaceId = true. */ + returnRecognitionModel?: boolean; + /** The number of seconds for the face ID being cached. Supported range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours). */ + faceIdTimeToLive?: number; +} + +export interface DetectQueryParam { + queryParameters?: DetectQueryParamProperties; +} + +export interface DetectMediaTypesParam { + /** The format of the HTTP payload. */ + contentType: "application/octet-stream"; +} + +export type DetectParameters = DetectQueryParam & + DetectMediaTypesParam & + DetectBodyParam & + RequestParameters; + +export interface FindSimilarBodyParam { + body?: { + faceId: string; + maxNumOfCandidatesReturned?: number; + mode?: FindSimilarMatchMode; + faceIds: string[]; + }; +} + +export type FindSimilarParameters = FindSimilarBodyParam & RequestParameters; + +export interface FindSimilarFromFaceListBodyParam { + body?: { + faceId: string; + maxNumOfCandidatesReturned?: number; + mode?: FindSimilarMatchMode; + faceListId: string; + }; +} + +export type FindSimilarFromFaceListParameters = + FindSimilarFromFaceListBodyParam & RequestParameters; + +export interface FindSimilarFromLargeFaceListBodyParam { + body?: { + faceId: string; + maxNumOfCandidatesReturned?: number; + mode?: FindSimilarMatchMode; + largeFaceListId: string; + }; +} + +export type FindSimilarFromLargeFaceListParameters = + FindSimilarFromLargeFaceListBodyParam & RequestParameters; + +export interface IdentifyFromPersonGroupBodyParam { + body?: { + faceIds: string[]; + personGroupId: string; + maxNumOfCandidatesReturned?: number; + confidenceThreshold?: number; + }; +} + +export type IdentifyFromPersonGroupParameters = + IdentifyFromPersonGroupBodyParam & RequestParameters; + +export interface IdentifyFromLargePersonGroupBodyParam { + body?: { + faceIds: string[]; + largePersonGroupId: string; + maxNumOfCandidatesReturned?: number; + confidenceThreshold?: number; + }; +} + +export type IdentifyFromLargePersonGroupParameters = + IdentifyFromLargePersonGroupBodyParam & RequestParameters; + +export interface IdentifyFromPersonDirectoryBodyParam { + body?: { + faceIds: string[]; + personIds: string[]; + maxNumOfCandidatesReturned?: number; + confidenceThreshold?: number; + }; +} + +export type IdentifyFromPersonDirectoryParameters = + IdentifyFromPersonDirectoryBodyParam & RequestParameters; + +export interface IdentifyFromDynamicPersonGroupBodyParam { + body?: { + faceIds: string[]; + dynamicPersonGroupId: string; + maxNumOfCandidatesReturned?: number; + confidenceThreshold?: number; + }; +} + +export type IdentifyFromDynamicPersonGroupParameters = + IdentifyFromDynamicPersonGroupBodyParam & RequestParameters; + +export interface VerifyFaceToFaceBodyParam { + body?: { faceId1: string; faceId2: string }; +} + +export type VerifyFaceToFaceParameters = VerifyFaceToFaceBodyParam & + RequestParameters; + +export interface VerifyFromPersonGroupBodyParam { + body?: { faceId: string; personGroupId: string; personId: string }; +} + +export type VerifyFromPersonGroupParameters = VerifyFromPersonGroupBodyParam & + RequestParameters; + +export interface VerifyFromLargePersonGroupBodyParam { + body?: { faceId: string; largePersonGroupId: string; personId: string }; +} + +export type VerifyFromLargePersonGroupParameters = + VerifyFromLargePersonGroupBodyParam & RequestParameters; + +export interface VerifyFromPersonDirectoryBodyParam { + body?: { faceId: string; personId: string }; +} + +export type VerifyFromPersonDirectoryParameters = + VerifyFromPersonDirectoryBodyParam & RequestParameters; + +export interface GroupBodyParam { + body?: { faceIds: string[] }; +} + +export type GroupParameters = GroupBodyParam & RequestParameters; + +export interface CreateFaceListBodyParam { + body?: { + name: string; + userData?: string; + recognitionModel?: RecognitionModel; + }; +} + +export type CreateFaceListParameters = CreateFaceListBodyParam & + RequestParameters; +export type DeleteFaceListParameters = RequestParameters; + +export interface GetFaceListQueryParamProperties { + /** Return 'recognitionModel' or not. The default value is false. */ + returnRecognitionModel?: boolean; +} + +export interface GetFaceListQueryParam { + queryParameters?: GetFaceListQueryParamProperties; +} + +export type GetFaceListParameters = GetFaceListQueryParam & RequestParameters; + +export interface UpdateFaceListBodyParam { + body?: { name?: string; userData?: string }; +} + +export type UpdateFaceListParameters = UpdateFaceListBodyParam & + RequestParameters; + +export interface GetFaceListsQueryParamProperties { + /** Return 'recognitionModel' or not. The default value is false. */ + returnRecognitionModel?: boolean; +} + +export interface GetFaceListsQueryParam { + queryParameters?: GetFaceListsQueryParamProperties; +} + +export type GetFaceListsParameters = GetFaceListsQueryParam & RequestParameters; + +export interface AddFaceListFaceFromUrlBodyParam { + body?: { url: string }; +} + +export interface AddFaceListFaceFromUrlQueryParamProperties { + /** A face rectangle to specify the target face to be added to a person, in the format of 'targetFace=left,top,width,height'. */ + targetFace?: number[]; + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** User-provided data attached to the face. The size limit is 1K. */ + userData?: string; +} + +export interface AddFaceListFaceFromUrlQueryParam { + queryParameters?: AddFaceListFaceFromUrlQueryParamProperties; +} + +export type AddFaceListFaceFromUrlParameters = + AddFaceListFaceFromUrlQueryParam & + AddFaceListFaceFromUrlBodyParam & + RequestParameters; + +export interface AddFaceListFaceBodyParam { + /** + * The image to be analyzed + * + * Value may contain any sequence of octets + */ + body: + | string + | Uint8Array + | ReadableStream + | NodeJS.ReadableStream; +} + +export interface AddFaceListFaceQueryParamProperties { + /** A face rectangle to specify the target face to be added to a person, in the format of 'targetFace=left,top,width,height'. */ + targetFace?: number[]; + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** User-provided data attached to the face. The size limit is 1K. */ + userData?: string; +} + +export interface AddFaceListFaceQueryParam { + queryParameters?: AddFaceListFaceQueryParamProperties; +} + +export interface AddFaceListFaceMediaTypesParam { + /** The format of the HTTP payload. */ + contentType: "application/octet-stream"; +} + +export type AddFaceListFaceParameters = AddFaceListFaceQueryParam & + AddFaceListFaceMediaTypesParam & + AddFaceListFaceBodyParam & + RequestParameters; +export type DeleteFaceListFaceParameters = RequestParameters; + +export interface CreateLargeFaceListBodyParam { + body?: { + name: string; + userData?: string; + recognitionModel?: RecognitionModel; + }; +} + +export type CreateLargeFaceListParameters = CreateLargeFaceListBodyParam & + RequestParameters; +export type DeleteLargeFaceListParameters = RequestParameters; + +export interface GetLargeFaceListQueryParamProperties { + /** Return 'recognitionModel' or not. The default value is false. */ + returnRecognitionModel?: boolean; +} + +export interface GetLargeFaceListQueryParam { + queryParameters?: GetLargeFaceListQueryParamProperties; +} + +export type GetLargeFaceListParameters = GetLargeFaceListQueryParam & + RequestParameters; + +export interface UpdateLargeFaceListBodyParam { + body?: { name?: string; userData?: string }; +} + +export type UpdateLargeFaceListParameters = UpdateLargeFaceListBodyParam & + RequestParameters; + +export interface GetLargeFaceListsQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; + /** Return 'recognitionModel' or not. The default value is false. */ + returnRecognitionModel?: boolean; +} + +export interface GetLargeFaceListsQueryParam { + queryParameters?: GetLargeFaceListsQueryParamProperties; +} + +export type GetLargeFaceListsParameters = GetLargeFaceListsQueryParam & + RequestParameters; +export type GetLargeFaceListTrainingStatusParameters = RequestParameters; +export type TrainLargeFaceListParameters = RequestParameters; + +export interface AddLargeFaceListFaceFromUrlBodyParam { + body?: { url: string }; +} + +export interface AddLargeFaceListFaceFromUrlQueryParamProperties { + /** A face rectangle to specify the target face to be added to a person, in the format of 'targetFace=left,top,width,height'. */ + targetFace?: number[]; + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** User-provided data attached to the face. The size limit is 1K. */ + userData?: string; +} + +export interface AddLargeFaceListFaceFromUrlQueryParam { + queryParameters?: AddLargeFaceListFaceFromUrlQueryParamProperties; +} + +export type AddLargeFaceListFaceFromUrlParameters = + AddLargeFaceListFaceFromUrlQueryParam & + AddLargeFaceListFaceFromUrlBodyParam & + RequestParameters; + +export interface AddLargeFaceListFaceBodyParam { + /** + * The image to be analyzed + * + * Value may contain any sequence of octets + */ + body: + | string + | Uint8Array + | ReadableStream + | NodeJS.ReadableStream; +} + +export interface AddLargeFaceListFaceQueryParamProperties { + /** A face rectangle to specify the target face to be added to a person, in the format of 'targetFace=left,top,width,height'. */ + targetFace?: number[]; + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** User-provided data attached to the face. The size limit is 1K. */ + userData?: string; +} + +export interface AddLargeFaceListFaceQueryParam { + queryParameters?: AddLargeFaceListFaceQueryParamProperties; +} + +export interface AddLargeFaceListFaceMediaTypesParam { + /** The format of the HTTP payload. */ + contentType: "application/octet-stream"; +} + +export type AddLargeFaceListFaceParameters = AddLargeFaceListFaceQueryParam & + AddLargeFaceListFaceMediaTypesParam & + AddLargeFaceListFaceBodyParam & + RequestParameters; +export type DeleteLargeFaceListFaceParameters = RequestParameters; +export type GetLargeFaceListFaceParameters = RequestParameters; + +export interface UpdateLargeFaceListFaceBodyParam { + body?: { userData?: string }; +} + +export type UpdateLargeFaceListFaceParameters = + UpdateLargeFaceListFaceBodyParam & RequestParameters; + +export interface GetLargeFaceListFacesQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; +} + +export interface GetLargeFaceListFacesQueryParam { + queryParameters?: GetLargeFaceListFacesQueryParamProperties; +} + +export type GetLargeFaceListFacesParameters = GetLargeFaceListFacesQueryParam & + RequestParameters; + +export interface CreatePersonGroupBodyParam { + body?: { + name: string; + userData?: string; + recognitionModel?: RecognitionModel; + }; +} + +export type CreatePersonGroupParameters = CreatePersonGroupBodyParam & + RequestParameters; +export type DeletePersonGroupParameters = RequestParameters; + +export interface GetPersonGroupQueryParamProperties { + /** Return 'recognitionModel' or not. The default value is false. */ + returnRecognitionModel?: boolean; +} + +export interface GetPersonGroupQueryParam { + queryParameters?: GetPersonGroupQueryParamProperties; +} + +export type GetPersonGroupParameters = GetPersonGroupQueryParam & + RequestParameters; + +export interface UpdatePersonGroupBodyParam { + body?: { name?: string; userData?: string }; +} + +export type UpdatePersonGroupParameters = UpdatePersonGroupBodyParam & + RequestParameters; + +export interface GetPersonGroupsQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; + /** Return 'recognitionModel' or not. The default value is false. */ + returnRecognitionModel?: boolean; +} + +export interface GetPersonGroupsQueryParam { + queryParameters?: GetPersonGroupsQueryParamProperties; +} + +export type GetPersonGroupsParameters = GetPersonGroupsQueryParam & + RequestParameters; +export type GetPersonGroupTrainingStatusParameters = RequestParameters; +export type TrainPersonGroupParameters = RequestParameters; + +export interface CreatePersonGroupPersonBodyParam { + body?: { name: string; userData?: string }; +} + +export type CreatePersonGroupPersonParameters = + CreatePersonGroupPersonBodyParam & RequestParameters; +export type DeletePersonGroupPersonParameters = RequestParameters; +export type GetPersonGroupPersonParameters = RequestParameters; + +export interface UpdatePersonGroupPersonBodyParam { + body?: { name?: string; userData?: string }; +} + +export type UpdatePersonGroupPersonParameters = + UpdatePersonGroupPersonBodyParam & RequestParameters; + +export interface GetPersonGroupPersonsQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; +} + +export interface GetPersonGroupPersonsQueryParam { + queryParameters?: GetPersonGroupPersonsQueryParamProperties; +} + +export type GetPersonGroupPersonsParameters = GetPersonGroupPersonsQueryParam & + RequestParameters; + +export interface AddPersonGroupPersonFaceFromUrlBodyParam { + body?: { url: string }; +} + +export interface AddPersonGroupPersonFaceFromUrlQueryParamProperties { + /** A face rectangle to specify the target face to be added to a person, in the format of 'targetFace=left,top,width,height'. */ + targetFace?: number[]; + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** User-provided data attached to the face. The size limit is 1K. */ + userData?: string; +} + +export interface AddPersonGroupPersonFaceFromUrlQueryParam { + queryParameters?: AddPersonGroupPersonFaceFromUrlQueryParamProperties; +} + +export type AddPersonGroupPersonFaceFromUrlParameters = + AddPersonGroupPersonFaceFromUrlQueryParam & + AddPersonGroupPersonFaceFromUrlBodyParam & + RequestParameters; + +export interface AddPersonGroupPersonFaceBodyParam { + /** + * The image to be analyzed + * + * Value may contain any sequence of octets + */ + body: + | string + | Uint8Array + | ReadableStream + | NodeJS.ReadableStream; +} + +export interface AddPersonGroupPersonFaceQueryParamProperties { + /** A face rectangle to specify the target face to be added to a person, in the format of 'targetFace=left,top,width,height'. */ + targetFace?: number[]; + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** User-provided data attached to the face. The size limit is 1K. */ + userData?: string; +} + +export interface AddPersonGroupPersonFaceQueryParam { + queryParameters?: AddPersonGroupPersonFaceQueryParamProperties; +} + +export interface AddPersonGroupPersonFaceMediaTypesParam { + /** The format of the HTTP payload. */ + contentType: "application/octet-stream"; +} + +export type AddPersonGroupPersonFaceParameters = + AddPersonGroupPersonFaceQueryParam & + AddPersonGroupPersonFaceMediaTypesParam & + AddPersonGroupPersonFaceBodyParam & + RequestParameters; +export type DeletePersonGroupPersonFaceParameters = RequestParameters; +export type GetPersonGroupPersonFaceParameters = RequestParameters; + +export interface UpdatePersonGroupPersonFaceBodyParam { + body?: { userData?: string }; +} + +export type UpdatePersonGroupPersonFaceParameters = + UpdatePersonGroupPersonFaceBodyParam & RequestParameters; + +export interface CreateLargePersonGroupBodyParam { + body?: { + name: string; + userData?: string; + recognitionModel?: RecognitionModel; + }; +} + +export type CreateLargePersonGroupParameters = CreateLargePersonGroupBodyParam & + RequestParameters; +export type DeleteLargePersonGroupParameters = RequestParameters; + +export interface GetLargePersonGroupQueryParamProperties { + /** Return 'recognitionModel' or not. The default value is false. */ + returnRecognitionModel?: boolean; +} + +export interface GetLargePersonGroupQueryParam { + queryParameters?: GetLargePersonGroupQueryParamProperties; +} + +export type GetLargePersonGroupParameters = GetLargePersonGroupQueryParam & + RequestParameters; + +export interface UpdateLargePersonGroupBodyParam { + body?: { name?: string; userData?: string }; +} + +export type UpdateLargePersonGroupParameters = UpdateLargePersonGroupBodyParam & + RequestParameters; + +export interface GetLargePersonGroupsQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; + /** Return 'recognitionModel' or not. The default value is false. */ + returnRecognitionModel?: boolean; +} + +export interface GetLargePersonGroupsQueryParam { + queryParameters?: GetLargePersonGroupsQueryParamProperties; +} + +export type GetLargePersonGroupsParameters = GetLargePersonGroupsQueryParam & + RequestParameters; +export type GetLargePersonGroupTrainingStatusParameters = RequestParameters; +export type TrainLargePersonGroupParameters = RequestParameters; + +export interface CreateLargePersonGroupPersonBodyParam { + body?: { name: string; userData?: string }; +} + +export type CreateLargePersonGroupPersonParameters = + CreateLargePersonGroupPersonBodyParam & RequestParameters; +export type DeleteLargePersonGroupPersonParameters = RequestParameters; +export type GetLargePersonGroupPersonParameters = RequestParameters; + +export interface UpdateLargePersonGroupPersonBodyParam { + body?: { name?: string; userData?: string }; +} + +export type UpdateLargePersonGroupPersonParameters = + UpdateLargePersonGroupPersonBodyParam & RequestParameters; + +export interface GetLargePersonGroupPersonsQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; +} + +export interface GetLargePersonGroupPersonsQueryParam { + queryParameters?: GetLargePersonGroupPersonsQueryParamProperties; +} + +export type GetLargePersonGroupPersonsParameters = + GetLargePersonGroupPersonsQueryParam & RequestParameters; + +export interface AddLargePersonGroupPersonFaceFromUrlBodyParam { + body?: { url: string }; +} + +export interface AddLargePersonGroupPersonFaceFromUrlQueryParamProperties { + /** A face rectangle to specify the target face to be added to a person, in the format of 'targetFace=left,top,width,height'. */ + targetFace?: number[]; + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** User-provided data attached to the face. The size limit is 1K. */ + userData?: string; +} + +export interface AddLargePersonGroupPersonFaceFromUrlQueryParam { + queryParameters?: AddLargePersonGroupPersonFaceFromUrlQueryParamProperties; +} + +export type AddLargePersonGroupPersonFaceFromUrlParameters = + AddLargePersonGroupPersonFaceFromUrlQueryParam & + AddLargePersonGroupPersonFaceFromUrlBodyParam & + RequestParameters; + +export interface AddLargePersonGroupPersonFaceBodyParam { + /** + * The image to be analyzed + * + * Value may contain any sequence of octets + */ + body: + | string + | Uint8Array + | ReadableStream + | NodeJS.ReadableStream; +} + +export interface AddLargePersonGroupPersonFaceQueryParamProperties { + /** A face rectangle to specify the target face to be added to a person, in the format of 'targetFace=left,top,width,height'. */ + targetFace?: number[]; + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** User-provided data attached to the face. The size limit is 1K. */ + userData?: string; +} + +export interface AddLargePersonGroupPersonFaceQueryParam { + queryParameters?: AddLargePersonGroupPersonFaceQueryParamProperties; +} + +export interface AddLargePersonGroupPersonFaceMediaTypesParam { + /** The format of the HTTP payload. */ + contentType: "application/octet-stream"; +} + +export type AddLargePersonGroupPersonFaceParameters = + AddLargePersonGroupPersonFaceQueryParam & + AddLargePersonGroupPersonFaceMediaTypesParam & + AddLargePersonGroupPersonFaceBodyParam & + RequestParameters; +export type DeleteLargePersonGroupPersonFaceParameters = RequestParameters; +export type GetLargePersonGroupPersonFaceParameters = RequestParameters; + +export interface UpdateLargePersonGroupPersonFaceBodyParam { + body?: { userData?: string }; +} + +export type UpdateLargePersonGroupPersonFaceParameters = + UpdateLargePersonGroupPersonFaceBodyParam & RequestParameters; + +export interface CreatePersonBodyParam { + body?: { name: string; userData?: string }; +} + +export type CreatePersonParameters = CreatePersonBodyParam & RequestParameters; +export type DeletePersonParameters = RequestParameters; +export type GetPersonParameters = RequestParameters; + +export interface UpdatePersonBodyParam { + body?: { name?: string; userData?: string }; +} + +export type UpdatePersonParameters = UpdatePersonBodyParam & RequestParameters; + +export interface GetPersonsQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; +} + +export interface GetPersonsQueryParam { + queryParameters?: GetPersonsQueryParamProperties; +} + +export type GetPersonsParameters = GetPersonsQueryParam & RequestParameters; + +export interface GetDynamicPersonGroupReferencesQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; +} + +export interface GetDynamicPersonGroupReferencesQueryParam { + queryParameters?: GetDynamicPersonGroupReferencesQueryParamProperties; +} + +export type GetDynamicPersonGroupReferencesParameters = + GetDynamicPersonGroupReferencesQueryParam & RequestParameters; + +export interface AddPersonFaceBodyParam { + /** + * The image to be analyzed + * + * Value may contain any sequence of octets + */ + body: + | string + | Uint8Array + | ReadableStream + | NodeJS.ReadableStream; +} + +export interface AddPersonFaceQueryParamProperties { + /** A face rectangle to specify the target face to be added to a person, in the format of 'targetFace=left,top,width,height'. */ + targetFace?: number[]; + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** User-provided data attached to the face. The size limit is 1K. */ + userData?: string; +} + +export interface AddPersonFaceQueryParam { + queryParameters?: AddPersonFaceQueryParamProperties; +} + +export interface AddPersonFaceMediaTypesParam { + /** The format of the HTTP payload. */ + contentType: "application/octet-stream"; +} + +export type AddPersonFaceParameters = AddPersonFaceQueryParam & + AddPersonFaceMediaTypesParam & + AddPersonFaceBodyParam & + RequestParameters; + +export interface AddPersonFaceFromUrlBodyParam { + body?: { url: string }; +} + +export interface AddPersonFaceFromUrlQueryParamProperties { + /** A face rectangle to specify the target face to be added to a person, in the format of 'targetFace=left,top,width,height'. */ + targetFace?: number[]; + /** The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. */ + detectionModel?: DetectionModel; + /** User-provided data attached to the face. The size limit is 1K. */ + userData?: string; +} + +export interface AddPersonFaceFromUrlQueryParam { + queryParameters?: AddPersonFaceFromUrlQueryParamProperties; +} + +export type AddPersonFaceFromUrlParameters = AddPersonFaceFromUrlQueryParam & + AddPersonFaceFromUrlBodyParam & + RequestParameters; +export type DeletePersonFaceParameters = RequestParameters; +export type GetPersonFaceParameters = RequestParameters; + +export interface UpdatePersonFaceBodyParam { + body?: { userData?: string }; +} + +export type UpdatePersonFaceParameters = UpdatePersonFaceBodyParam & + RequestParameters; +export type GetPersonFacesParameters = RequestParameters; + +export interface CreateDynamicPersonGroupWithPersonBodyParam { + body?: { name: string; userData?: string; addPersonIds: string[] }; +} + +export type CreateDynamicPersonGroupWithPersonParameters = + CreateDynamicPersonGroupWithPersonBodyParam & RequestParameters; + +export interface CreateDynamicPersonGroupBodyParam { + body?: { name: string; userData?: string }; +} + +export type CreateDynamicPersonGroupParameters = + CreateDynamicPersonGroupBodyParam & RequestParameters; +export type DeleteDynamicPersonGroupParameters = RequestParameters; +export type GetDynamicPersonGroupParameters = RequestParameters; + +export interface UpdateDynamicPersonGroupWithPersonChangesBodyParam { + body?: { + name?: string; + userData?: string; + addPersonIds?: string[]; + removePersonIds?: string[]; + }; +} + +export type UpdateDynamicPersonGroupWithPersonChangesParameters = + UpdateDynamicPersonGroupWithPersonChangesBodyParam & RequestParameters; + +export interface UpdateDynamicPersonGroupBodyParam { + body?: { name?: string; userData?: string }; +} + +export type UpdateDynamicPersonGroupParameters = + UpdateDynamicPersonGroupBodyParam & RequestParameters; + +export interface GetDynamicPersonGroupsQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; +} + +export interface GetDynamicPersonGroupsQueryParam { + queryParameters?: GetDynamicPersonGroupsQueryParamProperties; +} + +export type GetDynamicPersonGroupsParameters = + GetDynamicPersonGroupsQueryParam & RequestParameters; + +export interface GetDynamicPersonGroupPersonsQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; +} + +export interface GetDynamicPersonGroupPersonsQueryParam { + queryParameters?: GetDynamicPersonGroupPersonsQueryParamProperties; +} + +export type GetDynamicPersonGroupPersonsParameters = + GetDynamicPersonGroupPersonsQueryParam & RequestParameters; + +export interface CreateLivenessSessionBodyParam { + body?: CreateLivenessSessionContent; +} + +export type CreateLivenessSessionParameters = CreateLivenessSessionBodyParam & + RequestParameters; +export type DeleteLivenessSessionParameters = RequestParameters; +export type GetLivenessSessionResultParameters = RequestParameters; + +export interface GetLivenessSessionsQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; +} + +export interface GetLivenessSessionsQueryParam { + queryParameters?: GetLivenessSessionsQueryParamProperties; +} + +export type GetLivenessSessionsParameters = GetLivenessSessionsQueryParam & + RequestParameters; + +export interface GetLivenessSessionAuditEntriesQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; +} + +export interface GetLivenessSessionAuditEntriesQueryParam { + queryParameters?: GetLivenessSessionAuditEntriesQueryParamProperties; +} + +export type GetLivenessSessionAuditEntriesParameters = + GetLivenessSessionAuditEntriesQueryParam & RequestParameters; + +export interface CreateLivenessWithVerifySessionWithVerifyImageBodyParam { + body?: CreateLivenessWithVerifySessionContent; +} + +export interface CreateLivenessWithVerifySessionWithVerifyImageMediaTypesParam { + /** The content type for the operation. Always multipart/form-data for this operation. */ + contentType: "multipart/form-data"; +} + +export type CreateLivenessWithVerifySessionWithVerifyImageParameters = + CreateLivenessWithVerifySessionWithVerifyImageMediaTypesParam & + CreateLivenessWithVerifySessionWithVerifyImageBodyParam & + RequestParameters; + +export interface CreateLivenessWithVerifySessionBodyParam { + body?: CreateLivenessSessionContent; +} + +export type CreateLivenessWithVerifySessionParameters = + CreateLivenessWithVerifySessionBodyParam & RequestParameters; +export type DeleteLivenessWithVerifySessionParameters = RequestParameters; +export type GetLivenessWithVerifySessionResultParameters = RequestParameters; + +export interface GetLivenessWithVerifySessionsQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; +} + +export interface GetLivenessWithVerifySessionsQueryParam { + queryParameters?: GetLivenessWithVerifySessionsQueryParamProperties; +} + +export type GetLivenessWithVerifySessionsParameters = + GetLivenessWithVerifySessionsQueryParam & RequestParameters; + +export interface GetLivenessWithVerifySessionAuditEntriesQueryParamProperties { + /** List resources greater than the "start". It contains no more than 64 characters. Default is empty. */ + start?: string; + /** The number of items to list, ranging in [1, 1000]. Default is 1000. */ + top?: number; +} + +export interface GetLivenessWithVerifySessionAuditEntriesQueryParam { + queryParameters?: GetLivenessWithVerifySessionAuditEntriesQueryParamProperties; +} + +export type GetLivenessWithVerifySessionAuditEntriesParameters = + GetLivenessWithVerifySessionAuditEntriesQueryParam & RequestParameters; diff --git a/sdk/vision/ai-vision-face-rest/src/pollingHelper.ts b/sdk/vision/ai-vision-face-rest/src/pollingHelper.ts new file mode 100644 index 000000000000..58ae96c0d277 --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/src/pollingHelper.ts @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Client, HttpResponse } from "@azure-rest/core-client"; +import { + CreateHttpPollerOptions, + LongRunningOperation, + LroResponse, + OperationState, + SimplePollerLike, + createHttpPoller, +} from "@azure/core-lro"; +import { + TrainLargeFaceList202Response, + TrainLargeFaceListDefaultResponse, + TrainLargeFaceListLogicalResponse, + TrainPersonGroup202Response, + TrainPersonGroupDefaultResponse, + TrainPersonGroupLogicalResponse, + TrainLargePersonGroup202Response, + TrainLargePersonGroupDefaultResponse, + TrainLargePersonGroupLogicalResponse, + CreatePerson202Response, + CreatePersonDefaultResponse, + CreatePersonLogicalResponse, + DeletePerson202Response, + DeletePersonDefaultResponse, + DeletePersonLogicalResponse, + AddPersonFace202Response, + AddPersonFaceDefaultResponse, + AddPersonFaceLogicalResponse, + DeletePersonFace202Response, + DeletePersonFaceDefaultResponse, + DeletePersonFaceLogicalResponse, + CreateDynamicPersonGroupWithPerson202Response, + CreateDynamicPersonGroupWithPersonDefaultResponse, + CreateDynamicPersonGroupWithPersonLogicalResponse, + DeleteDynamicPersonGroup202Response, + DeleteDynamicPersonGroupDefaultResponse, + DeleteDynamicPersonGroupLogicalResponse, + UpdateDynamicPersonGroupWithPersonChanges202Response, + UpdateDynamicPersonGroupWithPersonChangesDefaultResponse, + UpdateDynamicPersonGroupWithPersonChangesLogicalResponse, +} from "./responses.js"; +/** + * Helper function that builds a Poller object to help polling a long running operation. + * @param client - Client to use for sending the request to get additional pages. + * @param initialResponse - The initial response. + * @param options - Options to set a resume state or custom polling interval. + * @returns - A poller object to poll for operation state updates and eventually get the final response. + */ +export async function getLongRunningPoller< + TResult extends + | TrainLargeFaceListLogicalResponse + | TrainLargeFaceListDefaultResponse, +>( + client: Client, + initialResponse: + | TrainLargeFaceList202Response + | TrainLargeFaceListDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | TrainPersonGroupLogicalResponse + | TrainPersonGroupDefaultResponse, +>( + client: Client, + initialResponse: + | TrainPersonGroup202Response + | TrainPersonGroupDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | TrainLargePersonGroupLogicalResponse + | TrainLargePersonGroupDefaultResponse, +>( + client: Client, + initialResponse: + | TrainLargePersonGroup202Response + | TrainLargePersonGroupDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends CreatePersonLogicalResponse | CreatePersonDefaultResponse, +>( + client: Client, + initialResponse: CreatePerson202Response | CreatePersonDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends DeletePersonLogicalResponse | DeletePersonDefaultResponse, +>( + client: Client, + initialResponse: DeletePerson202Response | DeletePersonDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends AddPersonFaceLogicalResponse | AddPersonFaceDefaultResponse, +>( + client: Client, + initialResponse: AddPersonFace202Response | AddPersonFaceDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | DeletePersonFaceLogicalResponse + | DeletePersonFaceDefaultResponse, +>( + client: Client, + initialResponse: + | DeletePersonFace202Response + | DeletePersonFaceDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | CreateDynamicPersonGroupWithPersonLogicalResponse + | CreateDynamicPersonGroupWithPersonDefaultResponse, +>( + client: Client, + initialResponse: + | CreateDynamicPersonGroupWithPerson202Response + | CreateDynamicPersonGroupWithPersonDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | DeleteDynamicPersonGroupLogicalResponse + | DeleteDynamicPersonGroupDefaultResponse, +>( + client: Client, + initialResponse: + | DeleteDynamicPersonGroup202Response + | DeleteDynamicPersonGroupDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | UpdateDynamicPersonGroupWithPersonChangesLogicalResponse + | UpdateDynamicPersonGroupWithPersonChangesDefaultResponse, +>( + client: Client, + initialResponse: + | UpdateDynamicPersonGroupWithPersonChanges202Response + | UpdateDynamicPersonGroupWithPersonChangesDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller( + client: Client, + initialResponse: TResult, + options: CreateHttpPollerOptions> = {}, +): Promise, TResult>> { + const poller: LongRunningOperation = { + requestMethod: initialResponse.request.method, + requestPath: initialResponse.request.url, + sendInitialRequest: async () => { + // In the case of Rest Clients we are building the LRO poller object from a response that's the reason + // we are not triggering the initial request here, just extracting the information from the + // response we were provided. + return getLroResponse(initialResponse); + }, + sendPollRequest: async (path) => { + // This is the callback that is going to be called to poll the service + // to get the latest status. We use the client provided and the polling path + // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location + // depending on the lro pattern that the service implements. If non is provided we default to the initial path. + const response = await client + .pathUnchecked(path ?? initialResponse.request.url) + .get(); + const lroResponse = getLroResponse(response as TResult); + lroResponse.rawResponse.headers["x-ms-original-url"] = + initialResponse.request.url; + return lroResponse; + }, + }; + + options.resolveOnUnsuccessful = options.resolveOnUnsuccessful ?? true; + return createHttpPoller(poller, options); +} + +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResult, +): LroResponse { + if (Number.isNaN(response.status)) { + throw new TypeError( + `Status code of the response is not a number. Value: ${response.status}`, + ); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/vision/ai-vision-face-rest/src/responses.ts b/sdk/vision/ai-vision-face-rest/src/responses.ts new file mode 100644 index 000000000000..cc6689b23fd0 --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/src/responses.ts @@ -0,0 +1,1888 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { RawHttpHeaders } from "@azure/core-rest-pipeline"; +import { HttpResponse } from "@azure-rest/core-client"; +import { + OperationResultOutput, + FaceErrorResponseOutput, + FaceDetectionResultOutput, + FindSimilarResultOutput, + IdentificationResultOutput, + VerificationResultOutput, + GroupingResultOutput, + FaceListOutput, + FaceListItemOutput, + AddFaceResultOutput, + LargeFaceListOutput, + TrainingResultOutput, + LargeFaceListFaceOutput, + PersonGroupOutput, + CreatePersonResultOutput, + PersonGroupPersonOutput, + PersonGroupPersonFaceOutput, + LargePersonGroupOutput, + LargePersonGroupPersonOutput, + LargePersonGroupPersonFaceOutput, + PersonDirectoryPersonOutput, + ListGroupReferenceResultOutput, + PersonDirectoryFaceOutput, + ListFaceResultOutput, + DynamicPersonGroupOutput, + ListPersonResultOutput, + CreateLivenessSessionResultOutput, + LivenessSessionOutput, + LivenessSessionItemOutput, + LivenessSessionAuditEntryOutput, + CreateLivenessWithVerifySessionResultOutput, + LivenessWithVerifySessionOutput, +} from "./outputModels.js"; + +/** A successful call returns the long running operation status. */ +export interface GetOperationResult200Response extends HttpResponse { + status: "200"; + body: OperationResultOutput; +} + +export interface GetOperationResultDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetOperationResultDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetOperationResultDefaultHeaders; +} + +/** A successful call returns an array of face entries ranked by face rectangle size in descending order. An empty response indicates no faces detected. */ +export interface DetectFromUrl200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface DetectFromUrlDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DetectFromUrlDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DetectFromUrlDefaultHeaders; +} + +/** A successful call returns an array of face entries ranked by face rectangle size in descending order. An empty response indicates no faces detected. */ +export interface Detect200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface DetectDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DetectDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DetectDefaultHeaders; +} + +/** A successful call returns an array of the most similar faces represented in faceId if the input parameter is faceIds or persistedFaceId if the input parameter is faceListId or largeFaceListId. */ +export interface FindSimilar200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface FindSimilarDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface FindSimilarDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & FindSimilarDefaultHeaders; +} + +/** A successful call returns an array of the most similar faces represented in faceId if the input parameter is faceIds or persistedFaceId if the input parameter is faceListId or largeFaceListId. */ +export interface FindSimilarFromFaceList200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface FindSimilarFromFaceListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface FindSimilarFromFaceListDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & FindSimilarFromFaceListDefaultHeaders; +} + +/** A successful call returns an array of the most similar faces represented in faceId if the input parameter is faceIds or persistedFaceId if the input parameter is faceListId or largeFaceListId. */ +export interface FindSimilarFromLargeFaceList200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface FindSimilarFromLargeFaceListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface FindSimilarFromLargeFaceListDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & FindSimilarFromLargeFaceListDefaultHeaders; +} + +/** A successful call returns the identified candidate person(s) for each query face. */ +export interface IdentifyFromPersonGroup200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface IdentifyFromPersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IdentifyFromPersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & IdentifyFromPersonGroupDefaultHeaders; +} + +/** A successful call returns the identified candidate person(s) for each query face. */ +export interface IdentifyFromLargePersonGroup200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface IdentifyFromLargePersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IdentifyFromLargePersonGroupDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & IdentifyFromLargePersonGroupDefaultHeaders; +} + +/** A successful call returns the identified candidate person(s) for each query face. */ +export interface IdentifyFromPersonDirectory200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface IdentifyFromPersonDirectoryDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IdentifyFromPersonDirectoryDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & IdentifyFromPersonDirectoryDefaultHeaders; +} + +/** A successful call returns the identified candidate person(s) for each query face. */ +export interface IdentifyFromDynamicPersonGroup200Response + extends HttpResponse { + status: "200"; + body: Array; +} + +export interface IdentifyFromDynamicPersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface IdentifyFromDynamicPersonGroupDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & IdentifyFromDynamicPersonGroupDefaultHeaders; +} + +/** A successful call returns the verification result. */ +export interface VerifyFaceToFace200Response extends HttpResponse { + status: "200"; + body: VerificationResultOutput; +} + +export interface VerifyFaceToFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface VerifyFaceToFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & VerifyFaceToFaceDefaultHeaders; +} + +/** A successful call returns the verification result. */ +export interface VerifyFromPersonGroup200Response extends HttpResponse { + status: "200"; + body: VerificationResultOutput; +} + +export interface VerifyFromPersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface VerifyFromPersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & VerifyFromPersonGroupDefaultHeaders; +} + +/** A successful call returns the verification result. */ +export interface VerifyFromLargePersonGroup200Response extends HttpResponse { + status: "200"; + body: VerificationResultOutput; +} + +export interface VerifyFromLargePersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface VerifyFromLargePersonGroupDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & VerifyFromLargePersonGroupDefaultHeaders; +} + +/** A successful call returns the verification result. */ +export interface VerifyFromPersonDirectory200Response extends HttpResponse { + status: "200"; + body: VerificationResultOutput; +} + +export interface VerifyFromPersonDirectoryDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface VerifyFromPersonDirectoryDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & VerifyFromPersonDirectoryDefaultHeaders; +} + +/** A successful call returns one or more groups of similar faces (rank by group size) and a messyGroup. */ +export interface Group200Response extends HttpResponse { + status: "200"; + body: GroupingResultOutput; +} + +export interface GroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GroupDefaultHeaders; +} + +/** The request has succeeded. */ +export interface CreateFaceList200Response extends HttpResponse { + status: "200"; +} + +export interface CreateFaceListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateFaceListDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & CreateFaceListDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeleteFaceList200Response extends HttpResponse { + status: "200"; +} + +export interface DeleteFaceListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteFaceListDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeleteFaceListDefaultHeaders; +} + +/** A successful call returns the Face List's information. */ +export interface GetFaceList200Response extends HttpResponse { + status: "200"; + body: FaceListOutput; +} + +export interface GetFaceListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetFaceListDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetFaceListDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdateFaceList200Response extends HttpResponse { + status: "200"; +} + +export interface UpdateFaceListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdateFaceListDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdateFaceListDefaultHeaders; +} + +/** A successful call returns an array of Face Lists. */ +export interface GetFaceLists200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetFaceListsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetFaceListsDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetFaceListsDefaultHeaders; +} + +/** A successful call returns a new persistedFaceId. */ +export interface AddFaceListFaceFromUrl200Response extends HttpResponse { + status: "200"; + body: AddFaceResultOutput; +} + +export interface AddFaceListFaceFromUrlDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AddFaceListFaceFromUrlDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & AddFaceListFaceFromUrlDefaultHeaders; +} + +/** A successful call returns a new persistedFaceId. */ +export interface AddFaceListFace200Response extends HttpResponse { + status: "200"; + body: AddFaceResultOutput; +} + +export interface AddFaceListFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AddFaceListFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & AddFaceListFaceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeleteFaceListFace200Response extends HttpResponse { + status: "200"; +} + +export interface DeleteFaceListFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteFaceListFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeleteFaceListFaceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface CreateLargeFaceList200Response extends HttpResponse { + status: "200"; +} + +export interface CreateLargeFaceListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateLargeFaceListDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & CreateLargeFaceListDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeleteLargeFaceList200Response extends HttpResponse { + status: "200"; +} + +export interface DeleteLargeFaceListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteLargeFaceListDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeleteLargeFaceListDefaultHeaders; +} + +/** A successful call returns the Large Face List's information. */ +export interface GetLargeFaceList200Response extends HttpResponse { + status: "200"; + body: LargeFaceListOutput; +} + +export interface GetLargeFaceListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLargeFaceListDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLargeFaceListDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdateLargeFaceList200Response extends HttpResponse { + status: "200"; +} + +export interface UpdateLargeFaceListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdateLargeFaceListDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdateLargeFaceListDefaultHeaders; +} + +/** A successful call returns an array of Large Face Lists and their information (largeFaceListId, name and userData). */ +export interface GetLargeFaceLists200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetLargeFaceListsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLargeFaceListsDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLargeFaceListsDefaultHeaders; +} + +/** A successful call returns the Large Face List's training status. */ +export interface GetLargeFaceListTrainingStatus200Response + extends HttpResponse { + status: "200"; + body: TrainingResultOutput; +} + +export interface GetLargeFaceListTrainingStatusDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLargeFaceListTrainingStatusDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLargeFaceListTrainingStatusDefaultHeaders; +} + +export interface TrainLargeFaceList202Headers { + "operation-location": string; +} + +/** A successful call returns an empty response body. */ +export interface TrainLargeFaceList202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & TrainLargeFaceList202Headers; +} + +export interface TrainLargeFaceListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TrainLargeFaceListDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & TrainLargeFaceListDefaultHeaders; +} + +/** The final response for long-running trainLargeFaceList operation */ +export interface TrainLargeFaceListLogicalResponse extends HttpResponse { + status: "200"; +} + +/** A successful call returns a new persistedFaceId. */ +export interface AddLargeFaceListFaceFromUrl200Response extends HttpResponse { + status: "200"; + body: AddFaceResultOutput; +} + +export interface AddLargeFaceListFaceFromUrlDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AddLargeFaceListFaceFromUrlDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & AddLargeFaceListFaceFromUrlDefaultHeaders; +} + +/** A successful call returns a new persistedFaceId. */ +export interface AddLargeFaceListFace200Response extends HttpResponse { + status: "200"; + body: AddFaceResultOutput; +} + +export interface AddLargeFaceListFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AddLargeFaceListFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & AddLargeFaceListFaceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeleteLargeFaceListFace200Response extends HttpResponse { + status: "200"; +} + +export interface DeleteLargeFaceListFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteLargeFaceListFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeleteLargeFaceListFaceDefaultHeaders; +} + +/** A successful call returns target persisted face's information (persistedFaceId and userData). */ +export interface GetLargeFaceListFace200Response extends HttpResponse { + status: "200"; + body: LargeFaceListFaceOutput; +} + +export interface GetLargeFaceListFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLargeFaceListFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLargeFaceListFaceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdateLargeFaceListFace200Response extends HttpResponse { + status: "200"; +} + +export interface UpdateLargeFaceListFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdateLargeFaceListFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdateLargeFaceListFaceDefaultHeaders; +} + +/** A successful call returns an array of persisted faces and their information (persistedFaceId and userData). */ +export interface GetLargeFaceListFaces200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetLargeFaceListFacesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLargeFaceListFacesDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLargeFaceListFacesDefaultHeaders; +} + +/** The request has succeeded. */ +export interface CreatePersonGroup200Response extends HttpResponse { + status: "200"; +} + +export interface CreatePersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreatePersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & CreatePersonGroupDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeletePersonGroup200Response extends HttpResponse { + status: "200"; +} + +export interface DeletePersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeletePersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeletePersonGroupDefaultHeaders; +} + +/** A successful call returns the Person Group's information. */ +export interface GetPersonGroup200Response extends HttpResponse { + status: "200"; + body: PersonGroupOutput; +} + +export interface GetPersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetPersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetPersonGroupDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdatePersonGroup200Response extends HttpResponse { + status: "200"; +} + +export interface UpdatePersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdatePersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdatePersonGroupDefaultHeaders; +} + +/** A successful call returns an array of Person Groups and their information (personGroupId, name and userData). */ +export interface GetPersonGroups200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetPersonGroupsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetPersonGroupsDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetPersonGroupsDefaultHeaders; +} + +/** A successful call returns the Person Group's training status. */ +export interface GetPersonGroupTrainingStatus200Response extends HttpResponse { + status: "200"; + body: TrainingResultOutput; +} + +export interface GetPersonGroupTrainingStatusDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetPersonGroupTrainingStatusDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetPersonGroupTrainingStatusDefaultHeaders; +} + +export interface TrainPersonGroup202Headers { + "operation-location": string; +} + +/** A successful call returns an empty response body. */ +export interface TrainPersonGroup202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & TrainPersonGroup202Headers; +} + +export interface TrainPersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TrainPersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & TrainPersonGroupDefaultHeaders; +} + +/** The final response for long-running trainPersonGroup operation */ +export interface TrainPersonGroupLogicalResponse extends HttpResponse { + status: "200"; +} + +/** A successful call returns a new personId created. */ +export interface CreatePersonGroupPerson200Response extends HttpResponse { + status: "200"; + body: CreatePersonResultOutput; +} + +export interface CreatePersonGroupPersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreatePersonGroupPersonDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & CreatePersonGroupPersonDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeletePersonGroupPerson200Response extends HttpResponse { + status: "200"; +} + +export interface DeletePersonGroupPersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeletePersonGroupPersonDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeletePersonGroupPersonDefaultHeaders; +} + +/** A successful call returns the person's information. */ +export interface GetPersonGroupPerson200Response extends HttpResponse { + status: "200"; + body: PersonGroupPersonOutput; +} + +export interface GetPersonGroupPersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetPersonGroupPersonDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetPersonGroupPersonDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdatePersonGroupPerson200Response extends HttpResponse { + status: "200"; +} + +export interface UpdatePersonGroupPersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdatePersonGroupPersonDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdatePersonGroupPersonDefaultHeaders; +} + +/** A successful call returns an array of person information that belong to the Person Group. */ +export interface GetPersonGroupPersons200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetPersonGroupPersonsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetPersonGroupPersonsDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetPersonGroupPersonsDefaultHeaders; +} + +/** A successful call returns a new persistedFaceId. */ +export interface AddPersonGroupPersonFaceFromUrl200Response + extends HttpResponse { + status: "200"; + body: AddFaceResultOutput; +} + +export interface AddPersonGroupPersonFaceFromUrlDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AddPersonGroupPersonFaceFromUrlDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & AddPersonGroupPersonFaceFromUrlDefaultHeaders; +} + +/** A successful call returns a new persistedFaceId. */ +export interface AddPersonGroupPersonFace200Response extends HttpResponse { + status: "200"; + body: AddFaceResultOutput; +} + +export interface AddPersonGroupPersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AddPersonGroupPersonFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & AddPersonGroupPersonFaceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeletePersonGroupPersonFace200Response extends HttpResponse { + status: "200"; +} + +export interface DeletePersonGroupPersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeletePersonGroupPersonFaceDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeletePersonGroupPersonFaceDefaultHeaders; +} + +/** A successful call returns target persisted face's information (persistedFaceId and userData). */ +export interface GetPersonGroupPersonFace200Response extends HttpResponse { + status: "200"; + body: PersonGroupPersonFaceOutput; +} + +export interface GetPersonGroupPersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetPersonGroupPersonFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetPersonGroupPersonFaceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdatePersonGroupPersonFace200Response extends HttpResponse { + status: "200"; +} + +export interface UpdatePersonGroupPersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdatePersonGroupPersonFaceDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdatePersonGroupPersonFaceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface CreateLargePersonGroup200Response extends HttpResponse { + status: "200"; +} + +export interface CreateLargePersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateLargePersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & CreateLargePersonGroupDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeleteLargePersonGroup200Response extends HttpResponse { + status: "200"; +} + +export interface DeleteLargePersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteLargePersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeleteLargePersonGroupDefaultHeaders; +} + +/** A successful call returns the Large Person Group's information. */ +export interface GetLargePersonGroup200Response extends HttpResponse { + status: "200"; + body: LargePersonGroupOutput; +} + +export interface GetLargePersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLargePersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLargePersonGroupDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdateLargePersonGroup200Response extends HttpResponse { + status: "200"; +} + +export interface UpdateLargePersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdateLargePersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdateLargePersonGroupDefaultHeaders; +} + +/** A successful call returns an array of Large Person Groups and their information (largePersonGroupId, name and userData). */ +export interface GetLargePersonGroups200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetLargePersonGroupsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLargePersonGroupsDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLargePersonGroupsDefaultHeaders; +} + +/** A successful call returns the Large Person Group's training status. */ +export interface GetLargePersonGroupTrainingStatus200Response + extends HttpResponse { + status: "200"; + body: TrainingResultOutput; +} + +export interface GetLargePersonGroupTrainingStatusDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLargePersonGroupTrainingStatusDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLargePersonGroupTrainingStatusDefaultHeaders; +} + +export interface TrainLargePersonGroup202Headers { + "operation-location": string; +} + +/** A successful call returns an empty response body. */ +export interface TrainLargePersonGroup202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & TrainLargePersonGroup202Headers; +} + +export interface TrainLargePersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TrainLargePersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & TrainLargePersonGroupDefaultHeaders; +} + +/** The final response for long-running trainLargePersonGroup operation */ +export interface TrainLargePersonGroupLogicalResponse extends HttpResponse { + status: "200"; +} + +/** A successful call returns a new personId created. */ +export interface CreateLargePersonGroupPerson200Response extends HttpResponse { + status: "200"; + body: CreatePersonResultOutput; +} + +export interface CreateLargePersonGroupPersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateLargePersonGroupPersonDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & CreateLargePersonGroupPersonDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeleteLargePersonGroupPerson200Response extends HttpResponse { + status: "200"; +} + +export interface DeleteLargePersonGroupPersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteLargePersonGroupPersonDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeleteLargePersonGroupPersonDefaultHeaders; +} + +/** A successful call returns the person's information. */ +export interface GetLargePersonGroupPerson200Response extends HttpResponse { + status: "200"; + body: LargePersonGroupPersonOutput; +} + +export interface GetLargePersonGroupPersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLargePersonGroupPersonDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLargePersonGroupPersonDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdateLargePersonGroupPerson200Response extends HttpResponse { + status: "200"; +} + +export interface UpdateLargePersonGroupPersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdateLargePersonGroupPersonDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdateLargePersonGroupPersonDefaultHeaders; +} + +/** A successful call returns an array of person information that belong to the Large Person Group. */ +export interface GetLargePersonGroupPersons200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetLargePersonGroupPersonsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLargePersonGroupPersonsDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLargePersonGroupPersonsDefaultHeaders; +} + +/** A successful call returns a new persistedFaceId. */ +export interface AddLargePersonGroupPersonFaceFromUrl200Response + extends HttpResponse { + status: "200"; + body: AddFaceResultOutput; +} + +export interface AddLargePersonGroupPersonFaceFromUrlDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AddLargePersonGroupPersonFaceFromUrlDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & AddLargePersonGroupPersonFaceFromUrlDefaultHeaders; +} + +/** A successful call returns a new persistedFaceId. */ +export interface AddLargePersonGroupPersonFace200Response extends HttpResponse { + status: "200"; + body: AddFaceResultOutput; +} + +export interface AddLargePersonGroupPersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AddLargePersonGroupPersonFaceDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & AddLargePersonGroupPersonFaceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeleteLargePersonGroupPersonFace200Response + extends HttpResponse { + status: "200"; +} + +export interface DeleteLargePersonGroupPersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteLargePersonGroupPersonFaceDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeleteLargePersonGroupPersonFaceDefaultHeaders; +} + +/** A successful call returns target persisted face's information (persistedFaceId and userData). */ +export interface GetLargePersonGroupPersonFace200Response extends HttpResponse { + status: "200"; + body: LargePersonGroupPersonFaceOutput; +} + +export interface GetLargePersonGroupPersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLargePersonGroupPersonFaceDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLargePersonGroupPersonFaceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdateLargePersonGroupPersonFace200Response + extends HttpResponse { + status: "200"; +} + +export interface UpdateLargePersonGroupPersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdateLargePersonGroupPersonFaceDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdateLargePersonGroupPersonFaceDefaultHeaders; +} + +export interface CreatePerson202Headers { + "operation-location": string; + location: string; +} + +/** A successful call returns an empty response body. The service has accepted the request and will start processing soon. The client can query the operation status and result using the URL specified in the 'Operation-Location' response header. The URL expires in 48 hours. */ +export interface CreatePerson202Response extends HttpResponse { + status: "202"; + body: CreatePersonResultOutput; + headers: RawHttpHeaders & CreatePerson202Headers; +} + +export interface CreatePersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreatePersonDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & CreatePersonDefaultHeaders; +} + +/** The final response for long-running createPerson operation */ +export interface CreatePersonLogicalResponse extends HttpResponse { + status: "200"; + body: CreatePersonResultOutput; +} + +export interface DeletePerson202Headers { + "operation-location": string; +} + +/** A successful call returns an empty response body. The service has accepted the request and will start processing soon. The client can query the operation status and result using the URL specified in the 'Operation-Location' response header. The URL expires in 48 hours. */ +export interface DeletePerson202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & DeletePerson202Headers; +} + +export interface DeletePersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeletePersonDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeletePersonDefaultHeaders; +} + +/** The final response for long-running deletePerson operation */ +export interface DeletePersonLogicalResponse extends HttpResponse { + status: "200"; +} + +/** A successful call returns the person's information. */ +export interface GetPerson200Response extends HttpResponse { + status: "200"; + body: PersonDirectoryPersonOutput; +} + +export interface GetPersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetPersonDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetPersonDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdatePerson200Response extends HttpResponse { + status: "200"; +} + +export interface UpdatePersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdatePersonDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdatePersonDefaultHeaders; +} + +/** A successful call returns an array of Person Directory Persons contained in the Dynamic Person Group. */ +export interface GetPersons200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetPersonsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetPersonsDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetPersonsDefaultHeaders; +} + +/** A successful call returns an array of dynamicPersonGroups information that reference the provided personId. */ +export interface GetDynamicPersonGroupReferences200Response + extends HttpResponse { + status: "200"; + body: ListGroupReferenceResultOutput; +} + +export interface GetDynamicPersonGroupReferencesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetDynamicPersonGroupReferencesDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetDynamicPersonGroupReferencesDefaultHeaders; +} + +export interface AddPersonFace202Headers { + "operation-location": string; + location: string; +} + +/** A successful call returns an empty response body. The service has accepted the request and will start processing soon. The client can query the operation status and result using the URL specified in the 'Operation-Location' response header. The URL expires in 48 hours. */ +export interface AddPersonFace202Response extends HttpResponse { + status: "202"; + body: AddFaceResultOutput; + headers: RawHttpHeaders & AddPersonFace202Headers; +} + +export interface AddPersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AddPersonFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & AddPersonFaceDefaultHeaders; +} + +/** The final response for long-running addPersonFace operation */ +export interface AddPersonFaceLogicalResponse extends HttpResponse { + status: "200"; + body: AddFaceResultOutput; +} + +export interface AddPersonFaceFromUrl202Headers { + "operation-location": string; + location: string; +} + +/** A successful call returns an empty response body. The service has accepted the request and will start processing soon. The client can query the operation status and result using the URL specified in the 'Operation-Location' response header. The URL expires in 48 hours. */ +export interface AddPersonFaceFromUrl202Response extends HttpResponse { + status: "202"; + body: AddFaceResultOutput; + headers: RawHttpHeaders & AddPersonFaceFromUrl202Headers; +} + +export interface AddPersonFaceFromUrlDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AddPersonFaceFromUrlDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & AddPersonFaceFromUrlDefaultHeaders; +} + +/** The final response for long-running addPersonFaceFromUrl operation */ +export interface AddPersonFaceFromUrlLogicalResponse extends HttpResponse { + status: "200"; + body: AddFaceResultOutput; +} + +export interface DeletePersonFace202Headers { + "operation-location": string; +} + +/** A successful call returns an empty response body. The service has accepted the request and will start processing soon. The client can query the operation status and result using the URL specified in the 'Operation-Location' response header. The URL expires in 48 hours. */ +export interface DeletePersonFace202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & DeletePersonFace202Headers; +} + +export interface DeletePersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeletePersonFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeletePersonFaceDefaultHeaders; +} + +/** The final response for long-running deletePersonFace operation */ +export interface DeletePersonFaceLogicalResponse extends HttpResponse { + status: "200"; +} + +/** A successful call returns target persisted face's information (persistedFaceId and userData). */ +export interface GetPersonFace200Response extends HttpResponse { + status: "200"; + body: PersonDirectoryFaceOutput; +} + +export interface GetPersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetPersonFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetPersonFaceDefaultHeaders; +} + +/** The request has succeeded. */ +export interface UpdatePersonFace200Response extends HttpResponse { + status: "200"; +} + +export interface UpdatePersonFaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdatePersonFaceDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdatePersonFaceDefaultHeaders; +} + +/** A successful call returns an array of persistedFaceIds and and a person ID. */ +export interface GetPersonFaces200Response extends HttpResponse { + status: "200"; + body: ListFaceResultOutput; +} + +export interface GetPersonFacesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetPersonFacesDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetPersonFacesDefaultHeaders; +} + +export interface CreateDynamicPersonGroupWithPerson202Headers { + "operation-location": string; +} + +/** A successful call returns an empty response body. The service has accepted the request and will start processing soon. The client can query the operation status and result using the URL specified in the 'Operation-Location' response header. The URL expires in 48 hours. The URL provides the status of when Person Directory "Get Dynamic Person Group References" will return the changes made in this request. */ +export interface CreateDynamicPersonGroupWithPerson202Response + extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & CreateDynamicPersonGroupWithPerson202Headers; +} + +export interface CreateDynamicPersonGroupWithPersonDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateDynamicPersonGroupWithPersonDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & CreateDynamicPersonGroupWithPersonDefaultHeaders; +} + +/** The final response for long-running createDynamicPersonGroupWithPerson operation */ +export interface CreateDynamicPersonGroupWithPersonLogicalResponse + extends HttpResponse { + status: "200"; +} + +/** The request has succeeded. */ +export interface CreateDynamicPersonGroup200Response extends HttpResponse { + status: "200"; +} + +export interface CreateDynamicPersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateDynamicPersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & CreateDynamicPersonGroupDefaultHeaders; +} + +export interface DeleteDynamicPersonGroup202Headers { + "operation-location": string; +} + +/** A successful call returns an empty response body. The service has accepted the request and will start processing soon. The client can query the operation status and result using the URL specified in the 'Operation-Location' response header. The URL expires in 48 hours. The URL provides the status of when Person Directory "Get Dynamic Person Group References" will return the changes made in this request. */ +export interface DeleteDynamicPersonGroup202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & DeleteDynamicPersonGroup202Headers; +} + +export interface DeleteDynamicPersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteDynamicPersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeleteDynamicPersonGroupDefaultHeaders; +} + +/** The final response for long-running deleteDynamicPersonGroup operation */ +export interface DeleteDynamicPersonGroupLogicalResponse extends HttpResponse { + status: "200"; +} + +/** A successful call returns the Dynamic Person Group's information. */ +export interface GetDynamicPersonGroup200Response extends HttpResponse { + status: "200"; + body: DynamicPersonGroupOutput; +} + +export interface GetDynamicPersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetDynamicPersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetDynamicPersonGroupDefaultHeaders; +} + +export interface UpdateDynamicPersonGroupWithPersonChanges202Headers { + "operation-location": string; +} + +/** A successful call returns an empty response body. The service has accepted the request and will start processing soon. The client can query the operation status and result using the URL specified in the 'Operation-Location' response header. The URL expires in 48 hours. The URL provides the status of when Person Directory "Get Dynamic Person Group References" will return the changes made in this request. */ +export interface UpdateDynamicPersonGroupWithPersonChanges202Response + extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & UpdateDynamicPersonGroupWithPersonChanges202Headers; +} + +export interface UpdateDynamicPersonGroupWithPersonChangesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdateDynamicPersonGroupWithPersonChangesDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & + UpdateDynamicPersonGroupWithPersonChangesDefaultHeaders; +} + +/** The final response for long-running updateDynamicPersonGroupWithPersonChanges operation */ +export interface UpdateDynamicPersonGroupWithPersonChangesLogicalResponse + extends HttpResponse { + status: "200"; +} + +/** The request has succeeded. */ +export interface UpdateDynamicPersonGroup200Response extends HttpResponse { + status: "200"; +} + +export interface UpdateDynamicPersonGroupDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface UpdateDynamicPersonGroupDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & UpdateDynamicPersonGroupDefaultHeaders; +} + +/** A successful call returns an array of Dynamic Person Groups and their information (dynamicPersonGroupId, name and userData). */ +export interface GetDynamicPersonGroups200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetDynamicPersonGroupsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetDynamicPersonGroupsDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetDynamicPersonGroupsDefaultHeaders; +} + +/** A successful call returns an array of person information in the Person Directory. */ +export interface GetDynamicPersonGroupPersons200Response extends HttpResponse { + status: "200"; + body: ListPersonResultOutput; +} + +export interface GetDynamicPersonGroupPersonsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetDynamicPersonGroupPersonsDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetDynamicPersonGroupPersonsDefaultHeaders; +} + +/** A successful call create a session for a client device and provide an authorization token for use by the client application for a limited purpose and time. */ +export interface CreateLivenessSession200Response extends HttpResponse { + status: "200"; + body: CreateLivenessSessionResultOutput; +} + +export interface CreateLivenessSessionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateLivenessSessionDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & CreateLivenessSessionDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeleteLivenessSession200Response extends HttpResponse { + status: "200"; +} + +export interface DeleteLivenessSessionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteLivenessSessionDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeleteLivenessSessionDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetLivenessSessionResult200Response extends HttpResponse { + status: "200"; + body: LivenessSessionOutput; +} + +export interface GetLivenessSessionResultDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLivenessSessionResultDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLivenessSessionResultDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetLivenessSessions200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetLivenessSessionsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLivenessSessionsDefaultResponse extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLivenessSessionsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetLivenessSessionAuditEntries200Response + extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetLivenessSessionAuditEntriesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLivenessSessionAuditEntriesDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLivenessSessionAuditEntriesDefaultHeaders; +} + +/** A successful call create a session for a client device and provide an authorization token for use by the client application for a limited purpose and time. */ +export interface CreateLivenessWithVerifySessionWithVerifyImage200Response + extends HttpResponse { + status: "200"; + body: CreateLivenessWithVerifySessionResultOutput; +} + +export interface CreateLivenessWithVerifySessionWithVerifyImageDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateLivenessWithVerifySessionWithVerifyImageDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & + CreateLivenessWithVerifySessionWithVerifyImageDefaultHeaders; +} + +/** A successful call create a session for a client device and provide an authorization token for use by the client application for a limited purpose and time. */ +export interface CreateLivenessWithVerifySession200Response + extends HttpResponse { + status: "200"; + body: CreateLivenessWithVerifySessionResultOutput; +} + +export interface CreateLivenessWithVerifySessionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface CreateLivenessWithVerifySessionDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & CreateLivenessWithVerifySessionDefaultHeaders; +} + +/** The request has succeeded. */ +export interface DeleteLivenessWithVerifySession200Response + extends HttpResponse { + status: "200"; +} + +export interface DeleteLivenessWithVerifySessionDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface DeleteLivenessWithVerifySessionDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & DeleteLivenessWithVerifySessionDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetLivenessWithVerifySessionResult200Response + extends HttpResponse { + status: "200"; + body: LivenessWithVerifySessionOutput; +} + +export interface GetLivenessWithVerifySessionResultDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLivenessWithVerifySessionResultDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLivenessWithVerifySessionResultDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetLivenessWithVerifySessions200Response extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetLivenessWithVerifySessionsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLivenessWithVerifySessionsDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & GetLivenessWithVerifySessionsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface GetLivenessWithVerifySessionAuditEntries200Response + extends HttpResponse { + status: "200"; + body: Array; +} + +export interface GetLivenessWithVerifySessionAuditEntriesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface GetLivenessWithVerifySessionAuditEntriesDefaultResponse + extends HttpResponse { + status: string; + body: FaceErrorResponseOutput; + headers: RawHttpHeaders & + GetLivenessWithVerifySessionAuditEntriesDefaultHeaders; +} diff --git a/sdk/vision/ai-vision-face-rest/test/public/sampleTest.spec.ts b/sdk/vision/ai-vision-face-rest/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..344657d6f17e --- /dev/null +++ b/sdk/vision/ai-vision-face-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/vision/ai-vision-face-rest/test/public/utils/env.browser.ts b/sdk/vision/ai-vision-face-rest/test/public/utils/env.browser.ts new file mode 100644 index 000000000000..fd2aca680c7b --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/test/public/utils/env.browser.ts @@ -0,0 +1,2 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. diff --git a/sdk/vision/ai-vision-face-rest/test/public/utils/env.ts b/sdk/vision/ai-vision-face-rest/test/public/utils/env.ts new file mode 100644 index 000000000000..0e06855b73ae --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/test/public/utils/env.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import * as dotenv from "dotenv"; + +dotenv.config(); diff --git a/sdk/vision/ai-vision-face-rest/test/public/utils/recordedClient.ts b/sdk/vision/ai-vision-face-rest/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..6cc58bc15e11 --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/test/public/utils/recordedClient.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Context } from "mocha"; +import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; +import "./env"; + +const envSetupForPlayback: Record = { + ENDPOINT: "https://endpoint", + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback, +}; + +/** + * 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: Context): Promise { + const recorder = new Recorder(context.currentTest); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/vision/ai-vision-face-rest/tsconfig.browser.config.json b/sdk/vision/ai-vision-face-rest/tsconfig.browser.config.json new file mode 100644 index 000000000000..1b37aebc5457 --- /dev/null +++ b/sdk/vision/ai-vision-face-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/vision/ai-vision-face-rest/tsconfig.json b/sdk/vision/ai-vision-face-rest/tsconfig.json new file mode 100644 index 000000000000..b21bfb510a9d --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../tsconfig.package", + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "rootDir": "." + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.mts", + "./src/**/*.cts", + "test/**/*.ts", + "./test/**/*.ts" + ] +} \ No newline at end of file diff --git a/sdk/vision/ai-vision-face-rest/tsp-location.yaml b/sdk/vision/ai-vision-face-rest/tsp-location.yaml new file mode 100644 index 000000000000..e4904f92aed4 --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/ai/Face +repo: Azure/azure-rest-api-specs +commit: 4d15e8e8e0c72b7e3e2f74186da4b9ed950ce2c2 +additionalDirectories: [] + diff --git a/sdk/vision/ai-vision-face-rest/vitest.browser.config.ts b/sdk/vision/ai-vision-face-rest/vitest.browser.config.ts new file mode 100644 index 000000000000..dc2f66e5d521 --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/vitest.browser.config.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { defineConfig } from "vitest/config"; + +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", + }, + }, +}); diff --git a/sdk/vision/ai-vision-face-rest/vitest.config.ts b/sdk/vision/ai-vision-face-rest/vitest.config.ts new file mode 100644 index 000000000000..7c014c00af62 --- /dev/null +++ b/sdk/vision/ai-vision-face-rest/vitest.config.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { defineConfig } from "vitest/config"; + +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", + }, + }, +}); diff --git a/sdk/vision/ci.yml b/sdk/vision/ci.yml index a4d7842fdb13..28c327af8a19 100644 --- a/sdk/vision/ci.yml +++ b/sdk/vision/ci.yml @@ -1,32 +1,34 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: - - main - - hotfix/* - - release/* - - restapi* + - main + - hotfix/* + - release/* + - restapi* paths: include: - - sdk/vision/ - + - sdk/vision/ pr: branches: include: - - main - - feature/* - - hotfix/* - - release/* - - restapi* + - main + - feature/* + - hotfix/* + - release/* + - restapi* + exclude: + - feature/v4 paths: include: - - sdk/vision/ - + - sdk/vision/ extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: vision Artifacts: - name: azure-rest-ai-vision-image-analysis - safeName: azurerestaivisionimageanalysis \ No newline at end of file + safeName: azurerestaivisionimageanalysis + - name: azure-rest-ai-vision-face + safeName: azurerestaivisionface