diff --git a/.vscode/settings.json b/.vscode/settings.json index 70af7bbae..d0bde7dcb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,5 +9,8 @@ "python.testing.unittestEnabled": true, "python.analysis.enablePytestSupport": false, "python.testing.pytestEnabled": false, - "python.analysis.typeCheckingMode": "strict" + "python.analysis.typeCheckingMode": "standard", + "python.analysis.extraPaths": [ + "./openapi/openapi-client" + ] } \ No newline at end of file diff --git a/docs/source/development.md b/docs/source/development.md new file mode 100644 index 000000000..659fee0f6 --- /dev/null +++ b/docs/source/development.md @@ -0,0 +1,55 @@ +# Development + +This page describes the set-up of a development environment. The project uses a generated client based on Rapidata's OpenApi spec located at https://docs.rabbitdata.ch/. + +## OpenAPI Client generation + +### Download Specs + +The specs used for generation are tracked at `openapi/output.swagger.json`. The following steps are only necessary to synchronize the generated client with the latest spec. + +This requires [openapi-merge-cli](https://www.npmjs.com/package/openapi-merge-cli) installed globally + +``` +npm i -g openapi-merge-cli +``` + +Download and merge the specification from https://docs.rabbitdata.ch/: + +``` +./openapi/download-and-merge-spec.sh +``` + +This should have produced/updated the file at `openapi/output.swagger.json` + +### Generate OpenAPI Client + +This requires [openapi-generator](https://github.com/OpenAPITools/openapi-generator) installed + +``` +brew install openapi-generator +``` + +Execute the generation command by running + +``` +./openapi/generate.sh +``` + +## Python Package Management + +This repository is using [poetry](https://python-poetry.org/) to manage dependencies. + +To set-up a python environment using conda, run: +``` +conda create -n rapi-client +``` + +Then let poetry install all dependencies: + +``` +poetry install +``` + +This will also install the OpenAPI Client located at `openapi/openapi-client` as a development dependency. So any new generation does not require a re-install. + diff --git a/docs/source/index.md b/docs/source/index.md index 6b0f73e77..01835c425 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -10,5 +10,6 @@ Welcome! The Rapidata Python Client is a convenient way to interact with the Rap quickstart examples/index +development ``` \ No newline at end of file diff --git a/examples/classify_order.py b/examples/classify_order.py index ecef6074f..70809a4a1 100644 --- a/examples/classify_order.py +++ b/examples/classify_order.py @@ -5,7 +5,7 @@ from rapidata.rapidata_client import RapidataClient from rapidata.rapidata_client.workflow import FeatureFlags from rapidata.rapidata_client.workflow import ClassifyWorkflow -from rapidata.rapidata_client.workflow.referee import NaiveReferee +from rapidata.rapidata_client.referee import NaiveReferee CLIENT_ID = os.getenv("CLIENT_ID") CLIENT_SECRET = os.getenv("CLIENT_SECRET") @@ -32,7 +32,7 @@ .workflow( ClassifyWorkflow( question="Who should be president?", - categories=["Kamala Harris", "Donald Trump"], + options=["Kamala Harris", "Donald Trump"], ) .referee(NaiveReferee(required_guesses=15)) .feature_flags(FeatureFlags().alert_on_fast_response(3)) diff --git a/openapi/.gitignore b/openapi/.gitignore new file mode 100644 index 000000000..a988cffd1 --- /dev/null +++ b/openapi/.gitignore @@ -0,0 +1,2 @@ +openapi-client/ +spec/ \ No newline at end of file diff --git a/openapi/download-and-merge-spec.sh b/openapi/download-and-merge-spec.sh new file mode 100755 index 000000000..237a8b940 --- /dev/null +++ b/openapi/download-and-merge-spec.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +rm -rf openapi/spec +mkdir openapi/spec + +# Use a function to simulate an associative array +url_for() { + case $1 in + "order") echo "https://api.app.rabbitdata.ch/Order/swagger/v1/swagger.json" ;; + "dataset") echo "https://api.app.rabbitdata.ch/Dataset/swagger/v1/swagger.json" ;; + "identity") echo "https://api.app.rabbitdata.ch/Identity/swagger/v1/swagger.json" ;; + *) echo "" ;; + esac +} + +# List of keys +keys=("order" "dataset" "identity") + +for key in "${keys[@]}"; do + url=$(url_for "$key") + output_json="openapi/spec/${key}.json" + output_ts="openapi/${key}.zod.ts" + + # Download the JSON file using curl + curl -o "$output_json" "$url" + + echo "Downloaded $url to $output_json" + +done + +# Merge the OpenAPI specs into a single file (output.swagger.json) +cd openapi +npx openapi-merge-cli \ No newline at end of file diff --git a/openapi/generate.sh b/openapi/generate.sh new file mode 100755 index 000000000..874568534 --- /dev/null +++ b/openapi/generate.sh @@ -0,0 +1,3 @@ +rm -rf openapi/openapi-client + +openapi-generator generate -i openapi/output.swagger.json -g python -o openapi/openapi-client --skip-validate-spec \ No newline at end of file diff --git a/openapi/openapi-merge.json b/openapi/openapi-merge.json new file mode 100644 index 000000000..2b912477e --- /dev/null +++ b/openapi/openapi-merge.json @@ -0,0 +1,14 @@ +{ + "inputs": [ + { + "inputFile": "./spec/dataset.json" + }, + { + "inputFile": "./spec/order.json" + }, + { + "inputFile": "./spec/identity.json" + } + ], + "output": "./output.swagger.json" +} diff --git a/openapi/output.swagger.json b/openapi/output.swagger.json new file mode 100644 index 000000000..b928580a6 --- /dev/null +++ b/openapi/output.swagger.json @@ -0,0 +1,4906 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Rapidata.Dataset", + "version": "v1" + }, + "security": [ + { + "bearer": [] + } + ], + "paths": { + "/Datapoint/GetById": { + "get": { + "tags": [ + "Datapoint" + ], + "summary": "Get a datapoint by its id.", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The id of the datapoint to get.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Datapoint" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Datapoint" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "text/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Datapoint" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + } + } + } + } + } + }, + "/Datapoint/GetAllDatapointsByDatasetId": { + "get": { + "tags": [ + "Datapoint" + ], + "summary": "Get all datapoints of a dataset.", + "parameters": [ + { + "name": "datasetId", + "in": "query", + "description": "The id of the dataset to get the datapoints of.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/GetDatapointsByDatasetIdResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetDatapointsByDatasetIdResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/GetDatapointsByDatasetIdResult" + } + } + } + } + } + } + }, + "/Datapoint/Delete": { + "delete": { + "tags": [ + "Datapoint" + ], + "summary": "Delete a datapoint.", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The id of the datapoint to delete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Dataset/CreateDatapoint": { + "post": { + "tags": [ + "Dataset" + ], + "summary": "Creates a single datapoint.", + "description": "If multiple files are uploaded, a multi asset datapoint will be created.", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + } + }, + "model": { + "$ref": "#/components/schemas/DatapointMetadataModel" + } + } + }, + "encoding": { + "files": { + "style": "form" + }, + "model": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + } + } + } + } + } + }, + "/Dataset/GetById": { + "get": { + "tags": [ + "Dataset" + ], + "summary": "Gets a dataset by its id.", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The id of the dataset to get.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/GetDatasetByIdResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetDatasetByIdResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/GetDatasetByIdResult" + } + } + } + } + } + } + }, + "/Dataset/UploadDatapoint": { + "post": { + "tags": [ + "Dataset" + ], + "summary": "Creates a new multi asset datapoint.", + "parameters": [ + { + "name": "datasetId", + "in": "query", + "description": "The id of the dataset to upload the datapoint to.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + } + } + } + }, + "encoding": { + "files": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + } + } + } + } + } + }, + "/Dataset/UploadImagesToDataset": { + "post": { + "tags": [ + "Dataset" + ], + "summary": "Uploads images to a dataset.", + "description": "If multiple files are uploaded, a new datapoint will be created for each file.", + "parameters": [ + { + "name": "datasetId", + "in": "query", + "description": "The id of the dataset to upload the images to.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + } + } + } + }, + "encoding": { + "files": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Dataset/UploadTextSourcesToDataset": { + "post": { + "tags": [ + "Dataset" + ], + "summary": "Creates new datapoints from text sources.", + "description": "If multiple text sources are uploaded, a new datapoint will be created for each text source.", + "requestBody": { + "description": "The body of the request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UploadTextSourcesToDatasetModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UploadTextSourcesToDatasetModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UploadTextSourcesToDatasetModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + } + } + } + } + } + }, + "/Dataset/UploadFilesFromS3": { + "post": { + "tags": [ + "Dataset" + ], + "summary": "Uploads files from an S3 bucket to a dataset.", + "description": "A new datapoint will be created for each file in the bucket.", + "requestBody": { + "description": "The body of the request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UploadFilesFromS3BucketModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UploadFilesFromS3BucketModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UploadFilesFromS3BucketModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UploadDatapointsResult" + } + } + } + } + } + } + }, + "/Dataset/UpdateName": { + "post": { + "tags": [ + "Dataset" + ], + "summary": "Updates the name of a dataset.", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The id of the dataset to update.", + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "The new name of the dataset.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Dataset/Import": { + "post": { + "tags": [ + "Dataset" + ], + "summary": "Imports datapoints from a csv file.", + "parameters": [ + { + "name": "datasetId", + "in": "query", + "description": "The id of the dataset to import the datapoints to.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ImportFromFileResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImportFromFileResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ImportFromFileResult" + } + } + } + } + } + } + }, + "/Order/Query": { + "get": { + "tags": [ + "Order" + ], + "summary": "Queries orders based on a filter, page, and sort criteria.", + "parameters": [ + { + "name": "request", + "in": "query", + "description": "The parameters for filtering, paging, and sorting", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryOrdersModel" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/CustomerOrderModelPagedResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomerOrderModelPagedResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CustomerOrderModelPagedResult" + } + } + } + } + } + } + }, + "/Order/GetById": { + "get": { + "tags": [ + "Order" + ], + "summary": "Retrieves an order by its id.", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The id of the order", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/GetOrderByIdResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetOrderByIdResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/GetOrderByIdResult" + } + } + } + } + } + } + }, + "/Order/GetPublic": { + "get": { + "tags": [ + "Order" + ], + "summary": "Retrieves orders that are public and can be cloned by any user.", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/GetPublicOrdersResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPublicOrdersResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/GetPublicOrdersResult" + } + } + } + } + } + } + }, + "/Order/GetWorkflowConfig": { + "get": { + "tags": [ + "Order" + ], + "summary": "Retrieves the workflow configuration for an order.", + "description": "A workflow configuration defines how rapids are created, processed, and aggregated.", + "parameters": [ + { + "name": "OrderId", + "in": "query", + "description": "The id of the order", + "schema": { + "type": "string" + } + }, + { + "name": "ArtifactIdentifier", + "in": "query", + "description": "The identifier of the workflow config artifact in the pipeline. If using the default pipeline this is not needed.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/GetWorkflowConfigResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWorkflowConfigResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/GetWorkflowConfigResult" + } + } + } + } + } + } + }, + "/Order/Create": { + "post": { + "tags": [ + "Order" + ], + "summary": "Used to create a new order.", + "requestBody": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/CreateOrderResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderResult" + } + } + } + } + } + } + }, + "/Order/CreateComplexOrder": { + "post": { + "tags": [ + "Order" + ], + "summary": "Creates a new order with a custom pipeline.", + "requestBody": { + "description": "The body content of the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateComplexOrderModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CreateComplexOrderModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CreateComplexOrderModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/CreateComplexOrderResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateComplexOrderResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CreateComplexOrderResult" + } + } + } + } + } + } + }, + "/Order/CreateDefaultOrder": { + "post": { + "tags": [ + "Order" + ], + "summary": "Creates a new order with a default pipeline.", + "requestBody": { + "description": "The body content of the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDefaultOrderModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CreateDefaultOrderModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CreateDefaultOrderModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/CreateLegacyOrderResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLegacyOrderResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CreateLegacyOrderResult" + } + } + } + } + }, + "deprecated": true + } + }, + "/Order/CreateUnsupportedOrder": { + "post": { + "tags": [ + "Order" + ], + "summary": "Notifies the admins that a user wants to create an order with an unsupported label type or data type.", + "requestBody": { + "description": "The body content of the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateUnsupportedOrderModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CreateUnsupportedOrderModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CreateUnsupportedOrderModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Order/CloneOrder": { + "post": { + "tags": [ + "Order" + ], + "summary": "Clones an existing order.", + "description": "In order to clone an order, the existing order must be marked as public.", + "requestBody": { + "description": "The body content of the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloneOrderModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CloneOrderModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CloneOrderModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/CloneOrderResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloneOrderResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CloneOrderResult" + } + } + } + } + } + } + }, + "/Order/Unlock": { + "post": { + "tags": [ + "Order" + ], + "summary": "Unlocks a newly cloned order.", + "description": "When an order is cloned only the necessary information is copied.\r\nIn order to make changes to the order, it must be unlocked first.\r\nUnlocking the order will clone the entire dataset and its datapoints.", + "parameters": [ + { + "name": "orderId", + "in": "query", + "description": "The id of the order to unlock", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/UnlockOrderResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnlockOrderResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UnlockOrderResult" + } + } + } + } + } + } + }, + "/Order/UpdateWorkflowConfig": { + "put": { + "tags": [ + "Order" + ], + "summary": "Updates the workflow configuration of an order.", + "description": "A workflow configuration defines how rapids are created, processed, and aggregated.", + "requestBody": { + "description": "The body content of the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWorkflowConfigModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWorkflowConfigModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UpdateWorkflowConfigModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Order/UpdateAccess": { + "put": { + "tags": [ + "Order" + ], + "summary": "Updates whether an order is public or not.", + "parameters": [ + { + "name": "orderId", + "in": "query", + "description": "The id of the order to update", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The body content of the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateAccessModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UpdateAccessModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UpdateAccessModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Order/Submit": { + "post": { + "tags": [ + "Order" + ], + "summary": "Submits an order for approval.", + "description": "Once an order is created its order id and dataset id is returned.\r\nThe dataset id can be used to fill the dataset with data points.\r\nOnce submitted, the order will be locked and no further changes can be made.", + "parameters": [ + { + "name": "orderId", + "in": "query", + "description": "The id of the order to submit", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Order/Approve": { + "post": { + "tags": [ + "Order" + ], + "summary": "Approves an order that has been submitted for manual approval.", + "description": "An order is submitted for manual approval when the automatic approval process could not automatically\r\ndetermine if the order is safe to process.\r\n \r\nOnce an order is approved, the pipeline will start processing the order.", + "parameters": [ + { + "name": "orderId", + "in": "query", + "description": "The id of the order to approve", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Order/UpdateOrderName": { + "put": { + "tags": [ + "Order" + ], + "summary": "Updates the name of an order.", + "parameters": [ + { + "name": "orderId", + "in": "query", + "description": "The id of the order to update", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The body content of the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrderModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrderModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrderModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Order/GetOrderResults": { + "get": { + "tags": [ + "Order" + ], + "summary": "Aggregates the results of an order.", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The id of the order", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/GetOrderResultsResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetOrderResultsResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/GetOrderResultsResult" + } + } + } + } + } + } + }, + "/Order/RetryFailed": { + "post": { + "tags": [ + "Order" + ], + "summary": "Retries a failed order.", + "parameters": [ + { + "name": "orderId", + "in": "query", + "description": "The id of the order to retry", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Order/Delete": { + "delete": { + "tags": [ + "Order" + ], + "summary": "Deletes an order.", + "parameters": [ + { + "name": "orderId", + "in": "query", + "description": "The id of the order to delete", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Order/Feedback": { + "post": { + "tags": [ + "Order" + ], + "summary": "Submits feedback about our services.", + "requestBody": { + "description": "The body content of the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedbackModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/FeedbackModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/FeedbackModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Identity/CreateClient": { + "post": { + "tags": [ + "Identity" + ], + "summary": "Creates a new client for a customer.", + "description": "A client represents an application or project that a customer might use to access the API.\r\nThe clients are used for machine-to-machine communication.", + "requestBody": { + "description": "The model for creating a new client.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateClientModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CreateClientModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CreateClientModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Identity/Logout": { + "post": { + "tags": [ + "Identity" + ], + "summary": "Logs out the current user by deleting the refresh token cookie.", + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Identity/Index": { + "post": { + "tags": [ + "Identity" + ], + "summary": "Logs in a user by username or email and password.", + "requestBody": { + "description": "The model containing the username or email and password.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/LoginModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/LoginModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Identity/ExternalLoginCallback": { + "get": { + "tags": [ + "Identity" + ], + "summary": "Logs in a user using after receiving a grant from an external provider.", + "parameters": [ + { + "name": "returnUrl", + "in": "query", + "description": "The URL to redirect to after logging in.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "302": { + "description": "Found" + } + } + } + }, + "/Identity/ExternalLogin": { + "post": { + "tags": [ + "Identity" + ], + "summary": "Logs in a user using an external provider.", + "parameters": [ + { + "name": "provider", + "in": "query", + "description": "The name of the external provider.", + "schema": { + "type": "string" + } + }, + { + "name": "returnUrl", + "in": "query", + "description": "The URL to redirect to after logging in.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "302": { + "description": "Found" + } + } + } + }, + "/Identity/GetAuthToken": { + "get": { + "tags": [ + "Identity" + ], + "summary": "Issues a new auth token using the refresh token.", + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Identity/GetClientAuthToken": { + "post": { + "tags": [ + "Identity" + ], + "summary": "Issues a new auth token using the client credentials.", + "parameters": [ + { + "name": "clientId", + "in": "query", + "description": "The id of the client to issue the token for.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/IssueClientAuthTokenResult" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/IssueClientAuthTokenResult" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/IssueClientAuthTokenResult" + } + } + } + } + } + } + }, + "/Identity/RequestReset": { + "post": { + "tags": [ + "Identity" + ], + "summary": "Request a password reset for a user.", + "requestBody": { + "description": "The command containing the user's email.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestPasswordResetCommand" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/RequestPasswordResetCommand" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/RequestPasswordResetCommand" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Identity/SubmitReset": { + "post": { + "tags": [ + "Identity" + ], + "summary": "Updates the password of a user after a password reset request.", + "requestBody": { + "description": "The command containing the user's email, the reset token and the new password.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmitPasswordResetCommand" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/SubmitPasswordResetCommand" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/SubmitPasswordResetCommand" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Identity/Confirm": { + "get": { + "tags": [ + "Identity" + ], + "summary": "Confirms a user's signup by a token.", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The id of the user to confirm the signup for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "token", + "in": "query", + "description": "The confirmation token received by mail.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Identity/Signup": { + "post": { + "tags": [ + "Identity" + ], + "summary": "Signs up a new user.", + "requestBody": { + "description": "The body to sign up the user with.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SignupCustomerModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/SignupCustomerModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/SignupCustomerModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Identity/Temporary": { + "post": { + "tags": [ + "Identity" + ], + "summary": "Creates a new temporary user.", + "requestBody": { + "description": "The model to create the temporary user with.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SignupShadowCustomerModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/SignupShadowCustomerModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/SignupShadowCustomerModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Newsletter": { + "post": { + "tags": [ + "Newsletter" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewsletterModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/NewsletterModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/NewsletterModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/Newsletter/Unsubscribe": { + "post": { + "tags": [ + "Newsletter" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewsletterModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/NewsletterModel" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/NewsletterModel" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "BaseError": { + "type": "object", + "properties": { + "errorType": { + "$ref": "#/components/schemas/ErrorType" + }, + "errorMessage": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ClassificationMetadata": { + "title": "ClassificationMetadata", + "required": [ + "_t", + "classification" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "ClassificationMetadata" + ], + "type": "string", + "description": "Discriminator value for ClassificationMetadata", + "example": "ClassificationMetadata" + }, + "classification": { + "type": "string" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + }, + "identifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CountMetadata": { + "title": "CountMetadata", + "required": [ + "_t", + "count" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "CountMetadata" + ], + "type": "string", + "description": "Discriminator value for CountMetadata", + "example": "CountMetadata" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "identifier": { + "type": "string" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + } + }, + "additionalProperties": false + }, + "Datapoint": { + "title": "Datapoint", + "required": [ + "_t", + "asset", + "datasetId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "Datapoint" + ], + "type": "string", + "description": "Discriminator value for Datapoint", + "example": "Datapoint" + }, + "asset": { + "oneOf": [ + { + "$ref": "#/components/schemas/FileAsset" + }, + { + "$ref": "#/components/schemas/MultiAsset" + }, + { + "$ref": "#/components/schemas/NullAsset" + }, + { + "$ref": "#/components/schemas/TextAsset" + } + ], + "discriminator": { + "propertyName": "_t" + } + }, + "datasetId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "deletionDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "deleterId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false + }, + "DatapointMetadataModel": { + "required": [ + "datasetId", + "metadata" + ], + "type": "object", + "properties": { + "datasetId": { + "type": "string", + "description": "The id of the dataset to create the datapoint in." + }, + "metadata": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PromptMetadataInput" + }, + { + "$ref": "#/components/schemas/PublicTextMetadataInput" + }, + { + "$ref": "#/components/schemas/TranscriptionMetadataInput" + } + ], + "discriminator": { + "propertyName": "_t" + } + }, + "description": "The metadata of the datapoint." + } + }, + "additionalProperties": false, + "description": "The model for creating a datapoint." + }, + "DatapointModel": { + "required": [ + "asset", + "datasetId", + "id" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "datasetId": { + "type": "string" + }, + "asset": { + "oneOf": [ + { + "$ref": "#/components/schemas/FileAssetModel" + }, + { + "$ref": "#/components/schemas/MultiAssetModel" + }, + { + "$ref": "#/components/schemas/NullAssetModel" + }, + { + "$ref": "#/components/schemas/TextAssetModel" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "additionalProperties": false + }, + "ErrorType": { + "enum": [ + "Validation", + "Authorization", + "Runtime", + "NotFound", + "Timeout" + ], + "type": "string" + }, + "FileAsset": { + "title": "FileAsset", + "required": [ + "_t", + "fileName", + "originalFileName" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "FileAsset" + ], + "type": "string", + "description": "Discriminator value for FileAsset", + "example": "FileAsset" + }, + "fileName": { + "type": "string" + }, + "originalFileName": { + "type": "string" + }, + "metadata": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ClassificationMetadata" + }, + { + "$ref": "#/components/schemas/CountMetadata" + }, + { + "$ref": "#/components/schemas/ImageDimensionMetadata" + }, + { + "$ref": "#/components/schemas/LocationMetadata" + }, + { + "$ref": "#/components/schemas/OriginalFilenameMetadata" + }, + { + "$ref": "#/components/schemas/PromptMetadata" + }, + { + "$ref": "#/components/schemas/TextMetadata" + }, + { + "$ref": "#/components/schemas/TranscriptionMetadata" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + } + }, + "additionalProperties": false + }, + "FileAssetModel": { + "title": "FileAssetModel", + "required": [ + "_t", + "fileName", + "identifier", + "metadata" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "FileAssetModel" + ], + "type": "string", + "description": "Discriminator value for FileAssetModel", + "example": "FileAssetModel" + }, + "fileName": { + "type": "string" + }, + "metadata": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ClassificationMetadata" + }, + { + "$ref": "#/components/schemas/CountMetadata" + }, + { + "$ref": "#/components/schemas/ImageDimensionMetadata" + }, + { + "$ref": "#/components/schemas/LocationMetadata" + }, + { + "$ref": "#/components/schemas/OriginalFilenameMetadata" + }, + { + "$ref": "#/components/schemas/PromptMetadata" + }, + { + "$ref": "#/components/schemas/TextMetadata" + }, + { + "$ref": "#/components/schemas/TranscriptionMetadata" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "identifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "GetDatapointsByDatasetIdResult": { + "required": [ + "list" + ], + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DatapointModel" + } + } + }, + "additionalProperties": false + }, + "GetDatasetByIdResult": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ImageDimensionMetadata": { + "title": "ImageDimensionMetadata", + "required": [ + "_t" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "ImageDimensionMetadata" + ], + "type": "string", + "description": "Discriminator value for ImageDimensionMetadata", + "example": "ImageDimensionMetadata" + }, + "height": { + "type": "integer", + "format": "int32" + }, + "width": { + "type": "integer", + "format": "int32" + }, + "identifier": { + "type": "string" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + } + }, + "additionalProperties": false + }, + "ImportFromFileResult": { + "required": [ + "datasetId" + ], + "type": "object", + "properties": { + "datasetId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "LocationMetadata": { + "title": "LocationMetadata", + "required": [ + "_t", + "x", + "y" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "LocationMetadata" + ], + "type": "string", + "description": "Discriminator value for LocationMetadata", + "example": "LocationMetadata" + }, + "x": { + "type": "number", + "format": "float" + }, + "y": { + "type": "number", + "format": "float" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + }, + "identifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "MetadataVisibilities": { + "enum": [ + "None", + "Users", + "Customers", + "Admins", + "All" + ], + "type": "string" + }, + "MultiAsset": { + "title": "MultiAsset", + "required": [ + "_t", + "assets" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "MultiAsset" + ], + "type": "string", + "description": "Discriminator value for MultiAsset", + "example": "MultiAsset" + }, + "assets": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/FileAsset" + }, + { + "$ref": "#/components/schemas/MultiAsset" + }, + { + "$ref": "#/components/schemas/NullAsset" + }, + { + "$ref": "#/components/schemas/TextAsset" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "metadata": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ClassificationMetadata" + }, + { + "$ref": "#/components/schemas/CountMetadata" + }, + { + "$ref": "#/components/schemas/ImageDimensionMetadata" + }, + { + "$ref": "#/components/schemas/LocationMetadata" + }, + { + "$ref": "#/components/schemas/OriginalFilenameMetadata" + }, + { + "$ref": "#/components/schemas/PromptMetadata" + }, + { + "$ref": "#/components/schemas/TextMetadata" + }, + { + "$ref": "#/components/schemas/TranscriptionMetadata" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + } + }, + "additionalProperties": false + }, + "MultiAssetModel": { + "title": "MultiAssetModel", + "required": [ + "_t", + "assets", + "identifier", + "metadata" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "MultiAssetModel" + ], + "type": "string", + "description": "Discriminator value for MultiAssetModel", + "example": "MultiAssetModel" + }, + "assets": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/FileAssetModel" + }, + { + "$ref": "#/components/schemas/MultiAssetModel" + }, + { + "$ref": "#/components/schemas/NullAssetModel" + }, + { + "$ref": "#/components/schemas/TextAssetModel" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "metadata": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ClassificationMetadata" + }, + { + "$ref": "#/components/schemas/CountMetadata" + }, + { + "$ref": "#/components/schemas/ImageDimensionMetadata" + }, + { + "$ref": "#/components/schemas/LocationMetadata" + }, + { + "$ref": "#/components/schemas/OriginalFilenameMetadata" + }, + { + "$ref": "#/components/schemas/PromptMetadata" + }, + { + "$ref": "#/components/schemas/TextMetadata" + }, + { + "$ref": "#/components/schemas/TranscriptionMetadata" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "identifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "NullAsset": { + "title": "NullAsset", + "required": [ + "_t" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "NullAsset" + ], + "type": "string", + "description": "Discriminator value for NullAsset", + "example": "NullAsset" + }, + "metadata": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ClassificationMetadata" + }, + { + "$ref": "#/components/schemas/CountMetadata" + }, + { + "$ref": "#/components/schemas/ImageDimensionMetadata" + }, + { + "$ref": "#/components/schemas/LocationMetadata" + }, + { + "$ref": "#/components/schemas/OriginalFilenameMetadata" + }, + { + "$ref": "#/components/schemas/PromptMetadata" + }, + { + "$ref": "#/components/schemas/TextMetadata" + }, + { + "$ref": "#/components/schemas/TranscriptionMetadata" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + } + }, + "additionalProperties": false + }, + "NullAssetModel": { + "title": "NullAssetModel", + "required": [ + "_t", + "identifier", + "metadata" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "NullAssetModel" + ], + "type": "string", + "description": "Discriminator value for NullAssetModel", + "example": "NullAssetModel" + }, + "metadata": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ClassificationMetadata" + }, + { + "$ref": "#/components/schemas/CountMetadata" + }, + { + "$ref": "#/components/schemas/ImageDimensionMetadata" + }, + { + "$ref": "#/components/schemas/LocationMetadata" + }, + { + "$ref": "#/components/schemas/OriginalFilenameMetadata" + }, + { + "$ref": "#/components/schemas/PromptMetadata" + }, + { + "$ref": "#/components/schemas/TextMetadata" + }, + { + "$ref": "#/components/schemas/TranscriptionMetadata" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "identifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "OriginalFilenameMetadata": { + "title": "OriginalFilenameMetadata", + "required": [ + "_t", + "originalFilename" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "OriginalFilenameMetadata" + ], + "type": "string", + "description": "Discriminator value for OriginalFilenameMetadata", + "example": "OriginalFilenameMetadata" + }, + "originalFilename": { + "type": "string" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + }, + "identifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PromptMetadata": { + "title": "PromptMetadata", + "required": [ + "_t", + "prompt" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "PromptMetadata" + ], + "type": "string", + "description": "Discriminator value for PromptMetadata", + "example": "PromptMetadata" + }, + "prompt": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + } + }, + "additionalProperties": false + }, + "PromptMetadataInput": { + "title": "PromptMetadataInput", + "required": [ + "_t", + "identifier", + "prompt" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "PromptMetadataInput" + ], + "type": "string", + "description": "Discriminator value for PromptMetadataInput", + "example": "PromptMetadataInput" + }, + "prompt": { + "type": "string" + }, + "identifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PublicTextMetadataInput": { + "title": "PublicTextMetadataInput", + "required": [ + "_t", + "identifier", + "text" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "PublicTextMetadataInput" + ], + "type": "string", + "description": "Discriminator value for PublicTextMetadataInput", + "example": "PublicTextMetadataInput" + }, + "text": { + "type": "string" + }, + "identifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "TextAsset": { + "title": "TextAsset", + "required": [ + "_t", + "metadata", + "text" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "TextAsset" + ], + "type": "string", + "description": "Discriminator value for TextAsset", + "example": "TextAsset" + }, + "metadata": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ClassificationMetadata" + }, + { + "$ref": "#/components/schemas/CountMetadata" + }, + { + "$ref": "#/components/schemas/ImageDimensionMetadata" + }, + { + "$ref": "#/components/schemas/LocationMetadata" + }, + { + "$ref": "#/components/schemas/OriginalFilenameMetadata" + }, + { + "$ref": "#/components/schemas/PromptMetadata" + }, + { + "$ref": "#/components/schemas/TextMetadata" + }, + { + "$ref": "#/components/schemas/TranscriptionMetadata" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "TextAssetModel": { + "title": "TextAssetModel", + "required": [ + "_t", + "identifier", + "metadata", + "text" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "TextAssetModel" + ], + "type": "string", + "description": "Discriminator value for TextAssetModel", + "example": "TextAssetModel" + }, + "text": { + "type": "string" + }, + "metadata": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ClassificationMetadata" + }, + { + "$ref": "#/components/schemas/CountMetadata" + }, + { + "$ref": "#/components/schemas/ImageDimensionMetadata" + }, + { + "$ref": "#/components/schemas/LocationMetadata" + }, + { + "$ref": "#/components/schemas/OriginalFilenameMetadata" + }, + { + "$ref": "#/components/schemas/PromptMetadata" + }, + { + "$ref": "#/components/schemas/TextMetadata" + }, + { + "$ref": "#/components/schemas/TranscriptionMetadata" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "identifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "TextMetadata": { + "title": "TextMetadata", + "required": [ + "_t", + "identifier", + "text", + "visibilities" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "TextMetadata" + ], + "type": "string", + "description": "Discriminator value for TextMetadata", + "example": "TextMetadata" + }, + "text": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + } + }, + "additionalProperties": false + }, + "TranscriptionMetadata": { + "title": "TranscriptionMetadata", + "required": [ + "_t", + "identifier", + "transcription", + "visibilities" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "TranscriptionMetadata" + ], + "type": "string", + "description": "Discriminator value for TranscriptionMetadata", + "example": "TranscriptionMetadata" + }, + "identifier": { + "type": "string" + }, + "visibilities": { + "$ref": "#/components/schemas/MetadataVisibilities" + }, + "transcription": { + "type": "string" + } + }, + "additionalProperties": false + }, + "TranscriptionMetadataInput": { + "title": "TranscriptionMetadataInput", + "required": [ + "_t", + "identifier", + "transcription" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "TranscriptionMetadataInput" + ], + "type": "string", + "description": "Discriminator value for TranscriptionMetadataInput", + "example": "TranscriptionMetadataInput" + }, + "transcription": { + "type": "string" + }, + "identifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "UploadDatapointsResult": { + "required": [ + "createdCount", + "errors" + ], + "type": "object", + "properties": { + "createdCount": { + "type": "integer", + "format": "int64" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseError" + } + } + }, + "additionalProperties": false + }, + "UploadFilesFromS3BucketModel": { + "required": [ + "accessKey", + "bucketName", + "clearDataset", + "datasetId", + "region", + "secretKey", + "sourcePrefix", + "useCustomAwsCredentials" + ], + "type": "object", + "properties": { + "datasetId": { + "type": "string", + "description": "The id of the dataset to upload the files to." + }, + "bucketName": { + "type": "string", + "description": "The name of the S3 bucket to upload the files from." + }, + "region": { + "type": "string", + "description": "The region of the S3 bucket." + }, + "sourcePrefix": { + "type": "string", + "description": "The prefix of the files to upload." + }, + "accessKey": { + "type": "string", + "description": "The access key to use for the S3 bucket." + }, + "secretKey": { + "type": "string", + "description": "The secret key to use for the S3 bucket." + }, + "useCustomAwsCredentials": { + "type": "boolean", + "description": "Whether to use custom AWS credentials." + }, + "clearDataset": { + "type": "boolean", + "description": "Whether to clear the dataset before uploading the files." + } + }, + "additionalProperties": false, + "description": "The model for uploading files from an S3 bucket to a dataset." + }, + "UploadTextSourcesToDatasetModel": { + "required": [ + "datasetId", + "textSources" + ], + "type": "object", + "properties": { + "datasetId": { + "type": "string", + "description": "The id of the dataset to upload the text sources to." + }, + "textSources": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The text sources to upload." + } + }, + "additionalProperties": false, + "description": "The model for uploading text sources to a dataset." + }, + "AgeGroup": { + "enum": [ + "0-18", + "19-30", + "31-50", + "51-65", + "65+" + ], + "type": "string", + "description": "The valid age groups." + }, + "AgeUserFilterModel": { + "title": "AgeFilter", + "required": [ + "_t", + "ageGroups" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "AgeFilter" + ], + "type": "string", + "description": "Discriminator value for AgeFilter", + "example": "AgeFilter" + }, + "ageGroups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AgeGroup" + }, + "description": "A whitelist for age groups." + } + }, + "additionalProperties": false, + "description": "The AgeFilter is used to restrict users to age groups." + }, + "AggregatorType": { + "enum": [ + "NonCommittal", + "MajorityVote", + "SimpleMatchup", + "LocateCluster", + "Classification", + "Locate", + "BoundingBox", + "Line", + "Transcription", + "SinglePointLocate", + "FreeText" + ], + "type": "string" + }, + "AttachCategoryRapidBlueprint": { + "title": "ClassifyBlueprint", + "required": [ + "_t", + "possibleCategories", + "title" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "ClassifyBlueprint" + ], + "type": "string", + "description": "Discriminator value for ClassifyBlueprint", + "example": "ClassifyBlueprint" + }, + "possibleCategories": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + } + }, + "additionalProperties": false + }, + "BoundingBoxRapidBlueprint": { + "title": "BoundingBoxBlueprint", + "required": [ + "_t", + "target" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "BoundingBoxBlueprint" + ], + "type": "string", + "description": "Discriminator value for BoundingBoxBlueprint", + "example": "BoundingBoxBlueprint" + }, + "target": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ClassificationMetadataFilterConfig": { + "title": "ClassificationMetadataFilterConfig", + "required": [ + "_t", + "classification" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "ClassificationMetadataFilterConfig" + ], + "type": "string", + "description": "Discriminator value for ClassificationMetadataFilterConfig", + "example": "ClassificationMetadataFilterConfig" + }, + "classification": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CloneDatasetModel": { + "title": "CloneDatasetModel", + "required": [ + "_t", + "datasetName", + "datasetToCloneId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "CloneDatasetModel" + ], + "type": "string", + "description": "Discriminator value for CloneDatasetModel", + "example": "CloneDatasetModel" + }, + "datasetToCloneId": { + "type": "string" + }, + "datasetName": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CloneOrderModel": { + "required": [ + "orderName", + "orderToCloneId" + ], + "type": "object", + "properties": { + "orderName": { + "type": "string", + "description": "The name of the new order" + }, + "orderToCloneId": { + "type": "string", + "description": "The id of the order to clone" + } + }, + "additionalProperties": false, + "description": "The model for cloning an existing order." + }, + "CloneOrderResult": { + "required": [ + "datasetId", + "orderId" + ], + "type": "object", + "properties": { + "datasetId": { + "type": "string" + }, + "orderId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CompareRapidBlueprint": { + "title": "CompareBlueprint", + "required": [ + "_t", + "criteria" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "CompareBlueprint" + ], + "type": "string", + "description": "Discriminator value for CompareBlueprint", + "example": "CompareBlueprint" + }, + "criteria": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CompareWorkflowConfig": { + "title": "CompareWorkflowConfig", + "required": [ + "_t", + "criteria", + "referee", + "targetCountryCodes" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "CompareWorkflowConfig" + ], + "type": "string", + "description": "Discriminator value for CompareWorkflowConfig", + "example": "CompareWorkflowConfig" + }, + "criteria": { + "type": "string" + }, + "startingElo": { + "type": "integer", + "format": "int32" + }, + "kFactor": { + "type": "integer", + "format": "int32" + }, + "matchSize": { + "type": "integer", + "format": "int32" + }, + "scalingFactor": { + "type": "integer", + "format": "int32" + }, + "matchesUntilCompleted": { + "type": "integer", + "format": "int32" + }, + "referee": { + "oneOf": [ + { + "$ref": "#/components/schemas/NaiveRefereeConfig" + }, + { + "$ref": "#/components/schemas/NeverEndingRefereeConfig" + }, + { + "$ref": "#/components/schemas/ProbabilisticAttachCategoryRefereeConfig" + } + ], + "discriminator": { + "propertyName": "_t" + } + }, + "targetCountryCodes": { + "type": "array", + "items": { + "type": "string" + } + }, + "featureFlags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FeatureFlag" + } + }, + "priority": { + "type": "string", + "nullable": true + }, + "isFallback": { + "type": "boolean" + }, + "rapidSelectionConfigs": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OnlyValidationWorkflowRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/CorrelatedRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/DemographicRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/StaticRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/ValidationRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/ConditionalValidationRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/NoValidationWorkflowRapidSelectionConfig" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + } + }, + "additionalProperties": false + }, + "ConditionalValidationRapidSelectionConfig": { + "title": "ConditionalValidationRapidSelectionConfig", + "required": [ + "_t", + "validationChances", + "validationSetId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "ConditionalValidationRapidSelectionConfig" + ], + "type": "string", + "description": "Discriminator value for ConditionalValidationRapidSelectionConfig", + "example": "ConditionalValidationRapidSelectionConfig" + }, + "validationSetId": { + "type": "string" + }, + "validationChances": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ValidationChance" + } + }, + "amount": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + }, + "CorrelatedRapidSelectionConfig": { + "title": "CorrelatedRapidSelectionConfig", + "required": [ + "_t", + "amount", + "correlationId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "CorrelatedRapidSelectionConfig" + ], + "type": "string", + "description": "Discriminator value for CorrelatedRapidSelectionConfig", + "example": "CorrelatedRapidSelectionConfig" + }, + "correlationId": { + "type": "string" + }, + "amount": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "CountClassificationMetadataFilterConfig": { + "title": "CountClassificationMetadataFilterConfig", + "required": [ + "_t" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "CountClassificationMetadataFilterConfig" + ], + "type": "string", + "description": "Discriminator value for CountClassificationMetadataFilterConfig", + "example": "CountClassificationMetadataFilterConfig" + } + }, + "additionalProperties": false + }, + "CountryUserFilterModel": { + "title": "CountryFilter", + "required": [ + "_t", + "countries" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "CountryFilter" + ], + "type": "string", + "description": "Discriminator value for CountryFilter", + "example": "CountryFilter" + }, + "countries": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A whitelist for countries in the ISO 3166-1 alpha-2 format." + } + }, + "additionalProperties": false, + "description": "The CountryUserFilter is used to restrict users to specific countries." + }, + "CreateComplexOrderModel": { + "required": [ + "orderName", + "pipeline" + ], + "type": "object", + "properties": { + "orderName": { + "type": "string", + "description": "The name of the order" + }, + "pipeline": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateSimplePipelineModel" + } + ], + "description": "The pipeline to use", + "discriminator": { + "propertyName": "_t" + } + }, + "isPublic": { + "type": "boolean", + "description": "Whether the order is public", + "default": false + } + }, + "additionalProperties": false, + "description": "The model for creating a new order with a custom pipeline." + }, + "CreateComplexOrderResult": { + "required": [ + "datasetId", + "orderId" + ], + "type": "object", + "properties": { + "datasetId": { + "type": "string" + }, + "orderId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CreateDatasetArtifactModel": { + "title": "CreateDatasetArtifactModel", + "required": [ + "_t", + "dataset", + "identifier" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "CreateDatasetArtifactModel" + ], + "type": "string", + "description": "Discriminator value for CreateDatasetArtifactModel", + "example": "CreateDatasetArtifactModel" + }, + "identifier": { + "type": "string" + }, + "dataset": { + "oneOf": [ + { + "$ref": "#/components/schemas/CloneDatasetModel" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "additionalProperties": false + }, + "CreateDefaultOrderModel": { + "required": [ + "datasetName", + "isPublic", + "orderName", + "workflowConfig" + ], + "type": "object", + "properties": { + "orderName": { + "type": "string", + "description": "The name of the order" + }, + "datasetName": { + "type": "string", + "description": "The name of the dataset" + }, + "isPublic": { + "type": "boolean", + "description": "Whether the order is public" + }, + "workflowConfig": { + "oneOf": [ + { + "$ref": "#/components/schemas/CompareWorkflowConfig" + }, + { + "$ref": "#/components/schemas/SimpleWorkflowConfig" + } + ], + "description": "The workflow configuration", + "discriminator": { + "propertyName": "_t" + } + }, + "aggregatorType": { + "$ref": "#/components/schemas/AggregatorType" + } + }, + "additionalProperties": false, + "description": "The model for creating a new order with a default pipeline." + }, + "CreateLegacyOrderResult": { + "required": [ + "datasetId", + "orderId" + ], + "type": "object", + "properties": { + "datasetId": { + "type": "string" + }, + "orderId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CreateOrderModel": { + "required": [ + "orderName", + "referee", + "userFilters", + "workflow" + ], + "type": "object", + "properties": { + "orderName": { + "type": "string", + "description": "The name is used as an identifier for an order and can be freely chosen." + }, + "userFilters": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CountryUserFilterModel" + }, + { + "$ref": "#/components/schemas/AgeUserFilterModel" + }, + { + "$ref": "#/components/schemas/GenderUserFilterModel" + } + ], + "description": "The filter model can be used to restrict users to specific demographics.", + "discriminator": { + "propertyName": "_t" + } + }, + "description": "The user filters are used to restrict the order to only collect votes from a specific demographic." + }, + "workflow": { + "oneOf": [ + { + "$ref": "#/components/schemas/SimpleWorkflowModel" + } + ], + "description": "The workflow helps to determine the tasks that need to be completed by the users.", + "discriminator": { + "propertyName": "_t" + } + }, + "referee": { + "oneOf": [ + { + "$ref": "#/components/schemas/NaiveRefereeModel" + } + ], + "description": "The referee is used to determine how many votes will be collected.", + "discriminator": { + "propertyName": "_t" + } + }, + "aggregator": { + "$ref": "#/components/schemas/AggregatorType" + } + }, + "additionalProperties": false, + "description": "This model is used to create a simple order" + }, + "CreateOrderResult": { + "required": [ + "datasetId", + "orderId" + ], + "type": "object", + "properties": { + "datasetId": { + "type": "string" + }, + "orderId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CreateSimplePipelineModel": { + "title": "CreateSimplePipelineModel", + "required": [ + "_t", + "artifacts", + "namePrefix", + "pipelineSteps" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "CreateSimplePipelineModel" + ], + "type": "string", + "description": "Discriminator value for CreateSimplePipelineModel", + "example": "CreateSimplePipelineModel" + }, + "artifacts": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateDatasetArtifactModel" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "pipelineSteps": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DatasetEvaluationStepModel" + }, + { + "$ref": "#/components/schemas/DatasetLabelingStepModel" + }, + { + "$ref": "#/components/schemas/SendCompletionMailStepModel" + }, + { + "$ref": "#/components/schemas/WorkflowAggregationStepModel" + }, + { + "$ref": "#/components/schemas/WorkflowResultFileCreatorStepModel" + }, + { + "$ref": "#/components/schemas/WorkflowSplitModel" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "namePrefix": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CreateUnsupportedOrderModel": { + "required": [ + "dataType", + "labelType", + "orderName" + ], + "type": "object", + "properties": { + "orderName": { + "type": "string", + "description": "The name of the order" + }, + "dataType": { + "type": "string", + "description": "The type of the data that was attempted to be ordered" + }, + "labelType": { + "type": "string", + "description": "The type of the labels that were attempted to be ordered" + } + }, + "additionalProperties": false, + "description": "The model for creating an order with an unsupported label type or data type." + }, + "CustomerOrderModel": { + "required": [ + "id", + "isPublic", + "orderDate", + "orderName", + "state" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "orderDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "state": { + "type": "string" + }, + "orderName": { + "type": "string" + }, + "isPublic": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "CustomerOrderModelPagedResult": { + "required": [ + "items", + "page", + "pageSize", + "total" + ], + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerOrderModel" + } + }, + "totalPages": { + "type": "integer", + "format": "int32", + "readOnly": true + } + }, + "additionalProperties": false + }, + "DatasetEvaluationStepModel": { + "title": "DatasetEvaluationStepModel", + "required": [ + "_t", + "aggregationResultFileArtifactId", + "datasetArtifactId", + "evaluationResultFileArtifactId", + "receiver" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "DatasetEvaluationStepModel" + ], + "type": "string", + "description": "Discriminator value for DatasetEvaluationStepModel", + "example": "DatasetEvaluationStepModel" + }, + "datasetArtifactId": { + "type": "string" + }, + "aggregationResultFileArtifactId": { + "type": "string" + }, + "evaluationResultFileArtifactId": { + "type": "string" + }, + "receiver": { + "type": "string" + } + }, + "additionalProperties": false + }, + "DatasetLabelingStepModel": { + "title": "DatasetLabelingStepModel", + "required": [ + "_t", + "datasetArtifactId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "DatasetLabelingStepModel" + ], + "type": "string", + "description": "Discriminator value for DatasetLabelingStepModel", + "example": "DatasetLabelingStepModel" + }, + "datasetArtifactId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "DemographicRapidSelectionConfig": { + "title": "DemographicRapidSelectionConfig", + "required": [ + "_t", + "rapidId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "DemographicRapidSelectionConfig" + ], + "type": "string", + "description": "Discriminator value for DemographicRapidSelectionConfig", + "example": "DemographicRapidSelectionConfig" + }, + "rapidId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "FeatureFlag": { + "required": [ + "key", + "value" + ], + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false + }, + "FeedbackModel": { + "required": [ + "feedback" + ], + "type": "object", + "properties": { + "feedback": { + "type": "string", + "description": "The feedback" + }, + "email": { + "type": "string", + "description": "The email of the user submitting the feedback", + "default": null + } + }, + "additionalProperties": false, + "description": "The model for submitting feedback." + }, + "Filter": { + "type": "object", + "properties": { + "field": { + "type": "string", + "nullable": true + }, + "value": { + "nullable": true + }, + "operator": { + "$ref": "#/components/schemas/FilterOperator" + }, + "logic": { + "$ref": "#/components/schemas/LogicOperator" + }, + "filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Filter" + } + } + }, + "additionalProperties": false + }, + "FilterOperator": { + "enum": [ + "Eq", + "Neq", + "Gt", + "Gte", + "Lt", + "Lte", + "Contains", + "StartsWith", + "EndsWith" + ], + "type": "string" + }, + "FreeTextRapidBlueprint": { + "title": "FreeTextBlueprint", + "required": [ + "_t", + "question" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "FreeTextBlueprint" + ], + "type": "string", + "description": "Discriminator value for FreeTextBlueprint", + "example": "FreeTextBlueprint" + }, + "question": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Gender": { + "enum": [ + "Male", + "Female", + "Other" + ], + "type": "string", + "description": "All available Gender options." + }, + "GenderUserFilterModel": { + "title": "GenderUserFilterModel", + "required": [ + "_t", + "genders" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "GenderUserFilterModel" + ], + "type": "string", + "description": "Discriminator value for GenderUserFilterModel", + "example": "GenderUserFilterModel" + }, + "genders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Gender" + }, + "description": "A whitelist of all genders allowed." + } + }, + "additionalProperties": false, + "description": "The GenderFilter is used to restrict users to specific genders." + }, + "GetOrderByIdResult": { + "required": [ + "customerMail", + "isLocked", + "orderDate", + "orderName", + "pipelineId", + "state" + ], + "type": "object", + "properties": { + "orderName": { + "type": "string" + }, + "customerMail": { + "type": "string" + }, + "orderDate": { + "type": "string", + "format": "date-time" + }, + "state": { + "type": "string" + }, + "pipelineId": { + "type": "string" + }, + "isLocked": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "GetOrderResultsResult": { + "required": [ + "contentType", + "fileName", + "stream" + ], + "type": "object", + "properties": { + "stream": { + "type": "string", + "format": "binary" + }, + "contentType": { + "type": "string" + }, + "fileName": { + "type": "string" + } + }, + "additionalProperties": false + }, + "GetPublicOrdersResult": { + "required": [ + "orders" + ], + "type": "object", + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderModel" + } + } + }, + "additionalProperties": false + }, + "GetWorkflowConfigResult": { + "required": [ + "workflowConfig" + ], + "type": "object", + "properties": { + "workflowConfig": { + "oneOf": [ + { + "$ref": "#/components/schemas/CompareWorkflowConfig" + }, + { + "$ref": "#/components/schemas/SimpleWorkflowConfig" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + }, + "additionalProperties": false + }, + "LineRapidBlueprint": { + "title": "LineBlueprint", + "required": [ + "_t", + "target" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "LineBlueprint" + ], + "type": "string", + "description": "Discriminator value for LineBlueprint", + "example": "LineBlueprint" + }, + "target": { + "type": "string" + } + }, + "additionalProperties": false + }, + "LocateRapidBlueprint": { + "title": "LocateBlueprint", + "required": [ + "_t", + "target" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "LocateBlueprint" + ], + "type": "string", + "description": "Discriminator value for LocateBlueprint", + "example": "LocateBlueprint" + }, + "target": { + "type": "string" + } + }, + "additionalProperties": false + }, + "LocationMetadataExistsFilterConfig": { + "title": "LocationMetadataExistsFilterConfig", + "required": [ + "_t" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "LocationMetadataExistsFilterConfig" + ], + "type": "string", + "description": "Discriminator value for LocationMetadataExistsFilterConfig", + "example": "LocationMetadataExistsFilterConfig" + } + }, + "additionalProperties": false + }, + "LogicOperator": { + "enum": [ + "And", + "Or" + ], + "type": "string" + }, + "NaiveRefereeConfig": { + "title": "NaiveRefereeConfig", + "required": [ + "_t" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "NaiveRefereeConfig" + ], + "type": "string", + "description": "Discriminator value for NaiveRefereeConfig", + "example": "NaiveRefereeConfig" + }, + "guessesRequired": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "NaiveRefereeModel": { + "title": "NaiveReferee", + "required": [ + "_t", + "totalVotes" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "NaiveReferee" + ], + "type": "string", + "description": "Discriminator value for NaiveReferee", + "example": "NaiveReferee" + }, + "totalVotes": { + "type": "integer", + "description": "The number of votes that need to be collected as a minimum.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "The NaiveReferee is used to collect a fixed number of votes." + }, + "NamedEntityRapidBlueprint": { + "title": "NamedEntityBlueprint", + "required": [ + "_t", + "classes", + "target" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "NamedEntityBlueprint" + ], + "type": "string", + "description": "Discriminator value for NamedEntityBlueprint", + "example": "NamedEntityBlueprint" + }, + "target": { + "type": "string" + }, + "classes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "NeverEndingRefereeConfig": { + "title": "NeverEndingRefereeConfig", + "required": [ + "_t" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "NeverEndingRefereeConfig" + ], + "type": "string", + "description": "Discriminator value for NeverEndingRefereeConfig", + "example": "NeverEndingRefereeConfig" + } + }, + "additionalProperties": false + }, + "NoValidationWorkflowRapidSelectionConfig": { + "title": "NoValidationWorkflowRapidSelectionConfig", + "required": [ + "_t" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "NoValidationWorkflowRapidSelectionConfig" + ], + "type": "string", + "description": "Discriminator value for NoValidationWorkflowRapidSelectionConfig", + "example": "NoValidationWorkflowRapidSelectionConfig" + }, + "amount": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + }, + "OnlyValidationWorkflowRapidSelectionConfig": { + "title": "OnlyValidationWorkflowRapidSelectionConfig", + "required": [ + "_t", + "validationSetId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "OnlyValidationWorkflowRapidSelectionConfig" + ], + "type": "string", + "description": "Discriminator value for OnlyValidationWorkflowRapidSelectionConfig", + "example": "OnlyValidationWorkflowRapidSelectionConfig" + }, + "validationSetId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "OrderModel": { + "required": [ + "id", + "isPublic", + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "isPublic": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PageInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "format": "int32" + }, + "size": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + }, + "PolygonRapidBlueprint": { + "title": "PolygonBlueprint", + "required": [ + "_t", + "target" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "PolygonBlueprint" + ], + "type": "string", + "description": "Discriminator value for PolygonBlueprint", + "example": "PolygonBlueprint" + }, + "target": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ProbabilisticAttachCategoryRefereeConfig": { + "title": "ProbabilisticAttachCategoryRefereeConfig", + "required": [ + "_t", + "maxVotes", + "threshold" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "ProbabilisticAttachCategoryRefereeConfig" + ], + "type": "string", + "description": "Discriminator value for ProbabilisticAttachCategoryRefereeConfig", + "example": "ProbabilisticAttachCategoryRefereeConfig" + }, + "threshold": { + "type": "number", + "format": "double" + }, + "maxVotes": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "QueryOrdersModel": { + "type": "object", + "properties": { + "page": { + "$ref": "#/components/schemas/PageInfo" + }, + "filter": { + "$ref": "#/components/schemas/RootFilter" + }, + "sortCriteria": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortCriterion" + }, + "description": "The sorting criteria", + "default": null + } + }, + "additionalProperties": false, + "description": "The model for querying orders." + }, + "RootFilter": { + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Filter" + } + }, + "logic": { + "$ref": "#/components/schemas/LogicOperator" + } + }, + "additionalProperties": false + }, + "SendCompletionMailStepModel": { + "title": "SendCompletionMailStepModel", + "required": [ + "_t", + "receiver", + "resultsFileArtifactIdentifier" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "SendCompletionMailStepModel" + ], + "type": "string", + "description": "Discriminator value for SendCompletionMailStepModel", + "example": "SendCompletionMailStepModel" + }, + "receiver": { + "type": "string" + }, + "resultsFileArtifactIdentifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "SimpleWorkflowConfig": { + "title": "SimpleWorkflowConfig", + "required": [ + "_t", + "blueprint", + "referee", + "targetCountryCodes" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "SimpleWorkflowConfig" + ], + "type": "string", + "description": "Discriminator value for SimpleWorkflowConfig", + "example": "SimpleWorkflowConfig" + }, + "referee": { + "oneOf": [ + { + "$ref": "#/components/schemas/NaiveRefereeConfig" + }, + { + "$ref": "#/components/schemas/NeverEndingRefereeConfig" + }, + { + "$ref": "#/components/schemas/ProbabilisticAttachCategoryRefereeConfig" + } + ], + "discriminator": { + "propertyName": "_t" + } + }, + "blueprint": { + "oneOf": [ + { + "$ref": "#/components/schemas/TranscriptionRapidBlueprint" + }, + { + "$ref": "#/components/schemas/PolygonRapidBlueprint" + }, + { + "$ref": "#/components/schemas/NamedEntityRapidBlueprint" + }, + { + "$ref": "#/components/schemas/LocateRapidBlueprint" + }, + { + "$ref": "#/components/schemas/LineRapidBlueprint" + }, + { + "$ref": "#/components/schemas/FreeTextRapidBlueprint" + }, + { + "$ref": "#/components/schemas/CompareRapidBlueprint" + }, + { + "$ref": "#/components/schemas/AttachCategoryRapidBlueprint" + }, + { + "$ref": "#/components/schemas/BoundingBoxRapidBlueprint" + } + ], + "discriminator": { + "propertyName": "_t" + } + }, + "targetCountryCodes": { + "type": "array", + "items": { + "type": "string" + } + }, + "featureFlags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FeatureFlag" + } + }, + "priority": { + "type": "string", + "nullable": true + }, + "isFallback": { + "type": "boolean" + }, + "rapidSelectionConfigs": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OnlyValidationWorkflowRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/CorrelatedRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/DemographicRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/StaticRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/ValidationRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/ConditionalValidationRapidSelectionConfig" + }, + { + "$ref": "#/components/schemas/NoValidationWorkflowRapidSelectionConfig" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + } + }, + "additionalProperties": false + }, + "SimpleWorkflowModel": { + "title": "SimpleWorkflow", + "required": [ + "_t", + "blueprint" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "SimpleWorkflow" + ], + "type": "string", + "description": "Discriminator value for SimpleWorkflow", + "example": "SimpleWorkflow" + }, + "blueprint": { + "oneOf": [ + { + "$ref": "#/components/schemas/TranscriptionRapidBlueprint" + }, + { + "$ref": "#/components/schemas/PolygonRapidBlueprint" + }, + { + "$ref": "#/components/schemas/NamedEntityRapidBlueprint" + }, + { + "$ref": "#/components/schemas/LocateRapidBlueprint" + }, + { + "$ref": "#/components/schemas/LineRapidBlueprint" + }, + { + "$ref": "#/components/schemas/FreeTextRapidBlueprint" + }, + { + "$ref": "#/components/schemas/CompareRapidBlueprint" + }, + { + "$ref": "#/components/schemas/AttachCategoryRapidBlueprint" + }, + { + "$ref": "#/components/schemas/BoundingBoxRapidBlueprint" + } + ], + "description": "The blueprint is used to create the tasks that will be shown to the users. They contain the common information\r\nacross all tasks. For example, the tasks question.", + "discriminator": { + "propertyName": "_t" + } + } + }, + "additionalProperties": false, + "description": "If the SimpleWorkflow is chosen, each datapoint uploaded will correspond to a single task to be solved.\r\nThis is the most commonly chosen workflow." + }, + "SortCriterion": { + "required": [ + "direction", + "propertyName" + ], + "type": "object", + "properties": { + "propertyName": { + "type": "string" + }, + "direction": { + "$ref": "#/components/schemas/SortDirection" + } + }, + "additionalProperties": false + }, + "SortDirection": { + "enum": [ + "Asc", + "Desc" + ], + "type": "string" + }, + "StaticRapidSelectionConfig": { + "title": "StaticRapidSelectionConfig", + "required": [ + "_t", + "rapidIds" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "StaticRapidSelectionConfig" + ], + "type": "string", + "description": "Discriminator value for StaticRapidSelectionConfig", + "example": "StaticRapidSelectionConfig" + }, + "rapidIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "TranscriptionRapidBlueprint": { + "title": "TranscriptionBlueprint", + "required": [ + "_t", + "title" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "TranscriptionBlueprint" + ], + "type": "string", + "description": "Discriminator value for TranscriptionBlueprint", + "example": "TranscriptionBlueprint" + }, + "title": { + "type": "string" + } + }, + "additionalProperties": false + }, + "UnlockOrderResult": { + "required": [ + "datasetIds" + ], + "type": "object", + "properties": { + "datasetIds": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "UpdateAccessModel": { + "required": [ + "isPublic" + ], + "type": "object", + "properties": { + "isPublic": { + "type": "boolean", + "description": "Whether the order is public" + } + }, + "additionalProperties": false, + "description": "The model for updating the access of an order." + }, + "UpdateOrderModel": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The new name of the order" + } + }, + "additionalProperties": false, + "description": "The model for updating the name of an order." + }, + "UpdateWorkflowConfigModel": { + "required": [ + "orderId", + "workflowConfig" + ], + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The id of the order" + }, + "workflowConfig": { + "oneOf": [ + { + "$ref": "#/components/schemas/CompareWorkflowConfig" + }, + { + "$ref": "#/components/schemas/SimpleWorkflowConfig" + } + ], + "description": "The new workflow configuration", + "discriminator": { + "propertyName": "_t" + } + }, + "workflowConfigArtifactId": { + "type": "string", + "description": "The id of the workflow config artifact in the pipeline. If using the default pipeline this is not needed.", + "default": null + } + }, + "additionalProperties": false, + "description": "The model for updating the workflow configuration of an order." + }, + "ValidationChance": { + "required": [ + "chance", + "rapidCount", + "userScoreThreshold" + ], + "type": "object", + "properties": { + "userScoreThreshold": { + "type": "number", + "format": "double" + }, + "chance": { + "type": "number", + "format": "double" + }, + "rapidCount": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "ValidationRapidSelectionConfig": { + "title": "ValidationRapidSelectionConfig", + "required": [ + "_t", + "amount", + "validationSetId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "ValidationRapidSelectionConfig" + ], + "type": "string", + "description": "Discriminator value for ValidationRapidSelectionConfig", + "example": "ValidationRapidSelectionConfig" + }, + "validationSetId": { + "type": "string" + }, + "amount": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "WorkflowAggregationStepModel": { + "title": "WorkflowAggregationStepModel", + "required": [ + "_t", + "datasetArtifactId", + "fileUploadedArtifactId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "WorkflowAggregationStepModel" + ], + "type": "string", + "description": "Discriminator value for WorkflowAggregationStepModel", + "example": "WorkflowAggregationStepModel" + }, + "datasetArtifactId": { + "type": "string" + }, + "fileUploadedArtifactId": { + "type": "string" + }, + "aggregatorType": { + "$ref": "#/components/schemas/AggregatorType" + } + }, + "additionalProperties": false + }, + "WorkflowResultFileCreatorStepModel": { + "title": "WorkflowResultFileCreatorStepModel", + "required": [ + "_t", + "datasetArtifactId", + "fileUploadedArtifactId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "WorkflowResultFileCreatorStepModel" + ], + "type": "string", + "description": "Discriminator value for WorkflowResultFileCreatorStepModel", + "example": "WorkflowResultFileCreatorStepModel" + }, + "datasetArtifactId": { + "type": "string" + }, + "fileUploadedArtifactId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "WorkflowSplitModel": { + "title": "WorkflowSplitModel", + "required": [ + "_t", + "aggregationResultArtifactId", + "destinationDatasetArtifactId", + "filterConfigs", + "sourceDatasetArtifactId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "WorkflowSplitModel" + ], + "type": "string", + "description": "Discriminator value for WorkflowSplitModel", + "example": "WorkflowSplitModel" + }, + "sourceDatasetArtifactId": { + "type": "string" + }, + "destinationDatasetArtifactId": { + "type": "string" + }, + "aggregationResultArtifactId": { + "type": "string" + }, + "filterConfigs": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ClassificationMetadataFilterConfig" + }, + { + "$ref": "#/components/schemas/CountClassificationMetadataFilterConfig" + }, + { + "$ref": "#/components/schemas/LocationMetadataExistsFilterConfig" + } + ], + "discriminator": { + "propertyName": "_t" + } + } + } + }, + "additionalProperties": false + }, + "CreateClientModel": { + "required": [ + "customerId", + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "A human-readable name for the client used for easy identification." + }, + "customerId": { + "type": "string", + "description": "The id of the customer that owns the client.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "The model for creating a new client." + }, + "IssueClientAuthTokenResult": { + "required": [ + "authToken" + ], + "type": "object", + "properties": { + "authToken": { + "type": "string" + } + }, + "additionalProperties": false + }, + "LoginModel": { + "required": [ + "password", + "usernameOrEmail" + ], + "type": "object", + "properties": { + "usernameOrEmail": { + "type": "string", + "description": "The username or email of the user." + }, + "password": { + "type": "string", + "description": "The password of the user." + } + }, + "additionalProperties": false, + "description": "The model for logging in a user." + }, + "NewsletterModel": { + "required": [ + "email", + "token" + ], + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "token": { + "type": "string" + } + }, + "additionalProperties": false + }, + "RequestPasswordResetCommand": { + "title": "RequestPasswordResetCommand", + "required": [ + "_t", + "email", + "recaptchaToken" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "RequestPasswordResetCommand" + ], + "type": "string", + "description": "Discriminator value for RequestPasswordResetCommand", + "example": "RequestPasswordResetCommand" + }, + "email": { + "type": "string" + }, + "recaptchaToken": { + "type": "string" + } + }, + "additionalProperties": false + }, + "SignupCustomerModel": { + "required": [ + "email", + "password", + "passwordRepeated", + "token" + ], + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The email of the user to sign up." + }, + "password": { + "type": "string", + "description": "The password of the user to sign up." + }, + "passwordRepeated": { + "type": "string", + "description": "The repeated password to confirm the password." + }, + "token": { + "type": "string", + "description": "A recaptcha token to verify the user is not a bot." + } + }, + "additionalProperties": false, + "description": "The model for signing up a new user." + }, + "SignupShadowCustomerModel": { + "required": [ + "token" + ], + "type": "object", + "properties": { + "token": { + "type": "string", + "description": "A recaptcha token to verify the user is not a bot." + } + }, + "additionalProperties": false, + "description": "The model for signing up a new temporary user." + }, + "SubmitPasswordResetCommand": { + "title": "SubmitPasswordResetCommand", + "required": [ + "_t", + "password", + "passwordRepeated", + "resetToken", + "userId" + ], + "type": "object", + "properties": { + "_t": { + "enum": [ + "SubmitPasswordResetCommand" + ], + "type": "string", + "description": "Discriminator value for SubmitPasswordResetCommand", + "example": "SubmitPasswordResetCommand" + }, + "userId": { + "type": "string", + "format": "uuid" + }, + "password": { + "type": "string" + }, + "passwordRepeated": { + "type": "string" + }, + "resetToken": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "securitySchemes": { + "bearer": { + "type": "apiKey", + "description": "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"", + "name": "Authorization", + "in": "header" + } + } + } +} \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 4daf27313..84071c99a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,5 +1,16 @@ # This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +[[package]] +name = "annotated-types" +version = "0.7.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, + {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, +] + [[package]] name = "certifi" version = "2024.7.4" @@ -121,6 +132,25 @@ files = [ {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, ] +[[package]] +name = "openapi-client" +version = "1.0.0" +description = "Rapidata.Dataset" +optional = false +python-versions = "^3.7" +files = [] +develop = true + +[package.dependencies] +pydantic = ">=2" +python-dateutil = ">=2.8.2" +typing-extensions = ">=4.7.1" +urllib3 = ">= 1.25.3" + +[package.source] +type = "directory" +url = "openapi/openapi-client" + [[package]] name = "pillow" version = "10.4.0" @@ -218,6 +248,129 @@ tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "pa typing = ["typing-extensions"] xmp = ["defusedxml"] +[[package]] +name = "pydantic" +version = "2.8.2" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic-2.8.2-py3-none-any.whl", hash = "sha256:73ee9fddd406dc318b885c7a2eab8a6472b68b8fb5ba8150949fc3db939f23c8"}, + {file = "pydantic-2.8.2.tar.gz", hash = "sha256:6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a"}, +] + +[package.dependencies] +annotated-types = ">=0.4.0" +pydantic-core = "2.20.1" +typing-extensions = [ + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, + {version = ">=4.6.1", markers = "python_version < \"3.13\""}, +] + +[package.extras] +email = ["email-validator (>=2.0.0)"] + +[[package]] +name = "pydantic-core" +version = "2.20.1" +description = "Core functionality for Pydantic validation and serialization" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic_core-2.20.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3acae97ffd19bf091c72df4d726d552c473f3576409b2a7ca36b2f535ffff4a3"}, + {file = "pydantic_core-2.20.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:41f4c96227a67a013e7de5ff8f20fb496ce573893b7f4f2707d065907bffdbd6"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f239eb799a2081495ea659d8d4a43a8f42cd1fe9ff2e7e436295c38a10c286a"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53e431da3fc53360db73eedf6f7124d1076e1b4ee4276b36fb25514544ceb4a3"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1f62b2413c3a0e846c3b838b2ecd6c7a19ec6793b2a522745b0869e37ab5bc1"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5d41e6daee2813ecceea8eda38062d69e280b39df793f5a942fa515b8ed67953"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d482efec8b7dc6bfaedc0f166b2ce349df0011f5d2f1f25537ced4cfc34fd98"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e93e1a4b4b33daed65d781a57a522ff153dcf748dee70b40c7258c5861e1768a"}, + {file = "pydantic_core-2.20.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e7c4ea22b6739b162c9ecaaa41d718dfad48a244909fe7ef4b54c0b530effc5a"}, + {file = "pydantic_core-2.20.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4f2790949cf385d985a31984907fecb3896999329103df4e4983a4a41e13e840"}, + {file = "pydantic_core-2.20.1-cp310-none-win32.whl", hash = "sha256:5e999ba8dd90e93d57410c5e67ebb67ffcaadcea0ad973240fdfd3a135506250"}, + {file = "pydantic_core-2.20.1-cp310-none-win_amd64.whl", hash = "sha256:512ecfbefef6dac7bc5eaaf46177b2de58cdf7acac8793fe033b24ece0b9566c"}, + {file = "pydantic_core-2.20.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:d2a8fa9d6d6f891f3deec72f5cc668e6f66b188ab14bb1ab52422fe8e644f312"}, + {file = "pydantic_core-2.20.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:175873691124f3d0da55aeea1d90660a6ea7a3cfea137c38afa0a5ffabe37b88"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37eee5b638f0e0dcd18d21f59b679686bbd18917b87db0193ae36f9c23c355fc"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:25e9185e2d06c16ee438ed39bf62935ec436474a6ac4f9358524220f1b236e43"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:150906b40ff188a3260cbee25380e7494ee85048584998c1e66df0c7a11c17a6"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ad4aeb3e9a97286573c03df758fc7627aecdd02f1da04516a86dc159bf70121"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3f3ed29cd9f978c604708511a1f9c2fdcb6c38b9aae36a51905b8811ee5cbf1"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b0dae11d8f5ded51699c74d9548dcc5938e0804cc8298ec0aa0da95c21fff57b"}, + {file = "pydantic_core-2.20.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:faa6b09ee09433b87992fb5a2859efd1c264ddc37280d2dd5db502126d0e7f27"}, + {file = "pydantic_core-2.20.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9dc1b507c12eb0481d071f3c1808f0529ad41dc415d0ca11f7ebfc666e66a18b"}, + {file = "pydantic_core-2.20.1-cp311-none-win32.whl", hash = "sha256:fa2fddcb7107e0d1808086ca306dcade7df60a13a6c347a7acf1ec139aa6789a"}, + {file = "pydantic_core-2.20.1-cp311-none-win_amd64.whl", hash = "sha256:40a783fb7ee353c50bd3853e626f15677ea527ae556429453685ae32280c19c2"}, + {file = "pydantic_core-2.20.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:595ba5be69b35777474fa07f80fc260ea71255656191adb22a8c53aba4479231"}, + {file = "pydantic_core-2.20.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a4f55095ad087474999ee28d3398bae183a66be4823f753cd7d67dd0153427c9"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f9aa05d09ecf4c75157197f27cdc9cfaeb7c5f15021c6373932bf3e124af029f"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e97fdf088d4b31ff4ba35db26d9cc472ac7ef4a2ff2badeabf8d727b3377fc52"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bc633a9fe1eb87e250b5c57d389cf28998e4292336926b0b6cdaee353f89a237"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d573faf8eb7e6b1cbbcb4f5b247c60ca8be39fe2c674495df0eb4318303137fe"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26dc97754b57d2fd00ac2b24dfa341abffc380b823211994c4efac7f13b9e90e"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:33499e85e739a4b60c9dac710c20a08dc73cb3240c9a0e22325e671b27b70d24"}, + {file = "pydantic_core-2.20.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:bebb4d6715c814597f85297c332297c6ce81e29436125ca59d1159b07f423eb1"}, + {file = "pydantic_core-2.20.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:516d9227919612425c8ef1c9b869bbbee249bc91912c8aaffb66116c0b447ebd"}, + {file = "pydantic_core-2.20.1-cp312-none-win32.whl", hash = "sha256:469f29f9093c9d834432034d33f5fe45699e664f12a13bf38c04967ce233d688"}, + {file = "pydantic_core-2.20.1-cp312-none-win_amd64.whl", hash = "sha256:035ede2e16da7281041f0e626459bcae33ed998cca6a0a007a5ebb73414ac72d"}, + {file = "pydantic_core-2.20.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:0827505a5c87e8aa285dc31e9ec7f4a17c81a813d45f70b1d9164e03a813a686"}, + {file = "pydantic_core-2.20.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:19c0fa39fa154e7e0b7f82f88ef85faa2a4c23cc65aae2f5aea625e3c13c735a"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa223cd1e36b642092c326d694d8bf59b71ddddc94cdb752bbbb1c5c91d833b"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c336a6d235522a62fef872c6295a42ecb0c4e1d0f1a3e500fe949415761b8a19"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7eb6a0587eded33aeefea9f916899d42b1799b7b14b8f8ff2753c0ac1741edac"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:70c8daf4faca8da5a6d655f9af86faf6ec2e1768f4b8b9d0226c02f3d6209703"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e9fa4c9bf273ca41f940bceb86922a7667cd5bf90e95dbb157cbb8441008482c"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:11b71d67b4725e7e2a9f6e9c0ac1239bbc0c48cce3dc59f98635efc57d6dac83"}, + {file = "pydantic_core-2.20.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:270755f15174fb983890c49881e93f8f1b80f0b5e3a3cc1394a255706cabd203"}, + {file = "pydantic_core-2.20.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c81131869240e3e568916ef4c307f8b99583efaa60a8112ef27a366eefba8ef0"}, + {file = "pydantic_core-2.20.1-cp313-none-win32.whl", hash = "sha256:b91ced227c41aa29c672814f50dbb05ec93536abf8f43cd14ec9521ea09afe4e"}, + {file = "pydantic_core-2.20.1-cp313-none-win_amd64.whl", hash = "sha256:65db0f2eefcaad1a3950f498aabb4875c8890438bc80b19362cf633b87a8ab20"}, + {file = "pydantic_core-2.20.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:4745f4ac52cc6686390c40eaa01d48b18997cb130833154801a442323cc78f91"}, + {file = "pydantic_core-2.20.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a8ad4c766d3f33ba8fd692f9aa297c9058970530a32c728a2c4bfd2616d3358b"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41e81317dd6a0127cabce83c0c9c3fbecceae981c8391e6f1dec88a77c8a569a"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:04024d270cf63f586ad41fff13fde4311c4fc13ea74676962c876d9577bcc78f"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eaad4ff2de1c3823fddf82f41121bdf453d922e9a238642b1dedb33c4e4f98ad"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:26ab812fa0c845df815e506be30337e2df27e88399b985d0bb4e3ecfe72df31c"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c5ebac750d9d5f2706654c638c041635c385596caf68f81342011ddfa1e5598"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2aafc5a503855ea5885559eae883978c9b6d8c8993d67766ee73d82e841300dd"}, + {file = "pydantic_core-2.20.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:4868f6bd7c9d98904b748a2653031fc9c2f85b6237009d475b1008bfaeb0a5aa"}, + {file = "pydantic_core-2.20.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:aa2f457b4af386254372dfa78a2eda2563680d982422641a85f271c859df1987"}, + {file = "pydantic_core-2.20.1-cp38-none-win32.whl", hash = "sha256:225b67a1f6d602de0ce7f6c1c3ae89a4aa25d3de9be857999e9124f15dab486a"}, + {file = "pydantic_core-2.20.1-cp38-none-win_amd64.whl", hash = "sha256:6b507132dcfc0dea440cce23ee2182c0ce7aba7054576efc65634f080dbe9434"}, + {file = "pydantic_core-2.20.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:b03f7941783b4c4a26051846dea594628b38f6940a2fdc0df00b221aed39314c"}, + {file = "pydantic_core-2.20.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1eedfeb6089ed3fad42e81a67755846ad4dcc14d73698c120a82e4ccf0f1f9f6"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:635fee4e041ab9c479e31edda27fcf966ea9614fff1317e280d99eb3e5ab6fe2"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:77bf3ac639c1ff567ae3b47f8d4cc3dc20f9966a2a6dd2311dcc055d3d04fb8a"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7ed1b0132f24beeec5a78b67d9388656d03e6a7c837394f99257e2d55b461611"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c6514f963b023aeee506678a1cf821fe31159b925c4b76fe2afa94cc70b3222b"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10d4204d8ca33146e761c79f83cc861df20e7ae9f6487ca290a97702daf56006"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2d036c7187b9422ae5b262badb87a20a49eb6c5238b2004e96d4da1231badef1"}, + {file = "pydantic_core-2.20.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9ebfef07dbe1d93efb94b4700f2d278494e9162565a54f124c404a5656d7ff09"}, + {file = "pydantic_core-2.20.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6b9d9bb600328a1ce523ab4f454859e9d439150abb0906c5a1983c146580ebab"}, + {file = "pydantic_core-2.20.1-cp39-none-win32.whl", hash = "sha256:784c1214cb6dd1e3b15dd8b91b9a53852aed16671cc3fbe4786f4f1db07089e2"}, + {file = "pydantic_core-2.20.1-cp39-none-win_amd64.whl", hash = "sha256:d2fe69c5434391727efa54b47a1e7986bb0186e72a41b203df8f5b0a19a4f669"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a45f84b09ac9c3d35dfcf6a27fd0634d30d183205230a0ebe8373a0e8cfa0906"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d02a72df14dfdbaf228424573a07af10637bd490f0901cee872c4f434a735b94"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d2b27e6af28f07e2f195552b37d7d66b150adbaa39a6d327766ffd695799780f"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:084659fac3c83fd674596612aeff6041a18402f1e1bc19ca39e417d554468482"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:242b8feb3c493ab78be289c034a1f659e8826e2233786e36f2893a950a719bb6"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:38cf1c40a921d05c5edc61a785c0ddb4bed67827069f535d794ce6bcded919fc"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e0bbdd76ce9aa5d4209d65f2b27fc6e5ef1312ae6c5333c26db3f5ade53a1e99"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:254ec27fdb5b1ee60684f91683be95e5133c994cc54e86a0b0963afa25c8f8a6"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:407653af5617f0757261ae249d3fba09504d7a71ab36ac057c938572d1bc9331"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:c693e916709c2465b02ca0ad7b387c4f8423d1db7b4649c551f27a529181c5ad"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b5ff4911aea936a47d9376fd3ab17e970cc543d1b68921886e7f64bd28308d1"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:177f55a886d74f1808763976ac4efd29b7ed15c69f4d838bbd74d9d09cf6fa86"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:964faa8a861d2664f0c7ab0c181af0bea66098b1919439815ca8803ef136fc4e"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:4dd484681c15e6b9a977c785a345d3e378d72678fd5f1f3c0509608da24f2ac0"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f6d6cff3538391e8486a431569b77921adfcdef14eb18fbf19b7c0a5294d4e6a"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:a6d511cc297ff0883bc3708b465ff82d7560193169a8b93260f74ecb0a5e08a7"}, + {file = "pydantic_core-2.20.1.tar.gz", hash = "sha256:26ca695eeee5f9f1aeeb211ffc12f10bcb6f71e2989988fda61dabd65db878d4"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + [[package]] name = "pyjwt" version = "2.9.0" @@ -235,6 +388,20 @@ dev = ["coverage[toml] (==5.0.4)", "cryptography (>=3.4.0)", "pre-commit", "pyte docs = ["sphinx", "sphinx-rtd-theme", "zope.interface"] tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"] +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, +] + +[package.dependencies] +six = ">=1.5" + [[package]] name = "python-dotenv" version = "1.0.1" @@ -270,6 +437,28 @@ urllib3 = ">=1.21.1,<3" socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "typing-extensions" +version = "4.12.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +files = [ + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, +] + [[package]] name = "urllib3" version = "2.2.2" @@ -290,4 +479,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "660d8ae0dff58645a69db98438c29d3457ab0f5233de9b2455fb50766a7b9888" +content-hash = "a57280f7ba874dace672c1020312fe8648dbd45ef9a3eba5ffe3135d1bcdf8a6" diff --git a/pyproject.toml b/pyproject.toml index 4d9602cbb..6e0893689 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ python = "^3.12" requests = "^2.32.3" PyJWT = "^2.9.0" pillow = "^10.4.0" - +openapi-client = {path = "openapi/openapi-client", develop = true} [tool.poetry.group.dev.dependencies] python-dotenv = "^1.0.1" diff --git a/rapidata/rapidata_client/order/dataset/rapidata_dataset.py b/rapidata/rapidata_client/order/dataset/rapidata_dataset.py index 51150eb57..0369955e3 100644 --- a/rapidata/rapidata_client/order/dataset/rapidata_dataset.py +++ b/rapidata/rapidata_client/order/dataset/rapidata_dataset.py @@ -1,26 +1,34 @@ import os +from typing import List + +from pydantic import StrictBytes, StrictStr +from openapi_client.api.dataset_api import DatasetApi +from openapi_client.api_client import ApiClient +from openapi_client.models.datapoint_metadata_model import DatapointMetadataModel +from openapi_client.models.upload_text_sources_to_dataset_model import UploadTextSourcesToDatasetModel from rapidata.service import LocalFileService -from rapidata.service import RapidataService class RapidataDataset: - def __init__(self, dataset_id: str, rapidata_service: RapidataService): + def __init__(self, dataset_id: str, api_client: ApiClient): self.dataset_id = dataset_id - self.rapidata_service = rapidata_service + self.api_client = api_client + self.dataset_api = DatasetApi(api_client) self.local_file_service = LocalFileService() def add_texts(self, texts: list[str]): - self.rapidata_service.dataset.upload_text_sources(self.dataset_id, texts) + model = UploadTextSourcesToDatasetModel(datasetId=self.dataset_id, textSources=texts) + self.dataset_api.dataset_upload_text_sources_to_dataset_post(model) def add_images_from_paths(self, image_paths: list[str]): - image_names = [os.path.basename(image_path) for image_path in image_paths] - images = self.local_file_service.load_images(image_paths) + model = DatapointMetadataModel(datasetId=self.dataset_id, metadata=[]) - self.rapidata_service.dataset.upload_images(self.dataset_id, images, image_names) + self.dataset_api.dataset_create_datapoint_post(model=model, files=image_paths) # type: ignore def add_videos_from_paths(self, video_paths: list[str]): + raise NotImplementedError("This method is not implemented yet") video_names = [os.path.basename(video_path) for video_path in video_paths] videos = self.local_file_service.load_videos(video_paths) - self.rapidata_service.dataset.upload_videos(self.dataset_id, videos, video_names) \ No newline at end of file + # self.api_client.dataset.upload_videos(self.dataset_id, videos, video_names) \ No newline at end of file diff --git a/rapidata/rapidata_client/order/rapidata_order.py b/rapidata/rapidata_client/order/rapidata_order.py index 7d478f9e7..24abb65ab 100644 --- a/rapidata/rapidata_client/order/rapidata_order.py +++ b/rapidata/rapidata_client/order/rapidata_order.py @@ -1,7 +1,11 @@ +from openapi_client.models.create_order_model_referee import CreateOrderModelReferee +from openapi_client.models.create_order_model_workflow import CreateOrderModelWorkflow from rapidata.rapidata_client.order.dataset.rapidata_dataset import RapidataDataset from rapidata.rapidata_client.workflow import Workflow -from rapidata.service import RapidataService - +from openapi_client.api_client import ApiClient +from openapi_client.api.order_api import OrderApi +from openapi_client.models.create_order_model import CreateOrderModel +from rapidata.rapidata_client.referee import Referee class RapidataOrder: """ @@ -15,14 +19,14 @@ class RapidataOrder: :type rapidata_service: RapidataService """ - def __init__( - self, name: str, workflow: Workflow, rapidata_service: RapidataService - ): + def __init__(self, name: str, workflow: Workflow, referee: Referee, api_client: ApiClient): self.name = name self.workflow = workflow - self.rapidata_service = rapidata_service + self.referee = referee + self.api_client = api_client + self.order_api = OrderApi(api_client) self.order_id = None - self._dataset = None + self._dataset: RapidataDataset | None = None def create(self): """ @@ -31,8 +35,16 @@ def create(self): :return: The created RapidataOrder instance. :rtype: RapidataOrder """ - self.order_id, dataset_id = self.rapidata_service.order.create_order(self.name, self.workflow.to_dict()) - self._dataset = RapidataDataset(dataset_id, self.rapidata_service) + order_model = CreateOrderModel( + orderName=self.name, + workflow=CreateOrderModelWorkflow(self.workflow.to_model()), + userFilters=[], + referee=CreateOrderModelReferee(self.referee.to_model()) + ) + + result = self.order_api.order_create_post(create_order_model=order_model) + self.order_id = result.order_id + self._dataset = RapidataDataset(result.dataset_id, self.api_client) return self def submit(self): @@ -42,9 +54,9 @@ def submit(self): :raises ValueError: If the order has not been created. """ if self.order_id is None: - raise ValueError("You must create the order before submitting it.") + raise ValueError("Order ID is None. Have you created the order?") - self.rapidata_service.order.submit(self.order_id) + self.order_api.order_submit_post(self.order_id) def approve(self): """ @@ -55,7 +67,7 @@ def approve(self): if self.order_id is None: raise ValueError("You must create the order before approving it.") - self.rapidata_service.order.approve(self.order_id) + self.order_api.order_approve_post(self.order_id) @property def dataset(self): @@ -67,5 +79,5 @@ def dataset(self): :rtype: RapidataDataset """ if self._dataset is None: - raise ValueError("You must submit the order before accessing the dataset.") + raise ValueError("Datset is None. Have you created the order?") return self._dataset diff --git a/rapidata/rapidata_client/order/rapidata_order_builder.py b/rapidata/rapidata_client/order/rapidata_order_builder.py index cad693a51..d88e776ac 100644 --- a/rapidata/rapidata_client/order/rapidata_order_builder.py +++ b/rapidata/rapidata_client/order/rapidata_order_builder.py @@ -1,6 +1,9 @@ +from openapi_client.api_client import ApiClient +from rapidata.rapidata_client.referee.naive_referee import NaiveReferee from rapidata.rapidata_client.workflow import Workflow from rapidata.rapidata_client.order.rapidata_order import RapidataOrder -from rapidata.service import RapidataService +from openapi_client import ApiClient +from rapidata.rapidata_client.referee import Referee class RapidataOrderBuilder: @@ -17,12 +20,13 @@ class RapidataOrderBuilder: def __init__( self, - rapidata_service: RapidataService, + api_client: ApiClient, name: str, ): self._name = name - self._rapidata_service = rapidata_service + self._api_client = api_client self._workflow: Workflow | None = None + self._referee: Referee | None = None def create(self) -> RapidataOrder: """ @@ -34,11 +38,22 @@ def create(self) -> RapidataOrder: """ if self._workflow is None: raise ValueError("You must provide a blueprint to create an order.") + + if self._referee is None: + print("No referee provided, using default NaiveReferee.") + self._referee = NaiveReferee() - return RapidataOrder( - name=self._name, workflow=self._workflow, rapidata_service=self._rapidata_service + order = RapidataOrder( + name=self._name, workflow=self._workflow, referee=self._referee, api_client=self._api_client ).create() + order.dataset.add_images_from_paths(self._image_paths) + + order.submit() + + return order + + def workflow(self, workflow: Workflow): """ Set the workflow for the order. @@ -50,3 +65,27 @@ def workflow(self, workflow: Workflow): """ self._workflow = workflow return self + + def referee(self, referee: Referee): + """ + Set the referee for the order. + + :param referee: The referee to be set. + :type referee: Referee + :return: The updated RapidataOrderBuilder instance. + :rtype: RapidataOrderBuilder + """ + self._referee = referee + return self + + def images(self, image_paths: list[str]): + """ + Set the images for the order. + + :param image_paths: The image paths to be set. + :type image_paths: list[str] + :return: The updated RapidataOrderBuilder instance. + :rtype: RapidataOrderBuilder + """ + self._image_paths = image_paths + return self diff --git a/rapidata/rapidata_client/rapidata_client.py b/rapidata/rapidata_client/rapidata_client.py index 85bdbcbf2..5d1fcb9cb 100644 --- a/rapidata/rapidata_client/rapidata_client.py +++ b/rapidata/rapidata_client/rapidata_client.py @@ -1,6 +1,7 @@ +from openapi_client.api_client import ApiClient +from openapi_client.configuration import Configuration +from openapi_client.api.identity_api import IdentityApi from rapidata.rapidata_client.order.rapidata_order_builder import RapidataOrderBuilder -from rapidata.service import RapidataService - class RapidataClient: """ @@ -20,10 +21,19 @@ def __init__( :param client_secret: The client secret for authentication. :param endpoint: The API endpoint URL. Defaults to "https://api.rapidata.ai". """ - self._rapidata_service = RapidataService( - client_id=client_id, client_secret=client_secret, endpoint=endpoint + + client_configuration = Configuration(host=endpoint) + self.api_client = ApiClient(configuration=client_configuration) + + identity_api = IdentityApi(self.api_client) + + result = identity_api.identity_get_client_auth_token_post( + client_id=client_id, + _headers={"Authorization": f"Basic {client_secret}"}, ) + client_configuration.api_key["bearer"] = f"Bearer {result.auth_token}" + def new_order(self, name: str) -> RapidataOrderBuilder: """ Create a new order using a RapidataOrderBuilder instance. @@ -31,4 +41,4 @@ def new_order(self, name: str) -> RapidataOrderBuilder: :param name: The name of the order. :return: A RapidataOrderBuilder instance. """ - return RapidataOrderBuilder(rapidata_service=self._rapidata_service, name=name) + return RapidataOrderBuilder(api_client=self.api_client, name=name) diff --git a/rapidata/rapidata_client/workflow/referee/__init__.py b/rapidata/rapidata_client/referee/__init__.py similarity index 100% rename from rapidata/rapidata_client/workflow/referee/__init__.py rename to rapidata/rapidata_client/referee/__init__.py diff --git a/rapidata/rapidata_client/workflow/referee/base_referee.py b/rapidata/rapidata_client/referee/base_referee.py similarity index 63% rename from rapidata/rapidata_client/workflow/referee/base_referee.py rename to rapidata/rapidata_client/referee/base_referee.py index 898e1944f..f5e835c58 100644 --- a/rapidata/rapidata_client/workflow/referee/base_referee.py +++ b/rapidata/rapidata_client/referee/base_referee.py @@ -1,6 +1,5 @@ from abc import ABC, abstractmethod -from typing import Mapping - +from typing import Any, Mapping class Referee(ABC): """ @@ -11,4 +10,11 @@ def to_dict(self) -> Mapping[str, str | int | float]: """ Convert the referee to a referee configuration dict. """ + pass + + @abstractmethod + def to_model(self) -> Any: + """ + Convert the referee to a referee configuration model. + """ pass \ No newline at end of file diff --git a/rapidata/rapidata_client/workflow/referee/classify_early_stopping_referee.py b/rapidata/rapidata_client/referee/classify_early_stopping_referee.py similarity index 90% rename from rapidata/rapidata_client/workflow/referee/classify_early_stopping_referee.py rename to rapidata/rapidata_client/referee/classify_early_stopping_referee.py index 0e9676b34..293290070 100644 --- a/rapidata/rapidata_client/workflow/referee/classify_early_stopping_referee.py +++ b/rapidata/rapidata_client/referee/classify_early_stopping_referee.py @@ -1,4 +1,4 @@ -from rapidata.rapidata_client.workflow.referee.base_referee import Referee +from rapidata.rapidata_client.referee.base_referee import Referee class ClassifyEarlyStoppingReferee(Referee): diff --git a/rapidata/rapidata_client/workflow/referee/naive_referee.py b/rapidata/rapidata_client/referee/naive_referee.py similarity index 65% rename from rapidata/rapidata_client/workflow/referee/naive_referee.py rename to rapidata/rapidata_client/referee/naive_referee.py index 3528aaca7..8fa93f860 100644 --- a/rapidata/rapidata_client/workflow/referee/naive_referee.py +++ b/rapidata/rapidata_client/referee/naive_referee.py @@ -1,4 +1,5 @@ -from rapidata.rapidata_client.workflow.referee.base_referee import Referee +from openapi_client.models.naive_referee_model import NaiveRefereeModel +from rapidata.rapidata_client.referee.base_referee import Referee class NaiveReferee(Referee): @@ -16,3 +17,6 @@ def to_dict(self): "_t": "NaiveRefereeConfig", "guessesRequired": self.required_guesses, } + + def to_model(self): + return NaiveRefereeModel(_t="NaiveReferee", totalVotes=self.required_guesses) diff --git a/rapidata/rapidata_client/workflow/base_workflow.py b/rapidata/rapidata_client/workflow/base_workflow.py index 26436198b..92e31a010 100644 --- a/rapidata/rapidata_client/workflow/base_workflow.py +++ b/rapidata/rapidata_client/workflow/base_workflow.py @@ -1,9 +1,10 @@ -from abc import ABC +from abc import ABC, abstractmethod from typing import Any +from openapi_client.models.simple_workflow_model import SimpleWorkflowModel from rapidata.rapidata_client.workflow.feature_flags import FeatureFlags -from rapidata.rapidata_client.workflow.referee.base_referee import Referee -from rapidata.rapidata_client.workflow.referee.naive_referee import NaiveReferee +from rapidata.rapidata_client.referee.base_referee import Referee +from rapidata.rapidata_client.referee.naive_referee import NaiveReferee class Workflow(ABC): @@ -21,6 +22,10 @@ def to_dict(self) -> dict[str, Any]: "targetCountryCodes": self._target_country_codes, "featureFlags": self._feature_flags.to_list(), } + + @abstractmethod + def to_model(self) -> SimpleWorkflowModel: + pass def referee(self, referee: Referee): self._referee = referee diff --git a/rapidata/rapidata_client/workflow/classify_workflow.py b/rapidata/rapidata_client/workflow/classify_workflow.py index fffd7e6d7..f4bff9527 100644 --- a/rapidata/rapidata_client/workflow/classify_workflow.py +++ b/rapidata/rapidata_client/workflow/classify_workflow.py @@ -1,12 +1,15 @@ from typing import Any +from openapi_client.models.attach_category_rapid_blueprint import AttachCategoryRapidBlueprint +from openapi_client.models.simple_workflow_model import SimpleWorkflowModel +from openapi_client.models.simple_workflow_model_blueprint import SimpleWorkflowModelBlueprint from rapidata.rapidata_client.workflow import Workflow class ClassifyWorkflow(Workflow): - def __init__(self, question: str, categories: list[str]): + def __init__(self, question: str, options: list[str]): super().__init__(type="SimpleWorkflowConfig") self._question = question - self._categories = categories + self._options = options def to_dict(self) -> dict[str, Any]: return { @@ -14,6 +17,18 @@ def to_dict(self) -> dict[str, Any]: "blueprint": { "_t": "ClassifyBlueprint", "title": self._question, - "possibleCategories": self._categories, + "possibleCategories": self._options, } } + + def to_model(self) -> SimpleWorkflowModel: + blueprint = AttachCategoryRapidBlueprint( + _t="ClassifyBlueprint", + title=self._question, + possibleCategories=self._options, + ) + + return SimpleWorkflowModel( + _t="SimpleWorkflow", + blueprint=SimpleWorkflowModelBlueprint(blueprint), + ) diff --git a/rapidata/service/__init__.py b/rapidata/service/__init__.py index 90b5f1955..e9e696b35 100644 --- a/rapidata/service/__init__.py +++ b/rapidata/service/__init__.py @@ -1,2 +1 @@ -from .rapidata_api_services.rapidata_service import RapidataService as RapidataService from .local_file_service import LocalFileService as LocalFileService \ No newline at end of file diff --git a/rapidata/service/rapidata_api_services/base_service.py b/rapidata/service/rapidata_api_services/base_service.py deleted file mode 100644 index d91222c16..000000000 --- a/rapidata/service/rapidata_api_services/base_service.py +++ /dev/null @@ -1,76 +0,0 @@ -from datetime import datetime, timedelta -from typing import Any -import jwt -import requests - - -class BaseRapidataAPIService: - - def __init__(self, client_id: str, client_secret: str, endpoint: str): - self.client_id = client_id - self.client_secret = client_secret - self.endpoint = endpoint - self.auth_header = None - self.token = self._get_auth_token() - - def _check_response(self, response: requests.Response): - if response.status_code != 200: - raise Exception(f"Error: {response.status_code} - {response.text}") - - def _get_new_auth_token_if_outdated(self): - if not self.token or not self._is_token_valid(): - self._get_auth_token() - - def _is_token_valid(self, expiration_threshold: timedelta = timedelta(minutes=5)): - try: - payload = jwt.decode(self.token, options={"verify_signature": False}) # type: ignore - exp_timestamp = payload.get("exp") - if exp_timestamp: - expiration_time = datetime.fromtimestamp(exp_timestamp) - return datetime.now() + expiration_threshold <= expiration_time - except jwt.DecodeError: - return False - return False - - def _get_auth_token(self): - url = f"{self.endpoint}/Identity/GetClientAuthToken" - params = { - "clientId": self.client_id, - } - headers = {"Authorization": f"Basic {self.client_secret}"} - response = requests.post(url, params=params, headers=headers) - self._check_response(response) - self.token = response.json().get("authToken") - if not self.token: - raise Exception("No token received") - self.auth_header = {"Authorization": f"Bearer {self.token}"} - - def _post( - self, - url: str, - params: dict[str, Any] | None = None, - data: dict[str, Any] | None = None, - json: dict[str, Any] | None = None, - files: Any | None = None, - ): - self._get_new_auth_token_if_outdated() - response = requests.post( - url, - params=params, - data=data, - json=json, - files=files, - headers=self.auth_header, - ) - self._check_response(response) - return response - - def _get( - self, - url: str, - params: dict[str, Any] | None = None, - ): - self._get_new_auth_token_if_outdated() - response = requests.get(url, params=params, headers=self.auth_header) - self._check_response(response) - return response diff --git a/rapidata/service/rapidata_api_services/dataset_service.py b/rapidata/service/rapidata_api_services/dataset_service.py deleted file mode 100644 index 5e2de1623..000000000 --- a/rapidata/service/rapidata_api_services/dataset_service.py +++ /dev/null @@ -1,82 +0,0 @@ -from io import BufferedReader -from PIL import Image -from rapidata.service.rapidata_api_services.base_service import BaseRapidataAPIService -from rapidata.utils.image_utils import ImageUtils - - -class DatasetService(BaseRapidataAPIService): - def __init__(self, client_id: str, client_secret: str, endpoint: str): - super().__init__( - client_id=client_id, client_secret=client_secret, endpoint=endpoint - ) - - def upload_text_sources(self, dataset_id: str, text_sources: list[str]): - url = f"{self.endpoint}/Dataset/UploadTextSourcesToDataset" - payload = {"datasetId": dataset_id, "textSources": text_sources} - - response = self._post(url, json=payload) - - return response - - def upload_images( - self, dataset_id: str, images: list[Image.Image], image_names: list[str] - ): - url = f"{self.endpoint}/Dataset/UploadImagesToDataset" - - params = {"datasetId": dataset_id} - - images_bytes: list[bytes] = [ - ImageUtils.convert_PIL_image_to_bytes(image) for image in images - ] - - files = [ - ("files", (image_name, image_bytes)) - for image_name, image_bytes in zip(image_names, images_bytes) - ] - - response = self._post(url, params=params, files=files) - - return response - - def upload_videos( - self, dataset_id: str, videos: list[BufferedReader], video_names: list[str] - ): - url = f"{self.endpoint}/Dataset/UploadImagesToDataset" - - params = {"datasetId": dataset_id} - - files = [ - ("files", (video_name, video_bytes)) - for video_name, video_bytes in zip(video_names, videos) - ] - - response = self._post(url, params=params, files=files) - - return response - - def upload_images_from_s3( - self, - dataset_id: str, - bucket_name: str, - region: str, - source_prefix: str, - access_key: str, - secret_key: str, - clear_dataset: bool = True, - ): - url = f"{self.endpoint}/Dataset/UploadFilesFromS3" - - payload = { - "datasetId": dataset_id, - "bucketName": bucket_name, - "region": region, - "sourcePrefix": source_prefix, - "accessKey": access_key, - "secretKey": secret_key, - "useCustomAwsCredentials": True, - "clearDataset": clear_dataset, - } - - response = self._post(url, json=payload) - - return response diff --git a/rapidata/service/rapidata_api_services/order_service.py b/rapidata/service/rapidata_api_services/order_service.py deleted file mode 100644 index 0f13c145f..000000000 --- a/rapidata/service/rapidata_api_services/order_service.py +++ /dev/null @@ -1,49 +0,0 @@ - -from typing import Any -from rapidata.service.rapidata_api_services.base_service import BaseRapidataAPIService - - -class OrderService(BaseRapidataAPIService): - def __init__(self, client_id: str, client_secret: str, endpoint: str): - super().__init__( - client_id=client_id, client_secret=client_secret, endpoint=endpoint - ) - - def create_order(self, name: str, workflow_config: dict[str, Any]) -> tuple[str, str]: - """ - order_name: name of the order that will be displayed in the Rapidata dashboard. - question: The question shown to the labeler in the rapid. - categories: The answer options, between which the labeler can choose. - target_country_codes: A list of two digit target country codes. - disable_translation: Per default, the question and categories get translated with DeepL (or Google Translate, if DeepL doesn't support a language). By setting this to `True`, the translation is disabled. - referee: The referee determines when the task is done. See above for the options. - """ - url = f"{self.endpoint}/Order/CreateDefaultOrder" - - payload = { - "orderName": name, - "datasetName": f"{name} dataset", - "isPublic": False, - "workflowConfig": workflow_config, - "aggregatorType": "Classification", - } - - response = self._post(url, json=payload) - - return response.json()["orderId"], response.json()["datasetId"] - - def submit(self, order_id: str): - url = f"{self.endpoint}/Order/Submit" - params = {"orderId": order_id} - - submit_response = self._post(url, params=params) - - return submit_response - - def approve(self, order_id: str): - url = f"{self.endpoint}/Order/Approve" - params = {"orderId": order_id} - - approve_response = self._post(url, params=params) - - return approve_response diff --git a/rapidata/service/rapidata_api_services/rapidata_service.py b/rapidata/service/rapidata_api_services/rapidata_service.py deleted file mode 100644 index 0aea79364..000000000 --- a/rapidata/service/rapidata_api_services/rapidata_service.py +++ /dev/null @@ -1,18 +0,0 @@ -from rapidata.service.rapidata_api_services.base_service import BaseRapidataAPIService -from rapidata.service.rapidata_api_services.dataset_service import DatasetService -from rapidata.service.rapidata_api_services.order_service import OrderService - - -class RapidataService(BaseRapidataAPIService): - def __init__(self, client_id: str, client_secret: str, endpoint: str): - super().__init__(client_id, client_secret, endpoint) - self._order_service = OrderService(client_id, client_secret, endpoint) - self._dataset_service = DatasetService(client_id, client_secret, endpoint) - - @property - def order(self): - return self._order_service - - @property - def dataset(self): - return self._dataset_service diff --git a/rapidata/service/rapidata_api_services/__init__.py b/tests/integration/__init__.py similarity index 100% rename from rapidata/service/rapidata_api_services/__init__.py rename to tests/integration/__init__.py diff --git a/tests/integration/test_classify_order.py b/tests/integration/test_classify_order.py new file mode 100644 index 000000000..12837c298 --- /dev/null +++ b/tests/integration/test_classify_order.py @@ -0,0 +1,46 @@ +import os +import unittest +from rapidata.rapidata_client.rapidata_client import RapidataClient +from rapidata.rapidata_client.referee.naive_referee import NaiveReferee +from rapidata.rapidata_client.workflow.classify_workflow import ClassifyWorkflow +from rapidata.rapidata_client.workflow.feature_flags.feature_flags import FeatureFlags + + +class TestClassifyOrder(unittest.TestCase): + + def setUp(self): + CLIENT_ID = os.getenv("CLIENT_ID") + CLIENT_SECRET = os.getenv("CLIENT_SECRET") + ENDPOINT = os.getenv("ENDPOINT") + + if not CLIENT_ID: + raise Exception("CLIENT_ID not found in environment variables") + if not CLIENT_SECRET: + raise Exception("CLIENT_SECRET not found in environment variables") + if not ENDPOINT: + raise Exception("ENDPOINT not found in environment variables") + + self.rapi = RapidataClient( + client_id=CLIENT_ID, client_secret=CLIENT_SECRET, endpoint=ENDPOINT + ) + + def test_classify_order(self): + # Configure order + order = ( + self.rapi.new_order( + name="Example Classify Order", + ) + .workflow( + ClassifyWorkflow( + question="Who should be president?", + options=["Kamala Harris", "Donald Trump"], + ) + .feature_flags(FeatureFlags().alert_on_fast_response(3)) + ) + .referee(NaiveReferee(required_guesses=15)) + .images(["examples/data/kamala_trump.jpg"]) + .create() + ) + + # Let's go! + # order.approve() diff --git a/tests/order/test_order_builder.py b/tests/order/test_order_builder.py index 51c39d238..c8038effc 100644 --- a/tests/order/test_order_builder.py +++ b/tests/order/test_order_builder.py @@ -7,27 +7,26 @@ class TestOrderBuilder(unittest.TestCase): def setUp(self): - self.rapidata_service = Mock() - self.rapidata_service.order = Mock() - self.rapidata_service.order.create_order.return_value = ("order_id", "dataset_id") + self.api_client = Mock() + self.api_client.order = Mock() + self.api_client.order.create_order.return_value = ("order_id", "dataset_id") def test_raise_error_if_no_workflow(self): with self.assertRaises(ValueError): - RapidataOrderBuilder(rapidata_service=self.rapidata_service, name="Test Order").create() + RapidataOrderBuilder(api_client=self.api_client, name="Test Order").create() def test_basic_order_build(self): order = ( - RapidataOrderBuilder( - rapidata_service=self.rapidata_service, name="Test Order" + RapidataOrderBuilder(api_client=self.api_client, name="Test Order") + .workflow( + ClassifyWorkflow(question="Test Question?", options=["Yes", "No"]) ) - .workflow(ClassifyWorkflow(question="Test Question?", categories=["Yes", "No"])) .create() ) self.assertEqual(order.name, "Test Order") self.assertIsInstance(order.workflow, ClassifyWorkflow) - self.assertEqual(order.workflow._question, "Test Question?") # type: ignore - self.assertEqual(order.workflow._categories, ["Yes", "No"]) # type: ignore - \ No newline at end of file + self.assertEqual(order.workflow._question, "Test Question?") # type: ignore + self.assertEqual(order.workflow._categories, ["Yes", "No"]) # type: ignore