diff --git a/codegen/in/archive/openapi_1.6.0.json b/codegen/in/archive/openapi_1.6.0.json new file mode 100644 index 000000000..4b3e1dbee --- /dev/null +++ b/codegen/in/archive/openapi_1.6.0.json @@ -0,0 +1,4279 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Aignostics Platform API", + "description": "\nThe Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. \n\nTo begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. \n\nMore information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com).\n\n**How to authorize and test API endpoints:**\n\n1. Click the \"Authorize\" button in the right corner below\n3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials\n4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint\n\n**Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized.\n\n", + "version": "1.6.0" + }, + "servers": [ + { + "url": "/api" + } + ], + "paths": { + "/v1/applications": { + "get": { + "tags": [ + "Public" + ], + "summary": "List available applications", + "description": "Returns the list of the applications, available to the caller.\n\nThe application is available if any of the versions of the application is assigned to the caller's organization.\nThe response is paginated and sorted according to the provided parameters.", + "operationId": "list_applications_v1_applications_get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "default": 1, + "title": "Page" + } + }, + { + "name": "page-size", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 100, + "minimum": 5, + "default": 50, + "title": "Page-Size" + } + }, + { + "name": "sort", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.\n\n**Available fields:**\n- `application_id`\n- `name`\n- `description`\n- `regulatory_classes`\n\n**Examples:**\n- `?sort=application_id` - Sort by application_id ascending\n- `?sort=-name` - Sort by name descending\n- `?sort=+description&sort=name` - Sort by description ascending, then name descending", + "title": "Sort" + }, + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.\n\n**Available fields:**\n- `application_id`\n- `name`\n- `description`\n- `regulatory_classes`\n\n**Examples:**\n- `?sort=application_id` - Sort by application_id ascending\n- `?sort=-name` - Sort by name descending\n- `?sort=+description&sort=name` - Sort by description ascending, then name descending" + } + ], + "responses": { + "200": { + "description": "A list of applications available to the caller", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationReadShortResponse" + }, + "title": "Response List Applications V1 Applications Get" + }, + "example": [ + { + "application_id": "he-tme", + "name": "Atlas H&E-TME", + "regulatory_classes": [ + "RUO" + ], + "description": "The Atlas H&E TME is an AI application designed to examine FFPE (formalin-fixed, paraffin-embedded) tissues stained with H&E (hematoxylin and eosin), delivering comprehensive insights into the tumor microenvironment.", + "latest_version": { + "number": "1.0.0", + "released_at": "2025-09-01T19:01:05.401Z" + } + }, + { + "application_id": "test-app", + "name": "Test Application", + "regulatory_classes": [ + "RUO" + ], + "description": "This is the test application with two algorithms: TissueQc and Tissue Segmentation", + "latest_version": { + "number": "2.0.0", + "released_at": "2025-09-02T19:01:05.401Z" + } + } + ] + } + } + }, + "401": { + "description": "Unauthorized - Invalid or missing authentication" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/applications/{application_id}": { + "get": { + "tags": [ + "Public" + ], + "summary": "Read Application By Id", + "description": "Retrieve details of a specific application by its ID.", + "operationId": "read_application_by_id_v1_applications__application_id__get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "application_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Application Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationReadResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to see this application" + }, + "404": { + "description": "Not Found - Application with the given ID does not exist" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/applications/{application_id}/versions/{version}": { + "get": { + "tags": [ + "Public" + ], + "summary": "Application Version Details", + "description": "Get the application version details.\n\nAllows caller to retrieve information about application version based on provided application version ID.", + "operationId": "application_version_details_v1_applications__application_id__versions__version__get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "application_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Application Id" + } + }, + { + "name": "version", + "in": "path", + "required": true, + "schema": { + "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "title": "Version" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VersionReadResponse" + }, + "example": { + "version_number": "0.4.4", + "changelog": "New deployment", + "input_artifacts": [ + { + "name": "whole_slide_image", + "mime_type": "image/tiff", + "metadata_schema": { + "type": "object", + "$defs": { + "LungCancerMetadata": { + "type": "object", + "title": "LungCancerMetadata", + "required": [ + "type", + "tissue" + ], + "properties": { + "type": { + "enum": [ + "lung" + ], + "type": "string", + "const": "lung", + "title": "Type" + }, + "tissue": { + "enum": [ + "lung", + "lymph node", + "liver", + "adrenal gland", + "bone", + "brain" + ], + "type": "string", + "title": "Tissue" + } + }, + "additionalProperties": false + } + }, + "title": "ExternalImageMetadata", + "$schema": "http://json-schema.org/draft-07/schema#", + "required": [ + "checksum_crc32c", + "base_mpp", + "width", + "height", + "cancer" + ], + "properties": { + "stain": { + "enum": [ + "H&E" + ], + "type": "string", + "const": "H&E", + "title": "Stain", + "default": "H&E" + }, + "width": { + "type": "integer", + "title": "Width", + "maximum": 150000, + "minimum": 1 + }, + "cancer": { + "anyOf": [ + { + "$ref": "#/$defs/LungCancerMetadata" + } + ], + "title": "Cancer" + }, + "height": { + "type": "integer", + "title": "Height", + "maximum": 150000, + "minimum": 1 + }, + "base_mpp": { + "type": "number", + "title": "Base Mpp", + "maximum": 0.5, + "minimum": 0.125 + }, + "mime_type": { + "enum": [ + "application/dicom", + "image/tiff" + ], + "type": "string", + "title": "Mime Type", + "default": "image/tiff" + }, + "checksum_crc32c": { + "type": "string", + "title": "Checksum Crc32C" + } + }, + "description": "Metadata corresponding to an external image.", + "additionalProperties": false + } + } + ], + "output_artifacts": [ + { + "name": "tissue_qc:tiff_heatmap", + "mime_type": "image/tiff", + "metadata_schema": { + "type": "object", + "title": "HeatmapMetadata", + "$schema": "http://json-schema.org/draft-07/schema#", + "required": [ + "checksum_crc32c", + "width", + "height", + "class_colors" + ], + "properties": { + "width": { + "type": "integer", + "title": "Width" + }, + "height": { + "type": "integer", + "title": "Height" + }, + "base_mpp": { + "type": "number", + "title": "Base Mpp", + "maximum": 0.5, + "minimum": 0.125 + }, + "mime_type": { + "enum": [ + "image/tiff" + ], + "type": "string", + "const": "image/tiff", + "title": "Mime Type", + "default": "image/tiff" + }, + "class_colors": { + "type": "object", + "title": "Class Colors", + "additionalProperties": { + "type": "array", + "maxItems": 3, + "minItems": 3, + "prefixItems": [ + { + "type": "integer", + "maximum": 255, + "minimum": 0 + }, + { + "type": "integer", + "maximum": 255, + "minimum": 0 + }, + { + "type": "integer", + "maximum": 255, + "minimum": 0 + } + ] + } + }, + "checksum_crc32c": { + "type": "string", + "title": "Checksum Crc32C" + } + }, + "description": "Metadata corresponding to a segmentation heatmap file.", + "additionalProperties": false + }, + "scope": "ITEM", + "visibility": "EXTERNAL" + } + ], + "released_at": "2025-04-16T08:45:20.655972Z" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to see this version" + }, + "404": { + "description": "Not Found - Application version with given ID is not available to you or does not exist" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/runs": { + "get": { + "tags": [ + "Public" + ], + "summary": "List Runs", + "description": "List runs with filtering, sorting, and pagination capabilities.\n\nReturns paginated runs that were submitted by the user.", + "operationId": "list_runs_v1_runs_get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "application_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional application ID filter", + "examples": [ + "tissue-segmentation", + "heta" + ], + "title": "Application Id" + }, + "description": "Optional application ID filter" + }, + { + "name": "application_version", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional Version Name", + "examples": [ + "1.0.2", + "1.0.1-beta2" + ], + "title": "Application Version" + }, + "description": "Optional Version Name" + }, + { + "name": "external_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optionally filter runs by items with this external ID", + "examples": [ + "slide_001", + "patient_12345_sample_A" + ], + "title": "External Id" + }, + "description": "Optionally filter runs by items with this external ID" + }, + { + "name": "custom_metadata", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "maxLength": 1000 + }, + { + "type": "null" + } + ], + "description": "Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata.\n#### URL Encoding Required\n**Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding.\n\n#### Examples (Clear Format):\n- **Field existence**: `$.study` - Runs that have a study field defined\n- **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value\n- **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75\n- **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\"\n- **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements\n\n#### Examples (URL-Encoded Format):\n- **Field existence**: `%24.study`\n- **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)`\n- **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)`\n- **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)`\n- **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)`\n\n#### Notes\n- JSONPath expressions are evaluated using PostgreSQL's `@?` operator\n- The `$.` prefix is automatically added to root-level field references if missing\n- String values in conditions must be enclosed in double quotes\n- Use `&&` for AND operations and `||` for OR operations\n- Regular expressions use `like_regex` with standard regex syntax\n- **Please remember to URL-encode the entire JSONPath expression when making HTTP requests**\n\n ", + "title": "Custom Metadata" + }, + "description": "Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata.\n#### URL Encoding Required\n**Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding.\n\n#### Examples (Clear Format):\n- **Field existence**: `$.study` - Runs that have a study field defined\n- **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value\n- **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75\n- **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\"\n- **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements\n\n#### Examples (URL-Encoded Format):\n- **Field existence**: `%24.study`\n- **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)`\n- **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)`\n- **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)`\n- **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)`\n\n#### Notes\n- JSONPath expressions are evaluated using PostgreSQL's `@?` operator\n- The `$.` prefix is automatically added to root-level field references if missing\n- String values in conditions must be enclosed in double quotes\n- Use `&&` for AND operations and `||` for OR operations\n- Regular expressions use `like_regex` with standard regex syntax\n- **Please remember to URL-encode the entire JSONPath expression when making HTTP requests**\n\n ", + "examples": { + "no_filter": { + "summary": "No filter (returns all)", + "description": "Returns all items without filtering by custom metadata", + "value": "$" + }, + "field_exists": { + "summary": "Check if field exists", + "description": "Find applications that have a project field defined", + "value": "$.study" + }, + "field_has_value": { + "summary": "Check if field has a certain value", + "description": "Compare a field value against a certain value", + "value": "$.study ? (@ == \"abc-1\")" + }, + "numeric_comparisons": { + "summary": "Compare to a numeric value of a field", + "description": "Compare a field value against a numeric value of a field", + "value": "$.confidence_score ? (@ > 0.75)" + }, + "array_operations": { + "summary": "Check if an array contains a certain value", + "description": "Check if an array contains a certain value", + "value": "$.tags[*] ? (@ == \"draft\")" + }, + "complex_filters": { + "summary": "Combine multiple checks", + "description": "Combine multiple checks", + "value": "$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)" + } + } + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "default": 1, + "title": "Page" + } + }, + { + "name": "page_size", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 100, + "minimum": 5, + "default": 50, + "title": "Page Size" + } + }, + { + "name": "for_organization", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs.", + "title": "For Organization" + }, + "description": "Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs." + }, + { + "name": "sort", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.\n\n**Available fields:**\n- `run_id`\n- `application_id`\n- `version_number`\n- `custom_metadata`\n- `submitted_at`\n- `submitted_by`\n- `terminated_at`\n- `termination_reason`\n\n**Examples:**\n- `?sort=submitted_at` - Sort by creation time (ascending)\n- `?sort=-submitted_at` - Sort by creation time (descending)\n- `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending)\n", + "title": "Sort" + }, + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.\n\n**Available fields:**\n- `run_id`\n- `application_id`\n- `version_number`\n- `custom_metadata`\n- `submitted_at`\n- `submitted_by`\n- `terminated_at`\n- `termination_reason`\n\n**Examples:**\n- `?sort=submitted_at` - Sort by creation time (ascending)\n- `?sort=-submitted_at` - Sort by creation time (descending)\n- `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending)\n" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RunReadResponse" + }, + "title": "Response List Runs V1 Runs Get" + } + } + } + }, + "404": { + "description": "Run not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "post": { + "tags": [ + "Public" + ], + "summary": "Initiate Run", + "description": "This endpoint initiates a processing run for a selected application and version, and returns a `run_id` for tracking purposes.\n\nSlide processing occurs asynchronously, allowing you to retrieve results for individual slides as soon as they\ncomplete processing. The system typically processes slides in batches.\nBelow is an example of the required payload for initiating an Atlas H&E TME processing run.\n\n\n### Payload\n\nThe payload includes `application_id`, optional `version_number`, and `items` base fields.\n\n`application_id` is the unique identifier for the application.\n`version_number` is the semantic version to use. If not provided, the latest available version will be used.\n\n`items` includes the list of the items to process (slides, in case of HETA application).\nEvery item has a set of standard fields defined by the API, plus the custom_metadata, specific to the\nchosen application.\n\nExample payload structure with the comments:\n```\n{\n application_id: \"he-tme\",\n version_number: \"1.0.0-beta\",\n items: [{\n \"external_id\": \"slide_1\",\n \"custom_metadata\": {\"project\": \"sample-study\"},\n \"input_artifacts\": [{\n \"name\": \"user_slide\",\n \"download_url\": \"https://...\",\n \"metadata\": {\n \"specimen\": {\n \"disease\": \"LUNG_CANCER\",\n \"tissue\": \"LUNG\"\n },\n \"staining_method\": \"H&E\",\n \"width_px\": 136223,\n \"height_px\": 87761,\n \"resolution_mpp\": 0.2628238,\n \"media-type\":\"image/tiff\",\n \"checksum_base64_crc32c\": \"64RKKA==\"\n }\n }]\n }]\n}\n```\n\n| Parameter | Description |\n| :---- | :---- |\n| `application_id` required | Unique ID for the application |\n| `version_number` optional | Semantic version of the application. If not provided, the latest available version will be used |\n| `items` required | List of submitted items i.e. whole slide images (WSIs) with parameters described below. |\n| `external_id` required | Unique WSI name or ID for easy reference to items, provided by the caller. The `external_id` should be unique across all items of the run. |\n| `input_artifacts` required | List of provided artifacts for a WSI; at the moment Atlas H&E-TME receives only 1 artifact per slide (the slide itself), but for some other applications this can be a slide and a segmentation map |\n| `name` required | Type of artifact; Atlas H&E-TME supports only `\"input_slide\"` |\n| `download_url` required | Signed URL to the input file in the S3 or GCS; Should be valid for at least 6 days |\n| `specimen: disease` required | Supported cancer types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) |\n| `specimen: tissue` required | Supported tissue types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) |\n| `staining_method` required | WSI stain bio-marker; Atlas H&E-TME supports only `\"H&E\"` |\n| `width_px` required | Integer value. Number of pixels of the WSI in the X dimension. |\n| `height_px` required | Integer value. Number of pixels of the WSI in the Y dimension. |\n| `resolution_mpp` required | Resolution of WSI in micrometers per pixel; check allowed range in Atlas H&E-TME manual |\n| `media-type` required | Supported media formats; available values are: image/tiff (for .tiff or .tif WSI), application/dicom (for DICOM ), application/zip (for zipped DICOM), and application/octet-stream (for .svs WSI) |\n| `checksum_base64_crc32c` required | Base64-encoded big-endian CRC32C checksum of the WSI image |\n\n\n\n### Response\n\nThe endpoint returns the run UUID. After that, the job is scheduled for the execution in the background.\n\nTo check the status of the run, call `GET v1/runs/{run_id}` endpoint with the returned run UUID.\n\n### Rejection\n\nApart from the authentication, authorization, and malformed input error, the request can be\nrejected when specific quota limit is exceeded. More details on quotas is described in the\ndocumentation", + "operationId": "create_run_v1_runs_post", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunCreationRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunCreationResponse" + } + } + } + }, + "404": { + "description": "Application version not found" + }, + "403": { + "description": "Forbidden - You don't have permission to create this run" + }, + "400": { + "description": "Bad Request - Input validation failed" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/runs/{run_id}": { + "get": { + "tags": [ + "Public" + ], + "summary": "Get run details", + "description": "This endpoint allows the caller to retrieve the current status of a run along with other relevant run details.\n A run becomes available immediately after it is created through the `POST /v1/runs/` endpoint.\n\n To download the output results, use `GET /v1/runs/{run_id}/` items to get outputs for all slides.\nAccess to a run is restricted to the user who created it, or users with an active grant or valid share token.", + "operationId": "get_run_v1_runs__run_id__get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Run id, returned by `POST /v1/runs/` endpoint", + "title": "Run Id" + }, + "description": "Run id, returned by `POST /v1/runs/` endpoint" + }, + { + "name": "share_token", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Share token for accessing shared runs", + "title": "Share Token" + }, + "description": "Share token for accessing shared runs" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunReadResponse" + } + } + } + }, + "404": { + "description": "Run not found because it was deleted." + }, + "403": { + "description": "Forbidden - You don't have permission to see this run" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/runs/{run_id}/cancel": { + "post": { + "tags": [ + "Public" + ], + "summary": "Cancel Run", + "description": "The run can be canceled by the user who created the run.\n\nThe execution can be canceled any time while the run is not in the terminated state. The\npending items of a canceled run will not be processed and will not add to the cost.\n\nWhen the run is canceled, the already completed items remain available for download.", + "operationId": "cancel_run_v1_runs__run_id__cancel_post", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Run id, returned by `POST /runs/` endpoint", + "title": "Run Id" + }, + "description": "Run id, returned by `POST /runs/` endpoint" + } + ], + "responses": { + "202": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Run not found" + }, + "403": { + "description": "Forbidden - You don't have permission to cancel this run" + }, + "409": { + "description": "Conflict - The Run is already cancelled" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/runs/{run_id}/items": { + "get": { + "tags": [ + "Public" + ], + "summary": "List Run Items", + "description": "List items in a run with filtering, sorting, and pagination capabilities.\n\nReturns paginated items within a specific run. Results can be filtered\nby `item_id`, `external_ids`, `custom_metadata`, `terminated_at`, and `termination_reason` using JSONPath expressions.\n\n## JSONPath Metadata Filtering\nUse PostgreSQL JSONPath expressions to filter items using their custom_metadata.\n\n### Examples:\n- **Field existence**: `$.case_id` - Results that have a case_id field defined\n- **Exact value match**: `$.priority ? (@ == \"high\")` - Results with high priority\n- **Numeric comparison**: `$.confidence_score ? (@ > 0.95)` - Results with high confidence\n- **Array operations**: `$.flags[*] ? (@ == \"reviewed\")` - Results flagged as reviewed\n- **Complex conditions**: `$.metrics ? (@.accuracy > 0.9 && @.recall > 0.8)` - Results meeting performance thresholds\n\n## Notes\n- JSONPath expressions are evaluated using PostgreSQL's `@?` operator\n- The `$.` prefix is automatically added to root-level field references if missing\n- String values in conditions must be enclosed in double quotes\n- Use `&&` for AND operations and `||` for OR operations", + "operationId": "list_run_items_v1_runs__run_id__items_get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Run id, returned by `POST /v1/runs/` endpoint", + "title": "Run Id" + }, + "description": "Run id, returned by `POST /v1/runs/` endpoint" + }, + { + "name": "share_token", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Share token for accessing shared runs", + "title": "Share Token" + }, + "description": "Share token for accessing shared runs" + }, + { + "name": "item_id__in", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + { + "type": "null" + } + ], + "description": "Filter for item ids", + "title": "Item Id In" + }, + "description": "Filter for item ids" + }, + { + "name": "external_id__in", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "description": "Filter for items by their external_id from the input payload", + "title": "External Id In" + }, + "description": "Filter for items by their external_id from the input payload" + }, + { + "name": "state", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/ItemState" + }, + { + "type": "null" + } + ], + "description": "Filter items by their state", + "title": "State" + }, + "description": "Filter items by their state" + }, + { + "name": "termination_reason", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/ItemTerminationReason" + }, + { + "type": "null" + } + ], + "description": "Filter items by their termination reason. Only applies to TERMINATED items.", + "title": "Termination Reason" + }, + "description": "Filter items by their termination reason. Only applies to TERMINATED items." + }, + { + "name": "custom_metadata", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "maxLength": 1000 + }, + { + "type": "null" + } + ], + "description": "JSONPath expression to filter items by their custom_metadata", + "title": "Custom Metadata" + }, + "description": "JSONPath expression to filter items by their custom_metadata", + "examples": { + "no_filter": { + "summary": "No filter (returns all)", + "description": "Returns all items without filtering by custom metadata", + "value": "$" + }, + "field_exists": { + "summary": "Check if field exists", + "description": "Find items that have a project field defined", + "value": "$.project" + }, + "field_has_value": { + "summary": "Check if field has a certain value", + "description": "Compare a field value against a certain value", + "value": "$.project ? (@ == \"cancer-research\")" + }, + "numeric_comparisons": { + "summary": "Compare to a numeric value of a field", + "description": "Compare a field value against a numeric value of a field", + "value": "$.duration_hours ? (@ < 2)" + }, + "array_operations": { + "summary": "Check if an array contains a certain value", + "description": "Check if an array contains a certain value", + "value": "$.tags[*] ? (@ == \"production\")" + }, + "complex_filters": { + "summary": "Combine multiple checks", + "description": "Combine multiple checks", + "value": "$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)" + } + } + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "default": 1, + "title": "Page" + } + }, + { + "name": "page_size", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 100, + "minimum": 5, + "default": 50, + "title": "Page Size" + } + }, + { + "name": "sort", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "description": "Sort the items by one or more fields. Use `+` for ascending and `-` for descending order.\n **Available fields:**\n- `item_id`\n- `external_id`\n- `custom_metadata`\n- `terminated_at`\n- `termination_reason`\n\n**Examples:**\n- `?sort=item_id` - Sort by id of the item (ascending)\n- `?sort=-external_id` - Sort by external ID (descending)\n- `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending)", + "title": "Sort" + }, + "description": "Sort the items by one or more fields. Use `+` for ascending and `-` for descending order.\n **Available fields:**\n- `item_id`\n- `external_id`\n- `custom_metadata`\n- `terminated_at`\n- `termination_reason`\n\n**Examples:**\n- `?sort=item_id` - Sort by id of the item (ascending)\n- `?sort=-external_id` - Sort by external ID (descending)\n- `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending)" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemResultReadResponse" + }, + "title": "Response List Run Items V1 Runs Run Id Items Get" + } + } + } + }, + "404": { + "description": "Run not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/runs/{run_id}/items/{external_id}": { + "get": { + "tags": [ + "Public" + ], + "summary": "Get Item By Run", + "description": "Retrieve details of a specific item (slide) by its external ID and the run ID.", + "operationId": "get_item_by_run_v1_runs__run_id__items__external_id__get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "The run id, returned by `POST /runs/` endpoint", + "title": "Run Id" + }, + "description": "The run id, returned by `POST /runs/` endpoint" + }, + { + "name": "external_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "The `external_id` that was defined for the item by the customer that triggered the run.", + "title": "External Id" + }, + "description": "The `external_id` that was defined for the item by the customer that triggered the run." + }, + { + "name": "share_token", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Share token for accessing shared runs", + "title": "Share Token" + }, + "description": "Share token for accessing shared runs" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ItemResultReadResponse" + } + } + } + }, + "404": { + "description": "Not Found - Item with given ID does not exist" + }, + "403": { + "description": "Forbidden - You don't have permission to see this item" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/runs/{run_id}/artifacts/{artifact_id}/file": { + "get": { + "tags": [ + "Public" + ], + "summary": "Get Artifact Url", + "description": "Download the artifact file with the specified artifact_id, belonging to the specified run.\nThe artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also\nbe retrieved via `GET /v1/runs/{run_id}/items/{external_id}`.\n\nThe endpoint may return a redirect response with a presigned URL to download the artifact file from the storage\nbucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response.", + "operationId": "get_artifact_url_v1_runs__run_id__artifacts__artifact_id__file_get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Run id, returned by `POST /runs/` endpoint", + "title": "Run Id" + }, + "description": "Run id, returned by `POST /runs/` endpoint" + }, + { + "name": "artifact_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "The artifact id to download", + "title": "Artifact Id" + }, + "description": "The artifact id to download" + }, + { + "name": "share_token", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Share token for accessing shared runs", + "title": "Share Token" + }, + "description": "Share token for accessing shared runs" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not Found - Artifact not found for the specified run" + }, + "307": { + "description": "Temporary Redirect - Redirect to the artifact file URL" + }, + "403": { + "description": "Forbidden - You don't have permission to download this artifact" + }, + "410": { + "description": "Gone - Artifact has been deleted" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/runs/{run_id}/artifacts": { + "delete": { + "tags": [ + "Public" + ], + "summary": "Delete Run Items", + "description": "This endpoint allows the caller to explicitly delete artifacts generated by a run.\nIt can only be invoked when the run has reached a final state, i.e.\n`PROCESSED`, `CANCELED_SYSTEM`, or `CANCELED_USER`.\nNote that by default, all artifacts are automatically deleted 30 days after the run finishes,\nregardless of whether the caller explicitly requests such deletion.", + "operationId": "delete_run_items_v1_runs__run_id__artifacts_delete", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Run id, returned by `POST /runs/` endpoint", + "title": "Run Id" + }, + "description": "Run id, returned by `POST /runs/` endpoint" + } + ], + "responses": { + "200": { + "description": "Run artifacts deleted", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Run not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/runs/{run_id}/custom-metadata": { + "put": { + "tags": [ + "Public" + ], + "summary": "Put Run Custom Metadata", + "description": "Update the custom metadata of a run with the specified `run_id`.\n\nOptionally, a checksum may be provided along the custom metadata JSON.\nIt can be used to verify if the custom metadata was updated since the last time it was accessed.\nIf the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current\ncustom metadata value to be overwritten is acknowledged by the user.\nIf no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks.\n\nThe latest custom metadata and checksum can be retrieved for the run via the `GET /v1/runs/{run_id}` endpoint.\n\n**Note on deadlines:** Run deadlines must be set during run creation and cannot be modified afterward.\nAny deadline changes in custom metadata will be ignored by the system.", + "operationId": "put_run_custom_metadata_v1_runs__run_id__custom_metadata_put", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Run id, returned by `POST /runs/` endpoint", + "title": "Run Id" + }, + "description": "Run id, returned by `POST /runs/` endpoint" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomMetadataUpdateRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Custom metadata successfully updated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomMetadataUpdateResponse" + } + } + } + }, + "404": { + "description": "Run not found" + }, + "403": { + "description": "Forbidden - You don't have permission to update this run" + }, + "412": { + "description": "Precondition Failed - Checksum mismatch, resource has been modified" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/runs/{run_id}/items/{external_id}/custom-metadata": { + "put": { + "tags": [ + "Public" + ], + "summary": "Put Item Custom Metadata By Run", + "description": "Update the custom metadata of the item with the specified `external_id`, belonging to the specified run.\n\nOptionally, a checksum may be provided along the custom metadata JSON.\nIt can be used to verify if the custom metadata was updated since the last time it was accessed.\nIf the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current\ncustom metadata value to be overwritten is acknowledged by the user.\nIf no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks.\n\nThe latest custom metadata and checksum can be retrieved\n for individual items via `GET /v1/runs/{run_id}/items/{external_id}`,\n and for all items of a run via `GET /v1/runs/{run_id}/items`.", + "operationId": "put_item_custom_metadata_by_run_v1_runs__run_id__items__external_id__custom_metadata_put", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "The run id, returned by `POST /runs/` endpoint", + "title": "Run Id" + }, + "description": "The run id, returned by `POST /runs/` endpoint" + }, + { + "name": "external_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "The `external_id` that was defined for the item by the customer that triggered the run.", + "title": "External Id" + }, + "description": "The `external_id` that was defined for the item by the customer that triggered the run." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomMetadataUpdateRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Custom metadata successfully updated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomMetadataUpdateResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to update this item" + }, + "404": { + "description": "Item not found" + }, + "412": { + "description": "Precondition Failed - Checksum mismatch" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/me": { + "get": { + "tags": [ + "Public" + ], + "summary": "Get current user", + "description": "Retrieves your identity details, including name, email, and organization.\nThis is useful for verifying that the request is being made under the correct user profile\nand organization context, as well as confirming that the expected environment variables are correctly set\n(in case you are using Python SDK)", + "operationId": "get_me_v1_me_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeReadResponse" + } + } + } + } + }, + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ] + } + }, + "/v1/applications/{application_id}/versions/{version}/documents": { + "get": { + "tags": [ + "Public" + ], + "summary": "List version documents", + "description": "List public documents attached to an application version.\n\nReturns only documents with ``visibility=public`` and ``status=uploaded``.", + "operationId": "list_version_documents", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "application_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Application Id" + } + }, + { + "name": "version", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Version" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VersionDocumentResponse" + }, + "title": "Response List Version Documents" + } + } + } + }, + "404": { + "description": "Application version not found or not accessible" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/applications/{application_id}/versions/{version}/documents/{name}": { + "get": { + "tags": [ + "Public" + ], + "summary": "Get version document metadata", + "description": "Return metadata for a single public document attached to an application version.", + "operationId": "get_version_document", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "application_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Application Id" + } + }, + { + "name": "version", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Version" + } + }, + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Name" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VersionDocumentResponse" + } + } + } + }, + "404": { + "description": "Document not found, not public, or version not accessible" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/applications/{application_id}/versions/{version}/documents/{name}/file": { + "get": { + "tags": [ + "Public" + ], + "summary": "Download version document (browser)", + "description": "307 redirect to a short-lived GCS signed URL for downloading a document.\n\nThe signed URL includes ``response-content-disposition=attachment; filename=\"\"``\nso browsers prompt a save-as dialog rather than rendering inline.\nResponse carries ``Cache-Control: no-store``.", + "operationId": "get_version_document_file", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "application_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Application Id" + } + }, + { + "name": "version", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Version" + } + }, + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Name" + } + } + ], + "responses": { + "307": { + "description": "Temporary redirect to signed GCS URL with Content-Disposition: attachment" + }, + "404": { + "description": "Document not found, not public, or version not accessible" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/applications/{application_id}/versions/{version}/documents/{name}/content": { + "get": { + "tags": [ + "Public" + ], + "summary": "Stream version document content (programmatic)", + "description": "307 redirect to a short-lived GCS signed URL for streaming document content.\n\nUnlike ``/file``, no ``Content-Disposition`` override is set — GCS serves\nthe object body with its stored ``Content-Type``. Intended for programmatic\nclients that follow redirects and consume the content directly.\nResponse carries ``Cache-Control: no-store``.", + "operationId": "get_version_document_content", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "application_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Application Id" + } + }, + { + "name": "version", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Version" + } + }, + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Name" + } + } + ], + "responses": { + "307": { + "description": "Temporary redirect to signed GCS URL; GCS serves the object with its stored Content-Type" + }, + "404": { + "description": "Document not found, not public, or version not accessible" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/access/grants": { + "post": { + "tags": [ + "Public" + ], + "summary": "Create Grant", + "description": "Create a grant to share access to a resource with a subject (user or organization).", + "operationId": "create_grant_v1_access_grants_post", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GrantCreateRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GrantReadResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to grant access to this resource" + }, + "404": { + "description": "Resource not found" + }, + "422": { + "description": "Unprocessable Entity - Only viewer grants can be created" + } + } + }, + "get": { + "tags": [ + "Public" + ], + "summary": "List Grants", + "description": "List grants.\n\nOrg admins see all grants for all resources in their organization.\nRegular users see grants for all resources they submitted.", + "operationId": "list_grants_v1_access_grants_get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "resource_type", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResourceType" + }, + { + "type": "null" + } + ], + "title": "Resource Type" + } + }, + { + "name": "resource_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "title": "Resource Id" + } + }, + { + "name": "subject_type", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubjectType" + }, + { + "type": "null" + } + ], + "title": "Subject Type" + } + }, + { + "name": "subject_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Subject Id" + } + }, + { + "name": "revoked", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Revoked" + } + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "default": 1, + "title": "Page" + } + }, + { + "name": "page_size", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 100, + "minimum": 5, + "default": 50, + "title": "Page Size" + } + }, + { + "name": "sort", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.", + "title": "Sort" + }, + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GrantReadResponse" + }, + "title": "Response List Grants V1 Access Grants Get" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/access/grants/{grant_id}": { + "get": { + "tags": [ + "Public" + ], + "summary": "Get Grant", + "description": "Get a grant by its ID.", + "operationId": "get_grant_v1_access_grants__grant_id__get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "grant_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Grant ID", + "title": "Grant Id" + }, + "description": "Grant ID" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GrantReadResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to view this grant" + }, + "404": { + "description": "Grant not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Public" + ], + "summary": "Revoke Grant", + "description": "Revoke a grant by its ID. Sets the revoked_at timestamp on the grant.", + "operationId": "revoke_grant_v1_access_grants__grant_id__delete", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "grant_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Grant ID", + "title": "Grant Id" + }, + "description": "Grant ID" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GrantReadResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to revoke this grant" + }, + "404": { + "description": "Grant not found" + }, + "409": { + "description": "Conflict - Grant is already revoked" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/access/share-tokens": { + "post": { + "tags": [ + "Public" + ], + "summary": "Create Share Token", + "description": "Create a share token. The returned share_token value is shown only once and is never stored.\nUse POST /access/grants with subject_type=share_token to grant access to a resource.", + "operationId": "create_share_token_v1_access_share_tokens_post", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ShareTokenCreateRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ShareTokenCreateResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Public" + ], + "summary": "List Share Tokens", + "description": "List share tokens. Service and Superadmin see all tokens; other users see only their own.", + "operationId": "list_share_tokens_v1_access_share_tokens_get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "run_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "description": "Filter by run ID", + "title": "Run Id" + }, + "description": "Filter by run ID" + }, + { + "name": "created_by", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter by share token creator", + "title": "Created By" + }, + "description": "Filter by share token creator" + }, + { + "name": "revoked", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Revoked" + } + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "default": 1, + "title": "Page" + } + }, + { + "name": "page_size", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 100, + "minimum": 5, + "default": 50, + "title": "Page Size" + } + }, + { + "name": "sort", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.", + "title": "Sort" + }, + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ShareTokenReadResponse" + }, + "title": "Response List Share Tokens V1 Access Share Tokens Get" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/access/share-tokens/{share_token_id}": { + "get": { + "tags": [ + "Public" + ], + "summary": "Get Share Token", + "description": "Get a share token by its ID.", + "operationId": "get_share_token_v1_access_share_tokens__share_token_id__get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "share_token_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Share token ID", + "title": "Share Token Id" + }, + "description": "Share token ID" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ShareTokenReadResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to view this share token" + }, + "404": { + "description": "Share token not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Public" + ], + "summary": "Revoke Share Token", + "description": "Revoke a share token by its ID. Invalidates the credential regardless of any active grants.", + "operationId": "revoke_share_token_v1_access_share_tokens__share_token_id__delete", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "share_token_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Share token ID", + "title": "Share Token Id" + }, + "description": "Share token ID" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ShareTokenReadResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to revoke this share token" + }, + "404": { + "description": "Share token not found" + }, + "409": { + "description": "Conflict - Share token is already revoked" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ApplicationReadResponse": { + "properties": { + "application_id": { + "type": "string", + "title": "Application Id", + "description": "Application ID", + "examples": [ + "he-tme" + ] + }, + "name": { + "type": "string", + "title": "Name", + "description": "Application display name", + "examples": [ + "Atlas H&E-TME" + ] + }, + "regulatory_classes": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Regulatory Classes", + "description": "Regulatory classes, to which the applications comply with. Possible values include: RUO, IVDR, FDA.", + "examples": [ + [ + "RUO" + ] + ] + }, + "description": { + "type": "string", + "title": "Description", + "description": "Describing what the application can do ", + "examples": [ + "The Atlas H&E TME is an AI application designed to examine FFPE (formalin-fixed, paraffin-embedded) tissues stained with H&E (hematoxylin and eosin), delivering comprehensive insights into the tumor microenvironment." + ] + }, + "versions": { + "items": { + "$ref": "#/components/schemas/ApplicationVersion" + }, + "type": "array", + "title": "Versions", + "description": "All version numbers available to the user" + } + }, + "type": "object", + "required": [ + "application_id", + "name", + "regulatory_classes", + "description", + "versions" + ], + "title": "ApplicationReadResponse", + "description": "Response schema for `List available applications` and `Read Application by Id` endpoints" + }, + "ApplicationReadShortResponse": { + "properties": { + "application_id": { + "type": "string", + "title": "Application Id", + "description": "Application ID", + "examples": [ + "he-tme" + ] + }, + "name": { + "type": "string", + "title": "Name", + "description": "Application display name", + "examples": [ + "Atlas H&E-TME" + ] + }, + "regulatory_classes": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Regulatory Classes", + "description": "Regulatory classes, to which the applications comply with. Possible values include: RUO, IVDR, FDA.", + "examples": [ + [ + "RUO" + ] + ] + }, + "description": { + "type": "string", + "title": "Description", + "description": "Describing what the application can do ", + "examples": [ + "The Atlas H&E TME is an AI application designed to examine FFPE (formalin-fixed, paraffin-embedded) tissues stained with H&E (hematoxylin and eosin), delivering comprehensive insights into the tumor microenvironment." + ] + }, + "latest_version": { + "anyOf": [ + { + "$ref": "#/components/schemas/ApplicationVersion" + }, + { + "type": "null" + } + ], + "description": "The version with highest version number available to the user" + } + }, + "type": "object", + "required": [ + "application_id", + "name", + "regulatory_classes", + "description" + ], + "title": "ApplicationReadShortResponse", + "description": "Response schema for `List available applications` and `Read Application by Id` endpoints" + }, + "ApplicationVersion": { + "properties": { + "number": { + "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "title": "Number", + "description": "The number of the latest version", + "examples": [ + "1.0.0" + ] + }, + "released_at": { + "type": "string", + "format": "date-time", + "title": "Released At", + "description": "The timestamp for when the application version was made available in the Platform", + "examples": [ + "2025-09-15T10:30:45.123Z" + ] + } + }, + "type": "object", + "required": [ + "number", + "released_at" + ], + "title": "ApplicationVersion" + }, + "ArtifactOutput": { + "type": "string", + "enum": [ + "NONE", + "AVAILABLE", + "DELETED_BY_USER", + "DELETED_BY_SYSTEM" + ], + "title": "ArtifactOutput" + }, + "ArtifactState": { + "type": "string", + "enum": [ + "PENDING", + "PROCESSING", + "TERMINATED" + ], + "title": "ArtifactState" + }, + "ArtifactTerminationReason": { + "type": "string", + "enum": [ + "SUCCEEDED", + "USER_ERROR", + "SYSTEM_ERROR", + "SKIPPED" + ], + "title": "ArtifactTerminationReason" + }, + "CustomMetadataUpdateRequest": { + "properties": { + "custom_metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Custom Metadata", + "description": "JSON metadata that should be set for the run", + "examples": [ + { + "department": "D1", + "study": "abc-1" + } + ] + }, + "custom_metadata_checksum": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Custom Metadata Checksum", + "description": "Optional field to verify that the latest custom metadata was known. If set to the checksum retrieved via the /runs endpoint, it must match the checksum of the current value in the database.", + "examples": [ + "f54fe109" + ] + } + }, + "type": "object", + "title": "CustomMetadataUpdateRequest" + }, + "CustomMetadataUpdateResponse": { + "properties": { + "custom_metadata_checksum": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Custom Metadata Checksum", + "description": "The checksum of the updated custom metadata. If the `custom_metadata` is None,\nthe checksum also None.", + "readOnly": true + } + }, + "type": "object", + "required": [ + "custom_metadata_checksum" + ], + "title": "CustomMetadataUpdateResponse" + }, + "GrantCreateRequest": { + "properties": { + "resource_type": { + "$ref": "#/components/schemas/ResourceType" + }, + "resource_id": { + "type": "string", + "format": "uuid", + "title": "Resource Id" + }, + "subject_type": { + "$ref": "#/components/schemas/SubjectType" + }, + "subject_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Subject Id" + }, + "subject_email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Subject Email" + }, + "relation": { + "$ref": "#/components/schemas/GrantRelation" + } + }, + "type": "object", + "required": [ + "resource_type", + "resource_id", + "subject_type", + "relation" + ], + "title": "GrantCreateRequest" + }, + "GrantReadResponse": { + "properties": { + "grant_id": { + "type": "string", + "format": "uuid", + "title": "Grant Id" + }, + "resource_type": { + "$ref": "#/components/schemas/ResourceType" + }, + "resource_id": { + "type": "string", + "format": "uuid", + "title": "Resource Id" + }, + "subject_type": { + "$ref": "#/components/schemas/SubjectType" + }, + "subject_id": { + "type": "string", + "title": "Subject Id" + }, + "relation": { + "$ref": "#/components/schemas/GrantRelation" + }, + "created_by": { + "type": "string", + "title": "Created By" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "revoked": { + "type": "boolean", + "title": "Revoked" + } + }, + "type": "object", + "required": [ + "grant_id", + "resource_type", + "resource_id", + "subject_type", + "subject_id", + "relation", + "created_by", + "created_at", + "revoked" + ], + "title": "GrantReadResponse" + }, + "GrantRelation": { + "type": "string", + "enum": [ + "owner", + "editor", + "viewer" + ], + "title": "GrantRelation" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "InputArtifact": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "mime_type": { + "type": "string", + "pattern": "^\\w+\\/\\w+[-+.|\\w+]+\\w+$", + "title": "Mime Type", + "examples": [ + "image/tiff" + ] + }, + "metadata_schema": { + "additionalProperties": true, + "type": "object", + "title": "Metadata Schema" + } + }, + "type": "object", + "required": [ + "name", + "mime_type", + "metadata_schema" + ], + "title": "InputArtifact" + }, + "InputArtifactCreationRequest": { + "properties": { + "name": { + "type": "string", + "title": "Name", + "description": "Type of artifact. For Atlas H&E-TME, use \"input_slide\"", + "examples": [ + "input_slide" + ] + }, + "download_url": { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri", + "title": "Download Url", + "description": "[Signed URL](https://cloud.google.com/cdn/docs/using-signed-urls) to the input artifact file. The URL should be valid for at least 6 days from the payload submission time.", + "examples": [ + "https://example.com/case-no-1-slide.tiff" + ] + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "The metadata of the artifact, required by the application version. The JSON schema of the metadata can be requested by `/v1/versions/{application_version_id}`. The schema is located in `input_artifacts.[].metadata_schema`", + "examples": [ + { + "checksum_base64_crc32c": "752f9554", + "height": 2000, + "height_mpp": 0.5, + "width": 10000, + "width_mpp": 0.5 + } + ] + } + }, + "type": "object", + "required": [ + "name", + "download_url", + "metadata" + ], + "title": "InputArtifactCreationRequest", + "description": "Input artifact containing the slide image and associated metadata." + }, + "InputArtifactResultReadResponse": { + "properties": { + "input_artifact_id": { + "type": "string", + "format": "uuid", + "title": "Input Artifact Id", + "description": "The Id of the artifact. Used internally" + }, + "name": { + "type": "string", + "title": "Name", + "description": "Name of the input from the schema from the `/v1/versions/{version_id}` endpoint.", + "examples": [ + "whole_slide_image" + ] + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata", + "description": "The metadata of the input artifact, provided by the user." + }, + "download_url": { + "anyOf": [ + { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" + }, + { + "type": "null" + } + ], + "title": "Download Url", + "description": "The download URL to for the input artifact provided by the user." + } + }, + "type": "object", + "required": [ + "input_artifact_id", + "name" + ], + "title": "InputArtifactResultReadResponse" + }, + "ItemCreationRequest": { + "properties": { + "external_id": { + "type": "string", + "maxLength": 255, + "title": "External Id", + "description": "Unique identifier for this item within the run. Used for referencing items. Must be unique across all items in the same run", + "examples": [ + "slide_1", + "patient_001_slide_A", + "sample_12345" + ] + }, + "custom_metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Custom Metadata", + "description": "Optional JSON custom_metadata to store additional information alongside an item.", + "examples": [ + { + "case": "abc" + } + ] + }, + "input_artifacts": { + "items": { + "$ref": "#/components/schemas/InputArtifactCreationRequest" + }, + "type": "array", + "title": "Input Artifacts", + "description": "List of input artifacts for this item. For Atlas H&E-TME, typically contains one artifact (the slide image)", + "examples": [ + [ + { + "download_url": "https://example-bucket.s3.amazonaws.com/slide1.tiff", + "metadata": { + "checksum_base64_crc32c": "64RKKA==", + "height_px": 87761, + "media-type": "image/tiff", + "resolution_mpp": 0.2628238, + "specimen": { + "disease": "LUNG_CANCER", + "tissue": "LUNG" + }, + "staining_method": "H&E", + "width_px": 136223 + }, + "name": "input_slide" + } + ] + ] + } + }, + "type": "object", + "required": [ + "external_id", + "input_artifacts" + ], + "title": "ItemCreationRequest", + "description": "Individual item (slide) to be processed in a run." + }, + "ItemOutput": { + "type": "string", + "enum": [ + "NONE", + "FULL" + ], + "title": "ItemOutput" + }, + "ItemResultReadResponse": { + "properties": { + "item_id": { + "type": "string", + "format": "uuid", + "title": "Item Id", + "description": "Item UUID generated by the Platform" + }, + "external_id": { + "type": "string", + "title": "External Id", + "description": "The external_id of the item from the user payload", + "examples": [ + "slide_1" + ] + }, + "custom_metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Custom Metadata", + "description": "The custom_metadata of the item that has been provided by the user on run creation." + }, + "custom_metadata_checksum": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Custom Metadata Checksum", + "description": "The checksum of the `custom_metadata` field.\nCan be used in the `PUT /runs/{run-id}/items/{external_id}/custom_metadata`\nrequest to avoid unwanted override of the values in concurrent requests.", + "examples": [ + "f54fe109" + ] + }, + "queue_position_org": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Queue Position Org", + "description": "The position of the item in the organization's queue." + }, + "queue_position_platform": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Queue Position Platform", + "description": "The position of the item in the platform's queue." + }, + "state": { + "$ref": "#/components/schemas/ItemState", + "description": "\nThe item moves from `PENDING` to `PROCESSING` to `TERMINATED` state.\nWhen terminated, consult the `termination_reason` property to see whether it was successful.\n " + }, + "output": { + "$ref": "#/components/schemas/ItemOutput", + "description": "The output status of the item (NONE, FULL)" + }, + "termination_reason": { + "anyOf": [ + { + "$ref": "#/components/schemas/ItemTerminationReason" + }, + { + "type": "null" + } + ], + "description": "\nWhen the `state` is `TERMINATED` this will explain why\n`SUCCEEDED` -> Successful processing.\n`USER_ERROR` -> Failed because the provided input was invalid.\n`SYSTEM_ERROR` -> There was an error in the model or platform.\n`SKIPPED` -> Was cancelled\n" + }, + "error_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error Code" + }, + "error_message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error Message", + "description": "\n The error message in case the `termination_reason` is in `USER_ERROR` or `SYSTEM_ERROR`\n ", + "examples": [ + "This item was not processed because the threshold of 3 items finishing in error state (user or system error) was reached before the item was processed.", + "The item was not processed because the run was cancelled by the user before the item was processed.", + "User error raised by Application because the input data provided by the user cannot be processed:\nThe image width is 123000 px, but the maximum width is 100000 px", + "A system error occurred during the item execution:\n System went out of memory in cell classification", + "An unknown system error occurred during the item execution" + ] + }, + "terminated_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Terminated At", + "description": "Timestamp showing when the item reached a terminal state.", + "examples": [ + "2024-01-15T10:30:45.123Z" + ] + }, + "input_artifacts": { + "items": { + "$ref": "#/components/schemas/InputArtifactResultReadResponse" + }, + "type": "array", + "title": "Input Artifacts", + "description": "\nThe input artifact(s) provided by the user. For most applications, this will be one artifact that\ndefines the whole slide image to be processed.\n " + }, + "output_artifacts": { + "items": { + "$ref": "#/components/schemas/OutputArtifactResultReadResponse" + }, + "type": "array", + "title": "Output Artifacts", + "description": "\nThe list of the results generated by the application algorithm. The number of files and their\ntypes depend on the particular application version, call `/v1/versions/{version_id}` to get\nthe details.\n " + } + }, + "type": "object", + "required": [ + "item_id", + "external_id", + "custom_metadata", + "state", + "output", + "input_artifacts", + "output_artifacts" + ], + "title": "ItemResultReadResponse", + "description": "Response schema for items in `List Run Items` endpoint" + }, + "ItemState": { + "type": "string", + "enum": [ + "PENDING", + "PROCESSING", + "TERMINATED" + ], + "title": "ItemState" + }, + "ItemTerminationReason": { + "type": "string", + "enum": [ + "SUCCEEDED", + "USER_ERROR", + "SYSTEM_ERROR", + "SKIPPED" + ], + "title": "ItemTerminationReason" + }, + "MeReadResponse": { + "properties": { + "user": { + "$ref": "#/components/schemas/UserReadResponse" + }, + "organization": { + "$ref": "#/components/schemas/OrganizationReadResponse" + } + }, + "type": "object", + "required": [ + "user", + "organization" + ], + "title": "MeReadResponse", + "description": "Response schema for `Get current user` endpoint" + }, + "OrganizationReadResponse": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "Unique organization identifier", + "examples": [ + "org_123456" + ] + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name", + "description": "Organization name (E.g. “aignx”)", + "examples": [ + "aignx" + ] + }, + "display_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Display Name", + "description": "Public organization name (E.g. “Aignostics GmbH”)", + "examples": [ + "Aignostics GmbH" + ] + }, + "aignostics_bucket_hmac_access_key_id": { + "type": "string", + "title": "Aignostics Bucket Hmac Access Key Id", + "description": "HMAC access key ID for the Aignostics-provided storage bucket. Used to authenticate requests for uploading files and generating signed URLs", + "examples": [ + "YOUR_HMAC_ACCESS_KEY_ID" + ] + }, + "aignostics_bucket_hmac_secret_access_key": { + "type": "string", + "title": "Aignostics Bucket Hmac Secret Access Key", + "description": "HMAC secret access key paired with the access key ID. Keep this credential secure.", + "examples": [ + "YOUR/HMAC/SECRET_ACCESS_KEY" + ] + }, + "aignostics_bucket_name": { + "type": "string", + "title": "Aignostics Bucket Name", + "description": "Name of the bucket provided by Aignostics for storing input artifacts (slide images)", + "examples": [ + "aignostics-platform-bucket" + ] + }, + "aignostics_bucket_protocol": { + "type": "string", + "title": "Aignostics Bucket Protocol", + "description": "Protocol to use for bucket access. Defines the URL scheme for connecting to the storage service", + "examples": [ + "gs" + ] + }, + "aignostics_logfire_token": { + "type": "string", + "title": "Aignostics Logfire Token", + "description": "Authentication token for Logfire observability service. Enables sending application logs and performance metrics to Aignostics for monitoring and support", + "examples": [ + "your-logfire-token" + ] + }, + "aignostics_sentry_dsn": { + "type": "string", + "title": "Aignostics Sentry Dsn", + "description": "Data Source Name (DSN) for Sentry error tracking service. Allows automatic reporting of errors and exceptions to Aignostics support team", + "examples": [ + "https://2354s3#ewsha@o44.ingest.us.sentry.io/34345123432" + ] + } + }, + "type": "object", + "required": [ + "id", + "aignostics_bucket_hmac_access_key_id", + "aignostics_bucket_hmac_secret_access_key", + "aignostics_bucket_name", + "aignostics_bucket_protocol", + "aignostics_logfire_token", + "aignostics_sentry_dsn" + ], + "title": "OrganizationReadResponse", + "description": "Part of response schema for Organization object in `Get current user` endpoint.\nThis model corresponds to the response schema returned from\nAuth0 GET /v2/organizations/{id} endpoint, flattens out the metadata out\nand doesn't return branding or token_quota objects.\nFor details, see:\nhttps://auth0.com/docs/api/management/v2/organizations/get-organizations-by-id\n\n#### Configuration for integrating with Aignostics Platform services.\n\nThe Aignostics Platform API requires signed URLs for input artifacts (slide images). To simplify this process,\nAignostics provides a dedicated storage bucket. The HMAC credentials below grant read and write\naccess to this bucket, allowing you to upload files and generate the signed URLs needed for API calls.\n\nAdditionally, logging and error reporting tokens enable Aignostics to provide better support and monitor\nsystem performance for your integration." + }, + "OutputArtifact": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "mime_type": { + "type": "string", + "pattern": "^\\w+\\/\\w+[-+.|\\w+]+\\w+$", + "title": "Mime Type", + "examples": [ + "application/vnd.apache.parquet" + ] + }, + "metadata_schema": { + "additionalProperties": true, + "type": "object", + "title": "Metadata Schema" + }, + "scope": { + "$ref": "#/components/schemas/OutputArtifactScope" + }, + "visibility": { + "$ref": "#/components/schemas/OutputArtifactVisibility" + } + }, + "type": "object", + "required": [ + "name", + "mime_type", + "metadata_schema", + "scope", + "visibility" + ], + "title": "OutputArtifact" + }, + "OutputArtifactResultReadResponse": { + "properties": { + "output_artifact_id": { + "type": "string", + "format": "uuid", + "title": "Output Artifact Id", + "description": "The Id of the artifact. Used internally" + }, + "name": { + "type": "string", + "title": "Name", + "description": "\nName of the output from the output schema from the `/v1/versions/{version_id}` endpoint.\n ", + "examples": [ + "tissue_qc:tiff_heatmap" + ] + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata", + "description": "The metadata of the output artifact, provided by the application. Can only be None if the artifact itself was deleted." + }, + "state": { + "$ref": "#/components/schemas/ArtifactState", + "description": "The current state of the artifact (PENDING, PROCESSING, TERMINATED)" + }, + "termination_reason": { + "anyOf": [ + { + "$ref": "#/components/schemas/ArtifactTerminationReason" + }, + { + "type": "null" + } + ], + "description": "The reason for termination when state is TERMINATED" + }, + "output": { + "$ref": "#/components/schemas/ArtifactOutput", + "description": "The output status of the artifact (NONE, FULL)" + }, + "error_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error Code" + }, + "error_message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error Message" + }, + "download_url": { + "anyOf": [ + { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" + }, + { + "type": "null" + } + ], + "title": "Download Url", + "description": "\nThe download URL to the output file. The URL is valid for 1 hour after the endpoint is called.\nA new URL is generated every time the endpoint is called.\n ", + "deprecated": true + } + }, + "type": "object", + "required": [ + "output_artifact_id", + "name", + "state", + "output" + ], + "title": "OutputArtifactResultReadResponse" + }, + "OutputArtifactScope": { + "type": "string", + "enum": [ + "ITEM", + "GLOBAL" + ], + "title": "OutputArtifactScope" + }, + "OutputArtifactVisibility": { + "type": "string", + "enum": [ + "INTERNAL", + "EXTERNAL" + ], + "title": "OutputArtifactVisibility" + }, + "ResourceType": { + "type": "string", + "enum": [ + "run", + "item", + "output_artifact", + "share_token" + ], + "title": "ResourceType" + }, + "RunCreationRequest": { + "properties": { + "application_id": { + "type": "string", + "title": "Application Id", + "description": "Unique ID for the application to use for processing", + "examples": [ + "he-tme" + ] + }, + "version_number": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Version Number", + "description": "Semantic version of the application to use for processing. If not provided, the latest available version will be used", + "examples": [ + "1.0.0-beta1" + ] + }, + "custom_metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Custom Metadata", + "description": "Optional JSON metadata to store additional information alongside the run", + "examples": [ + { + "department": "D1", + "study": "abc-1" + } + ] + }, + "scheduling": { + "anyOf": [ + { + "$ref": "#/components/schemas/SchedulingRequest" + }, + { + "type": "null" + } + ], + "description": "Optional scheduling constraints for this run.", + "examples": [ + { + "deadline": "2026-03-05T23:59:59Z", + "due_date": "2026-03-04T23:59:59Z" + } + ] + }, + "callback_context": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Callback Context", + "description": "Opaque JSON object for caller-supplied correlation data. Stored verbatim and echoed in state-change events. Max 1 KB after JSON serialization." + }, + "items": { + "items": { + "$ref": "#/components/schemas/ItemCreationRequest" + }, + "type": "array", + "minItems": 1, + "title": "Items", + "description": "List of items (slides) to process. Each item represents a whole slide image (WSI) with its associated metadata and artifacts", + "examples": [ + [ + { + "external_id": "slide_1", + "input_artifacts": [ + { + "download_url": "https://example-bucket.s3.amazonaws.com/slide1.tiff?signature=...", + "metadata": { + "checksum_base64_crc32c": "64RKKA==", + "height_px": 87761, + "media-type": "image/tiff", + "resolution_mpp": 0.2628238, + "specimen": { + "disease": "LUNG_CANCER", + "tissue": "LUNG" + }, + "staining_method": "H&E", + "width_px": 136223 + }, + "name": "input_slide" + } + ] + } + ] + ] + } + }, + "type": "object", + "required": [ + "application_id", + "items" + ], + "title": "RunCreationRequest", + "description": "Request schema for `Initiate Run` endpoint.\nIt describes which application version is chosen, and which user data should be processed." + }, + "RunCreationResponse": { + "properties": { + "run_id": { + "type": "string", + "format": "uuid", + "title": "Run Id", + "examples": [ + "3fa85f64-5717-4562-b3fc-2c963f66afa6" + ] + } + }, + "type": "object", + "required": [ + "run_id" + ], + "title": "RunCreationResponse" + }, + "RunItemStatistics": { + "properties": { + "item_count": { + "type": "integer", + "title": "Item Count", + "description": "Total number of the items in the run" + }, + "item_pending_count": { + "type": "integer", + "title": "Item Pending Count", + "description": "The number of items in `PENDING` state" + }, + "item_processing_count": { + "type": "integer", + "title": "Item Processing Count", + "description": "The number of items in `PROCESSING` state" + }, + "item_user_error_count": { + "type": "integer", + "title": "Item User Error Count", + "description": "The number of items in `TERMINATED` state, and the item termination reason is `USER_ERROR`" + }, + "item_system_error_count": { + "type": "integer", + "title": "Item System Error Count", + "description": "The number of items in `TERMINATED` state, and the item termination reason is `SYSTEM_ERROR`" + }, + "item_skipped_count": { + "type": "integer", + "title": "Item Skipped Count", + "description": "The number of items in `TERMINATED` state, and the item termination reason is `SKIPPED`" + }, + "item_succeeded_count": { + "type": "integer", + "title": "Item Succeeded Count", + "description": "The number of items in `TERMINATED` state, and the item termination reason is `SUCCEEDED`" + } + }, + "type": "object", + "required": [ + "item_count", + "item_pending_count", + "item_processing_count", + "item_user_error_count", + "item_system_error_count", + "item_skipped_count", + "item_succeeded_count" + ], + "title": "RunItemStatistics" + }, + "RunOutput": { + "type": "string", + "enum": [ + "NONE", + "PARTIAL", + "FULL" + ], + "title": "RunOutput" + }, + "RunReadResponse": { + "properties": { + "run_id": { + "type": "string", + "format": "uuid", + "title": "Run Id", + "description": "UUID of the application" + }, + "application_id": { + "type": "string", + "title": "Application Id", + "description": "Application id", + "examples": [ + "he-tme" + ] + }, + "version_number": { + "type": "string", + "title": "Version Number", + "description": "Application version number", + "examples": [ + "0.4.4" + ] + }, + "state": { + "$ref": "#/components/schemas/RunState", + "description": "When the run request is received by the Platform, the `state` of it is set to\n`PENDING`. The state changes to `PROCESSING` when at least one item is being processed. After `PROCESSING`, the\nstate of the run can switch back to `PENDING` if there are no processing items, or to `TERMINATED` when the run\nfinished processing." + }, + "output": { + "$ref": "#/components/schemas/RunOutput", + "description": "The status of the output of the run. When 0 items are successfully processed the output is\n`NONE`, after one item is successfully processed, the value is set to `PARTIAL`. When all items of the run are\nsuccessfully processed, the output is set to `FULL`." + }, + "termination_reason": { + "anyOf": [ + { + "$ref": "#/components/schemas/RunTerminationReason" + }, + { + "type": "null" + } + ], + "description": "The termination reason of the run. When the run is not in `TERMINATED` state, the\n termination_reason is `null`. If all items of of the run are processed (successfully or with an error), then\n termination_reason is set to `ALL_ITEMS_PROCESSED`. If the run is cancelled by the user, the value is set to\n `CANCELED_BY_USER`. If the run reaches the threshold of number of failed items, the Platform cancels the run\n and sets the termination_reason to `CANCELED_BY_SYSTEM`.\n " + }, + "error_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error Code", + "description": "When the termination_reason is set to CANCELED_BY_SYSTEM, the error_code is set to define the\n structured description of the error.", + "examples": [ + "SCHEDULER.ITEMS_WITH_ERROR_THRESHOLD_REACHED" + ] + }, + "error_message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error Message", + "description": "When the termination_reason is set to CANCELED_BY_SYSTEM, the error_message is set to provide\n more insights to the error cause.", + "examples": [ + "Run canceled given errors on more than 10 items." + ] + }, + "statistics": { + "$ref": "#/components/schemas/RunItemStatistics", + "description": "Aggregated statistics of the run execution" + }, + "custom_metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Custom Metadata", + "description": "Optional JSON metadata that was stored in alongside the run by the user", + "examples": [ + { + "department": "D1", + "study": "abc-1" + } + ] + }, + "custom_metadata_checksum": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Custom Metadata Checksum", + "description": "The checksum of the `custom_metadata` field. Can be used in the `PUT /runs/{run-id}/custom_metadata`\nrequest to avoid unwanted override of the values in concurrent requests.", + "examples": [ + "f54fe109" + ] + }, + "submitted_at": { + "type": "string", + "format": "date-time", + "title": "Submitted At", + "description": "Timestamp showing when the run was triggered" + }, + "submitted_by": { + "type": "string", + "title": "Submitted By", + "description": "Id of the user who triggered the run", + "examples": [ + "auth0|123456" + ] + }, + "terminated_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Terminated At", + "description": "Timestamp showing when the run reached a terminal state.", + "examples": [ + "2024-01-15T10:30:45.123Z" + ] + }, + "num_preceding_items_org": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Num Preceding Items Org", + "description": "How many Items from other Runs in the same Organization are due to begin processing before this Run's next Item does." + }, + "num_preceding_items_platform": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Num Preceding Items Platform", + "description": "How many Items from other Runs are due to begin processing before this Run's next Item does." + }, + "scheduling": { + "anyOf": [ + { + "$ref": "#/components/schemas/SchedulingResponse" + }, + { + "type": "null" + } + ], + "description": "Scheduling constraints set for this run." + } + }, + "type": "object", + "required": [ + "run_id", + "application_id", + "version_number", + "state", + "output", + "termination_reason", + "error_code", + "error_message", + "statistics", + "submitted_at", + "submitted_by" + ], + "title": "RunReadResponse", + "description": "Response schema for `Get run details` endpoint" + }, + "RunState": { + "type": "string", + "enum": [ + "PENDING", + "PROCESSING", + "TERMINATED" + ], + "title": "RunState" + }, + "RunTerminationReason": { + "type": "string", + "enum": [ + "ALL_ITEMS_PROCESSED", + "CANCELED_BY_SYSTEM", + "CANCELED_BY_USER" + ], + "title": "RunTerminationReason" + }, + "SchedulingRequest": { + "properties": { + "due_date": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Due Date", + "description": "Requested completion time. Items are prioritized to meet this target.", + "examples": [ + "2026-03-04T23:59:59Z" + ] + }, + "deadline": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Deadline", + "description": "Hard deadline. The run will be cancelled if not completed by this time.", + "examples": [ + "2026-03-05T23:59:59Z" + ] + } + }, + "type": "object", + "title": "SchedulingRequest", + "description": "Scheduling constraints for a run." + }, + "SchedulingResponse": { + "properties": { + "due_date": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Due Date" + }, + "deadline": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Deadline" + } + }, + "type": "object", + "title": "SchedulingResponse", + "description": "Scheduling fields returned in run responses." + }, + "ShareTokenCreateRequest": { + "properties": { + "expires_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Expires At" + } + }, + "type": "object", + "title": "ShareTokenCreateRequest" + }, + "ShareTokenCreateResponse": { + "properties": { + "share_token_id": { + "type": "string", + "format": "uuid", + "title": "Share Token Id" + }, + "share_token": { + "type": "string", + "title": "Share Token" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "expires_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Expires At" + }, + "revoked": { + "type": "boolean", + "title": "Revoked" + } + }, + "type": "object", + "required": [ + "share_token_id", + "share_token", + "created_at", + "expires_at", + "revoked" + ], + "title": "ShareTokenCreateResponse", + "description": "Returned only on POST — includes the one-time share_token." + }, + "ShareTokenReadResponse": { + "properties": { + "share_token_id": { + "type": "string", + "format": "uuid", + "title": "Share Token Id" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "expires_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Expires At" + }, + "revoked": { + "type": "boolean", + "title": "Revoked" + } + }, + "type": "object", + "required": [ + "share_token_id", + "created_at", + "expires_at", + "revoked" + ], + "title": "ShareTokenReadResponse", + "description": "Returned on GET endpoints — omits share_token." + }, + "SubjectType": { + "type": "string", + "enum": [ + "user", + "organization_admin", + "organization_user", + "share_token" + ], + "title": "SubjectType" + }, + "UserReadResponse": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "Unique user identifier", + "examples": [ + "auth0|123456" + ] + }, + "email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Email", + "description": "User email", + "examples": [ + "user@domain.com" + ] + }, + "email_verified": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Email Verified", + "examples": [ + true + ] + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name", + "description": "First and last name of the user", + "examples": [ + "Jane Doe" + ] + }, + "given_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Given Name", + "examples": [ + "Jane" + ] + }, + "family_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Family Name", + "examples": [ + "Doe" + ] + }, + "nickname": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Nickname", + "examples": [ + "jdoe" + ] + }, + "picture": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Picture", + "examples": [ + "https://example.com/jdoe.jpg" + ] + }, + "updated_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Updated At", + "examples": [ + "2023-10-05T14:48:00.000Z" + ] + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "UserReadResponse", + "description": "Part of response schema for User object in `Get current user` endpoint.\nThis model corresponds to the response schema returned from\nAuth0 GET /v2/users/{id} endpoint.\nFor details, see:\nhttps://auth0.com/docs/api/management/v2/users/get-users-by-id" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "type": "array", + "title": "Location" + }, + "msg": { + "type": "string", + "title": "Message" + }, + "type": { + "type": "string", + "title": "Error Type" + }, + "input": { + "title": "Input" + }, + "ctx": { + "type": "object", + "title": "Context" + } + }, + "type": "object", + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError" + }, + "VersionDocumentResponse": { + "properties": { + "id": { + "type": "string", + "format": "uuid", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "mime_type": { + "type": "string", + "title": "Mime Type" + }, + "visibility": { + "$ref": "#/components/schemas/VersionDocumentVisibility" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "title": "Updated At" + } + }, + "type": "object", + "required": [ + "id", + "name", + "mime_type", + "visibility", + "created_at", + "updated_at" + ], + "title": "VersionDocumentResponse" + }, + "VersionDocumentVisibility": { + "type": "string", + "enum": [ + "public", + "internal" + ], + "title": "VersionDocumentVisibility" + }, + "VersionReadResponse": { + "properties": { + "version_number": { + "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "title": "Version Number", + "description": "Semantic version of the application" + }, + "changelog": { + "type": "string", + "title": "Changelog", + "description": "Description of the changes relative to the previous version" + }, + "input_artifacts": { + "items": { + "$ref": "#/components/schemas/InputArtifact" + }, + "type": "array", + "title": "Input Artifacts", + "description": "List of the input fields, provided by the User" + }, + "output_artifacts": { + "items": { + "$ref": "#/components/schemas/OutputArtifact" + }, + "type": "array", + "title": "Output Artifacts", + "description": "List of the output fields, generated by the application" + }, + "released_at": { + "type": "string", + "format": "date-time", + "title": "Released At", + "description": "The timestamp when the application version was registered" + } + }, + "type": "object", + "required": [ + "version_number", + "changelog", + "input_artifacts", + "output_artifacts", + "released_at" + ], + "title": "VersionReadResponse", + "description": "Base Response schema for the `Application Version Details` endpoint" + } + }, + "securitySchemes": { + "OAuth2AuthorizationCodeBearer": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "scopes": {}, + "authorizationUrl": "https://aignostics-platform-staging.eu.auth0.com/authorize", + "tokenUrl": "https://aignostics-platform-staging.eu.auth0.com/oauth/token" + } + } + } + } + } +} diff --git a/codegen/in/openapi.json b/codegen/in/openapi.json index 1e0c6e0e4..4b3e1dbee 100644 --- a/codegen/in/openapi.json +++ b/codegen/in/openapi.json @@ -3,7 +3,7 @@ "info": { "title": "Aignostics Platform API", "description": "\nThe Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. \n\nTo begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. \n\nMore information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com).\n\n**How to authorize and test API endpoints:**\n\n1. Click the \"Authorize\" button in the right corner below\n3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials\n4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint\n\n**Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized.\n\n", - "version": "1.5.0" + "version": "1.6.0" }, "servers": [ { @@ -714,7 +714,7 @@ "Public" ], "summary": "Get run details", - "description": "This endpoint allows the caller to retrieve the current status of a run along with other relevant run details.\n A run becomes available immediately after it is created through the `POST /v1/runs/` endpoint.\n\n To download the output results, use `GET /v1/runs/{run_id}/` items to get outputs for all slides.\nAccess to a run is restricted to the user who created it.", + "description": "This endpoint allows the caller to retrieve the current status of a run along with other relevant run details.\n A run becomes available immediately after it is created through the `POST /v1/runs/` endpoint.\n\n To download the output results, use `GET /v1/runs/{run_id}/` items to get outputs for all slides.\nAccess to a run is restricted to the user who created it, or users with an active grant or valid share token.", "operationId": "get_run_v1_runs__run_id__get", "security": [ { @@ -733,6 +733,24 @@ "title": "Run Id" }, "description": "Run id, returned by `POST /v1/runs/` endpoint" + }, + { + "name": "share_token", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Share token for accessing shared runs", + "title": "Share Token" + }, + "description": "Share token for accessing shared runs" } ], "responses": { @@ -849,6 +867,24 @@ }, "description": "Run id, returned by `POST /v1/runs/` endpoint" }, + { + "name": "share_token", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Share token for accessing shared runs", + "title": "Share Token" + }, + "description": "Share token for accessing shared runs" + }, { "name": "item_id__in", "in": "query", @@ -1091,6 +1127,24 @@ "title": "External Id" }, "description": "The `external_id` that was defined for the item by the customer that triggered the run." + }, + { + "name": "share_token", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Share token for accessing shared runs", + "title": "Share Token" + }, + "description": "Share token for accessing shared runs" } ], "responses": { @@ -1160,6 +1214,24 @@ "title": "Artifact Id" }, "description": "The artifact id to download" + }, + { + "name": "share_token", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Share token for accessing shared runs", + "title": "Share Token" + }, + "description": "Share token for accessing shared runs" } ], "responses": { @@ -1538,14 +1610,650 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VersionDocumentResponse" + "$ref": "#/components/schemas/VersionDocumentResponse" + } + } + } + }, + "404": { + "description": "Document not found, not public, or version not accessible" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/applications/{application_id}/versions/{version}/documents/{name}/file": { + "get": { + "tags": [ + "Public" + ], + "summary": "Download version document (browser)", + "description": "307 redirect to a short-lived GCS signed URL for downloading a document.\n\nThe signed URL includes ``response-content-disposition=attachment; filename=\"\"``\nso browsers prompt a save-as dialog rather than rendering inline.\nResponse carries ``Cache-Control: no-store``.", + "operationId": "get_version_document_file", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "application_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Application Id" + } + }, + { + "name": "version", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Version" + } + }, + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Name" + } + } + ], + "responses": { + "307": { + "description": "Temporary redirect to signed GCS URL with Content-Disposition: attachment" + }, + "404": { + "description": "Document not found, not public, or version not accessible" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/applications/{application_id}/versions/{version}/documents/{name}/content": { + "get": { + "tags": [ + "Public" + ], + "summary": "Stream version document content (programmatic)", + "description": "307 redirect to a short-lived GCS signed URL for streaming document content.\n\nUnlike ``/file``, no ``Content-Disposition`` override is set — GCS serves\nthe object body with its stored ``Content-Type``. Intended for programmatic\nclients that follow redirects and consume the content directly.\nResponse carries ``Cache-Control: no-store``.", + "operationId": "get_version_document_content", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "application_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Application Id" + } + }, + { + "name": "version", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Version" + } + }, + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Name" + } + } + ], + "responses": { + "307": { + "description": "Temporary redirect to signed GCS URL; GCS serves the object with its stored Content-Type" + }, + "404": { + "description": "Document not found, not public, or version not accessible" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/access/grants": { + "post": { + "tags": [ + "Public" + ], + "summary": "Create Grant", + "description": "Create a grant to share access to a resource with a subject (user or organization).", + "operationId": "create_grant_v1_access_grants_post", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GrantCreateRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GrantReadResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to grant access to this resource" + }, + "404": { + "description": "Resource not found" + }, + "422": { + "description": "Unprocessable Entity - Only viewer grants can be created" + } + } + }, + "get": { + "tags": [ + "Public" + ], + "summary": "List Grants", + "description": "List grants.\n\nOrg admins see all grants for all resources in their organization.\nRegular users see grants for all resources they submitted.", + "operationId": "list_grants_v1_access_grants_get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "resource_type", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResourceType" + }, + { + "type": "null" + } + ], + "title": "Resource Type" + } + }, + { + "name": "resource_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "title": "Resource Id" + } + }, + { + "name": "subject_type", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/SubjectType" + }, + { + "type": "null" + } + ], + "title": "Subject Type" + } + }, + { + "name": "subject_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Subject Id" + } + }, + { + "name": "revoked", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Revoked" + } + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "default": 1, + "title": "Page" + } + }, + { + "name": "page_size", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 100, + "minimum": 5, + "default": 50, + "title": "Page Size" + } + }, + { + "name": "sort", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.", + "title": "Sort" + }, + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GrantReadResponse" + }, + "title": "Response List Grants V1 Access Grants Get" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/access/grants/{grant_id}": { + "get": { + "tags": [ + "Public" + ], + "summary": "Get Grant", + "description": "Get a grant by its ID.", + "operationId": "get_grant_v1_access_grants__grant_id__get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "grant_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Grant ID", + "title": "Grant Id" + }, + "description": "Grant ID" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GrantReadResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to view this grant" + }, + "404": { + "description": "Grant not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Public" + ], + "summary": "Revoke Grant", + "description": "Revoke a grant by its ID. Sets the revoked_at timestamp on the grant.", + "operationId": "revoke_grant_v1_access_grants__grant_id__delete", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "grant_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Grant ID", + "title": "Grant Id" + }, + "description": "Grant ID" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GrantReadResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to revoke this grant" + }, + "404": { + "description": "Grant not found" + }, + "409": { + "description": "Conflict - Grant is already revoked" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/access/share-tokens": { + "post": { + "tags": [ + "Public" + ], + "summary": "Create Share Token", + "description": "Create a share token. The returned share_token value is shown only once and is never stored.\nUse POST /access/grants with subject_type=share_token to grant access to a resource.", + "operationId": "create_share_token_v1_access_share_tokens_post", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ShareTokenCreateRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ShareTokenCreateResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Public" + ], + "summary": "List Share Tokens", + "description": "List share tokens. Service and Superadmin see all tokens; other users see only their own.", + "operationId": "list_share_tokens_v1_access_share_tokens_get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "run_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "description": "Filter by run ID", + "title": "Run Id" + }, + "description": "Filter by run ID" + }, + { + "name": "created_by", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter by share token creator", + "title": "Created By" + }, + "description": "Filter by share token creator" + }, + { + "name": "revoked", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Revoked" + } + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "default": 1, + "title": "Page" + } + }, + { + "name": "page_size", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 100, + "minimum": 5, + "default": 50, + "title": "Page Size" + } + }, + { + "name": "sort", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.", + "title": "Sort" + }, + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ShareTokenReadResponse" + }, + "title": "Response List Share Tokens V1 Access Share Tokens Get" } } } }, - "404": { - "description": "Document not found, not public, or version not accessible" - }, "422": { "description": "Validation Error", "content": { @@ -1559,14 +2267,14 @@ } } }, - "/v1/applications/{application_id}/versions/{version}/documents/{name}/file": { + "/v1/access/share-tokens/{share_token_id}": { "get": { "tags": [ "Public" ], - "summary": "Download version document (browser)", - "description": "307 redirect to a short-lived GCS signed URL for downloading a document.\n\nThe signed URL includes ``response-content-disposition=attachment; filename=\"\"``\nso browsers prompt a save-as dialog rather than rendering inline.\nResponse carries ``Cache-Control: no-store``.", - "operationId": "get_version_document_file", + "summary": "Get Share Token", + "description": "Get a share token by its ID.", + "operationId": "get_share_token_v1_access_share_tokens__share_token_id__get", "security": [ { "OAuth2AuthorizationCodeBearer": [] @@ -1574,39 +2282,34 @@ ], "parameters": [ { - "name": "application_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Application Id" - } - }, - { - "name": "version", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Version" - } - }, - { - "name": "name", + "name": "share_token_id", "in": "path", "required": true, "schema": { "type": "string", - "title": "Name" - } + "format": "uuid", + "description": "Share token ID", + "title": "Share Token Id" + }, + "description": "Share token ID" } ], "responses": { - "307": { - "description": "Temporary redirect to signed GCS URL with Content-Disposition: attachment" + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ShareTokenReadResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to view this share token" }, "404": { - "description": "Document not found, not public, or version not accessible" + "description": "Share token not found" }, "422": { "description": "Validation Error", @@ -1619,16 +2322,14 @@ } } } - } - }, - "/v1/applications/{application_id}/versions/{version}/documents/{name}/content": { - "get": { + }, + "delete": { "tags": [ "Public" ], - "summary": "Stream version document content (programmatic)", - "description": "307 redirect to a short-lived GCS signed URL for streaming document content.\n\nUnlike ``/file``, no ``Content-Disposition`` override is set — GCS serves\nthe object body with its stored ``Content-Type``. Intended for programmatic\nclients that follow redirects and consume the content directly.\nResponse carries ``Cache-Control: no-store``.", - "operationId": "get_version_document_content", + "summary": "Revoke Share Token", + "description": "Revoke a share token by its ID. Invalidates the credential regardless of any active grants.", + "operationId": "revoke_share_token_v1_access_share_tokens__share_token_id__delete", "security": [ { "OAuth2AuthorizationCodeBearer": [] @@ -1636,39 +2337,37 @@ ], "parameters": [ { - "name": "application_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Application Id" - } - }, - { - "name": "version", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Version" - } - }, - { - "name": "name", + "name": "share_token_id", "in": "path", "required": true, "schema": { "type": "string", - "title": "Name" - } + "format": "uuid", + "description": "Share token ID", + "title": "Share Token Id" + }, + "description": "Share token ID" } ], "responses": { - "307": { - "description": "Temporary redirect to signed GCS URL; GCS serves the object with its stored Content-Type" + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ShareTokenReadResponse" + } + } + } + }, + "403": { + "description": "Forbidden - You don't have permission to revoke this share token" }, "404": { - "description": "Document not found, not public, or version not accessible" + "description": "Share token not found" + }, + "409": { + "description": "Conflict - Share token is already revoked" }, "422": { "description": "Validation Error", @@ -1925,6 +2624,116 @@ ], "title": "CustomMetadataUpdateResponse" }, + "GrantCreateRequest": { + "properties": { + "resource_type": { + "$ref": "#/components/schemas/ResourceType" + }, + "resource_id": { + "type": "string", + "format": "uuid", + "title": "Resource Id" + }, + "subject_type": { + "$ref": "#/components/schemas/SubjectType" + }, + "subject_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Subject Id" + }, + "subject_email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Subject Email" + }, + "relation": { + "$ref": "#/components/schemas/GrantRelation" + } + }, + "type": "object", + "required": [ + "resource_type", + "resource_id", + "subject_type", + "relation" + ], + "title": "GrantCreateRequest" + }, + "GrantReadResponse": { + "properties": { + "grant_id": { + "type": "string", + "format": "uuid", + "title": "Grant Id" + }, + "resource_type": { + "$ref": "#/components/schemas/ResourceType" + }, + "resource_id": { + "type": "string", + "format": "uuid", + "title": "Resource Id" + }, + "subject_type": { + "$ref": "#/components/schemas/SubjectType" + }, + "subject_id": { + "type": "string", + "title": "Subject Id" + }, + "relation": { + "$ref": "#/components/schemas/GrantRelation" + }, + "created_by": { + "type": "string", + "title": "Created By" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "revoked": { + "type": "boolean", + "title": "Revoked" + } + }, + "type": "object", + "required": [ + "grant_id", + "resource_type", + "resource_id", + "subject_type", + "subject_id", + "relation", + "created_by", + "created_at", + "revoked" + ], + "title": "GrantReadResponse" + }, + "GrantRelation": { + "type": "string", + "enum": [ + "owner", + "editor", + "viewer" + ], + "title": "GrantRelation" + }, "HTTPValidationError": { "properties": { "detail": { @@ -2589,6 +3398,16 @@ ], "title": "OutputArtifactVisibility" }, + "ResourceType": { + "type": "string", + "enum": [ + "run", + "item", + "output_artifact", + "share_token" + ], + "title": "ResourceType" + }, "RunCreationRequest": { "properties": { "application_id": { @@ -2650,6 +3469,19 @@ } ] }, + "callback_context": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Callback Context", + "description": "Opaque JSON object for caller-supplied correlation data. Stored verbatim and echoed in state-change events. Max 1 KB after JSON serialization." + }, "items": { "items": { "$ref": "#/components/schemas/ItemCreationRequest" @@ -3051,6 +3883,117 @@ "title": "SchedulingResponse", "description": "Scheduling fields returned in run responses." }, + "ShareTokenCreateRequest": { + "properties": { + "expires_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Expires At" + } + }, + "type": "object", + "title": "ShareTokenCreateRequest" + }, + "ShareTokenCreateResponse": { + "properties": { + "share_token_id": { + "type": "string", + "format": "uuid", + "title": "Share Token Id" + }, + "share_token": { + "type": "string", + "title": "Share Token" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "expires_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Expires At" + }, + "revoked": { + "type": "boolean", + "title": "Revoked" + } + }, + "type": "object", + "required": [ + "share_token_id", + "share_token", + "created_at", + "expires_at", + "revoked" + ], + "title": "ShareTokenCreateResponse", + "description": "Returned only on POST — includes the one-time share_token." + }, + "ShareTokenReadResponse": { + "properties": { + "share_token_id": { + "type": "string", + "format": "uuid", + "title": "Share Token Id" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "expires_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Expires At" + }, + "revoked": { + "type": "boolean", + "title": "Revoked" + } + }, + "type": "object", + "required": [ + "share_token_id", + "created_at", + "expires_at", + "revoked" + ], + "title": "ShareTokenReadResponse", + "description": "Returned on GET endpoints — omits share_token." + }, + "SubjectType": { + "type": "string", + "enum": [ + "user", + "organization_admin", + "organization_user", + "share_token" + ], + "title": "SubjectType" + }, "UserReadResponse": { "properties": { "id": { diff --git a/codegen/out/.openapi-generator/FILES b/codegen/out/.openapi-generator/FILES index 56c6dba42..22e4309ce 100644 --- a/codegen/out/.openapi-generator/FILES +++ b/codegen/out/.openapi-generator/FILES @@ -11,6 +11,9 @@ aignx/codegen/models/artifact_state.py aignx/codegen/models/artifact_termination_reason.py aignx/codegen/models/custom_metadata_update_request.py aignx/codegen/models/custom_metadata_update_response.py +aignx/codegen/models/grant_create_request.py +aignx/codegen/models/grant_read_response.py +aignx/codegen/models/grant_relation.py aignx/codegen/models/http_validation_error.py aignx/codegen/models/input_artifact.py aignx/codegen/models/input_artifact_creation_request.py @@ -26,6 +29,7 @@ aignx/codegen/models/output_artifact.py aignx/codegen/models/output_artifact_result_read_response.py aignx/codegen/models/output_artifact_scope.py aignx/codegen/models/output_artifact_visibility.py +aignx/codegen/models/resource_type.py aignx/codegen/models/run_creation_request.py aignx/codegen/models/run_creation_response.py aignx/codegen/models/run_item_statistics.py @@ -35,6 +39,10 @@ aignx/codegen/models/run_state.py aignx/codegen/models/run_termination_reason.py aignx/codegen/models/scheduling_request.py aignx/codegen/models/scheduling_response.py +aignx/codegen/models/share_token_create_request.py +aignx/codegen/models/share_token_create_response.py +aignx/codegen/models/share_token_read_response.py +aignx/codegen/models/subject_type.py aignx/codegen/models/user_read_response.py aignx/codegen/models/validation_error.py aignx/codegen/models/validation_error_loc_inner.py diff --git a/codegen/out/aignx/codegen/api/public_api.py b/codegen/out/aignx/codegen/api/public_api.py index 1a74d4508..ef6ebaf79 100644 --- a/codegen/out/aignx/codegen/api/public_api.py +++ b/codegen/out/aignx/codegen/api/public_api.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -16,20 +16,27 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr, field_validator +from pydantic import Field, StrictBool, StrictStr, field_validator from typing import Any, List, Optional from typing_extensions import Annotated from aignx.codegen.models.application_read_response import ApplicationReadResponse from aignx.codegen.models.application_read_short_response import ApplicationReadShortResponse from aignx.codegen.models.custom_metadata_update_request import CustomMetadataUpdateRequest from aignx.codegen.models.custom_metadata_update_response import CustomMetadataUpdateResponse +from aignx.codegen.models.grant_create_request import GrantCreateRequest +from aignx.codegen.models.grant_read_response import GrantReadResponse from aignx.codegen.models.item_result_read_response import ItemResultReadResponse from aignx.codegen.models.item_state import ItemState from aignx.codegen.models.item_termination_reason import ItemTerminationReason from aignx.codegen.models.me_read_response import MeReadResponse +from aignx.codegen.models.resource_type import ResourceType from aignx.codegen.models.run_creation_request import RunCreationRequest from aignx.codegen.models.run_creation_response import RunCreationResponse from aignx.codegen.models.run_read_response import RunReadResponse +from aignx.codegen.models.share_token_create_request import ShareTokenCreateRequest +from aignx.codegen.models.share_token_create_response import ShareTokenCreateResponse +from aignx.codegen.models.share_token_read_response import ShareTokenReadResponse +from aignx.codegen.models.subject_type import SubjectType from aignx.codegen.models.version_document_response import VersionDocumentResponse from aignx.codegen.models.version_read_response import VersionReadResponse @@ -610,9 +617,9 @@ def _cancel_run_v1_runs_run_id_cancel_post_serialize( @validate_call - def create_run_v1_runs_post( + def create_grant_v1_access_grants_post( self, - run_creation_request: RunCreationRequest, + grant_create_request: GrantCreateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -625,13 +632,13 @@ def create_run_v1_runs_post( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RunCreationResponse: - """Initiate Run + ) -> GrantReadResponse: + """Create Grant - This endpoint initiates a processing run for a selected application and version, and returns a `run_id` for tracking purposes. Slide processing occurs asynchronously, allowing you to retrieve results for individual slides as soon as they complete processing. The system typically processes slides in batches. Below is an example of the required payload for initiating an Atlas H&E TME processing run. ### Payload The payload includes `application_id`, optional `version_number`, and `items` base fields. `application_id` is the unique identifier for the application. `version_number` is the semantic version to use. If not provided, the latest available version will be used. `items` includes the list of the items to process (slides, in case of HETA application). Every item has a set of standard fields defined by the API, plus the custom_metadata, specific to the chosen application. Example payload structure with the comments: ``` { application_id: \"he-tme\", version_number: \"1.0.0-beta\", items: [{ \"external_id\": \"slide_1\", \"custom_metadata\": {\"project\": \"sample-study\"}, \"input_artifacts\": [{ \"name\": \"user_slide\", \"download_url\": \"https://...\", \"metadata\": { \"specimen\": { \"disease\": \"LUNG_CANCER\", \"tissue\": \"LUNG\" }, \"staining_method\": \"H&E\", \"width_px\": 136223, \"height_px\": 87761, \"resolution_mpp\": 0.2628238, \"media-type\":\"image/tiff\", \"checksum_base64_crc32c\": \"64RKKA==\" } }] }] } ``` | Parameter | Description | | :---- | :---- | | `application_id` required | Unique ID for the application | | `version_number` optional | Semantic version of the application. If not provided, the latest available version will be used | | `items` required | List of submitted items i.e. whole slide images (WSIs) with parameters described below. | | `external_id` required | Unique WSI name or ID for easy reference to items, provided by the caller. The `external_id` should be unique across all items of the run. | | `input_artifacts` required | List of provided artifacts for a WSI; at the moment Atlas H&E-TME receives only 1 artifact per slide (the slide itself), but for some other applications this can be a slide and a segmentation map | | `name` required | Type of artifact; Atlas H&E-TME supports only `\"input_slide\"` | | `download_url` required | Signed URL to the input file in the S3 or GCS; Should be valid for at least 6 days | | `specimen: disease` required | Supported cancer types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `specimen: tissue` required | Supported tissue types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `staining_method` required | WSI stain bio-marker; Atlas H&E-TME supports only `\"H&E\"` | | `width_px` required | Integer value. Number of pixels of the WSI in the X dimension. | | `height_px` required | Integer value. Number of pixels of the WSI in the Y dimension. | | `resolution_mpp` required | Resolution of WSI in micrometers per pixel; check allowed range in Atlas H&E-TME manual | | `media-type` required | Supported media formats; available values are: image/tiff (for .tiff or .tif WSI), application/dicom (for DICOM ), application/zip (for zipped DICOM), and application/octet-stream (for .svs WSI) | | `checksum_base64_crc32c` required | Base64-encoded big-endian CRC32C checksum of the WSI image | ### Response The endpoint returns the run UUID. After that, the job is scheduled for the execution in the background. To check the status of the run, call `GET v1/runs/{run_id}` endpoint with the returned run UUID. ### Rejection Apart from the authentication, authorization, and malformed input error, the request can be rejected when specific quota limit is exceeded. More details on quotas is described in the documentation + Create a grant to share access to a resource with a subject (user or organization). - :param run_creation_request: (required) - :type run_creation_request: RunCreationRequest + :param grant_create_request: (required) + :type grant_create_request: GrantCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -654,8 +661,8 @@ def create_run_v1_runs_post( :return: Returns the result object. """ # noqa: E501 - _param = self._create_run_v1_runs_post_serialize( - run_creation_request=run_creation_request, + _param = self._create_grant_v1_access_grants_post_serialize( + grant_create_request=grant_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -663,11 +670,10 @@ def create_run_v1_runs_post( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "RunCreationResponse", - '404': None, + '201': "GrantReadResponse", '403': None, - '400': None, - '422': "HTTPValidationError", + '404': None, + '422': None, } response_data = self.api_client.call_api( *_param, @@ -681,9 +687,9 @@ def create_run_v1_runs_post( @validate_call - def create_run_v1_runs_post_with_http_info( + def create_grant_v1_access_grants_post_with_http_info( self, - run_creation_request: RunCreationRequest, + grant_create_request: GrantCreateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -696,13 +702,13 @@ def create_run_v1_runs_post_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RunCreationResponse]: - """Initiate Run + ) -> ApiResponse[GrantReadResponse]: + """Create Grant - This endpoint initiates a processing run for a selected application and version, and returns a `run_id` for tracking purposes. Slide processing occurs asynchronously, allowing you to retrieve results for individual slides as soon as they complete processing. The system typically processes slides in batches. Below is an example of the required payload for initiating an Atlas H&E TME processing run. ### Payload The payload includes `application_id`, optional `version_number`, and `items` base fields. `application_id` is the unique identifier for the application. `version_number` is the semantic version to use. If not provided, the latest available version will be used. `items` includes the list of the items to process (slides, in case of HETA application). Every item has a set of standard fields defined by the API, plus the custom_metadata, specific to the chosen application. Example payload structure with the comments: ``` { application_id: \"he-tme\", version_number: \"1.0.0-beta\", items: [{ \"external_id\": \"slide_1\", \"custom_metadata\": {\"project\": \"sample-study\"}, \"input_artifacts\": [{ \"name\": \"user_slide\", \"download_url\": \"https://...\", \"metadata\": { \"specimen\": { \"disease\": \"LUNG_CANCER\", \"tissue\": \"LUNG\" }, \"staining_method\": \"H&E\", \"width_px\": 136223, \"height_px\": 87761, \"resolution_mpp\": 0.2628238, \"media-type\":\"image/tiff\", \"checksum_base64_crc32c\": \"64RKKA==\" } }] }] } ``` | Parameter | Description | | :---- | :---- | | `application_id` required | Unique ID for the application | | `version_number` optional | Semantic version of the application. If not provided, the latest available version will be used | | `items` required | List of submitted items i.e. whole slide images (WSIs) with parameters described below. | | `external_id` required | Unique WSI name or ID for easy reference to items, provided by the caller. The `external_id` should be unique across all items of the run. | | `input_artifacts` required | List of provided artifacts for a WSI; at the moment Atlas H&E-TME receives only 1 artifact per slide (the slide itself), but for some other applications this can be a slide and a segmentation map | | `name` required | Type of artifact; Atlas H&E-TME supports only `\"input_slide\"` | | `download_url` required | Signed URL to the input file in the S3 or GCS; Should be valid for at least 6 days | | `specimen: disease` required | Supported cancer types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `specimen: tissue` required | Supported tissue types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `staining_method` required | WSI stain bio-marker; Atlas H&E-TME supports only `\"H&E\"` | | `width_px` required | Integer value. Number of pixels of the WSI in the X dimension. | | `height_px` required | Integer value. Number of pixels of the WSI in the Y dimension. | | `resolution_mpp` required | Resolution of WSI in micrometers per pixel; check allowed range in Atlas H&E-TME manual | | `media-type` required | Supported media formats; available values are: image/tiff (for .tiff or .tif WSI), application/dicom (for DICOM ), application/zip (for zipped DICOM), and application/octet-stream (for .svs WSI) | | `checksum_base64_crc32c` required | Base64-encoded big-endian CRC32C checksum of the WSI image | ### Response The endpoint returns the run UUID. After that, the job is scheduled for the execution in the background. To check the status of the run, call `GET v1/runs/{run_id}` endpoint with the returned run UUID. ### Rejection Apart from the authentication, authorization, and malformed input error, the request can be rejected when specific quota limit is exceeded. More details on quotas is described in the documentation + Create a grant to share access to a resource with a subject (user or organization). - :param run_creation_request: (required) - :type run_creation_request: RunCreationRequest + :param grant_create_request: (required) + :type grant_create_request: GrantCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -725,8 +731,8 @@ def create_run_v1_runs_post_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_run_v1_runs_post_serialize( - run_creation_request=run_creation_request, + _param = self._create_grant_v1_access_grants_post_serialize( + grant_create_request=grant_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -734,11 +740,10 @@ def create_run_v1_runs_post_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "RunCreationResponse", - '404': None, + '201': "GrantReadResponse", '403': None, - '400': None, - '422': "HTTPValidationError", + '404': None, + '422': None, } response_data = self.api_client.call_api( *_param, @@ -752,9 +757,9 @@ def create_run_v1_runs_post_with_http_info( @validate_call - def create_run_v1_runs_post_without_preload_content( + def create_grant_v1_access_grants_post_without_preload_content( self, - run_creation_request: RunCreationRequest, + grant_create_request: GrantCreateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -768,12 +773,12 @@ def create_run_v1_runs_post_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Initiate Run + """Create Grant - This endpoint initiates a processing run for a selected application and version, and returns a `run_id` for tracking purposes. Slide processing occurs asynchronously, allowing you to retrieve results for individual slides as soon as they complete processing. The system typically processes slides in batches. Below is an example of the required payload for initiating an Atlas H&E TME processing run. ### Payload The payload includes `application_id`, optional `version_number`, and `items` base fields. `application_id` is the unique identifier for the application. `version_number` is the semantic version to use. If not provided, the latest available version will be used. `items` includes the list of the items to process (slides, in case of HETA application). Every item has a set of standard fields defined by the API, plus the custom_metadata, specific to the chosen application. Example payload structure with the comments: ``` { application_id: \"he-tme\", version_number: \"1.0.0-beta\", items: [{ \"external_id\": \"slide_1\", \"custom_metadata\": {\"project\": \"sample-study\"}, \"input_artifacts\": [{ \"name\": \"user_slide\", \"download_url\": \"https://...\", \"metadata\": { \"specimen\": { \"disease\": \"LUNG_CANCER\", \"tissue\": \"LUNG\" }, \"staining_method\": \"H&E\", \"width_px\": 136223, \"height_px\": 87761, \"resolution_mpp\": 0.2628238, \"media-type\":\"image/tiff\", \"checksum_base64_crc32c\": \"64RKKA==\" } }] }] } ``` | Parameter | Description | | :---- | :---- | | `application_id` required | Unique ID for the application | | `version_number` optional | Semantic version of the application. If not provided, the latest available version will be used | | `items` required | List of submitted items i.e. whole slide images (WSIs) with parameters described below. | | `external_id` required | Unique WSI name or ID for easy reference to items, provided by the caller. The `external_id` should be unique across all items of the run. | | `input_artifacts` required | List of provided artifacts for a WSI; at the moment Atlas H&E-TME receives only 1 artifact per slide (the slide itself), but for some other applications this can be a slide and a segmentation map | | `name` required | Type of artifact; Atlas H&E-TME supports only `\"input_slide\"` | | `download_url` required | Signed URL to the input file in the S3 or GCS; Should be valid for at least 6 days | | `specimen: disease` required | Supported cancer types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `specimen: tissue` required | Supported tissue types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `staining_method` required | WSI stain bio-marker; Atlas H&E-TME supports only `\"H&E\"` | | `width_px` required | Integer value. Number of pixels of the WSI in the X dimension. | | `height_px` required | Integer value. Number of pixels of the WSI in the Y dimension. | | `resolution_mpp` required | Resolution of WSI in micrometers per pixel; check allowed range in Atlas H&E-TME manual | | `media-type` required | Supported media formats; available values are: image/tiff (for .tiff or .tif WSI), application/dicom (for DICOM ), application/zip (for zipped DICOM), and application/octet-stream (for .svs WSI) | | `checksum_base64_crc32c` required | Base64-encoded big-endian CRC32C checksum of the WSI image | ### Response The endpoint returns the run UUID. After that, the job is scheduled for the execution in the background. To check the status of the run, call `GET v1/runs/{run_id}` endpoint with the returned run UUID. ### Rejection Apart from the authentication, authorization, and malformed input error, the request can be rejected when specific quota limit is exceeded. More details on quotas is described in the documentation + Create a grant to share access to a resource with a subject (user or organization). - :param run_creation_request: (required) - :type run_creation_request: RunCreationRequest + :param grant_create_request: (required) + :type grant_create_request: GrantCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -796,8 +801,8 @@ def create_run_v1_runs_post_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_run_v1_runs_post_serialize( - run_creation_request=run_creation_request, + _param = self._create_grant_v1_access_grants_post_serialize( + grant_create_request=grant_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -805,11 +810,10 @@ def create_run_v1_runs_post_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "RunCreationResponse", - '404': None, + '201': "GrantReadResponse", '403': None, - '400': None, - '422': "HTTPValidationError", + '404': None, + '422': None, } response_data = self.api_client.call_api( *_param, @@ -818,9 +822,9 @@ def create_run_v1_runs_post_without_preload_content( return response_data.response - def _create_run_v1_runs_post_serialize( + def _create_grant_v1_access_grants_post_serialize( self, - run_creation_request, + grant_create_request, _request_auth, _content_type, _headers, @@ -846,8 +850,8 @@ def _create_run_v1_runs_post_serialize( # process the header parameters # process the form parameters # process the body parameter - if run_creation_request is not None: - _body_params = run_creation_request + if grant_create_request is not None: + _body_params = grant_create_request # set the HTTP header `Accept` @@ -879,7 +883,7 @@ def _create_run_v1_runs_post_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/api/v1/runs', + resource_path='/api/v1/access/grants', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -896,9 +900,9 @@ def _create_run_v1_runs_post_serialize( @validate_call - def delete_run_items_v1_runs_run_id_artifacts_delete( + def create_run_v1_runs_post( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], + run_creation_request: RunCreationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -911,13 +915,13 @@ def delete_run_items_v1_runs_run_id_artifacts_delete( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> object: - """Delete Run Items + ) -> RunCreationResponse: + """Initiate Run - This endpoint allows the caller to explicitly delete artifacts generated by a run. It can only be invoked when the run has reached a final state, i.e. `PROCESSED`, `CANCELED_SYSTEM`, or `CANCELED_USER`. Note that by default, all artifacts are automatically deleted 30 days after the run finishes, regardless of whether the caller explicitly requests such deletion. + This endpoint initiates a processing run for a selected application and version, and returns a `run_id` for tracking purposes. Slide processing occurs asynchronously, allowing you to retrieve results for individual slides as soon as they complete processing. The system typically processes slides in batches. Below is an example of the required payload for initiating an Atlas H&E TME processing run. ### Payload The payload includes `application_id`, optional `version_number`, and `items` base fields. `application_id` is the unique identifier for the application. `version_number` is the semantic version to use. If not provided, the latest available version will be used. `items` includes the list of the items to process (slides, in case of HETA application). Every item has a set of standard fields defined by the API, plus the custom_metadata, specific to the chosen application. Example payload structure with the comments: ``` { application_id: \"he-tme\", version_number: \"1.0.0-beta\", items: [{ \"external_id\": \"slide_1\", \"custom_metadata\": {\"project\": \"sample-study\"}, \"input_artifacts\": [{ \"name\": \"user_slide\", \"download_url\": \"https://...\", \"metadata\": { \"specimen\": { \"disease\": \"LUNG_CANCER\", \"tissue\": \"LUNG\" }, \"staining_method\": \"H&E\", \"width_px\": 136223, \"height_px\": 87761, \"resolution_mpp\": 0.2628238, \"media-type\":\"image/tiff\", \"checksum_base64_crc32c\": \"64RKKA==\" } }] }] } ``` | Parameter | Description | | :---- | :---- | | `application_id` required | Unique ID for the application | | `version_number` optional | Semantic version of the application. If not provided, the latest available version will be used | | `items` required | List of submitted items i.e. whole slide images (WSIs) with parameters described below. | | `external_id` required | Unique WSI name or ID for easy reference to items, provided by the caller. The `external_id` should be unique across all items of the run. | | `input_artifacts` required | List of provided artifacts for a WSI; at the moment Atlas H&E-TME receives only 1 artifact per slide (the slide itself), but for some other applications this can be a slide and a segmentation map | | `name` required | Type of artifact; Atlas H&E-TME supports only `\"input_slide\"` | | `download_url` required | Signed URL to the input file in the S3 or GCS; Should be valid for at least 6 days | | `specimen: disease` required | Supported cancer types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `specimen: tissue` required | Supported tissue types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `staining_method` required | WSI stain bio-marker; Atlas H&E-TME supports only `\"H&E\"` | | `width_px` required | Integer value. Number of pixels of the WSI in the X dimension. | | `height_px` required | Integer value. Number of pixels of the WSI in the Y dimension. | | `resolution_mpp` required | Resolution of WSI in micrometers per pixel; check allowed range in Atlas H&E-TME manual | | `media-type` required | Supported media formats; available values are: image/tiff (for .tiff or .tif WSI), application/dicom (for DICOM ), application/zip (for zipped DICOM), and application/octet-stream (for .svs WSI) | | `checksum_base64_crc32c` required | Base64-encoded big-endian CRC32C checksum of the WSI image | ### Response The endpoint returns the run UUID. After that, the job is scheduled for the execution in the background. To check the status of the run, call `GET v1/runs/{run_id}` endpoint with the returned run UUID. ### Rejection Apart from the authentication, authorization, and malformed input error, the request can be rejected when specific quota limit is exceeded. More details on quotas is described in the documentation - :param run_id: Run id, returned by `POST /runs/` endpoint (required) - :type run_id: str + :param run_creation_request: (required) + :type run_creation_request: RunCreationRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -940,8 +944,8 @@ def delete_run_items_v1_runs_run_id_artifacts_delete( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_run_items_v1_runs_run_id_artifacts_delete_serialize( - run_id=run_id, + _param = self._create_run_v1_runs_post_serialize( + run_creation_request=run_creation_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -949,8 +953,10 @@ def delete_run_items_v1_runs_run_id_artifacts_delete( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '201': "RunCreationResponse", '404': None, + '403': None, + '400': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -965,9 +971,9 @@ def delete_run_items_v1_runs_run_id_artifacts_delete( @validate_call - def delete_run_items_v1_runs_run_id_artifacts_delete_with_http_info( + def create_run_v1_runs_post_with_http_info( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], + run_creation_request: RunCreationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -980,13 +986,13 @@ def delete_run_items_v1_runs_run_id_artifacts_delete_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[object]: - """Delete Run Items + ) -> ApiResponse[RunCreationResponse]: + """Initiate Run - This endpoint allows the caller to explicitly delete artifacts generated by a run. It can only be invoked when the run has reached a final state, i.e. `PROCESSED`, `CANCELED_SYSTEM`, or `CANCELED_USER`. Note that by default, all artifacts are automatically deleted 30 days after the run finishes, regardless of whether the caller explicitly requests such deletion. + This endpoint initiates a processing run for a selected application and version, and returns a `run_id` for tracking purposes. Slide processing occurs asynchronously, allowing you to retrieve results for individual slides as soon as they complete processing. The system typically processes slides in batches. Below is an example of the required payload for initiating an Atlas H&E TME processing run. ### Payload The payload includes `application_id`, optional `version_number`, and `items` base fields. `application_id` is the unique identifier for the application. `version_number` is the semantic version to use. If not provided, the latest available version will be used. `items` includes the list of the items to process (slides, in case of HETA application). Every item has a set of standard fields defined by the API, plus the custom_metadata, specific to the chosen application. Example payload structure with the comments: ``` { application_id: \"he-tme\", version_number: \"1.0.0-beta\", items: [{ \"external_id\": \"slide_1\", \"custom_metadata\": {\"project\": \"sample-study\"}, \"input_artifacts\": [{ \"name\": \"user_slide\", \"download_url\": \"https://...\", \"metadata\": { \"specimen\": { \"disease\": \"LUNG_CANCER\", \"tissue\": \"LUNG\" }, \"staining_method\": \"H&E\", \"width_px\": 136223, \"height_px\": 87761, \"resolution_mpp\": 0.2628238, \"media-type\":\"image/tiff\", \"checksum_base64_crc32c\": \"64RKKA==\" } }] }] } ``` | Parameter | Description | | :---- | :---- | | `application_id` required | Unique ID for the application | | `version_number` optional | Semantic version of the application. If not provided, the latest available version will be used | | `items` required | List of submitted items i.e. whole slide images (WSIs) with parameters described below. | | `external_id` required | Unique WSI name or ID for easy reference to items, provided by the caller. The `external_id` should be unique across all items of the run. | | `input_artifacts` required | List of provided artifacts for a WSI; at the moment Atlas H&E-TME receives only 1 artifact per slide (the slide itself), but for some other applications this can be a slide and a segmentation map | | `name` required | Type of artifact; Atlas H&E-TME supports only `\"input_slide\"` | | `download_url` required | Signed URL to the input file in the S3 or GCS; Should be valid for at least 6 days | | `specimen: disease` required | Supported cancer types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `specimen: tissue` required | Supported tissue types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `staining_method` required | WSI stain bio-marker; Atlas H&E-TME supports only `\"H&E\"` | | `width_px` required | Integer value. Number of pixels of the WSI in the X dimension. | | `height_px` required | Integer value. Number of pixels of the WSI in the Y dimension. | | `resolution_mpp` required | Resolution of WSI in micrometers per pixel; check allowed range in Atlas H&E-TME manual | | `media-type` required | Supported media formats; available values are: image/tiff (for .tiff or .tif WSI), application/dicom (for DICOM ), application/zip (for zipped DICOM), and application/octet-stream (for .svs WSI) | | `checksum_base64_crc32c` required | Base64-encoded big-endian CRC32C checksum of the WSI image | ### Response The endpoint returns the run UUID. After that, the job is scheduled for the execution in the background. To check the status of the run, call `GET v1/runs/{run_id}` endpoint with the returned run UUID. ### Rejection Apart from the authentication, authorization, and malformed input error, the request can be rejected when specific quota limit is exceeded. More details on quotas is described in the documentation - :param run_id: Run id, returned by `POST /runs/` endpoint (required) - :type run_id: str + :param run_creation_request: (required) + :type run_creation_request: RunCreationRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1009,8 +1015,8 @@ def delete_run_items_v1_runs_run_id_artifacts_delete_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_run_items_v1_runs_run_id_artifacts_delete_serialize( - run_id=run_id, + _param = self._create_run_v1_runs_post_serialize( + run_creation_request=run_creation_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1018,8 +1024,10 @@ def delete_run_items_v1_runs_run_id_artifacts_delete_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '201': "RunCreationResponse", '404': None, + '403': None, + '400': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1034,9 +1042,9 @@ def delete_run_items_v1_runs_run_id_artifacts_delete_with_http_info( @validate_call - def delete_run_items_v1_runs_run_id_artifacts_delete_without_preload_content( + def create_run_v1_runs_post_without_preload_content( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], + run_creation_request: RunCreationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1050,12 +1058,12 @@ def delete_run_items_v1_runs_run_id_artifacts_delete_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete Run Items + """Initiate Run - This endpoint allows the caller to explicitly delete artifacts generated by a run. It can only be invoked when the run has reached a final state, i.e. `PROCESSED`, `CANCELED_SYSTEM`, or `CANCELED_USER`. Note that by default, all artifacts are automatically deleted 30 days after the run finishes, regardless of whether the caller explicitly requests such deletion. + This endpoint initiates a processing run for a selected application and version, and returns a `run_id` for tracking purposes. Slide processing occurs asynchronously, allowing you to retrieve results for individual slides as soon as they complete processing. The system typically processes slides in batches. Below is an example of the required payload for initiating an Atlas H&E TME processing run. ### Payload The payload includes `application_id`, optional `version_number`, and `items` base fields. `application_id` is the unique identifier for the application. `version_number` is the semantic version to use. If not provided, the latest available version will be used. `items` includes the list of the items to process (slides, in case of HETA application). Every item has a set of standard fields defined by the API, plus the custom_metadata, specific to the chosen application. Example payload structure with the comments: ``` { application_id: \"he-tme\", version_number: \"1.0.0-beta\", items: [{ \"external_id\": \"slide_1\", \"custom_metadata\": {\"project\": \"sample-study\"}, \"input_artifacts\": [{ \"name\": \"user_slide\", \"download_url\": \"https://...\", \"metadata\": { \"specimen\": { \"disease\": \"LUNG_CANCER\", \"tissue\": \"LUNG\" }, \"staining_method\": \"H&E\", \"width_px\": 136223, \"height_px\": 87761, \"resolution_mpp\": 0.2628238, \"media-type\":\"image/tiff\", \"checksum_base64_crc32c\": \"64RKKA==\" } }] }] } ``` | Parameter | Description | | :---- | :---- | | `application_id` required | Unique ID for the application | | `version_number` optional | Semantic version of the application. If not provided, the latest available version will be used | | `items` required | List of submitted items i.e. whole slide images (WSIs) with parameters described below. | | `external_id` required | Unique WSI name or ID for easy reference to items, provided by the caller. The `external_id` should be unique across all items of the run. | | `input_artifacts` required | List of provided artifacts for a WSI; at the moment Atlas H&E-TME receives only 1 artifact per slide (the slide itself), but for some other applications this can be a slide and a segmentation map | | `name` required | Type of artifact; Atlas H&E-TME supports only `\"input_slide\"` | | `download_url` required | Signed URL to the input file in the S3 or GCS; Should be valid for at least 6 days | | `specimen: disease` required | Supported cancer types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `specimen: tissue` required | Supported tissue types for Atlas H&E-TME (see full list in Atlas H&E-TME manual) | | `staining_method` required | WSI stain bio-marker; Atlas H&E-TME supports only `\"H&E\"` | | `width_px` required | Integer value. Number of pixels of the WSI in the X dimension. | | `height_px` required | Integer value. Number of pixels of the WSI in the Y dimension. | | `resolution_mpp` required | Resolution of WSI in micrometers per pixel; check allowed range in Atlas H&E-TME manual | | `media-type` required | Supported media formats; available values are: image/tiff (for .tiff or .tif WSI), application/dicom (for DICOM ), application/zip (for zipped DICOM), and application/octet-stream (for .svs WSI) | | `checksum_base64_crc32c` required | Base64-encoded big-endian CRC32C checksum of the WSI image | ### Response The endpoint returns the run UUID. After that, the job is scheduled for the execution in the background. To check the status of the run, call `GET v1/runs/{run_id}` endpoint with the returned run UUID. ### Rejection Apart from the authentication, authorization, and malformed input error, the request can be rejected when specific quota limit is exceeded. More details on quotas is described in the documentation - :param run_id: Run id, returned by `POST /runs/` endpoint (required) - :type run_id: str + :param run_creation_request: (required) + :type run_creation_request: RunCreationRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1078,8 +1086,8 @@ def delete_run_items_v1_runs_run_id_artifacts_delete_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_run_items_v1_runs_run_id_artifacts_delete_serialize( - run_id=run_id, + _param = self._create_run_v1_runs_post_serialize( + run_creation_request=run_creation_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1087,8 +1095,10 @@ def delete_run_items_v1_runs_run_id_artifacts_delete_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '201': "RunCreationResponse", '404': None, + '403': None, + '400': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1098,9 +1108,9 @@ def delete_run_items_v1_runs_run_id_artifacts_delete_without_preload_content( return response_data.response - def _delete_run_items_v1_runs_run_id_artifacts_delete_serialize( + def _create_run_v1_runs_post_serialize( self, - run_id, + run_creation_request, _request_auth, _content_type, _headers, @@ -1122,12 +1132,12 @@ def _delete_run_items_v1_runs_run_id_artifacts_delete_serialize( _body_params: Optional[bytes] = None # process the path parameters - if run_id is not None: - _path_params['run_id'] = run_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if run_creation_request is not None: + _body_params = run_creation_request # set the HTTP header `Accept` @@ -1138,6 +1148,19 @@ def _delete_run_items_v1_runs_run_id_artifacts_delete_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -1145,8 +1168,8 @@ def _delete_run_items_v1_runs_run_id_artifacts_delete_serialize( ] return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/runs/{run_id}/artifacts', + method='POST', + resource_path='/api/v1/runs', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1163,10 +1186,9 @@ def _delete_run_items_v1_runs_run_id_artifacts_delete_serialize( @validate_call - def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get( + def create_share_token_v1_access_share_tokens_post( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], - artifact_id: Annotated[StrictStr, Field(description="The artifact id to download")], + share_token_create_request: ShareTokenCreateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1179,15 +1201,13 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> object: - """Get Artifact Url + ) -> ShareTokenCreateResponse: + """Create Share Token - Download the artifact file with the specified artifact_id, belonging to the specified run. The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response. + Create a share token. The returned share_token value is shown only once and is never stored. Use POST /access/grants with subject_type=share_token to grant access to a resource. - :param run_id: Run id, returned by `POST /runs/` endpoint (required) - :type run_id: str - :param artifact_id: The artifact id to download (required) - :type artifact_id: str + :param share_token_create_request: (required) + :type share_token_create_request: ShareTokenCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1210,9 +1230,8 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get( :return: Returns the result object. """ # noqa: E501 - _param = self._get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( - run_id=run_id, - artifact_id=artifact_id, + _param = self._create_share_token_v1_access_share_tokens_post_serialize( + share_token_create_request=share_token_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1220,11 +1239,7 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - '404': None, - '307': None, - '403': None, - '410': None, + '201': "ShareTokenCreateResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1239,10 +1254,9 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get( @validate_call - def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_with_http_info( + def create_share_token_v1_access_share_tokens_post_with_http_info( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], - artifact_id: Annotated[StrictStr, Field(description="The artifact id to download")], + share_token_create_request: ShareTokenCreateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1255,15 +1269,13 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_with_http_inf _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[object]: - """Get Artifact Url + ) -> ApiResponse[ShareTokenCreateResponse]: + """Create Share Token - Download the artifact file with the specified artifact_id, belonging to the specified run. The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response. + Create a share token. The returned share_token value is shown only once and is never stored. Use POST /access/grants with subject_type=share_token to grant access to a resource. - :param run_id: Run id, returned by `POST /runs/` endpoint (required) - :type run_id: str - :param artifact_id: The artifact id to download (required) - :type artifact_id: str + :param share_token_create_request: (required) + :type share_token_create_request: ShareTokenCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1286,9 +1298,8 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_with_http_inf :return: Returns the result object. """ # noqa: E501 - _param = self._get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( - run_id=run_id, - artifact_id=artifact_id, + _param = self._create_share_token_v1_access_share_tokens_post_serialize( + share_token_create_request=share_token_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1296,11 +1307,7 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_with_http_inf ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - '404': None, - '307': None, - '403': None, - '410': None, + '201': "ShareTokenCreateResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1315,10 +1322,9 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_with_http_inf @validate_call - def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_without_preload_content( + def create_share_token_v1_access_share_tokens_post_without_preload_content( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], - artifact_id: Annotated[StrictStr, Field(description="The artifact id to download")], + share_token_create_request: ShareTokenCreateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1332,14 +1338,12 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_without_prelo _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Artifact Url + """Create Share Token - Download the artifact file with the specified artifact_id, belonging to the specified run. The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response. + Create a share token. The returned share_token value is shown only once and is never stored. Use POST /access/grants with subject_type=share_token to grant access to a resource. - :param run_id: Run id, returned by `POST /runs/` endpoint (required) - :type run_id: str - :param artifact_id: The artifact id to download (required) - :type artifact_id: str + :param share_token_create_request: (required) + :type share_token_create_request: ShareTokenCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1362,9 +1366,8 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_without_prelo :return: Returns the result object. """ # noqa: E501 - _param = self._get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( - run_id=run_id, - artifact_id=artifact_id, + _param = self._create_share_token_v1_access_share_tokens_post_serialize( + share_token_create_request=share_token_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1372,11 +1375,7 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_without_prelo ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - '404': None, - '307': None, - '403': None, - '410': None, + '201': "ShareTokenCreateResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1386,10 +1385,9 @@ def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_without_prelo return response_data.response - def _get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( + def _create_share_token_v1_access_share_tokens_post_serialize( self, - run_id, - artifact_id, + share_token_create_request, _request_auth, _content_type, _headers, @@ -1411,14 +1409,12 @@ def _get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( _body_params: Optional[bytes] = None # process the path parameters - if run_id is not None: - _path_params['run_id'] = run_id - if artifact_id is not None: - _path_params['artifact_id'] = artifact_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if share_token_create_request is not None: + _body_params = share_token_create_request # set the HTTP header `Accept` @@ -1429,6 +1425,19 @@ def _get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -1436,8 +1445,8 @@ def _get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/runs/{run_id}/artifacts/{artifact_id}/file', + method='POST', + resource_path='/api/v1/access/share-tokens', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1454,10 +1463,9 @@ def _get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( @validate_call - def get_item_by_run_v1_runs_run_id_items_external_id_get( + def delete_run_items_v1_runs_run_id_artifacts_delete( self, - run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], - external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1470,15 +1478,13 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ItemResultReadResponse: - """Get Item By Run + ) -> object: + """Delete Run Items - Retrieve details of a specific item (slide) by its external ID and the run ID. + This endpoint allows the caller to explicitly delete artifacts generated by a run. It can only be invoked when the run has reached a final state, i.e. `PROCESSED`, `CANCELED_SYSTEM`, or `CANCELED_USER`. Note that by default, all artifacts are automatically deleted 30 days after the run finishes, regardless of whether the caller explicitly requests such deletion. - :param run_id: The run id, returned by `POST /runs/` endpoint (required) + :param run_id: Run id, returned by `POST /runs/` endpoint (required) :type run_id: str - :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) - :type external_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1501,9 +1507,8 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get( :return: Returns the result object. """ # noqa: E501 - _param = self._get_item_by_run_v1_runs_run_id_items_external_id_get_serialize( + _param = self._delete_run_items_v1_runs_run_id_artifacts_delete_serialize( run_id=run_id, - external_id=external_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1511,9 +1516,8 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ItemResultReadResponse", + '200': "object", '404': None, - '403': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1528,10 +1532,9 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get( @validate_call - def get_item_by_run_v1_runs_run_id_items_external_id_get_with_http_info( + def delete_run_items_v1_runs_run_id_artifacts_delete_with_http_info( self, - run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], - external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1544,15 +1547,13 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ItemResultReadResponse]: - """Get Item By Run + ) -> ApiResponse[object]: + """Delete Run Items - Retrieve details of a specific item (slide) by its external ID and the run ID. + This endpoint allows the caller to explicitly delete artifacts generated by a run. It can only be invoked when the run has reached a final state, i.e. `PROCESSED`, `CANCELED_SYSTEM`, or `CANCELED_USER`. Note that by default, all artifacts are automatically deleted 30 days after the run finishes, regardless of whether the caller explicitly requests such deletion. - :param run_id: The run id, returned by `POST /runs/` endpoint (required) + :param run_id: Run id, returned by `POST /runs/` endpoint (required) :type run_id: str - :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) - :type external_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1575,9 +1576,8 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_item_by_run_v1_runs_run_id_items_external_id_get_serialize( + _param = self._delete_run_items_v1_runs_run_id_artifacts_delete_serialize( run_id=run_id, - external_id=external_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1585,9 +1585,8 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ItemResultReadResponse", + '200': "object", '404': None, - '403': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1602,10 +1601,9 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get_with_http_info( @validate_call - def get_item_by_run_v1_runs_run_id_items_external_id_get_without_preload_content( + def delete_run_items_v1_runs_run_id_artifacts_delete_without_preload_content( self, - run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], - external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1619,14 +1617,12 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get_without_preload_content _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Item By Run + """Delete Run Items - Retrieve details of a specific item (slide) by its external ID and the run ID. + This endpoint allows the caller to explicitly delete artifacts generated by a run. It can only be invoked when the run has reached a final state, i.e. `PROCESSED`, `CANCELED_SYSTEM`, or `CANCELED_USER`. Note that by default, all artifacts are automatically deleted 30 days after the run finishes, regardless of whether the caller explicitly requests such deletion. - :param run_id: The run id, returned by `POST /runs/` endpoint (required) + :param run_id: Run id, returned by `POST /runs/` endpoint (required) :type run_id: str - :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) - :type external_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1649,9 +1645,8 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get_without_preload_content :return: Returns the result object. """ # noqa: E501 - _param = self._get_item_by_run_v1_runs_run_id_items_external_id_get_serialize( + _param = self._delete_run_items_v1_runs_run_id_artifacts_delete_serialize( run_id=run_id, - external_id=external_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1659,9 +1654,8 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get_without_preload_content ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ItemResultReadResponse", + '200': "object", '404': None, - '403': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1671,10 +1665,9 @@ def get_item_by_run_v1_runs_run_id_items_external_id_get_without_preload_content return response_data.response - def _get_item_by_run_v1_runs_run_id_items_external_id_get_serialize( + def _delete_run_items_v1_runs_run_id_artifacts_delete_serialize( self, run_id, - external_id, _request_auth, _content_type, _headers, @@ -1698,8 +1691,6 @@ def _get_item_by_run_v1_runs_run_id_items_external_id_get_serialize( # process the path parameters if run_id is not None: _path_params['run_id'] = run_id - if external_id is not None: - _path_params['external_id'] = external_id # process the query parameters # process the header parameters # process the form parameters @@ -1721,8 +1712,8 @@ def _get_item_by_run_v1_runs_run_id_items_external_id_get_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/runs/{run_id}/items/{external_id}', + method='DELETE', + resource_path='/api/v1/runs/{run_id}/artifacts', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1739,8 +1730,11 @@ def _get_item_by_run_v1_runs_run_id_items_external_id_get_serialize( @validate_call - def get_me_v1_me_get( + def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get( self, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], + artifact_id: Annotated[StrictStr, Field(description="The artifact id to download")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1753,11 +1747,17 @@ def get_me_v1_me_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> MeReadResponse: - """Get current user + ) -> object: + """Get Artifact Url - Retrieves your identity details, including name, email, and organization. This is useful for verifying that the request is being made under the correct user profile and organization context, as well as confirming that the expected environment variables are correctly set (in case you are using Python SDK) + Download the artifact file with the specified artifact_id, belonging to the specified run. The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response. + :param run_id: Run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param artifact_id: The artifact id to download (required) + :type artifact_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1780,7 +1780,10 @@ def get_me_v1_me_get( :return: Returns the result object. """ # noqa: E501 - _param = self._get_me_v1_me_get_serialize( + _param = self._get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( + run_id=run_id, + artifact_id=artifact_id, + share_token=share_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1788,7 +1791,12 @@ def get_me_v1_me_get( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "MeReadResponse", + '200': "object", + '404': None, + '307': None, + '403': None, + '410': None, + '422': "HTTPValidationError", } response_data = self.api_client.call_api( *_param, @@ -1802,8 +1810,11 @@ def get_me_v1_me_get( @validate_call - def get_me_v1_me_get_with_http_info( + def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_with_http_info( self, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], + artifact_id: Annotated[StrictStr, Field(description="The artifact id to download")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1816,11 +1827,17 @@ def get_me_v1_me_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[MeReadResponse]: - """Get current user + ) -> ApiResponse[object]: + """Get Artifact Url - Retrieves your identity details, including name, email, and organization. This is useful for verifying that the request is being made under the correct user profile and organization context, as well as confirming that the expected environment variables are correctly set (in case you are using Python SDK) + Download the artifact file with the specified artifact_id, belonging to the specified run. The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response. + :param run_id: Run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param artifact_id: The artifact id to download (required) + :type artifact_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1843,7 +1860,10 @@ def get_me_v1_me_get_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_me_v1_me_get_serialize( + _param = self._get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( + run_id=run_id, + artifact_id=artifact_id, + share_token=share_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1851,7 +1871,12 @@ def get_me_v1_me_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "MeReadResponse", + '200': "object", + '404': None, + '307': None, + '403': None, + '410': None, + '422': "HTTPValidationError", } response_data = self.api_client.call_api( *_param, @@ -1865,8 +1890,11 @@ def get_me_v1_me_get_with_http_info( @validate_call - def get_me_v1_me_get_without_preload_content( + def get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_without_preload_content( self, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], + artifact_id: Annotated[StrictStr, Field(description="The artifact id to download")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1880,10 +1908,16 @@ def get_me_v1_me_get_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get current user + """Get Artifact Url - Retrieves your identity details, including name, email, and organization. This is useful for verifying that the request is being made under the correct user profile and organization context, as well as confirming that the expected environment variables are correctly set (in case you are using Python SDK) + Download the artifact file with the specified artifact_id, belonging to the specified run. The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response. + :param run_id: Run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param artifact_id: The artifact id to download (required) + :type artifact_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1906,7 +1940,10 @@ def get_me_v1_me_get_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_me_v1_me_get_serialize( + _param = self._get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( + run_id=run_id, + artifact_id=artifact_id, + share_token=share_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1914,7 +1951,12 @@ def get_me_v1_me_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "MeReadResponse", + '200': "object", + '404': None, + '307': None, + '403': None, + '410': None, + '422': "HTTPValidationError", } response_data = self.api_client.call_api( *_param, @@ -1923,8 +1965,11 @@ def get_me_v1_me_get_without_preload_content( return response_data.response - def _get_me_v1_me_get_serialize( + def _get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get_serialize( self, + run_id, + artifact_id, + share_token, _request_auth, _content_type, _headers, @@ -1946,7 +1991,15 @@ def _get_me_v1_me_get_serialize( _body_params: Optional[bytes] = None # process the path parameters + if run_id is not None: + _path_params['run_id'] = run_id + if artifact_id is not None: + _path_params['artifact_id'] = artifact_id # process the query parameters + if share_token is not None: + + _query_params.append(('share_token', share_token)) + # process the header parameters # process the form parameters # process the body parameter @@ -1968,7 +2021,7 @@ def _get_me_v1_me_get_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/me', + resource_path='/api/v1/runs/{run_id}/artifacts/{artifact_id}/file', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1985,9 +2038,9 @@ def _get_me_v1_me_get_serialize( @validate_call - def get_run_v1_runs_run_id_get( + def get_grant_v1_access_grants_grant_id_get( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], + grant_id: Annotated[StrictStr, Field(description="Grant ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2000,13 +2053,13 @@ def get_run_v1_runs_run_id_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RunReadResponse: - """Get run details + ) -> GrantReadResponse: + """Get Grant - This endpoint allows the caller to retrieve the current status of a run along with other relevant run details. A run becomes available immediately after it is created through the `POST /v1/runs/` endpoint. To download the output results, use `GET /v1/runs/{run_id}/` items to get outputs for all slides. Access to a run is restricted to the user who created it. + Get a grant by its ID. - :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) - :type run_id: str + :param grant_id: Grant ID (required) + :type grant_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2029,8 +2082,8 @@ def get_run_v1_runs_run_id_get( :return: Returns the result object. """ # noqa: E501 - _param = self._get_run_v1_runs_run_id_get_serialize( - run_id=run_id, + _param = self._get_grant_v1_access_grants_grant_id_get_serialize( + grant_id=grant_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2038,9 +2091,9 @@ def get_run_v1_runs_run_id_get( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RunReadResponse", - '404': None, + '200': "GrantReadResponse", '403': None, + '404': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2055,9 +2108,9 @@ def get_run_v1_runs_run_id_get( @validate_call - def get_run_v1_runs_run_id_get_with_http_info( + def get_grant_v1_access_grants_grant_id_get_with_http_info( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], + grant_id: Annotated[StrictStr, Field(description="Grant ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2070,13 +2123,13 @@ def get_run_v1_runs_run_id_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RunReadResponse]: - """Get run details + ) -> ApiResponse[GrantReadResponse]: + """Get Grant - This endpoint allows the caller to retrieve the current status of a run along with other relevant run details. A run becomes available immediately after it is created through the `POST /v1/runs/` endpoint. To download the output results, use `GET /v1/runs/{run_id}/` items to get outputs for all slides. Access to a run is restricted to the user who created it. + Get a grant by its ID. - :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) - :type run_id: str + :param grant_id: Grant ID (required) + :type grant_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2099,8 +2152,8 @@ def get_run_v1_runs_run_id_get_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_run_v1_runs_run_id_get_serialize( - run_id=run_id, + _param = self._get_grant_v1_access_grants_grant_id_get_serialize( + grant_id=grant_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2108,9 +2161,9 @@ def get_run_v1_runs_run_id_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RunReadResponse", - '404': None, + '200': "GrantReadResponse", '403': None, + '404': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2125,9 +2178,9 @@ def get_run_v1_runs_run_id_get_with_http_info( @validate_call - def get_run_v1_runs_run_id_get_without_preload_content( + def get_grant_v1_access_grants_grant_id_get_without_preload_content( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], + grant_id: Annotated[StrictStr, Field(description="Grant ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2141,12 +2194,12 @@ def get_run_v1_runs_run_id_get_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get run details + """Get Grant - This endpoint allows the caller to retrieve the current status of a run along with other relevant run details. A run becomes available immediately after it is created through the `POST /v1/runs/` endpoint. To download the output results, use `GET /v1/runs/{run_id}/` items to get outputs for all slides. Access to a run is restricted to the user who created it. + Get a grant by its ID. - :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) - :type run_id: str + :param grant_id: Grant ID (required) + :type grant_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2169,8 +2222,8 @@ def get_run_v1_runs_run_id_get_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_run_v1_runs_run_id_get_serialize( - run_id=run_id, + _param = self._get_grant_v1_access_grants_grant_id_get_serialize( + grant_id=grant_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2178,9 +2231,9 @@ def get_run_v1_runs_run_id_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RunReadResponse", - '404': None, + '200': "GrantReadResponse", '403': None, + '404': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2190,9 +2243,9 @@ def get_run_v1_runs_run_id_get_without_preload_content( return response_data.response - def _get_run_v1_runs_run_id_get_serialize( + def _get_grant_v1_access_grants_grant_id_get_serialize( self, - run_id, + grant_id, _request_auth, _content_type, _headers, @@ -2214,8 +2267,8 @@ def _get_run_v1_runs_run_id_get_serialize( _body_params: Optional[bytes] = None # process the path parameters - if run_id is not None: - _path_params['run_id'] = run_id + if grant_id is not None: + _path_params['grant_id'] = grant_id # process the query parameters # process the header parameters # process the form parameters @@ -2238,7 +2291,7 @@ def _get_run_v1_runs_run_id_get_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/runs/{run_id}', + resource_path='/api/v1/access/grants/{grant_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2255,11 +2308,11 @@ def _get_run_v1_runs_run_id_get_serialize( @validate_call - def get_version_document( + def get_item_by_run_v1_runs_run_id_items_external_id_get( self, - application_id: StrictStr, - version: StrictStr, - name: StrictStr, + run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], + external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2272,17 +2325,17 @@ def get_version_document( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VersionDocumentResponse: - """Get version document metadata + ) -> ItemResultReadResponse: + """Get Item By Run - Return metadata for a single public document attached to an application version. + Retrieve details of a specific item (slide) by its external ID and the run ID. - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str - :param name: (required) - :type name: str + :param run_id: The run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) + :type external_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2305,10 +2358,10 @@ def get_version_document( :return: Returns the result object. """ # noqa: E501 - _param = self._get_version_document_serialize( - application_id=application_id, - version=version, - name=name, + _param = self._get_item_by_run_v1_runs_run_id_items_external_id_get_serialize( + run_id=run_id, + external_id=external_id, + share_token=share_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2316,8 +2369,9 @@ def get_version_document( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "VersionDocumentResponse", + '200': "ItemResultReadResponse", '404': None, + '403': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2332,11 +2386,11 @@ def get_version_document( @validate_call - def get_version_document_with_http_info( + def get_item_by_run_v1_runs_run_id_items_external_id_get_with_http_info( self, - application_id: StrictStr, - version: StrictStr, - name: StrictStr, + run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], + external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2349,17 +2403,17 @@ def get_version_document_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VersionDocumentResponse]: - """Get version document metadata + ) -> ApiResponse[ItemResultReadResponse]: + """Get Item By Run - Return metadata for a single public document attached to an application version. + Retrieve details of a specific item (slide) by its external ID and the run ID. - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str - :param name: (required) - :type name: str + :param run_id: The run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) + :type external_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2382,10 +2436,10 @@ def get_version_document_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_version_document_serialize( - application_id=application_id, - version=version, - name=name, + _param = self._get_item_by_run_v1_runs_run_id_items_external_id_get_serialize( + run_id=run_id, + external_id=external_id, + share_token=share_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2393,8 +2447,9 @@ def get_version_document_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "VersionDocumentResponse", + '200': "ItemResultReadResponse", '404': None, + '403': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2409,11 +2464,11 @@ def get_version_document_with_http_info( @validate_call - def get_version_document_without_preload_content( + def get_item_by_run_v1_runs_run_id_items_external_id_get_without_preload_content( self, - application_id: StrictStr, - version: StrictStr, - name: StrictStr, + run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], + external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2427,16 +2482,16 @@ def get_version_document_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get version document metadata + """Get Item By Run - Return metadata for a single public document attached to an application version. + Retrieve details of a specific item (slide) by its external ID and the run ID. - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str - :param name: (required) - :type name: str + :param run_id: The run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) + :type external_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2459,10 +2514,10 @@ def get_version_document_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_version_document_serialize( - application_id=application_id, - version=version, - name=name, + _param = self._get_item_by_run_v1_runs_run_id_items_external_id_get_serialize( + run_id=run_id, + external_id=external_id, + share_token=share_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2470,8 +2525,9 @@ def get_version_document_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "VersionDocumentResponse", + '200': "ItemResultReadResponse", '404': None, + '403': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2481,11 +2537,11 @@ def get_version_document_without_preload_content( return response_data.response - def _get_version_document_serialize( + def _get_item_by_run_v1_runs_run_id_items_external_id_get_serialize( self, - application_id, - version, - name, + run_id, + external_id, + share_token, _request_auth, _content_type, _headers, @@ -2507,13 +2563,15 @@ def _get_version_document_serialize( _body_params: Optional[bytes] = None # process the path parameters - if application_id is not None: - _path_params['application_id'] = application_id - if version is not None: - _path_params['version'] = version - if name is not None: - _path_params['name'] = name + if run_id is not None: + _path_params['run_id'] = run_id + if external_id is not None: + _path_params['external_id'] = external_id # process the query parameters + if share_token is not None: + + _query_params.append(('share_token', share_token)) + # process the header parameters # process the form parameters # process the body parameter @@ -2535,7 +2593,7 @@ def _get_version_document_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/applications/{application_id}/versions/{version}/documents/{name}', + resource_path='/api/v1/runs/{run_id}/items/{external_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2552,11 +2610,8 @@ def _get_version_document_serialize( @validate_call - def get_version_document_content( + def get_me_v1_me_get( self, - application_id: StrictStr, - version: StrictStr, - name: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2569,17 +2624,11 @@ def get_version_document_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Stream version document content (programmatic) + ) -> MeReadResponse: + """Get current user - 307 redirect to a short-lived GCS signed URL for streaming document content. Unlike ``/file``, no ``Content-Disposition`` override is set — GCS serves the object body with its stored ``Content-Type``. Intended for programmatic clients that follow redirects and consume the content directly. Response carries ``Cache-Control: no-store``. + Retrieves your identity details, including name, email, and organization. This is useful for verifying that the request is being made under the correct user profile and organization context, as well as confirming that the expected environment variables are correctly set (in case you are using Python SDK) - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str - :param name: (required) - :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2602,10 +2651,7 @@ def get_version_document_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_version_document_content_serialize( - application_id=application_id, - version=version, - name=name, + _param = self._get_me_v1_me_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2613,9 +2659,7 @@ def get_version_document_content( ) _response_types_map: Dict[str, Optional[str]] = { - '307': None, - '404': None, - '422': "HTTPValidationError", + '200': "MeReadResponse", } response_data = self.api_client.call_api( *_param, @@ -2629,11 +2673,8 @@ def get_version_document_content( @validate_call - def get_version_document_content_with_http_info( + def get_me_v1_me_get_with_http_info( self, - application_id: StrictStr, - version: StrictStr, - name: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2646,17 +2687,11 @@ def get_version_document_content_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Stream version document content (programmatic) + ) -> ApiResponse[MeReadResponse]: + """Get current user - 307 redirect to a short-lived GCS signed URL for streaming document content. Unlike ``/file``, no ``Content-Disposition`` override is set — GCS serves the object body with its stored ``Content-Type``. Intended for programmatic clients that follow redirects and consume the content directly. Response carries ``Cache-Control: no-store``. + Retrieves your identity details, including name, email, and organization. This is useful for verifying that the request is being made under the correct user profile and organization context, as well as confirming that the expected environment variables are correctly set (in case you are using Python SDK) - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str - :param name: (required) - :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2679,10 +2714,7 @@ def get_version_document_content_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_version_document_content_serialize( - application_id=application_id, - version=version, - name=name, + _param = self._get_me_v1_me_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2690,9 +2722,7 @@ def get_version_document_content_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '307': None, - '404': None, - '422': "HTTPValidationError", + '200': "MeReadResponse", } response_data = self.api_client.call_api( *_param, @@ -2706,11 +2736,8 @@ def get_version_document_content_with_http_info( @validate_call - def get_version_document_content_without_preload_content( + def get_me_v1_me_get_without_preload_content( self, - application_id: StrictStr, - version: StrictStr, - name: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2724,16 +2751,10 @@ def get_version_document_content_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Stream version document content (programmatic) + """Get current user - 307 redirect to a short-lived GCS signed URL for streaming document content. Unlike ``/file``, no ``Content-Disposition`` override is set — GCS serves the object body with its stored ``Content-Type``. Intended for programmatic clients that follow redirects and consume the content directly. Response carries ``Cache-Control: no-store``. + Retrieves your identity details, including name, email, and organization. This is useful for verifying that the request is being made under the correct user profile and organization context, as well as confirming that the expected environment variables are correctly set (in case you are using Python SDK) - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str - :param name: (required) - :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2756,10 +2777,7 @@ def get_version_document_content_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_version_document_content_serialize( - application_id=application_id, - version=version, - name=name, + _param = self._get_me_v1_me_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2767,9 +2785,7 @@ def get_version_document_content_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '307': None, - '404': None, - '422': "HTTPValidationError", + '200': "MeReadResponse", } response_data = self.api_client.call_api( *_param, @@ -2778,11 +2794,8 @@ def get_version_document_content_without_preload_content( return response_data.response - def _get_version_document_content_serialize( + def _get_me_v1_me_get_serialize( self, - application_id, - version, - name, _request_auth, _content_type, _headers, @@ -2804,12 +2817,6 @@ def _get_version_document_content_serialize( _body_params: Optional[bytes] = None # process the path parameters - if application_id is not None: - _path_params['application_id'] = application_id - if version is not None: - _path_params['version'] = version - if name is not None: - _path_params['name'] = name # process the query parameters # process the header parameters # process the form parameters @@ -2832,7 +2839,7 @@ def _get_version_document_content_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/applications/{application_id}/versions/{version}/documents/{name}/content', + resource_path='/api/v1/me', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2849,11 +2856,10 @@ def _get_version_document_content_serialize( @validate_call - def get_version_document_file( + def get_run_v1_runs_run_id_get( self, - application_id: StrictStr, - version: StrictStr, - name: StrictStr, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2866,17 +2872,15 @@ def get_version_document_file( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Download version document (browser) + ) -> RunReadResponse: + """Get run details - 307 redirect to a short-lived GCS signed URL for downloading a document. The signed URL includes ``response-content-disposition=attachment; filename=\"\"`` so browsers prompt a save-as dialog rather than rendering inline. Response carries ``Cache-Control: no-store``. + This endpoint allows the caller to retrieve the current status of a run along with other relevant run details. A run becomes available immediately after it is created through the `POST /v1/runs/` endpoint. To download the output results, use `GET /v1/runs/{run_id}/` items to get outputs for all slides. Access to a run is restricted to the user who created it, or users with an active grant or valid share token. - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str - :param name: (required) - :type name: str + :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) + :type run_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2899,10 +2903,9 @@ def get_version_document_file( :return: Returns the result object. """ # noqa: E501 - _param = self._get_version_document_file_serialize( - application_id=application_id, - version=version, - name=name, + _param = self._get_run_v1_runs_run_id_get_serialize( + run_id=run_id, + share_token=share_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2910,8 +2913,9 @@ def get_version_document_file( ) _response_types_map: Dict[str, Optional[str]] = { - '307': None, + '200': "RunReadResponse", '404': None, + '403': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2926,11 +2930,10 @@ def get_version_document_file( @validate_call - def get_version_document_file_with_http_info( + def get_run_v1_runs_run_id_get_with_http_info( self, - application_id: StrictStr, - version: StrictStr, - name: StrictStr, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2943,17 +2946,15 @@ def get_version_document_file_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Download version document (browser) + ) -> ApiResponse[RunReadResponse]: + """Get run details - 307 redirect to a short-lived GCS signed URL for downloading a document. The signed URL includes ``response-content-disposition=attachment; filename=\"\"`` so browsers prompt a save-as dialog rather than rendering inline. Response carries ``Cache-Control: no-store``. + This endpoint allows the caller to retrieve the current status of a run along with other relevant run details. A run becomes available immediately after it is created through the `POST /v1/runs/` endpoint. To download the output results, use `GET /v1/runs/{run_id}/` items to get outputs for all slides. Access to a run is restricted to the user who created it, or users with an active grant or valid share token. - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str - :param name: (required) - :type name: str + :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) + :type run_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2976,10 +2977,9 @@ def get_version_document_file_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_version_document_file_serialize( - application_id=application_id, - version=version, - name=name, + _param = self._get_run_v1_runs_run_id_get_serialize( + run_id=run_id, + share_token=share_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2987,8 +2987,9 @@ def get_version_document_file_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '307': None, + '200': "RunReadResponse", '404': None, + '403': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -3003,11 +3004,10 @@ def get_version_document_file_with_http_info( @validate_call - def get_version_document_file_without_preload_content( + def get_run_v1_runs_run_id_get_without_preload_content( self, - application_id: StrictStr, - version: StrictStr, - name: StrictStr, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3021,16 +3021,14 @@ def get_version_document_file_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Download version document (browser) + """Get run details - 307 redirect to a short-lived GCS signed URL for downloading a document. The signed URL includes ``response-content-disposition=attachment; filename=\"\"`` so browsers prompt a save-as dialog rather than rendering inline. Response carries ``Cache-Control: no-store``. + This endpoint allows the caller to retrieve the current status of a run along with other relevant run details. A run becomes available immediately after it is created through the `POST /v1/runs/` endpoint. To download the output results, use `GET /v1/runs/{run_id}/` items to get outputs for all slides. Access to a run is restricted to the user who created it, or users with an active grant or valid share token. - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str - :param name: (required) - :type name: str + :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) + :type run_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3053,10 +3051,9 @@ def get_version_document_file_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_version_document_file_serialize( - application_id=application_id, - version=version, - name=name, + _param = self._get_run_v1_runs_run_id_get_serialize( + run_id=run_id, + share_token=share_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3064,8 +3061,9 @@ def get_version_document_file_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '307': None, + '200': "RunReadResponse", '404': None, + '403': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -3075,11 +3073,10 @@ def get_version_document_file_without_preload_content( return response_data.response - def _get_version_document_file_serialize( + def _get_run_v1_runs_run_id_get_serialize( self, - application_id, - version, - name, + run_id, + share_token, _request_auth, _content_type, _headers, @@ -3101,13 +3098,13 @@ def _get_version_document_file_serialize( _body_params: Optional[bytes] = None # process the path parameters - if application_id is not None: - _path_params['application_id'] = application_id - if version is not None: - _path_params['version'] = version - if name is not None: - _path_params['name'] = name + if run_id is not None: + _path_params['run_id'] = run_id # process the query parameters + if share_token is not None: + + _query_params.append(('share_token', share_token)) + # process the header parameters # process the form parameters # process the body parameter @@ -3129,7 +3126,7 @@ def _get_version_document_file_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/applications/{application_id}/versions/{version}/documents/{name}/file', + resource_path='/api/v1/runs/{run_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3146,11 +3143,9 @@ def _get_version_document_file_serialize( @validate_call - def list_applications_v1_applications_get( + def get_share_token_v1_access_share_tokens_share_token_id_get( self, - page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, - sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending")] = None, + share_token_id: Annotated[StrictStr, Field(description="Share token ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3163,17 +3158,13 @@ def list_applications_v1_applications_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[ApplicationReadShortResponse]: - """List available applications + ) -> ShareTokenReadResponse: + """Get Share Token - Returns the list of the applications, available to the caller. The application is available if any of the versions of the application is assigned to the caller's organization. The response is paginated and sorted according to the provided parameters. + Get a share token by its ID. - :param page: - :type page: int - :param page_size: - :type page_size: int - :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending - :type sort: List[str] + :param share_token_id: Share token ID (required) + :type share_token_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3196,10 +3187,8 @@ def list_applications_v1_applications_get( :return: Returns the result object. """ # noqa: E501 - _param = self._list_applications_v1_applications_get_serialize( - page=page, - page_size=page_size, - sort=sort, + _param = self._get_share_token_v1_access_share_tokens_share_token_id_get_serialize( + share_token_id=share_token_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3207,8 +3196,9 @@ def list_applications_v1_applications_get( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ApplicationReadShortResponse]", - '401': None, + '200': "ShareTokenReadResponse", + '403': None, + '404': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -3223,11 +3213,9 @@ def list_applications_v1_applications_get( @validate_call - def list_applications_v1_applications_get_with_http_info( + def get_share_token_v1_access_share_tokens_share_token_id_get_with_http_info( self, - page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, - sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending")] = None, + share_token_id: Annotated[StrictStr, Field(description="Share token ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3240,17 +3228,13 @@ def list_applications_v1_applications_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[ApplicationReadShortResponse]]: - """List available applications + ) -> ApiResponse[ShareTokenReadResponse]: + """Get Share Token - Returns the list of the applications, available to the caller. The application is available if any of the versions of the application is assigned to the caller's organization. The response is paginated and sorted according to the provided parameters. + Get a share token by its ID. - :param page: - :type page: int - :param page_size: - :type page_size: int - :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending - :type sort: List[str] + :param share_token_id: Share token ID (required) + :type share_token_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3273,10 +3257,8 @@ def list_applications_v1_applications_get_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_applications_v1_applications_get_serialize( - page=page, - page_size=page_size, - sort=sort, + _param = self._get_share_token_v1_access_share_tokens_share_token_id_get_serialize( + share_token_id=share_token_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3284,8 +3266,9 @@ def list_applications_v1_applications_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ApplicationReadShortResponse]", - '401': None, + '200': "ShareTokenReadResponse", + '403': None, + '404': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -3300,11 +3283,9 @@ def list_applications_v1_applications_get_with_http_info( @validate_call - def list_applications_v1_applications_get_without_preload_content( + def get_share_token_v1_access_share_tokens_share_token_id_get_without_preload_content( self, - page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, - sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending")] = None, + share_token_id: Annotated[StrictStr, Field(description="Share token ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3318,16 +3299,12 @@ def list_applications_v1_applications_get_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List available applications + """Get Share Token - Returns the list of the applications, available to the caller. The application is available if any of the versions of the application is assigned to the caller's organization. The response is paginated and sorted according to the provided parameters. + Get a share token by its ID. - :param page: - :type page: int - :param page_size: - :type page_size: int - :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending - :type sort: List[str] + :param share_token_id: Share token ID (required) + :type share_token_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3350,10 +3327,1191 @@ def list_applications_v1_applications_get_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_applications_v1_applications_get_serialize( - page=page, - page_size=page_size, - sort=sort, + _param = self._get_share_token_v1_access_share_tokens_share_token_id_get_serialize( + share_token_id=share_token_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShareTokenReadResponse", + '403': None, + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_share_token_v1_access_share_tokens_share_token_id_get_serialize( + self, + share_token_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if share_token_id is not None: + _path_params['share_token_id'] = share_token_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2AuthorizationCodeBearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/access/share-tokens/{share_token_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_version_document( + self, + application_id: StrictStr, + version: StrictStr, + name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VersionDocumentResponse: + """Get version document metadata + + Return metadata for a single public document attached to an application version. + + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str + :param name: (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_version_document_serialize( + application_id=application_id, + version=version, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VersionDocumentResponse", + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_version_document_with_http_info( + self, + application_id: StrictStr, + version: StrictStr, + name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VersionDocumentResponse]: + """Get version document metadata + + Return metadata for a single public document attached to an application version. + + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str + :param name: (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_version_document_serialize( + application_id=application_id, + version=version, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VersionDocumentResponse", + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_version_document_without_preload_content( + self, + application_id: StrictStr, + version: StrictStr, + name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get version document metadata + + Return metadata for a single public document attached to an application version. + + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str + :param name: (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_version_document_serialize( + application_id=application_id, + version=version, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VersionDocumentResponse", + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_version_document_serialize( + self, + application_id, + version, + name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if application_id is not None: + _path_params['application_id'] = application_id + if version is not None: + _path_params['version'] = version + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2AuthorizationCodeBearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/applications/{application_id}/versions/{version}/documents/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_version_document_content( + self, + application_id: StrictStr, + version: StrictStr, + name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Stream version document content (programmatic) + + 307 redirect to a short-lived GCS signed URL for streaming document content. Unlike ``/file``, no ``Content-Disposition`` override is set — GCS serves the object body with its stored ``Content-Type``. Intended for programmatic clients that follow redirects and consume the content directly. Response carries ``Cache-Control: no-store``. + + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str + :param name: (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_version_document_content_serialize( + application_id=application_id, + version=version, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '307': None, + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_version_document_content_with_http_info( + self, + application_id: StrictStr, + version: StrictStr, + name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Stream version document content (programmatic) + + 307 redirect to a short-lived GCS signed URL for streaming document content. Unlike ``/file``, no ``Content-Disposition`` override is set — GCS serves the object body with its stored ``Content-Type``. Intended for programmatic clients that follow redirects and consume the content directly. Response carries ``Cache-Control: no-store``. + + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str + :param name: (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_version_document_content_serialize( + application_id=application_id, + version=version, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '307': None, + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_version_document_content_without_preload_content( + self, + application_id: StrictStr, + version: StrictStr, + name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Stream version document content (programmatic) + + 307 redirect to a short-lived GCS signed URL for streaming document content. Unlike ``/file``, no ``Content-Disposition`` override is set — GCS serves the object body with its stored ``Content-Type``. Intended for programmatic clients that follow redirects and consume the content directly. Response carries ``Cache-Control: no-store``. + + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str + :param name: (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_version_document_content_serialize( + application_id=application_id, + version=version, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '307': None, + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_version_document_content_serialize( + self, + application_id, + version, + name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if application_id is not None: + _path_params['application_id'] = application_id + if version is not None: + _path_params['version'] = version + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2AuthorizationCodeBearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/applications/{application_id}/versions/{version}/documents/{name}/content', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_version_document_file( + self, + application_id: StrictStr, + version: StrictStr, + name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Download version document (browser) + + 307 redirect to a short-lived GCS signed URL for downloading a document. The signed URL includes ``response-content-disposition=attachment; filename=\"\"`` so browsers prompt a save-as dialog rather than rendering inline. Response carries ``Cache-Control: no-store``. + + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str + :param name: (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_version_document_file_serialize( + application_id=application_id, + version=version, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '307': None, + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_version_document_file_with_http_info( + self, + application_id: StrictStr, + version: StrictStr, + name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Download version document (browser) + + 307 redirect to a short-lived GCS signed URL for downloading a document. The signed URL includes ``response-content-disposition=attachment; filename=\"\"`` so browsers prompt a save-as dialog rather than rendering inline. Response carries ``Cache-Control: no-store``. + + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str + :param name: (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_version_document_file_serialize( + application_id=application_id, + version=version, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '307': None, + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_version_document_file_without_preload_content( + self, + application_id: StrictStr, + version: StrictStr, + name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download version document (browser) + + 307 redirect to a short-lived GCS signed URL for downloading a document. The signed URL includes ``response-content-disposition=attachment; filename=\"\"`` so browsers prompt a save-as dialog rather than rendering inline. Response carries ``Cache-Control: no-store``. + + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str + :param name: (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_version_document_file_serialize( + application_id=application_id, + version=version, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '307': None, + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_version_document_file_serialize( + self, + application_id, + version, + name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if application_id is not None: + _path_params['application_id'] = application_id + if version is not None: + _path_params['version'] = version + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2AuthorizationCodeBearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/applications/{application_id}/versions/{version}/documents/{name}/file', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_applications_v1_applications_get( + self, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ApplicationReadShortResponse]: + """List available applications + + Returns the list of the applications, available to the caller. The application is available if any of the versions of the application is assigned to the caller's organization. The response is paginated and sorted according to the provided parameters. + + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_applications_v1_applications_get_serialize( + page=page, + page_size=page_size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ApplicationReadShortResponse]", + '401': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_applications_v1_applications_get_with_http_info( + self, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ApplicationReadShortResponse]]: + """List available applications + + Returns the list of the applications, available to the caller. The application is available if any of the versions of the application is assigned to the caller's organization. The response is paginated and sorted according to the provided parameters. + + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_applications_v1_applications_get_serialize( + page=page, + page_size=page_size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ApplicationReadShortResponse]", + '401': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_applications_v1_applications_get_without_preload_content( + self, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List available applications + + Returns the list of the applications, available to the caller. The application is available if any of the versions of the application is assigned to the caller's organization. The response is paginated and sorted according to the provided parameters. + + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `application_id` - `name` - `description` - `regulatory_classes` **Examples:** - `?sort=application_id` - Sort by application_id ascending - `?sort=-name` - Sort by name descending - `?sort=+description&sort=name` - Sort by description ascending, then name descending + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_applications_v1_applications_get_serialize( + page=page, + page_size=page_size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3372,8 +4530,1546 @@ def list_applications_v1_applications_get_without_preload_content( return response_data.response - def _list_applications_v1_applications_get_serialize( + def _list_applications_v1_applications_get_serialize( + self, + page, + page_size, + sort, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'sort': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page-size', page_size)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2AuthorizationCodeBearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/applications', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_grants_v1_access_grants_get( + self, + resource_type: Optional[ResourceType] = None, + resource_id: Optional[StrictStr] = None, + subject_type: Optional[SubjectType] = None, + subject_id: Optional[StrictStr] = None, + revoked: Optional[StrictBool] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GrantReadResponse]: + """List Grants + + List grants. Org admins see all grants for all resources in their organization. Regular users see grants for all resources they submitted. + + :param resource_type: + :type resource_type: ResourceType + :param resource_id: + :type resource_id: str + :param subject_type: + :type subject_type: SubjectType + :param subject_id: + :type subject_id: str + :param revoked: + :type revoked: bool + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_grants_v1_access_grants_get_serialize( + resource_type=resource_type, + resource_id=resource_id, + subject_type=subject_type, + subject_id=subject_id, + revoked=revoked, + page=page, + page_size=page_size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GrantReadResponse]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_grants_v1_access_grants_get_with_http_info( + self, + resource_type: Optional[ResourceType] = None, + resource_id: Optional[StrictStr] = None, + subject_type: Optional[SubjectType] = None, + subject_id: Optional[StrictStr] = None, + revoked: Optional[StrictBool] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GrantReadResponse]]: + """List Grants + + List grants. Org admins see all grants for all resources in their organization. Regular users see grants for all resources they submitted. + + :param resource_type: + :type resource_type: ResourceType + :param resource_id: + :type resource_id: str + :param subject_type: + :type subject_type: SubjectType + :param subject_id: + :type subject_id: str + :param revoked: + :type revoked: bool + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_grants_v1_access_grants_get_serialize( + resource_type=resource_type, + resource_id=resource_id, + subject_type=subject_type, + subject_id=subject_id, + revoked=revoked, + page=page, + page_size=page_size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GrantReadResponse]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_grants_v1_access_grants_get_without_preload_content( + self, + resource_type: Optional[ResourceType] = None, + resource_id: Optional[StrictStr] = None, + subject_type: Optional[SubjectType] = None, + subject_id: Optional[StrictStr] = None, + revoked: Optional[StrictBool] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Grants + + List grants. Org admins see all grants for all resources in their organization. Regular users see grants for all resources they submitted. + + :param resource_type: + :type resource_type: ResourceType + :param resource_id: + :type resource_id: str + :param subject_type: + :type subject_type: SubjectType + :param subject_id: + :type subject_id: str + :param revoked: + :type revoked: bool + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_grants_v1_access_grants_get_serialize( + resource_type=resource_type, + resource_id=resource_id, + subject_type=subject_type, + subject_id=subject_id, + revoked=revoked, + page=page, + page_size=page_size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GrantReadResponse]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_grants_v1_access_grants_get_serialize( + self, + resource_type, + resource_id, + subject_type, + subject_id, + revoked, + page, + page_size, + sort, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'sort': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if resource_type is not None: + + _query_params.append(('resource_type', resource_type.value)) + + if resource_id is not None: + + _query_params.append(('resource_id', resource_id)) + + if subject_type is not None: + + _query_params.append(('subject_type', subject_type.value)) + + if subject_id is not None: + + _query_params.append(('subject_id', subject_id)) + + if revoked is not None: + + _query_params.append(('revoked', revoked)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2AuthorizationCodeBearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/access/grants', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_run_items_v1_runs_run_id_items_get( + self, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, + item_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for item ids")] = None, + external_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for items by their external_id from the input payload")] = None, + state: Annotated[Optional[ItemState], Field(description="Filter items by their state")] = None, + termination_reason: Annotated[Optional[ItemTerminationReason], Field(description="Filter items by their termination reason. Only applies to TERMINATED items.")] = None, + custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="JSONPath expression to filter items by their custom_metadata")] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ItemResultReadResponse]: + """List Run Items + + List items in a run with filtering, sorting, and pagination capabilities. Returns paginated items within a specific run. Results can be filtered by `item_id`, `external_ids`, `custom_metadata`, `terminated_at`, and `termination_reason` using JSONPath expressions. ## JSONPath Metadata Filtering Use PostgreSQL JSONPath expressions to filter items using their custom_metadata. ### Examples: - **Field existence**: `$.case_id` - Results that have a case_id field defined - **Exact value match**: `$.priority ? (@ == \"high\")` - Results with high priority - **Numeric comparison**: `$.confidence_score ? (@ > 0.95)` - Results with high confidence - **Array operations**: `$.flags[*] ? (@ == \"reviewed\")` - Results flagged as reviewed - **Complex conditions**: `$.metrics ? (@.accuracy > 0.9 && @.recall > 0.8)` - Results meeting performance thresholds ## Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations + + :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) + :type run_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str + :param item_id__in: Filter for item ids + :type item_id__in: List[str] + :param external_id__in: Filter for items by their external_id from the input payload + :type external_id__in: List[str] + :param state: Filter items by their state + :type state: ItemState + :param termination_reason: Filter items by their termination reason. Only applies to TERMINATED items. + :type termination_reason: ItemTerminationReason + :param custom_metadata: JSONPath expression to filter items by their custom_metadata + :type custom_metadata: str + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending) + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_run_items_v1_runs_run_id_items_get_serialize( + run_id=run_id, + share_token=share_token, + item_id__in=item_id__in, + external_id__in=external_id__in, + state=state, + termination_reason=termination_reason, + custom_metadata=custom_metadata, + page=page, + page_size=page_size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ItemResultReadResponse]", + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_run_items_v1_runs_run_id_items_get_with_http_info( + self, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, + item_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for item ids")] = None, + external_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for items by their external_id from the input payload")] = None, + state: Annotated[Optional[ItemState], Field(description="Filter items by their state")] = None, + termination_reason: Annotated[Optional[ItemTerminationReason], Field(description="Filter items by their termination reason. Only applies to TERMINATED items.")] = None, + custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="JSONPath expression to filter items by their custom_metadata")] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ItemResultReadResponse]]: + """List Run Items + + List items in a run with filtering, sorting, and pagination capabilities. Returns paginated items within a specific run. Results can be filtered by `item_id`, `external_ids`, `custom_metadata`, `terminated_at`, and `termination_reason` using JSONPath expressions. ## JSONPath Metadata Filtering Use PostgreSQL JSONPath expressions to filter items using their custom_metadata. ### Examples: - **Field existence**: `$.case_id` - Results that have a case_id field defined - **Exact value match**: `$.priority ? (@ == \"high\")` - Results with high priority - **Numeric comparison**: `$.confidence_score ? (@ > 0.95)` - Results with high confidence - **Array operations**: `$.flags[*] ? (@ == \"reviewed\")` - Results flagged as reviewed - **Complex conditions**: `$.metrics ? (@.accuracy > 0.9 && @.recall > 0.8)` - Results meeting performance thresholds ## Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations + + :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) + :type run_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str + :param item_id__in: Filter for item ids + :type item_id__in: List[str] + :param external_id__in: Filter for items by their external_id from the input payload + :type external_id__in: List[str] + :param state: Filter items by their state + :type state: ItemState + :param termination_reason: Filter items by their termination reason. Only applies to TERMINATED items. + :type termination_reason: ItemTerminationReason + :param custom_metadata: JSONPath expression to filter items by their custom_metadata + :type custom_metadata: str + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending) + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_run_items_v1_runs_run_id_items_get_serialize( + run_id=run_id, + share_token=share_token, + item_id__in=item_id__in, + external_id__in=external_id__in, + state=state, + termination_reason=termination_reason, + custom_metadata=custom_metadata, + page=page, + page_size=page_size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ItemResultReadResponse]", + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_run_items_v1_runs_run_id_items_get_without_preload_content( + self, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], + share_token: Annotated[Optional[StrictStr], Field(description="Share token for accessing shared runs")] = None, + item_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for item ids")] = None, + external_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for items by their external_id from the input payload")] = None, + state: Annotated[Optional[ItemState], Field(description="Filter items by their state")] = None, + termination_reason: Annotated[Optional[ItemTerminationReason], Field(description="Filter items by their termination reason. Only applies to TERMINATED items.")] = None, + custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="JSONPath expression to filter items by their custom_metadata")] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Run Items + + List items in a run with filtering, sorting, and pagination capabilities. Returns paginated items within a specific run. Results can be filtered by `item_id`, `external_ids`, `custom_metadata`, `terminated_at`, and `termination_reason` using JSONPath expressions. ## JSONPath Metadata Filtering Use PostgreSQL JSONPath expressions to filter items using their custom_metadata. ### Examples: - **Field existence**: `$.case_id` - Results that have a case_id field defined - **Exact value match**: `$.priority ? (@ == \"high\")` - Results with high priority - **Numeric comparison**: `$.confidence_score ? (@ > 0.95)` - Results with high confidence - **Array operations**: `$.flags[*] ? (@ == \"reviewed\")` - Results flagged as reviewed - **Complex conditions**: `$.metrics ? (@.accuracy > 0.9 && @.recall > 0.8)` - Results meeting performance thresholds ## Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations + + :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) + :type run_id: str + :param share_token: Share token for accessing shared runs + :type share_token: str + :param item_id__in: Filter for item ids + :type item_id__in: List[str] + :param external_id__in: Filter for items by their external_id from the input payload + :type external_id__in: List[str] + :param state: Filter items by their state + :type state: ItemState + :param termination_reason: Filter items by their termination reason. Only applies to TERMINATED items. + :type termination_reason: ItemTerminationReason + :param custom_metadata: JSONPath expression to filter items by their custom_metadata + :type custom_metadata: str + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending) + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_run_items_v1_runs_run_id_items_get_serialize( + run_id=run_id, + share_token=share_token, + item_id__in=item_id__in, + external_id__in=external_id__in, + state=state, + termination_reason=termination_reason, + custom_metadata=custom_metadata, + page=page, + page_size=page_size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ItemResultReadResponse]", + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_run_items_v1_runs_run_id_items_get_serialize( + self, + run_id, + share_token, + item_id__in, + external_id__in, + state, + termination_reason, + custom_metadata, + page, + page_size, + sort, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'item_id__in': 'multi', + 'external_id__in': 'multi', + 'sort': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if run_id is not None: + _path_params['run_id'] = run_id + # process the query parameters + if share_token is not None: + + _query_params.append(('share_token', share_token)) + + if item_id__in is not None: + + _query_params.append(('item_id__in', item_id__in)) + + if external_id__in is not None: + + _query_params.append(('external_id__in', external_id__in)) + + if state is not None: + + _query_params.append(('state', state.value)) + + if termination_reason is not None: + + _query_params.append(('termination_reason', termination_reason.value)) + + if custom_metadata is not None: + + _query_params.append(('custom_metadata', custom_metadata)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2AuthorizationCodeBearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/runs/{run_id}/items', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_runs_v1_runs_get( + self, + application_id: Annotated[Optional[StrictStr], Field(description="Optional application ID filter")] = None, + application_version: Annotated[Optional[StrictStr], Field(description="Optional Version Name")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="Optionally filter runs by items with this external ID")] = None, + custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** ")] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + for_organization: Annotated[Optional[StrictStr], Field(description="Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs.")] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[RunReadResponse]: + """List Runs + + List runs with filtering, sorting, and pagination capabilities. Returns paginated runs that were submitted by the user. + + :param application_id: Optional application ID filter + :type application_id: str + :param application_version: Optional Version Name + :type application_version: str + :param external_id: Optionally filter runs by items with this external ID + :type external_id: str + :param custom_metadata: Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** + :type custom_metadata: str + :param page: + :type page: int + :param page_size: + :type page_size: int + :param for_organization: Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs. + :type for_organization: str + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_runs_v1_runs_get_serialize( + application_id=application_id, + application_version=application_version, + external_id=external_id, + custom_metadata=custom_metadata, + page=page, + page_size=page_size, + for_organization=for_organization, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[RunReadResponse]", + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_runs_v1_runs_get_with_http_info( + self, + application_id: Annotated[Optional[StrictStr], Field(description="Optional application ID filter")] = None, + application_version: Annotated[Optional[StrictStr], Field(description="Optional Version Name")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="Optionally filter runs by items with this external ID")] = None, + custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** ")] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + for_organization: Annotated[Optional[StrictStr], Field(description="Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs.")] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[RunReadResponse]]: + """List Runs + + List runs with filtering, sorting, and pagination capabilities. Returns paginated runs that were submitted by the user. + + :param application_id: Optional application ID filter + :type application_id: str + :param application_version: Optional Version Name + :type application_version: str + :param external_id: Optionally filter runs by items with this external ID + :type external_id: str + :param custom_metadata: Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** + :type custom_metadata: str + :param page: + :type page: int + :param page_size: + :type page_size: int + :param for_organization: Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs. + :type for_organization: str + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_runs_v1_runs_get_serialize( + application_id=application_id, + application_version=application_version, + external_id=external_id, + custom_metadata=custom_metadata, + page=page, + page_size=page_size, + for_organization=for_organization, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[RunReadResponse]", + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_runs_v1_runs_get_without_preload_content( + self, + application_id: Annotated[Optional[StrictStr], Field(description="Optional application ID filter")] = None, + application_version: Annotated[Optional[StrictStr], Field(description="Optional Version Name")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="Optionally filter runs by items with this external ID")] = None, + custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** ")] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + for_organization: Annotated[Optional[StrictStr], Field(description="Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs.")] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Runs + + List runs with filtering, sorting, and pagination capabilities. Returns paginated runs that were submitted by the user. + + :param application_id: Optional application ID filter + :type application_id: str + :param application_version: Optional Version Name + :type application_version: str + :param external_id: Optionally filter runs by items with this external ID + :type external_id: str + :param custom_metadata: Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** + :type custom_metadata: str + :param page: + :type page: int + :param page_size: + :type page_size: int + :param for_organization: Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs. + :type for_organization: str + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_runs_v1_runs_get_serialize( + application_id=application_id, + application_version=application_version, + external_id=external_id, + custom_metadata=custom_metadata, + page=page, + page_size=page_size, + for_organization=for_organization, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[RunReadResponse]", + '404': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_runs_v1_runs_get_serialize( + self, + application_id, + application_version, + external_id, + custom_metadata, + page, + page_size, + for_organization, + sort, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'sort': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if application_id is not None: + + _query_params.append(('application_id', application_id)) + + if application_version is not None: + + _query_params.append(('application_version', application_version)) + + if external_id is not None: + + _query_params.append(('external_id', external_id)) + + if custom_metadata is not None: + + _query_params.append(('custom_metadata', custom_metadata)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if for_organization is not None: + + _query_params.append(('for_organization', for_organization)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2AuthorizationCodeBearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/runs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_share_tokens_v1_access_share_tokens_get( + self, + run_id: Annotated[Optional[StrictStr], Field(description="Filter by run ID")] = None, + created_by: Annotated[Optional[StrictStr], Field(description="Filter by share token creator")] = None, + revoked: Optional[StrictBool] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ShareTokenReadResponse]: + """List Share Tokens + + List share tokens. Service and Superadmin see all tokens; other users see only their own. + + :param run_id: Filter by run ID + :type run_id: str + :param created_by: Filter by share token creator + :type created_by: str + :param revoked: + :type revoked: bool + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_share_tokens_v1_access_share_tokens_get_serialize( + run_id=run_id, + created_by=created_by, + revoked=revoked, + page=page, + page_size=page_size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShareTokenReadResponse]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_share_tokens_v1_access_share_tokens_get_with_http_info( + self, + run_id: Annotated[Optional[StrictStr], Field(description="Filter by run ID")] = None, + created_by: Annotated[Optional[StrictStr], Field(description="Filter by share token creator")] = None, + revoked: Optional[StrictBool] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ShareTokenReadResponse]]: + """List Share Tokens + + List share tokens. Service and Superadmin see all tokens; other users see only their own. + + :param run_id: Filter by run ID + :type run_id: str + :param created_by: Filter by share token creator + :type created_by: str + :param revoked: + :type revoked: bool + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_share_tokens_v1_access_share_tokens_get_serialize( + run_id=run_id, + created_by=created_by, + revoked=revoked, + page=page, + page_size=page_size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShareTokenReadResponse]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_share_tokens_v1_access_share_tokens_get_without_preload_content( + self, + run_id: Annotated[Optional[StrictStr], Field(description="Filter by run ID")] = None, + created_by: Annotated[Optional[StrictStr], Field(description="Filter by share token creator")] = None, + revoked: Optional[StrictBool] = None, + page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, + sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Share Tokens + + List share tokens. Service and Superadmin see all tokens; other users see only their own. + + :param run_id: Filter by run ID + :type run_id: str + :param created_by: Filter by share token creator + :type created_by: str + :param revoked: + :type revoked: bool + :param page: + :type page: int + :param page_size: + :type page_size: int + :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_share_tokens_v1_access_share_tokens_get_serialize( + run_id=run_id, + created_by=created_by, + revoked=revoked, + page=page, + page_size=page_size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShareTokenReadResponse]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_share_tokens_v1_access_share_tokens_get_serialize( self, + run_id, + created_by, + revoked, page, page_size, sort, @@ -3400,13 +6096,25 @@ def _list_applications_v1_applications_get_serialize( # process the path parameters # process the query parameters + if run_id is not None: + + _query_params.append(('run_id', run_id)) + + if created_by is not None: + + _query_params.append(('created_by', created_by)) + + if revoked is not None: + + _query_params.append(('revoked', revoked)) + if page is not None: _query_params.append(('page', page)) if page_size is not None: - _query_params.append(('page-size', page_size)) + _query_params.append(('page_size', page_size)) if sort is not None: @@ -3433,7 +6141,7 @@ def _list_applications_v1_applications_get_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/applications', + resource_path='/api/v1/access/share-tokens', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3450,17 +6158,10 @@ def _list_applications_v1_applications_get_serialize( @validate_call - def list_run_items_v1_runs_run_id_items_get( + def list_version_documents( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], - item_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for item ids")] = None, - external_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for items by their external_id from the input payload")] = None, - state: Annotated[Optional[ItemState], Field(description="Filter items by their state")] = None, - termination_reason: Annotated[Optional[ItemTerminationReason], Field(description="Filter items by their termination reason. Only applies to TERMINATED items.")] = None, - custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="JSONPath expression to filter items by their custom_metadata")] = None, - page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, - sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending)")] = None, + application_id: StrictStr, + version: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3472,30 +6173,16 @@ def list_run_items_v1_runs_run_id_items_get( _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[ItemResultReadResponse]: - """List Run Items - - List items in a run with filtering, sorting, and pagination capabilities. Returns paginated items within a specific run. Results can be filtered by `item_id`, `external_ids`, `custom_metadata`, `terminated_at`, and `termination_reason` using JSONPath expressions. ## JSONPath Metadata Filtering Use PostgreSQL JSONPath expressions to filter items using their custom_metadata. ### Examples: - **Field existence**: `$.case_id` - Results that have a case_id field defined - **Exact value match**: `$.priority ? (@ == \"high\")` - Results with high priority - **Numeric comparison**: `$.confidence_score ? (@ > 0.95)` - Results with high confidence - **Array operations**: `$.flags[*] ? (@ == \"reviewed\")` - Results flagged as reviewed - **Complex conditions**: `$.metrics ? (@.accuracy > 0.9 && @.recall > 0.8)` - Results meeting performance thresholds ## Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - - :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) - :type run_id: str - :param item_id__in: Filter for item ids - :type item_id__in: List[str] - :param external_id__in: Filter for items by their external_id from the input payload - :type external_id__in: List[str] - :param state: Filter items by their state - :type state: ItemState - :param termination_reason: Filter items by their termination reason. Only applies to TERMINATED items. - :type termination_reason: ItemTerminationReason - :param custom_metadata: JSONPath expression to filter items by their custom_metadata - :type custom_metadata: str - :param page: - :type page: int - :param page_size: - :type page_size: int - :param sort: Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending) - :type sort: List[str] + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[VersionDocumentResponse]: + """List version documents + + List public documents attached to an application version. Returns only documents with ``visibility=public`` and ``status=uploaded``. + + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3518,16 +6205,9 @@ def list_run_items_v1_runs_run_id_items_get( :return: Returns the result object. """ # noqa: E501 - _param = self._list_run_items_v1_runs_run_id_items_get_serialize( - run_id=run_id, - item_id__in=item_id__in, - external_id__in=external_id__in, - state=state, - termination_reason=termination_reason, - custom_metadata=custom_metadata, - page=page, - page_size=page_size, - sort=sort, + _param = self._list_version_documents_serialize( + application_id=application_id, + version=version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3535,7 +6215,7 @@ def list_run_items_v1_runs_run_id_items_get( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ItemResultReadResponse]", + '200': "List[VersionDocumentResponse]", '404': None, '422': "HTTPValidationError", } @@ -3551,17 +6231,10 @@ def list_run_items_v1_runs_run_id_items_get( @validate_call - def list_run_items_v1_runs_run_id_items_get_with_http_info( + def list_version_documents_with_http_info( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], - item_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for item ids")] = None, - external_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for items by their external_id from the input payload")] = None, - state: Annotated[Optional[ItemState], Field(description="Filter items by their state")] = None, - termination_reason: Annotated[Optional[ItemTerminationReason], Field(description="Filter items by their termination reason. Only applies to TERMINATED items.")] = None, - custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="JSONPath expression to filter items by their custom_metadata")] = None, - page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, - sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending)")] = None, + application_id: StrictStr, + version: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3574,29 +6247,15 @@ def list_run_items_v1_runs_run_id_items_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[ItemResultReadResponse]]: - """List Run Items + ) -> ApiResponse[List[VersionDocumentResponse]]: + """List version documents - List items in a run with filtering, sorting, and pagination capabilities. Returns paginated items within a specific run. Results can be filtered by `item_id`, `external_ids`, `custom_metadata`, `terminated_at`, and `termination_reason` using JSONPath expressions. ## JSONPath Metadata Filtering Use PostgreSQL JSONPath expressions to filter items using their custom_metadata. ### Examples: - **Field existence**: `$.case_id` - Results that have a case_id field defined - **Exact value match**: `$.priority ? (@ == \"high\")` - Results with high priority - **Numeric comparison**: `$.confidence_score ? (@ > 0.95)` - Results with high confidence - **Array operations**: `$.flags[*] ? (@ == \"reviewed\")` - Results flagged as reviewed - **Complex conditions**: `$.metrics ? (@.accuracy > 0.9 && @.recall > 0.8)` - Results meeting performance thresholds ## Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations + List public documents attached to an application version. Returns only documents with ``visibility=public`` and ``status=uploaded``. - :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) - :type run_id: str - :param item_id__in: Filter for item ids - :type item_id__in: List[str] - :param external_id__in: Filter for items by their external_id from the input payload - :type external_id__in: List[str] - :param state: Filter items by their state - :type state: ItemState - :param termination_reason: Filter items by their termination reason. Only applies to TERMINATED items. - :type termination_reason: ItemTerminationReason - :param custom_metadata: JSONPath expression to filter items by their custom_metadata - :type custom_metadata: str - :param page: - :type page: int - :param page_size: - :type page_size: int - :param sort: Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending) - :type sort: List[str] + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3619,16 +6278,9 @@ def list_run_items_v1_runs_run_id_items_get_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_run_items_v1_runs_run_id_items_get_serialize( - run_id=run_id, - item_id__in=item_id__in, - external_id__in=external_id__in, - state=state, - termination_reason=termination_reason, - custom_metadata=custom_metadata, - page=page, - page_size=page_size, - sort=sort, + _param = self._list_version_documents_serialize( + application_id=application_id, + version=version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3636,7 +6288,7 @@ def list_run_items_v1_runs_run_id_items_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ItemResultReadResponse]", + '200': "List[VersionDocumentResponse]", '404': None, '422': "HTTPValidationError", } @@ -3652,17 +6304,10 @@ def list_run_items_v1_runs_run_id_items_get_with_http_info( @validate_call - def list_run_items_v1_runs_run_id_items_get_without_preload_content( + def list_version_documents_without_preload_content( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /v1/runs/` endpoint")], - item_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for item ids")] = None, - external_id__in: Annotated[Optional[List[StrictStr]], Field(description="Filter for items by their external_id from the input payload")] = None, - state: Annotated[Optional[ItemState], Field(description="Filter items by their state")] = None, - termination_reason: Annotated[Optional[ItemTerminationReason], Field(description="Filter items by their termination reason. Only applies to TERMINATED items.")] = None, - custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="JSONPath expression to filter items by their custom_metadata")] = None, - page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, - sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending)")] = None, + application_id: StrictStr, + version: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3676,28 +6321,14 @@ def list_run_items_v1_runs_run_id_items_get_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Run Items + """List version documents - List items in a run with filtering, sorting, and pagination capabilities. Returns paginated items within a specific run. Results can be filtered by `item_id`, `external_ids`, `custom_metadata`, `terminated_at`, and `termination_reason` using JSONPath expressions. ## JSONPath Metadata Filtering Use PostgreSQL JSONPath expressions to filter items using their custom_metadata. ### Examples: - **Field existence**: `$.case_id` - Results that have a case_id field defined - **Exact value match**: `$.priority ? (@ == \"high\")` - Results with high priority - **Numeric comparison**: `$.confidence_score ? (@ > 0.95)` - Results with high confidence - **Array operations**: `$.flags[*] ? (@ == \"reviewed\")` - Results flagged as reviewed - **Complex conditions**: `$.metrics ? (@.accuracy > 0.9 && @.recall > 0.8)` - Results meeting performance thresholds ## Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations + List public documents attached to an application version. Returns only documents with ``visibility=public`` and ``status=uploaded``. - :param run_id: Run id, returned by `POST /v1/runs/` endpoint (required) - :type run_id: str - :param item_id__in: Filter for item ids - :type item_id__in: List[str] - :param external_id__in: Filter for items by their external_id from the input payload - :type external_id__in: List[str] - :param state: Filter items by their state - :type state: ItemState - :param termination_reason: Filter items by their termination reason. Only applies to TERMINATED items. - :type termination_reason: ItemTerminationReason - :param custom_metadata: JSONPath expression to filter items by their custom_metadata - :type custom_metadata: str - :param page: - :type page: int - :param page_size: - :type page_size: int - :param sort: Sort the items by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `item_id` - `external_id` - `custom_metadata` - `terminated_at` - `termination_reason` **Examples:** - `?sort=item_id` - Sort by id of the item (ascending) - `?sort=-external_id` - Sort by external ID (descending) - `?sort=custom_metadata&sort=-external_id` - Sort by metadata, then by external ID (descending) - :type sort: List[str] + :param application_id: (required) + :type application_id: str + :param version: (required) + :type version: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3720,16 +6351,9 @@ def list_run_items_v1_runs_run_id_items_get_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_run_items_v1_runs_run_id_items_get_serialize( - run_id=run_id, - item_id__in=item_id__in, - external_id__in=external_id__in, - state=state, - termination_reason=termination_reason, - custom_metadata=custom_metadata, - page=page, - page_size=page_size, - sort=sort, + _param = self._list_version_documents_serialize( + application_id=application_id, + version=version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3737,7 +6361,7 @@ def list_run_items_v1_runs_run_id_items_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ItemResultReadResponse]", + '200': "List[VersionDocumentResponse]", '404': None, '422': "HTTPValidationError", } @@ -3748,17 +6372,10 @@ def list_run_items_v1_runs_run_id_items_get_without_preload_content( return response_data.response - def _list_run_items_v1_runs_run_id_items_get_serialize( + def _list_version_documents_serialize( self, - run_id, - item_id__in, - external_id__in, - state, - termination_reason, - custom_metadata, - page, - page_size, - sort, + application_id, + version, _request_auth, _content_type, _headers, @@ -3768,9 +6385,6 @@ def _list_run_items_v1_runs_run_id_items_get_serialize( _host = None _collection_formats: Dict[str, str] = { - 'item_id__in': 'multi', - 'external_id__in': 'multi', - 'sort': 'multi', } _path_params: Dict[str, str] = {} @@ -3783,41 +6397,11 @@ def _list_run_items_v1_runs_run_id_items_get_serialize( _body_params: Optional[bytes] = None # process the path parameters - if run_id is not None: - _path_params['run_id'] = run_id + if application_id is not None: + _path_params['application_id'] = application_id + if version is not None: + _path_params['version'] = version # process the query parameters - if item_id__in is not None: - - _query_params.append(('item_id__in', item_id__in)) - - if external_id__in is not None: - - _query_params.append(('external_id__in', external_id__in)) - - if state is not None: - - _query_params.append(('state', state.value)) - - if termination_reason is not None: - - _query_params.append(('termination_reason', termination_reason.value)) - - if custom_metadata is not None: - - _query_params.append(('custom_metadata', custom_metadata)) - - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('page_size', page_size)) - - if sort is not None: - - _query_params.append(('sort', sort)) - # process the header parameters # process the form parameters # process the body parameter @@ -3839,7 +6423,7 @@ def _list_run_items_v1_runs_run_id_items_get_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/runs/{run_id}/items', + resource_path='/api/v1/applications/{application_id}/versions/{version}/documents', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3856,16 +6440,11 @@ def _list_run_items_v1_runs_run_id_items_get_serialize( @validate_call - def list_runs_v1_runs_get( + def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put( self, - application_id: Annotated[Optional[StrictStr], Field(description="Optional application ID filter")] = None, - application_version: Annotated[Optional[StrictStr], Field(description="Optional Version Name")] = None, - external_id: Annotated[Optional[StrictStr], Field(description="Optionally filter runs by items with this external ID")] = None, - custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** ")] = None, - page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, - for_organization: Annotated[Optional[StrictStr], Field(description="Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs.")] = None, - sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) ")] = None, + run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], + external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], + custom_metadata_update_request: CustomMetadataUpdateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3878,27 +6457,17 @@ def list_runs_v1_runs_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[RunReadResponse]: - """List Runs + ) -> CustomMetadataUpdateResponse: + """Put Item Custom Metadata By Run - List runs with filtering, sorting, and pagination capabilities. Returns paginated runs that were submitted by the user. + Update the custom metadata of the item with the specified `external_id`, belonging to the specified run. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for individual items via `GET /v1/runs/{run_id}/items/{external_id}`, and for all items of a run via `GET /v1/runs/{run_id}/items`. - :param application_id: Optional application ID filter - :type application_id: str - :param application_version: Optional Version Name - :type application_version: str - :param external_id: Optionally filter runs by items with this external ID + :param run_id: The run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) :type external_id: str - :param custom_metadata: Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** - :type custom_metadata: str - :param page: - :type page: int - :param page_size: - :type page_size: int - :param for_organization: Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs. - :type for_organization: str - :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) - :type sort: List[str] + :param custom_metadata_update_request: (required) + :type custom_metadata_update_request: CustomMetadataUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3921,15 +6490,10 @@ def list_runs_v1_runs_get( :return: Returns the result object. """ # noqa: E501 - _param = self._list_runs_v1_runs_get_serialize( - application_id=application_id, - application_version=application_version, + _param = self._put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_serialize( + run_id=run_id, external_id=external_id, - custom_metadata=custom_metadata, - page=page, - page_size=page_size, - for_organization=for_organization, - sort=sort, + custom_metadata_update_request=custom_metadata_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3937,8 +6501,10 @@ def list_runs_v1_runs_get( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[RunReadResponse]", + '200': "CustomMetadataUpdateResponse", + '403': None, '404': None, + '412': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -3953,16 +6519,11 @@ def list_runs_v1_runs_get( @validate_call - def list_runs_v1_runs_get_with_http_info( + def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_with_http_info( self, - application_id: Annotated[Optional[StrictStr], Field(description="Optional application ID filter")] = None, - application_version: Annotated[Optional[StrictStr], Field(description="Optional Version Name")] = None, - external_id: Annotated[Optional[StrictStr], Field(description="Optionally filter runs by items with this external ID")] = None, - custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** ")] = None, - page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, - for_organization: Annotated[Optional[StrictStr], Field(description="Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs.")] = None, - sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) ")] = None, + run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], + external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], + custom_metadata_update_request: CustomMetadataUpdateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3975,27 +6536,17 @@ def list_runs_v1_runs_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[RunReadResponse]]: - """List Runs + ) -> ApiResponse[CustomMetadataUpdateResponse]: + """Put Item Custom Metadata By Run - List runs with filtering, sorting, and pagination capabilities. Returns paginated runs that were submitted by the user. + Update the custom metadata of the item with the specified `external_id`, belonging to the specified run. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for individual items via `GET /v1/runs/{run_id}/items/{external_id}`, and for all items of a run via `GET /v1/runs/{run_id}/items`. - :param application_id: Optional application ID filter - :type application_id: str - :param application_version: Optional Version Name - :type application_version: str - :param external_id: Optionally filter runs by items with this external ID + :param run_id: The run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) :type external_id: str - :param custom_metadata: Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** - :type custom_metadata: str - :param page: - :type page: int - :param page_size: - :type page_size: int - :param for_organization: Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs. - :type for_organization: str - :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) - :type sort: List[str] + :param custom_metadata_update_request: (required) + :type custom_metadata_update_request: CustomMetadataUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4018,15 +6569,10 @@ def list_runs_v1_runs_get_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_runs_v1_runs_get_serialize( - application_id=application_id, - application_version=application_version, + _param = self._put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_serialize( + run_id=run_id, external_id=external_id, - custom_metadata=custom_metadata, - page=page, - page_size=page_size, - for_organization=for_organization, - sort=sort, + custom_metadata_update_request=custom_metadata_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4034,8 +6580,10 @@ def list_runs_v1_runs_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[RunReadResponse]", + '200': "CustomMetadataUpdateResponse", + '403': None, '404': None, + '412': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -4050,16 +6598,11 @@ def list_runs_v1_runs_get_with_http_info( @validate_call - def list_runs_v1_runs_get_without_preload_content( + def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_without_preload_content( self, - application_id: Annotated[Optional[StrictStr], Field(description="Optional application ID filter")] = None, - application_version: Annotated[Optional[StrictStr], Field(description="Optional Version Name")] = None, - external_id: Annotated[Optional[StrictStr], Field(description="Optionally filter runs by items with this external ID")] = None, - custom_metadata: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1000)]], Field(description="Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** ")] = None, - page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=5)]] = None, - for_organization: Annotated[Optional[StrictStr], Field(description="Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs.")] = None, - sort: Annotated[Optional[List[StrictStr]], Field(description="Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) ")] = None, + run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], + external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], + custom_metadata_update_request: CustomMetadataUpdateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4073,26 +6616,16 @@ def list_runs_v1_runs_get_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Runs + """Put Item Custom Metadata By Run - List runs with filtering, sorting, and pagination capabilities. Returns paginated runs that were submitted by the user. + Update the custom metadata of the item with the specified `external_id`, belonging to the specified run. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for individual items via `GET /v1/runs/{run_id}/items/{external_id}`, and for all items of a run via `GET /v1/runs/{run_id}/items`. - :param application_id: Optional application ID filter - :type application_id: str - :param application_version: Optional Version Name - :type application_version: str - :param external_id: Optionally filter runs by items with this external ID + :param run_id: The run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) :type external_id: str - :param custom_metadata: Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL's `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests** - :type custom_metadata: str - :param page: - :type page: int - :param page_size: - :type page_size: int - :param for_organization: Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs. - :type for_organization: str - :param sort: Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending) - :type sort: List[str] + :param custom_metadata_update_request: (required) + :type custom_metadata_update_request: CustomMetadataUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4115,15 +6648,10 @@ def list_runs_v1_runs_get_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_runs_v1_runs_get_serialize( - application_id=application_id, - application_version=application_version, + _param = self._put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_serialize( + run_id=run_id, external_id=external_id, - custom_metadata=custom_metadata, - page=page, - page_size=page_size, - for_organization=for_organization, - sort=sort, + custom_metadata_update_request=custom_metadata_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4131,8 +6659,10 @@ def list_runs_v1_runs_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[RunReadResponse]", + '200': "CustomMetadataUpdateResponse", + '403': None, '404': None, + '412': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -4142,16 +6672,11 @@ def list_runs_v1_runs_get_without_preload_content( return response_data.response - def _list_runs_v1_runs_get_serialize( + def _put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_serialize( self, - application_id, - application_version, + run_id, external_id, - custom_metadata, - page, - page_size, - for_organization, - sort, + custom_metadata_update_request, _request_auth, _content_type, _headers, @@ -4161,7 +6686,6 @@ def _list_runs_v1_runs_get_serialize( _host = None _collection_formats: Dict[str, str] = { - 'sort': 'multi', } _path_params: Dict[str, str] = {} @@ -4174,42 +6698,16 @@ def _list_runs_v1_runs_get_serialize( _body_params: Optional[bytes] = None # process the path parameters - # process the query parameters - if application_id is not None: - - _query_params.append(('application_id', application_id)) - - if application_version is not None: - - _query_params.append(('application_version', application_version)) - + if run_id is not None: + _path_params['run_id'] = run_id if external_id is not None: - - _query_params.append(('external_id', external_id)) - - if custom_metadata is not None: - - _query_params.append(('custom_metadata', custom_metadata)) - - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('page_size', page_size)) - - if for_organization is not None: - - _query_params.append(('for_organization', for_organization)) - - if sort is not None: - - _query_params.append(('sort', sort)) - + _path_params['external_id'] = external_id + # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if custom_metadata_update_request is not None: + _body_params = custom_metadata_update_request # set the HTTP header `Accept` @@ -4220,6 +6718,19 @@ def _list_runs_v1_runs_get_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -4227,8 +6738,8 @@ def _list_runs_v1_runs_get_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/runs', + method='PUT', + resource_path='/api/v1/runs/{run_id}/items/{external_id}/custom-metadata', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4245,10 +6756,10 @@ def _list_runs_v1_runs_get_serialize( @validate_call - def list_version_documents( + def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put( self, - application_id: StrictStr, - version: StrictStr, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], + custom_metadata_update_request: CustomMetadataUpdateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4261,15 +6772,15 @@ def list_version_documents( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[VersionDocumentResponse]: - """List version documents + ) -> CustomMetadataUpdateResponse: + """Put Run Custom Metadata - List public documents attached to an application version. Returns only documents with ``visibility=public`` and ``status=uploaded``. + Update the custom metadata of a run with the specified `run_id`. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for the run via the `GET /v1/runs/{run_id}` endpoint. **Note on deadlines:** Run deadlines must be set during run creation and cannot be modified afterward. Any deadline changes in custom metadata will be ignored by the system. - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str + :param run_id: Run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param custom_metadata_update_request: (required) + :type custom_metadata_update_request: CustomMetadataUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4292,9 +6803,9 @@ def list_version_documents( :return: Returns the result object. """ # noqa: E501 - _param = self._list_version_documents_serialize( - application_id=application_id, - version=version, + _param = self._put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( + run_id=run_id, + custom_metadata_update_request=custom_metadata_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4302,8 +6813,10 @@ def list_version_documents( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[VersionDocumentResponse]", + '200': "CustomMetadataUpdateResponse", '404': None, + '403': None, + '412': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -4318,10 +6831,10 @@ def list_version_documents( @validate_call - def list_version_documents_with_http_info( + def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_with_http_info( self, - application_id: StrictStr, - version: StrictStr, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], + custom_metadata_update_request: CustomMetadataUpdateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4334,15 +6847,15 @@ def list_version_documents_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[VersionDocumentResponse]]: - """List version documents + ) -> ApiResponse[CustomMetadataUpdateResponse]: + """Put Run Custom Metadata - List public documents attached to an application version. Returns only documents with ``visibility=public`` and ``status=uploaded``. + Update the custom metadata of a run with the specified `run_id`. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for the run via the `GET /v1/runs/{run_id}` endpoint. **Note on deadlines:** Run deadlines must be set during run creation and cannot be modified afterward. Any deadline changes in custom metadata will be ignored by the system. - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str + :param run_id: Run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param custom_metadata_update_request: (required) + :type custom_metadata_update_request: CustomMetadataUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4365,9 +6878,9 @@ def list_version_documents_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_version_documents_serialize( - application_id=application_id, - version=version, + _param = self._put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( + run_id=run_id, + custom_metadata_update_request=custom_metadata_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4375,8 +6888,10 @@ def list_version_documents_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[VersionDocumentResponse]", + '200': "CustomMetadataUpdateResponse", '404': None, + '403': None, + '412': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -4391,10 +6906,10 @@ def list_version_documents_with_http_info( @validate_call - def list_version_documents_without_preload_content( + def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_without_preload_content( self, - application_id: StrictStr, - version: StrictStr, + run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], + custom_metadata_update_request: CustomMetadataUpdateRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4408,14 +6923,14 @@ def list_version_documents_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List version documents + """Put Run Custom Metadata - List public documents attached to an application version. Returns only documents with ``visibility=public`` and ``status=uploaded``. + Update the custom metadata of a run with the specified `run_id`. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for the run via the `GET /v1/runs/{run_id}` endpoint. **Note on deadlines:** Run deadlines must be set during run creation and cannot be modified afterward. Any deadline changes in custom metadata will be ignored by the system. - :param application_id: (required) - :type application_id: str - :param version: (required) - :type version: str + :param run_id: Run id, returned by `POST /runs/` endpoint (required) + :type run_id: str + :param custom_metadata_update_request: (required) + :type custom_metadata_update_request: CustomMetadataUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4438,9 +6953,9 @@ def list_version_documents_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_version_documents_serialize( - application_id=application_id, - version=version, + _param = self._put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( + run_id=run_id, + custom_metadata_update_request=custom_metadata_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4448,8 +6963,10 @@ def list_version_documents_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[VersionDocumentResponse]", + '200': "CustomMetadataUpdateResponse", '404': None, + '403': None, + '412': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -4459,10 +6976,10 @@ def list_version_documents_without_preload_content( return response_data.response - def _list_version_documents_serialize( + def _put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( self, - application_id, - version, + run_id, + custom_metadata_update_request, _request_auth, _content_type, _headers, @@ -4484,14 +7001,14 @@ def _list_version_documents_serialize( _body_params: Optional[bytes] = None # process the path parameters - if application_id is not None: - _path_params['application_id'] = application_id - if version is not None: - _path_params['version'] = version + if run_id is not None: + _path_params['run_id'] = run_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if custom_metadata_update_request is not None: + _body_params = custom_metadata_update_request # set the HTTP header `Accept` @@ -4502,6 +7019,19 @@ def _list_version_documents_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -4509,8 +7039,8 @@ def _list_version_documents_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/applications/{application_id}/versions/{version}/documents', + method='PUT', + resource_path='/api/v1/runs/{run_id}/custom-metadata', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4527,11 +7057,9 @@ def _list_version_documents_serialize( @validate_call - def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put( + def read_application_by_id_v1_applications_application_id_get( self, - run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], - external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], - custom_metadata_update_request: CustomMetadataUpdateRequest, + application_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4544,17 +7072,13 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CustomMetadataUpdateResponse: - """Put Item Custom Metadata By Run + ) -> ApplicationReadResponse: + """Read Application By Id - Update the custom metadata of the item with the specified `external_id`, belonging to the specified run. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for individual items via `GET /v1/runs/{run_id}/items/{external_id}`, and for all items of a run via `GET /v1/runs/{run_id}/items`. + Retrieve details of a specific application by its ID. - :param run_id: The run id, returned by `POST /runs/` endpoint (required) - :type run_id: str - :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) - :type external_id: str - :param custom_metadata_update_request: (required) - :type custom_metadata_update_request: CustomMetadataUpdateRequest + :param application_id: (required) + :type application_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4577,10 +7101,8 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta :return: Returns the result object. """ # noqa: E501 - _param = self._put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_serialize( - run_id=run_id, - external_id=external_id, - custom_metadata_update_request=custom_metadata_update_request, + _param = self._read_application_by_id_v1_applications_application_id_get_serialize( + application_id=application_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4588,10 +7110,9 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomMetadataUpdateResponse", + '200': "ApplicationReadResponse", '403': None, '404': None, - '412': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -4606,11 +7127,9 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta @validate_call - def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_with_http_info( + def read_application_by_id_v1_applications_application_id_get_with_http_info( self, - run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], - external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], - custom_metadata_update_request: CustomMetadataUpdateRequest, + application_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4623,17 +7142,13 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CustomMetadataUpdateResponse]: - """Put Item Custom Metadata By Run + ) -> ApiResponse[ApplicationReadResponse]: + """Read Application By Id - Update the custom metadata of the item with the specified `external_id`, belonging to the specified run. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for individual items via `GET /v1/runs/{run_id}/items/{external_id}`, and for all items of a run via `GET /v1/runs/{run_id}/items`. + Retrieve details of a specific application by its ID. - :param run_id: The run id, returned by `POST /runs/` endpoint (required) - :type run_id: str - :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) - :type external_id: str - :param custom_metadata_update_request: (required) - :type custom_metadata_update_request: CustomMetadataUpdateRequest + :param application_id: (required) + :type application_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4656,10 +7171,8 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta :return: Returns the result object. """ # noqa: E501 - _param = self._put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_serialize( - run_id=run_id, - external_id=external_id, - custom_metadata_update_request=custom_metadata_update_request, + _param = self._read_application_by_id_v1_applications_application_id_get_serialize( + application_id=application_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4667,10 +7180,9 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomMetadataUpdateResponse", + '200': "ApplicationReadResponse", '403': None, '404': None, - '412': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -4685,11 +7197,9 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta @validate_call - def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_without_preload_content( + def read_application_by_id_v1_applications_application_id_get_without_preload_content( self, - run_id: Annotated[StrictStr, Field(description="The run id, returned by `POST /runs/` endpoint")], - external_id: Annotated[StrictStr, Field(description="The `external_id` that was defined for the item by the customer that triggered the run.")], - custom_metadata_update_request: CustomMetadataUpdateRequest, + application_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4703,16 +7213,12 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Put Item Custom Metadata By Run + """Read Application By Id - Update the custom metadata of the item with the specified `external_id`, belonging to the specified run. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for individual items via `GET /v1/runs/{run_id}/items/{external_id}`, and for all items of a run via `GET /v1/runs/{run_id}/items`. + Retrieve details of a specific application by its ID. - :param run_id: The run id, returned by `POST /runs/` endpoint (required) - :type run_id: str - :param external_id: The `external_id` that was defined for the item by the customer that triggered the run. (required) - :type external_id: str - :param custom_metadata_update_request: (required) - :type custom_metadata_update_request: CustomMetadataUpdateRequest + :param application_id: (required) + :type application_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4735,10 +7241,8 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta :return: Returns the result object. """ # noqa: E501 - _param = self._put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_serialize( - run_id=run_id, - external_id=external_id, - custom_metadata_update_request=custom_metadata_update_request, + _param = self._read_application_by_id_v1_applications_application_id_get_serialize( + application_id=application_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4746,10 +7250,9 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomMetadataUpdateResponse", + '200': "ApplicationReadResponse", '403': None, '404': None, - '412': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -4759,11 +7262,9 @@ def put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_meta return response_data.response - def _put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put_serialize( + def _read_application_by_id_v1_applications_application_id_get_serialize( self, - run_id, - external_id, - custom_metadata_update_request, + application_id, _request_auth, _content_type, _headers, @@ -4785,16 +7286,12 @@ def _put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_met _body_params: Optional[bytes] = None # process the path parameters - if run_id is not None: - _path_params['run_id'] = run_id - if external_id is not None: - _path_params['external_id'] = external_id + if application_id is not None: + _path_params['application_id'] = application_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if custom_metadata_update_request is not None: - _body_params = custom_metadata_update_request # set the HTTP header `Accept` @@ -4805,19 +7302,6 @@ def _put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_met ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -4825,8 +7309,8 @@ def _put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_met ] return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/runs/{run_id}/items/{external_id}/custom-metadata', + method='GET', + resource_path='/api/v1/applications/{application_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4843,10 +7327,9 @@ def _put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_met @validate_call - def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put( + def revoke_grant_v1_access_grants_grant_id_delete( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], - custom_metadata_update_request: CustomMetadataUpdateRequest, + grant_id: Annotated[StrictStr, Field(description="Grant ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4859,15 +7342,13 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CustomMetadataUpdateResponse: - """Put Run Custom Metadata + ) -> GrantReadResponse: + """Revoke Grant - Update the custom metadata of a run with the specified `run_id`. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for the run via the `GET /v1/runs/{run_id}` endpoint. **Note on deadlines:** Run deadlines must be set during run creation and cannot be modified afterward. Any deadline changes in custom metadata will be ignored by the system. + Revoke a grant by its ID. Sets the revoked_at timestamp on the grant. - :param run_id: Run id, returned by `POST /runs/` endpoint (required) - :type run_id: str - :param custom_metadata_update_request: (required) - :type custom_metadata_update_request: CustomMetadataUpdateRequest + :param grant_id: Grant ID (required) + :type grant_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4890,9 +7371,8 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put( :return: Returns the result object. """ # noqa: E501 - _param = self._put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( - run_id=run_id, - custom_metadata_update_request=custom_metadata_update_request, + _param = self._revoke_grant_v1_access_grants_grant_id_delete_serialize( + grant_id=grant_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4900,10 +7380,10 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomMetadataUpdateResponse", - '404': None, + '200': "GrantReadResponse", '403': None, - '412': None, + '404': None, + '409': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -4918,10 +7398,9 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put( @validate_call - def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_with_http_info( + def revoke_grant_v1_access_grants_grant_id_delete_with_http_info( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], - custom_metadata_update_request: CustomMetadataUpdateRequest, + grant_id: Annotated[StrictStr, Field(description="Grant ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4934,15 +7413,13 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CustomMetadataUpdateResponse]: - """Put Run Custom Metadata + ) -> ApiResponse[GrantReadResponse]: + """Revoke Grant - Update the custom metadata of a run with the specified `run_id`. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for the run via the `GET /v1/runs/{run_id}` endpoint. **Note on deadlines:** Run deadlines must be set during run creation and cannot be modified afterward. Any deadline changes in custom metadata will be ignored by the system. + Revoke a grant by its ID. Sets the revoked_at timestamp on the grant. - :param run_id: Run id, returned by `POST /runs/` endpoint (required) - :type run_id: str - :param custom_metadata_update_request: (required) - :type custom_metadata_update_request: CustomMetadataUpdateRequest + :param grant_id: Grant ID (required) + :type grant_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4965,9 +7442,8 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( - run_id=run_id, - custom_metadata_update_request=custom_metadata_update_request, + _param = self._revoke_grant_v1_access_grants_grant_id_delete_serialize( + grant_id=grant_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4975,10 +7451,10 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomMetadataUpdateResponse", - '404': None, + '200': "GrantReadResponse", '403': None, - '412': None, + '404': None, + '409': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -4993,10 +7469,9 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_with_http_info( @validate_call - def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_without_preload_content( + def revoke_grant_v1_access_grants_grant_id_delete_without_preload_content( self, - run_id: Annotated[StrictStr, Field(description="Run id, returned by `POST /runs/` endpoint")], - custom_metadata_update_request: CustomMetadataUpdateRequest, + grant_id: Annotated[StrictStr, Field(description="Grant ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5010,14 +7485,12 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_without_preload_c _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Put Run Custom Metadata + """Revoke Grant - Update the custom metadata of a run with the specified `run_id`. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for the run via the `GET /v1/runs/{run_id}` endpoint. **Note on deadlines:** Run deadlines must be set during run creation and cannot be modified afterward. Any deadline changes in custom metadata will be ignored by the system. + Revoke a grant by its ID. Sets the revoked_at timestamp on the grant. - :param run_id: Run id, returned by `POST /runs/` endpoint (required) - :type run_id: str - :param custom_metadata_update_request: (required) - :type custom_metadata_update_request: CustomMetadataUpdateRequest + :param grant_id: Grant ID (required) + :type grant_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5040,9 +7513,8 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_without_preload_c :return: Returns the result object. """ # noqa: E501 - _param = self._put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( - run_id=run_id, - custom_metadata_update_request=custom_metadata_update_request, + _param = self._revoke_grant_v1_access_grants_grant_id_delete_serialize( + grant_id=grant_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5050,10 +7522,10 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_without_preload_c ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomMetadataUpdateResponse", - '404': None, + '200': "GrantReadResponse", '403': None, - '412': None, + '404': None, + '409': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -5063,10 +7535,9 @@ def put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_without_preload_c return response_data.response - def _put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( + def _revoke_grant_v1_access_grants_grant_id_delete_serialize( self, - run_id, - custom_metadata_update_request, + grant_id, _request_auth, _content_type, _headers, @@ -5088,14 +7559,12 @@ def _put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( _body_params: Optional[bytes] = None # process the path parameters - if run_id is not None: - _path_params['run_id'] = run_id + if grant_id is not None: + _path_params['grant_id'] = grant_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if custom_metadata_update_request is not None: - _body_params = custom_metadata_update_request # set the HTTP header `Accept` @@ -5106,19 +7575,6 @@ def _put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -5126,8 +7582,8 @@ def _put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( ] return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/runs/{run_id}/custom-metadata', + method='DELETE', + resource_path='/api/v1/access/grants/{grant_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5144,9 +7600,9 @@ def _put_run_custom_metadata_v1_runs_run_id_custom_metadata_put_serialize( @validate_call - def read_application_by_id_v1_applications_application_id_get( + def revoke_share_token_v1_access_share_tokens_share_token_id_delete( self, - application_id: StrictStr, + share_token_id: Annotated[StrictStr, Field(description="Share token ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5159,13 +7615,13 @@ def read_application_by_id_v1_applications_application_id_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApplicationReadResponse: - """Read Application By Id + ) -> ShareTokenReadResponse: + """Revoke Share Token - Retrieve details of a specific application by its ID. + Revoke a share token by its ID. Invalidates the credential regardless of any active grants. - :param application_id: (required) - :type application_id: str + :param share_token_id: Share token ID (required) + :type share_token_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5188,8 +7644,8 @@ def read_application_by_id_v1_applications_application_id_get( :return: Returns the result object. """ # noqa: E501 - _param = self._read_application_by_id_v1_applications_application_id_get_serialize( - application_id=application_id, + _param = self._revoke_share_token_v1_access_share_tokens_share_token_id_delete_serialize( + share_token_id=share_token_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5197,9 +7653,10 @@ def read_application_by_id_v1_applications_application_id_get( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationReadResponse", + '200': "ShareTokenReadResponse", '403': None, '404': None, + '409': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -5214,9 +7671,9 @@ def read_application_by_id_v1_applications_application_id_get( @validate_call - def read_application_by_id_v1_applications_application_id_get_with_http_info( + def revoke_share_token_v1_access_share_tokens_share_token_id_delete_with_http_info( self, - application_id: StrictStr, + share_token_id: Annotated[StrictStr, Field(description="Share token ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5229,13 +7686,13 @@ def read_application_by_id_v1_applications_application_id_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ApplicationReadResponse]: - """Read Application By Id + ) -> ApiResponse[ShareTokenReadResponse]: + """Revoke Share Token - Retrieve details of a specific application by its ID. + Revoke a share token by its ID. Invalidates the credential regardless of any active grants. - :param application_id: (required) - :type application_id: str + :param share_token_id: Share token ID (required) + :type share_token_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5258,8 +7715,8 @@ def read_application_by_id_v1_applications_application_id_get_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._read_application_by_id_v1_applications_application_id_get_serialize( - application_id=application_id, + _param = self._revoke_share_token_v1_access_share_tokens_share_token_id_delete_serialize( + share_token_id=share_token_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5267,9 +7724,10 @@ def read_application_by_id_v1_applications_application_id_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationReadResponse", + '200': "ShareTokenReadResponse", '403': None, '404': None, + '409': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -5284,9 +7742,9 @@ def read_application_by_id_v1_applications_application_id_get_with_http_info( @validate_call - def read_application_by_id_v1_applications_application_id_get_without_preload_content( + def revoke_share_token_v1_access_share_tokens_share_token_id_delete_without_preload_content( self, - application_id: StrictStr, + share_token_id: Annotated[StrictStr, Field(description="Share token ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5300,12 +7758,12 @@ def read_application_by_id_v1_applications_application_id_get_without_preload_co _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Read Application By Id + """Revoke Share Token - Retrieve details of a specific application by its ID. + Revoke a share token by its ID. Invalidates the credential regardless of any active grants. - :param application_id: (required) - :type application_id: str + :param share_token_id: Share token ID (required) + :type share_token_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5328,8 +7786,8 @@ def read_application_by_id_v1_applications_application_id_get_without_preload_co :return: Returns the result object. """ # noqa: E501 - _param = self._read_application_by_id_v1_applications_application_id_get_serialize( - application_id=application_id, + _param = self._revoke_share_token_v1_access_share_tokens_share_token_id_delete_serialize( + share_token_id=share_token_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5337,9 +7795,10 @@ def read_application_by_id_v1_applications_application_id_get_without_preload_co ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationReadResponse", + '200': "ShareTokenReadResponse", '403': None, '404': None, + '409': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -5349,9 +7808,9 @@ def read_application_by_id_v1_applications_application_id_get_without_preload_co return response_data.response - def _read_application_by_id_v1_applications_application_id_get_serialize( + def _revoke_share_token_v1_access_share_tokens_share_token_id_delete_serialize( self, - application_id, + share_token_id, _request_auth, _content_type, _headers, @@ -5373,8 +7832,8 @@ def _read_application_by_id_v1_applications_application_id_get_serialize( _body_params: Optional[bytes] = None # process the path parameters - if application_id is not None: - _path_params['application_id'] = application_id + if share_token_id is not None: + _path_params['share_token_id'] = share_token_id # process the query parameters # process the header parameters # process the form parameters @@ -5396,8 +7855,8 @@ def _read_application_by_id_v1_applications_application_id_get_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/applications/{application_id}', + method='DELETE', + resource_path='/api/v1/access/share-tokens/{share_token_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/codegen/out/aignx/codegen/api_client.py b/codegen/out/aignx/codegen/api_client.py index 1f5b8fc8d..cd8b95d27 100644 --- a/codegen/out/aignx/codegen/api_client.py +++ b/codegen/out/aignx/codegen/api_client.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/configuration.py b/codegen/out/aignx/codegen/configuration.py index 007c409c3..36a2ec2f8 100644 --- a/codegen/out/aignx/codegen/configuration.py +++ b/codegen/out/aignx/codegen/configuration.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -502,7 +502,7 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 1.5.0\n"\ + "Version of the API: 1.6.0\n"\ "SDK Package Version: 1.0.0".\ format(env=sys.platform, pyversion=sys.version) diff --git a/codegen/out/aignx/codegen/exceptions.py b/codegen/out/aignx/codegen/exceptions.py index 0da9a49e5..d5ddf1bad 100644 --- a/codegen/out/aignx/codegen/exceptions.py +++ b/codegen/out/aignx/codegen/exceptions.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/__init__.py b/codegen/out/aignx/codegen/models/__init__.py index b6d754dc8..7a1e70d6a 100644 --- a/codegen/out/aignx/codegen/models/__init__.py +++ b/codegen/out/aignx/codegen/models/__init__.py @@ -7,19 +7,25 @@ from .run_creation_response import * from .scheduling_request import * from .organization_read_response import * +from .grant_read_response import * from .validation_error import * from .application_read_response import * +from .share_token_create_request import * +from .share_token_create_response import * from .version_document_response import * from .application_read_short_response import * from .output_artifact_scope import * +from .grant_create_request import * from .scheduling_response import * from .me_read_response import * from .input_artifact_creation_request import * from .item_creation_request import * +from .subject_type import * from .item_state import * from .auth0_organization import * from .application_version import * from .http_validation_error import * +from .resource_type import * from .custom_metadata_update_response import * from .version_document_visibility import * from .user_read_response import * @@ -32,6 +38,8 @@ from .run_read_response import * from .artifact_termination_reason import * from .run_creation_request import * +from .grant_relation import * +from .share_token_read_response import * from .item_termination_reason import * from .run_item_statistics import * from .output_artifact_visibility import * diff --git a/codegen/out/aignx/codegen/models/application_read_response.py b/codegen/out/aignx/codegen/models/application_read_response.py index 23abca29c..d0836f7b7 100644 --- a/codegen/out/aignx/codegen/models/application_read_response.py +++ b/codegen/out/aignx/codegen/models/application_read_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/application_read_short_response.py b/codegen/out/aignx/codegen/models/application_read_short_response.py index 7bfce4e2a..f1f01a42a 100644 --- a/codegen/out/aignx/codegen/models/application_read_short_response.py +++ b/codegen/out/aignx/codegen/models/application_read_short_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/application_version.py b/codegen/out/aignx/codegen/models/application_version.py index fed544e18..06096d97e 100644 --- a/codegen/out/aignx/codegen/models/application_version.py +++ b/codegen/out/aignx/codegen/models/application_version.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/artifact_output.py b/codegen/out/aignx/codegen/models/artifact_output.py index 88b210599..60cd2218d 100644 --- a/codegen/out/aignx/codegen/models/artifact_output.py +++ b/codegen/out/aignx/codegen/models/artifact_output.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/artifact_state.py b/codegen/out/aignx/codegen/models/artifact_state.py index da25ba6a4..d6726b17c 100644 --- a/codegen/out/aignx/codegen/models/artifact_state.py +++ b/codegen/out/aignx/codegen/models/artifact_state.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/artifact_termination_reason.py b/codegen/out/aignx/codegen/models/artifact_termination_reason.py index 2e7573e1c..564ea6639 100644 --- a/codegen/out/aignx/codegen/models/artifact_termination_reason.py +++ b/codegen/out/aignx/codegen/models/artifact_termination_reason.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/custom_metadata_update_request.py b/codegen/out/aignx/codegen/models/custom_metadata_update_request.py index 9143c4df3..0645a7867 100644 --- a/codegen/out/aignx/codegen/models/custom_metadata_update_request.py +++ b/codegen/out/aignx/codegen/models/custom_metadata_update_request.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/custom_metadata_update_response.py b/codegen/out/aignx/codegen/models/custom_metadata_update_response.py index 2cfc00a64..6c1427463 100644 --- a/codegen/out/aignx/codegen/models/custom_metadata_update_response.py +++ b/codegen/out/aignx/codegen/models/custom_metadata_update_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/grant_create_request.py b/codegen/out/aignx/codegen/models/grant_create_request.py new file mode 100644 index 000000000..fd437135b --- /dev/null +++ b/codegen/out/aignx/codegen/models/grant_create_request.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Aignostics Platform API + + The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. + + The version of the OpenAPI document: 1.6.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from aignx.codegen.models.grant_relation import GrantRelation +from aignx.codegen.models.resource_type import ResourceType +from aignx.codegen.models.subject_type import SubjectType +from typing import Optional, Set +from typing_extensions import Self + +class GrantCreateRequest(BaseModel): + """ + GrantCreateRequest + """ # noqa: E501 + resource_type: ResourceType + resource_id: StrictStr + subject_type: SubjectType + subject_id: Optional[StrictStr] = None + subject_email: Optional[StrictStr] = None + relation: GrantRelation + __properties: ClassVar[List[str]] = ["resource_type", "resource_id", "subject_type", "subject_id", "subject_email", "relation"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GrantCreateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if subject_id (nullable) is None + # and model_fields_set contains the field + if self.subject_id is None and "subject_id" in self.model_fields_set: + _dict['subject_id'] = None + + # set to None if subject_email (nullable) is None + # and model_fields_set contains the field + if self.subject_email is None and "subject_email" in self.model_fields_set: + _dict['subject_email'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GrantCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resource_type": obj.get("resource_type"), + "resource_id": obj.get("resource_id"), + "subject_type": obj.get("subject_type"), + "subject_id": obj.get("subject_id"), + "subject_email": obj.get("subject_email"), + "relation": obj.get("relation") + }) + return _obj + + diff --git a/codegen/out/aignx/codegen/models/grant_read_response.py b/codegen/out/aignx/codegen/models/grant_read_response.py new file mode 100644 index 000000000..f60c05e99 --- /dev/null +++ b/codegen/out/aignx/codegen/models/grant_read_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Aignostics Platform API + + The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. + + The version of the OpenAPI document: 1.6.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from aignx.codegen.models.grant_relation import GrantRelation +from aignx.codegen.models.resource_type import ResourceType +from aignx.codegen.models.subject_type import SubjectType +from typing import Optional, Set +from typing_extensions import Self + +class GrantReadResponse(BaseModel): + """ + GrantReadResponse + """ # noqa: E501 + grant_id: StrictStr + resource_type: ResourceType + resource_id: StrictStr + subject_type: SubjectType + subject_id: StrictStr + relation: GrantRelation + created_by: StrictStr + created_at: datetime + revoked: StrictBool + __properties: ClassVar[List[str]] = ["grant_id", "resource_type", "resource_id", "subject_type", "subject_id", "relation", "created_by", "created_at", "revoked"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GrantReadResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GrantReadResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "grant_id": obj.get("grant_id"), + "resource_type": obj.get("resource_type"), + "resource_id": obj.get("resource_id"), + "subject_type": obj.get("subject_type"), + "subject_id": obj.get("subject_id"), + "relation": obj.get("relation"), + "created_by": obj.get("created_by"), + "created_at": obj.get("created_at"), + "revoked": obj.get("revoked") + }) + return _obj + + diff --git a/codegen/out/aignx/codegen/models/grant_relation.py b/codegen/out/aignx/codegen/models/grant_relation.py new file mode 100644 index 000000000..58f94a71e --- /dev/null +++ b/codegen/out/aignx/codegen/models/grant_relation.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Aignostics Platform API + + The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. + + The version of the OpenAPI document: 1.6.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class GrantRelation(str, Enum): + """ + GrantRelation + """ + + """ + allowed enum values + """ + OWNER = 'owner' + EDITOR = 'editor' + VIEWER = 'viewer' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GrantRelation from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/codegen/out/aignx/codegen/models/http_validation_error.py b/codegen/out/aignx/codegen/models/http_validation_error.py index a54b96060..7733008d3 100644 --- a/codegen/out/aignx/codegen/models/http_validation_error.py +++ b/codegen/out/aignx/codegen/models/http_validation_error.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/input_artifact.py b/codegen/out/aignx/codegen/models/input_artifact.py index 9cf652222..f97f4141e 100644 --- a/codegen/out/aignx/codegen/models/input_artifact.py +++ b/codegen/out/aignx/codegen/models/input_artifact.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/input_artifact_creation_request.py b/codegen/out/aignx/codegen/models/input_artifact_creation_request.py index 4a7844e60..93e90992b 100644 --- a/codegen/out/aignx/codegen/models/input_artifact_creation_request.py +++ b/codegen/out/aignx/codegen/models/input_artifact_creation_request.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/input_artifact_result_read_response.py b/codegen/out/aignx/codegen/models/input_artifact_result_read_response.py index da7fd3822..e4d779dcd 100644 --- a/codegen/out/aignx/codegen/models/input_artifact_result_read_response.py +++ b/codegen/out/aignx/codegen/models/input_artifact_result_read_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/item_creation_request.py b/codegen/out/aignx/codegen/models/item_creation_request.py index 3f49dc409..c91f837f5 100644 --- a/codegen/out/aignx/codegen/models/item_creation_request.py +++ b/codegen/out/aignx/codegen/models/item_creation_request.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/item_output.py b/codegen/out/aignx/codegen/models/item_output.py index 127b03723..ad5fe184b 100644 --- a/codegen/out/aignx/codegen/models/item_output.py +++ b/codegen/out/aignx/codegen/models/item_output.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/item_result_read_response.py b/codegen/out/aignx/codegen/models/item_result_read_response.py index 6c8fe46ba..101f888cf 100644 --- a/codegen/out/aignx/codegen/models/item_result_read_response.py +++ b/codegen/out/aignx/codegen/models/item_result_read_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/item_state.py b/codegen/out/aignx/codegen/models/item_state.py index 5dfdcdf39..d1ad49ecc 100644 --- a/codegen/out/aignx/codegen/models/item_state.py +++ b/codegen/out/aignx/codegen/models/item_state.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/item_termination_reason.py b/codegen/out/aignx/codegen/models/item_termination_reason.py index 7f6d5e6d3..7fd03bf45 100644 --- a/codegen/out/aignx/codegen/models/item_termination_reason.py +++ b/codegen/out/aignx/codegen/models/item_termination_reason.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/me_read_response.py b/codegen/out/aignx/codegen/models/me_read_response.py index dd63abf4e..ca44416f8 100644 --- a/codegen/out/aignx/codegen/models/me_read_response.py +++ b/codegen/out/aignx/codegen/models/me_read_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/organization_read_response.py b/codegen/out/aignx/codegen/models/organization_read_response.py index 0f85155cf..ff0aa1149 100644 --- a/codegen/out/aignx/codegen/models/organization_read_response.py +++ b/codegen/out/aignx/codegen/models/organization_read_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/output_artifact.py b/codegen/out/aignx/codegen/models/output_artifact.py index cc6230290..c0c34c9a7 100644 --- a/codegen/out/aignx/codegen/models/output_artifact.py +++ b/codegen/out/aignx/codegen/models/output_artifact.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/output_artifact_result_read_response.py b/codegen/out/aignx/codegen/models/output_artifact_result_read_response.py index fd0069b75..c111db09d 100644 --- a/codegen/out/aignx/codegen/models/output_artifact_result_read_response.py +++ b/codegen/out/aignx/codegen/models/output_artifact_result_read_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/output_artifact_scope.py b/codegen/out/aignx/codegen/models/output_artifact_scope.py index 8e4d0c6dd..067337c08 100644 --- a/codegen/out/aignx/codegen/models/output_artifact_scope.py +++ b/codegen/out/aignx/codegen/models/output_artifact_scope.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/output_artifact_visibility.py b/codegen/out/aignx/codegen/models/output_artifact_visibility.py index 5e6e492da..2da9ccd9d 100644 --- a/codegen/out/aignx/codegen/models/output_artifact_visibility.py +++ b/codegen/out/aignx/codegen/models/output_artifact_visibility.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/resource_type.py b/codegen/out/aignx/codegen/models/resource_type.py new file mode 100644 index 000000000..77025b299 --- /dev/null +++ b/codegen/out/aignx/codegen/models/resource_type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Aignostics Platform API + + The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. + + The version of the OpenAPI document: 1.6.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ResourceType(str, Enum): + """ + ResourceType + """ + + """ + allowed enum values + """ + RUN = 'run' + ITEM = 'item' + OUTPUT_ARTIFACT = 'output_artifact' + SHARE_TOKEN = 'share_token' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ResourceType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/codegen/out/aignx/codegen/models/run_creation_request.py b/codegen/out/aignx/codegen/models/run_creation_request.py index e29fabe6d..8cfb9be7c 100644 --- a/codegen/out/aignx/codegen/models/run_creation_request.py +++ b/codegen/out/aignx/codegen/models/run_creation_request.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -33,8 +33,9 @@ class RunCreationRequest(BaseModel): version_number: Optional[StrictStr] = None custom_metadata: Optional[Dict[str, Any]] = None scheduling: Optional[SchedulingRequest] = None + callback_context: Optional[Dict[str, Any]] = None items: Annotated[List[ItemCreationRequest], Field(min_length=1)] = Field(description="List of items (slides) to process. Each item represents a whole slide image (WSI) with its associated metadata and artifacts") - __properties: ClassVar[List[str]] = ["application_id", "version_number", "custom_metadata", "scheduling", "items"] + __properties: ClassVar[List[str]] = ["application_id", "version_number", "custom_metadata", "scheduling", "callback_context", "items"] model_config = ConfigDict( populate_by_name=True, @@ -100,6 +101,11 @@ def to_dict(self) -> Dict[str, Any]: if self.scheduling is None and "scheduling" in self.model_fields_set: _dict['scheduling'] = None + # set to None if callback_context (nullable) is None + # and model_fields_set contains the field + if self.callback_context is None and "callback_context" in self.model_fields_set: + _dict['callback_context'] = None + return _dict @classmethod @@ -116,6 +122,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "version_number": obj.get("version_number"), "custom_metadata": obj.get("custom_metadata"), "scheduling": SchedulingRequest.from_dict(obj["scheduling"]) if obj.get("scheduling") is not None else None, + "callback_context": obj.get("callback_context"), "items": [ItemCreationRequest.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None }) return _obj diff --git a/codegen/out/aignx/codegen/models/run_creation_response.py b/codegen/out/aignx/codegen/models/run_creation_response.py index 9868cc07c..7c3e5c0a6 100644 --- a/codegen/out/aignx/codegen/models/run_creation_response.py +++ b/codegen/out/aignx/codegen/models/run_creation_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/run_item_statistics.py b/codegen/out/aignx/codegen/models/run_item_statistics.py index fd3a98cf0..77128c9ff 100644 --- a/codegen/out/aignx/codegen/models/run_item_statistics.py +++ b/codegen/out/aignx/codegen/models/run_item_statistics.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/run_output.py b/codegen/out/aignx/codegen/models/run_output.py index 521bfd3ec..9d925f986 100644 --- a/codegen/out/aignx/codegen/models/run_output.py +++ b/codegen/out/aignx/codegen/models/run_output.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/run_read_response.py b/codegen/out/aignx/codegen/models/run_read_response.py index 9f1a1d55b..46caec8fa 100644 --- a/codegen/out/aignx/codegen/models/run_read_response.py +++ b/codegen/out/aignx/codegen/models/run_read_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/run_state.py b/codegen/out/aignx/codegen/models/run_state.py index c7cabff90..23ed86681 100644 --- a/codegen/out/aignx/codegen/models/run_state.py +++ b/codegen/out/aignx/codegen/models/run_state.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/run_termination_reason.py b/codegen/out/aignx/codegen/models/run_termination_reason.py index 3b116235f..a22517f6c 100644 --- a/codegen/out/aignx/codegen/models/run_termination_reason.py +++ b/codegen/out/aignx/codegen/models/run_termination_reason.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/scheduling_request.py b/codegen/out/aignx/codegen/models/scheduling_request.py index 712374162..cb5cb0007 100644 --- a/codegen/out/aignx/codegen/models/scheduling_request.py +++ b/codegen/out/aignx/codegen/models/scheduling_request.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/scheduling_response.py b/codegen/out/aignx/codegen/models/scheduling_response.py index c077ab1d7..9f305e343 100644 --- a/codegen/out/aignx/codegen/models/scheduling_response.py +++ b/codegen/out/aignx/codegen/models/scheduling_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/share_token_create_request.py b/codegen/out/aignx/codegen/models/share_token_create_request.py new file mode 100644 index 000000000..a639fcba0 --- /dev/null +++ b/codegen/out/aignx/codegen/models/share_token_create_request.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Aignostics Platform API + + The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. + + The version of the OpenAPI document: 1.6.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ShareTokenCreateRequest(BaseModel): + """ + ShareTokenCreateRequest + """ # noqa: E501 + expires_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ShareTokenCreateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if expires_at (nullable) is None + # and model_fields_set contains the field + if self.expires_at is None and "expires_at" in self.model_fields_set: + _dict['expires_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ShareTokenCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "expires_at": obj.get("expires_at") + }) + return _obj + + diff --git a/codegen/out/aignx/codegen/models/share_token_create_response.py b/codegen/out/aignx/codegen/models/share_token_create_response.py new file mode 100644 index 000000000..b0964d986 --- /dev/null +++ b/codegen/out/aignx/codegen/models/share_token_create_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Aignostics Platform API + + The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. + + The version of the OpenAPI document: 1.6.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ShareTokenCreateResponse(BaseModel): + """ + Returned only on POST — includes the one-time share_token. + """ # noqa: E501 + share_token_id: StrictStr + share_token: StrictStr + created_at: datetime + expires_at: Optional[datetime] + revoked: StrictBool + __properties: ClassVar[List[str]] = ["share_token_id", "share_token", "created_at", "expires_at", "revoked"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ShareTokenCreateResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if expires_at (nullable) is None + # and model_fields_set contains the field + if self.expires_at is None and "expires_at" in self.model_fields_set: + _dict['expires_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ShareTokenCreateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "share_token_id": obj.get("share_token_id"), + "share_token": obj.get("share_token"), + "created_at": obj.get("created_at"), + "expires_at": obj.get("expires_at"), + "revoked": obj.get("revoked") + }) + return _obj + + diff --git a/codegen/out/aignx/codegen/models/share_token_read_response.py b/codegen/out/aignx/codegen/models/share_token_read_response.py new file mode 100644 index 000000000..722bfa1bd --- /dev/null +++ b/codegen/out/aignx/codegen/models/share_token_read_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Aignostics Platform API + + The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. + + The version of the OpenAPI document: 1.6.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ShareTokenReadResponse(BaseModel): + """ + Returned on GET endpoints — omits share_token. + """ # noqa: E501 + share_token_id: StrictStr + created_at: datetime + expires_at: Optional[datetime] + revoked: StrictBool + __properties: ClassVar[List[str]] = ["share_token_id", "created_at", "expires_at", "revoked"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ShareTokenReadResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if expires_at (nullable) is None + # and model_fields_set contains the field + if self.expires_at is None and "expires_at" in self.model_fields_set: + _dict['expires_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ShareTokenReadResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "share_token_id": obj.get("share_token_id"), + "created_at": obj.get("created_at"), + "expires_at": obj.get("expires_at"), + "revoked": obj.get("revoked") + }) + return _obj + + diff --git a/codegen/out/aignx/codegen/models/subject_type.py b/codegen/out/aignx/codegen/models/subject_type.py new file mode 100644 index 000000000..e0a5c8441 --- /dev/null +++ b/codegen/out/aignx/codegen/models/subject_type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Aignostics Platform API + + The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. + + The version of the OpenAPI document: 1.6.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SubjectType(str, Enum): + """ + SubjectType + """ + + """ + allowed enum values + """ + USER = 'user' + ORGANIZATION_ADMIN = 'organization_admin' + ORGANIZATION_USER = 'organization_user' + SHARE_TOKEN = 'share_token' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SubjectType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/codegen/out/aignx/codegen/models/user_read_response.py b/codegen/out/aignx/codegen/models/user_read_response.py index 74f46eeef..b1d8f1806 100644 --- a/codegen/out/aignx/codegen/models/user_read_response.py +++ b/codegen/out/aignx/codegen/models/user_read_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/validation_error.py b/codegen/out/aignx/codegen/models/validation_error.py index aa8a684a4..7eef142d2 100644 --- a/codegen/out/aignx/codegen/models/validation_error.py +++ b/codegen/out/aignx/codegen/models/validation_error.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/validation_error_loc_inner.py b/codegen/out/aignx/codegen/models/validation_error_loc_inner.py index bc7371a62..022f4a69a 100644 --- a/codegen/out/aignx/codegen/models/validation_error_loc_inner.py +++ b/codegen/out/aignx/codegen/models/validation_error_loc_inner.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/version_document_response.py b/codegen/out/aignx/codegen/models/version_document_response.py index 8053168ed..f63a43711 100644 --- a/codegen/out/aignx/codegen/models/version_document_response.py +++ b/codegen/out/aignx/codegen/models/version_document_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/version_document_visibility.py b/codegen/out/aignx/codegen/models/version_document_visibility.py index 82e5977a8..aeb3840c5 100644 --- a/codegen/out/aignx/codegen/models/version_document_visibility.py +++ b/codegen/out/aignx/codegen/models/version_document_visibility.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/models/version_read_response.py b/codegen/out/aignx/codegen/models/version_read_response.py index 5d7ba6b9a..2ac813115 100644 --- a/codegen/out/aignx/codegen/models/version_read_response.py +++ b/codegen/out/aignx/codegen/models/version_read_response.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/aignx/codegen/rest.py b/codegen/out/aignx/codegen/rest.py index 1237dd274..1f8f90e77 100644 --- a/codegen/out/aignx/codegen/rest.py +++ b/codegen/out/aignx/codegen/rest.py @@ -5,7 +5,7 @@ The Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. To begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. More information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com). **How to authorize and test API endpoints:** 1. Click the \"Authorize\" button in the right corner below 3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials 4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint **Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized. - The version of the OpenAPI document: 1.5.0 + The version of the OpenAPI document: 1.6.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/codegen/out/docs/PublicApi.md b/codegen/out/docs/PublicApi.md index 0524b92cd..6ae6863b3 100644 --- a/codegen/out/docs/PublicApi.md +++ b/codegen/out/docs/PublicApi.md @@ -6,22 +6,30 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**application_version_details_v1_applications_application_id_versions_version_get**](PublicApi.md#application_version_details_v1_applications_application_id_versions_version_get) | **GET** /v1/applications/{application_id}/versions/{version} | Application Version Details [**cancel_run_v1_runs_run_id_cancel_post**](PublicApi.md#cancel_run_v1_runs_run_id_cancel_post) | **POST** /v1/runs/{run_id}/cancel | Cancel Run +[**create_grant_v1_access_grants_post**](PublicApi.md#create_grant_v1_access_grants_post) | **POST** /v1/access/grants | Create Grant [**create_run_v1_runs_post**](PublicApi.md#create_run_v1_runs_post) | **POST** /v1/runs | Initiate Run +[**create_share_token_v1_access_share_tokens_post**](PublicApi.md#create_share_token_v1_access_share_tokens_post) | **POST** /v1/access/share-tokens | Create Share Token [**delete_run_items_v1_runs_run_id_artifacts_delete**](PublicApi.md#delete_run_items_v1_runs_run_id_artifacts_delete) | **DELETE** /v1/runs/{run_id}/artifacts | Delete Run Items [**get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get**](PublicApi.md#get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get) | **GET** /v1/runs/{run_id}/artifacts/{artifact_id}/file | Get Artifact Url +[**get_grant_v1_access_grants_grant_id_get**](PublicApi.md#get_grant_v1_access_grants_grant_id_get) | **GET** /v1/access/grants/{grant_id} | Get Grant [**get_item_by_run_v1_runs_run_id_items_external_id_get**](PublicApi.md#get_item_by_run_v1_runs_run_id_items_external_id_get) | **GET** /v1/runs/{run_id}/items/{external_id} | Get Item By Run [**get_me_v1_me_get**](PublicApi.md#get_me_v1_me_get) | **GET** /v1/me | Get current user [**get_run_v1_runs_run_id_get**](PublicApi.md#get_run_v1_runs_run_id_get) | **GET** /v1/runs/{run_id} | Get run details +[**get_share_token_v1_access_share_tokens_share_token_id_get**](PublicApi.md#get_share_token_v1_access_share_tokens_share_token_id_get) | **GET** /v1/access/share-tokens/{share_token_id} | Get Share Token [**get_version_document**](PublicApi.md#get_version_document) | **GET** /v1/applications/{application_id}/versions/{version}/documents/{name} | Get version document metadata [**get_version_document_content**](PublicApi.md#get_version_document_content) | **GET** /v1/applications/{application_id}/versions/{version}/documents/{name}/content | Stream version document content (programmatic) [**get_version_document_file**](PublicApi.md#get_version_document_file) | **GET** /v1/applications/{application_id}/versions/{version}/documents/{name}/file | Download version document (browser) [**list_applications_v1_applications_get**](PublicApi.md#list_applications_v1_applications_get) | **GET** /v1/applications | List available applications +[**list_grants_v1_access_grants_get**](PublicApi.md#list_grants_v1_access_grants_get) | **GET** /v1/access/grants | List Grants [**list_run_items_v1_runs_run_id_items_get**](PublicApi.md#list_run_items_v1_runs_run_id_items_get) | **GET** /v1/runs/{run_id}/items | List Run Items [**list_runs_v1_runs_get**](PublicApi.md#list_runs_v1_runs_get) | **GET** /v1/runs | List Runs +[**list_share_tokens_v1_access_share_tokens_get**](PublicApi.md#list_share_tokens_v1_access_share_tokens_get) | **GET** /v1/access/share-tokens | List Share Tokens [**list_version_documents**](PublicApi.md#list_version_documents) | **GET** /v1/applications/{application_id}/versions/{version}/documents | List version documents [**put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put**](PublicApi.md#put_item_custom_metadata_by_run_v1_runs_run_id_items_external_id_custom_metadata_put) | **PUT** /v1/runs/{run_id}/items/{external_id}/custom-metadata | Put Item Custom Metadata By Run [**put_run_custom_metadata_v1_runs_run_id_custom_metadata_put**](PublicApi.md#put_run_custom_metadata_v1_runs_run_id_custom_metadata_put) | **PUT** /v1/runs/{run_id}/custom-metadata | Put Run Custom Metadata [**read_application_by_id_v1_applications_application_id_get**](PublicApi.md#read_application_by_id_v1_applications_application_id_get) | **GET** /v1/applications/{application_id} | Read Application By Id +[**revoke_grant_v1_access_grants_grant_id_delete**](PublicApi.md#revoke_grant_v1_access_grants_grant_id_delete) | **DELETE** /v1/access/grants/{grant_id} | Revoke Grant +[**revoke_share_token_v1_access_share_tokens_share_token_id_delete**](PublicApi.md#revoke_share_token_v1_access_share_tokens_share_token_id_delete) | **DELETE** /v1/access/share-tokens/{share_token_id} | Revoke Share Token # **application_version_details_v1_applications_application_id_versions_version_get** @@ -182,6 +190,85 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_grant_v1_access_grants_post** +> GrantReadResponse create_grant_v1_access_grants_post(grant_create_request) + +Create Grant + +Create a grant to share access to a resource with a subject (user or organization). + +### Example + +* OAuth Authentication (OAuth2AuthorizationCodeBearer): + +```python +import aignx.codegen +from aignx.codegen.models.grant_create_request import GrantCreateRequest +from aignx.codegen.models.grant_read_response import GrantReadResponse +from aignx.codegen.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api +# See configuration.py for a list of all supported configuration parameters. +configuration = aignx.codegen.Configuration( + host = "/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with aignx.codegen.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = aignx.codegen.PublicApi(api_client) + grant_create_request = aignx.codegen.GrantCreateRequest() # GrantCreateRequest | + + try: + # Create Grant + api_response = api_instance.create_grant_v1_access_grants_post(grant_create_request) + print("The response of PublicApi->create_grant_v1_access_grants_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PublicApi->create_grant_v1_access_grants_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **grant_create_request** | [**GrantCreateRequest**](GrantCreateRequest.md)| | + +### Return type + +[**GrantReadResponse**](GrantReadResponse.md) + +### Authorization + +[OAuth2AuthorizationCodeBearer](../README.md#OAuth2AuthorizationCodeBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful Response | - | +**403** | Forbidden - You don't have permission to grant access to this resource | - | +**404** | Resource not found | - | +**422** | Unprocessable Entity - Only viewer grants can be created | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **create_run_v1_runs_post** > RunCreationResponse create_run_v1_runs_post(run_creation_request) @@ -262,6 +349,83 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_share_token_v1_access_share_tokens_post** +> ShareTokenCreateResponse create_share_token_v1_access_share_tokens_post(share_token_create_request) + +Create Share Token + +Create a share token. The returned share_token value is shown only once and is never stored. Use POST /access/grants with subject_type=share_token to grant access to a resource. + +### Example + +* OAuth Authentication (OAuth2AuthorizationCodeBearer): + +```python +import aignx.codegen +from aignx.codegen.models.share_token_create_request import ShareTokenCreateRequest +from aignx.codegen.models.share_token_create_response import ShareTokenCreateResponse +from aignx.codegen.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api +# See configuration.py for a list of all supported configuration parameters. +configuration = aignx.codegen.Configuration( + host = "/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with aignx.codegen.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = aignx.codegen.PublicApi(api_client) + share_token_create_request = aignx.codegen.ShareTokenCreateRequest() # ShareTokenCreateRequest | + + try: + # Create Share Token + api_response = api_instance.create_share_token_v1_access_share_tokens_post(share_token_create_request) + print("The response of PublicApi->create_share_token_v1_access_share_tokens_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PublicApi->create_share_token_v1_access_share_tokens_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **share_token_create_request** | [**ShareTokenCreateRequest**](ShareTokenCreateRequest.md)| | + +### Return type + +[**ShareTokenCreateResponse**](ShareTokenCreateResponse.md) + +### Authorization + +[OAuth2AuthorizationCodeBearer](../README.md#OAuth2AuthorizationCodeBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **delete_run_items_v1_runs_run_id_artifacts_delete** > object delete_run_items_v1_runs_run_id_artifacts_delete(run_id) @@ -339,7 +503,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get** -> object get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get(run_id, artifact_id) +> object get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get(run_id, artifact_id, share_token=share_token) Get Artifact Url @@ -373,10 +537,11 @@ with aignx.codegen.ApiClient(configuration) as api_client: api_instance = aignx.codegen.PublicApi(api_client) run_id = 'run_id_example' # str | Run id, returned by `POST /runs/` endpoint artifact_id = 'artifact_id_example' # str | The artifact id to download + share_token = 'share_token_example' # str | Share token for accessing shared runs (optional) try: # Get Artifact Url - api_response = api_instance.get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get(run_id, artifact_id) + api_response = api_instance.get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get(run_id, artifact_id, share_token=share_token) print("The response of PublicApi->get_artifact_url_v1_runs_run_id_artifacts_artifact_id_file_get:\n") pprint(api_response) except Exception as e: @@ -392,6 +557,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **run_id** | **str**| Run id, returned by `POST /runs/` endpoint | **artifact_id** | **str**| The artifact id to download | + **share_token** | **str**| Share token for accessing shared runs | [optional] ### Return type @@ -419,8 +585,86 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_grant_v1_access_grants_grant_id_get** +> GrantReadResponse get_grant_v1_access_grants_grant_id_get(grant_id) + +Get Grant + +Get a grant by its ID. + +### Example + +* OAuth Authentication (OAuth2AuthorizationCodeBearer): + +```python +import aignx.codegen +from aignx.codegen.models.grant_read_response import GrantReadResponse +from aignx.codegen.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api +# See configuration.py for a list of all supported configuration parameters. +configuration = aignx.codegen.Configuration( + host = "/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with aignx.codegen.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = aignx.codegen.PublicApi(api_client) + grant_id = 'grant_id_example' # str | Grant ID + + try: + # Get Grant + api_response = api_instance.get_grant_v1_access_grants_grant_id_get(grant_id) + print("The response of PublicApi->get_grant_v1_access_grants_grant_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PublicApi->get_grant_v1_access_grants_grant_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **grant_id** | **str**| Grant ID | + +### Return type + +[**GrantReadResponse**](GrantReadResponse.md) + +### Authorization + +[OAuth2AuthorizationCodeBearer](../README.md#OAuth2AuthorizationCodeBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**403** | Forbidden - You don't have permission to view this grant | - | +**404** | Grant not found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_item_by_run_v1_runs_run_id_items_external_id_get** -> ItemResultReadResponse get_item_by_run_v1_runs_run_id_items_external_id_get(run_id, external_id) +> ItemResultReadResponse get_item_by_run_v1_runs_run_id_items_external_id_get(run_id, external_id, share_token=share_token) Get Item By Run @@ -455,10 +699,11 @@ with aignx.codegen.ApiClient(configuration) as api_client: api_instance = aignx.codegen.PublicApi(api_client) run_id = 'run_id_example' # str | The run id, returned by `POST /runs/` endpoint external_id = 'external_id_example' # str | The `external_id` that was defined for the item by the customer that triggered the run. + share_token = 'share_token_example' # str | Share token for accessing shared runs (optional) try: # Get Item By Run - api_response = api_instance.get_item_by_run_v1_runs_run_id_items_external_id_get(run_id, external_id) + api_response = api_instance.get_item_by_run_v1_runs_run_id_items_external_id_get(run_id, external_id, share_token=share_token) print("The response of PublicApi->get_item_by_run_v1_runs_run_id_items_external_id_get:\n") pprint(api_response) except Exception as e: @@ -474,6 +719,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **run_id** | **str**| The run id, returned by `POST /runs/` endpoint | **external_id** | **str**| The `external_id` that was defined for the item by the customer that triggered the run. | + **share_token** | **str**| Share token for accessing shared runs | [optional] ### Return type @@ -571,11 +817,11 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_run_v1_runs_run_id_get** -> RunReadResponse get_run_v1_runs_run_id_get(run_id) +> RunReadResponse get_run_v1_runs_run_id_get(run_id, share_token=share_token) Get run details -This endpoint allows the caller to retrieve the current status of a run along with other relevant run details. A run becomes available immediately after it is created through the `POST /v1/runs/` endpoint. To download the output results, use `GET /v1/runs/{run_id}/` items to get outputs for all slides. Access to a run is restricted to the user who created it. +This endpoint allows the caller to retrieve the current status of a run along with other relevant run details. A run becomes available immediately after it is created through the `POST /v1/runs/` endpoint. To download the output results, use `GET /v1/runs/{run_id}/` items to get outputs for all slides. Access to a run is restricted to the user who created it, or users with an active grant or valid share token. ### Example @@ -605,10 +851,11 @@ with aignx.codegen.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = aignx.codegen.PublicApi(api_client) run_id = 'run_id_example' # str | Run id, returned by `POST /v1/runs/` endpoint + share_token = 'share_token_example' # str | Share token for accessing shared runs (optional) try: # Get run details - api_response = api_instance.get_run_v1_runs_run_id_get(run_id) + api_response = api_instance.get_run_v1_runs_run_id_get(run_id, share_token=share_token) print("The response of PublicApi->get_run_v1_runs_run_id_get:\n") pprint(api_response) except Exception as e: @@ -623,6 +870,7 @@ with aignx.codegen.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **run_id** | **str**| Run id, returned by `POST /v1/runs/` endpoint | + **share_token** | **str**| Share token for accessing shared runs | [optional] ### Return type @@ -648,6 +896,84 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_share_token_v1_access_share_tokens_share_token_id_get** +> ShareTokenReadResponse get_share_token_v1_access_share_tokens_share_token_id_get(share_token_id) + +Get Share Token + +Get a share token by its ID. + +### Example + +* OAuth Authentication (OAuth2AuthorizationCodeBearer): + +```python +import aignx.codegen +from aignx.codegen.models.share_token_read_response import ShareTokenReadResponse +from aignx.codegen.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api +# See configuration.py for a list of all supported configuration parameters. +configuration = aignx.codegen.Configuration( + host = "/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with aignx.codegen.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = aignx.codegen.PublicApi(api_client) + share_token_id = 'share_token_id_example' # str | Share token ID + + try: + # Get Share Token + api_response = api_instance.get_share_token_v1_access_share_tokens_share_token_id_get(share_token_id) + print("The response of PublicApi->get_share_token_v1_access_share_tokens_share_token_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PublicApi->get_share_token_v1_access_share_tokens_share_token_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **share_token_id** | **str**| Share token ID | + +### Return type + +[**ShareTokenReadResponse**](ShareTokenReadResponse.md) + +### Authorization + +[OAuth2AuthorizationCodeBearer](../README.md#OAuth2AuthorizationCodeBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**403** | Forbidden - You don't have permission to view this share token | - | +**404** | Share token not found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_version_document** > VersionDocumentResponse get_version_document(application_id, version, name) @@ -966,8 +1292,100 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_run_items_v1_runs_run_id_items_get** -> List[ItemResultReadResponse] list_run_items_v1_runs_run_id_items_get(run_id, item_id__in=item_id__in, external_id__in=external_id__in, state=state, termination_reason=termination_reason, custom_metadata=custom_metadata, page=page, page_size=page_size, sort=sort) +# **list_grants_v1_access_grants_get** +> List[GrantReadResponse] list_grants_v1_access_grants_get(resource_type=resource_type, resource_id=resource_id, subject_type=subject_type, subject_id=subject_id, revoked=revoked, page=page, page_size=page_size, sort=sort) + +List Grants + +List grants. Org admins see all grants for all resources in their organization. Regular users see grants for all resources they submitted. + +### Example + +* OAuth Authentication (OAuth2AuthorizationCodeBearer): + +```python +import aignx.codegen +from aignx.codegen.models.grant_read_response import GrantReadResponse +from aignx.codegen.models.resource_type import ResourceType +from aignx.codegen.models.subject_type import SubjectType +from aignx.codegen.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api +# See configuration.py for a list of all supported configuration parameters. +configuration = aignx.codegen.Configuration( + host = "/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with aignx.codegen.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = aignx.codegen.PublicApi(api_client) + resource_type = aignx.codegen.ResourceType() # ResourceType | (optional) + resource_id = 'resource_id_example' # str | (optional) + subject_type = aignx.codegen.SubjectType() # SubjectType | (optional) + subject_id = 'subject_id_example' # str | (optional) + revoked = True # bool | (optional) + page = 1 # int | (optional) (default to 1) + page_size = 50 # int | (optional) (default to 50) + sort = ['sort_example'] # List[str] | Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. (optional) + + try: + # List Grants + api_response = api_instance.list_grants_v1_access_grants_get(resource_type=resource_type, resource_id=resource_id, subject_type=subject_type, subject_id=subject_id, revoked=revoked, page=page, page_size=page_size, sort=sort) + print("The response of PublicApi->list_grants_v1_access_grants_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PublicApi->list_grants_v1_access_grants_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **resource_type** | [**ResourceType**](.md)| | [optional] + **resource_id** | **str**| | [optional] + **subject_type** | [**SubjectType**](.md)| | [optional] + **subject_id** | **str**| | [optional] + **revoked** | **bool**| | [optional] + **page** | **int**| | [optional] [default to 1] + **page_size** | **int**| | [optional] [default to 50] + **sort** | [**List[str]**](str.md)| Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. | [optional] + +### Return type + +[**List[GrantReadResponse]**](GrantReadResponse.md) + +### Authorization + +[OAuth2AuthorizationCodeBearer](../README.md#OAuth2AuthorizationCodeBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_run_items_v1_runs_run_id_items_get** +> List[ItemResultReadResponse] list_run_items_v1_runs_run_id_items_get(run_id, share_token=share_token, item_id__in=item_id__in, external_id__in=external_id__in, state=state, termination_reason=termination_reason, custom_metadata=custom_metadata, page=page, page_size=page_size, sort=sort) List Run Items @@ -1003,6 +1421,7 @@ with aignx.codegen.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = aignx.codegen.PublicApi(api_client) run_id = 'run_id_example' # str | Run id, returned by `POST /v1/runs/` endpoint + share_token = 'share_token_example' # str | Share token for accessing shared runs (optional) item_id__in = ['item_id__in_example'] # List[str] | Filter for item ids (optional) external_id__in = ['external_id__in_example'] # List[str] | Filter for items by their external_id from the input payload (optional) state = aignx.codegen.ItemState() # ItemState | Filter items by their state (optional) @@ -1014,7 +1433,7 @@ with aignx.codegen.ApiClient(configuration) as api_client: try: # List Run Items - api_response = api_instance.list_run_items_v1_runs_run_id_items_get(run_id, item_id__in=item_id__in, external_id__in=external_id__in, state=state, termination_reason=termination_reason, custom_metadata=custom_metadata, page=page, page_size=page_size, sort=sort) + api_response = api_instance.list_run_items_v1_runs_run_id_items_get(run_id, share_token=share_token, item_id__in=item_id__in, external_id__in=external_id__in, state=state, termination_reason=termination_reason, custom_metadata=custom_metadata, page=page, page_size=page_size, sort=sort) print("The response of PublicApi->list_run_items_v1_runs_run_id_items_get:\n") pprint(api_response) except Exception as e: @@ -1029,6 +1448,7 @@ with aignx.codegen.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **run_id** | **str**| Run id, returned by `POST /v1/runs/` endpoint | + **share_token** | **str**| Share token for accessing shared runs | [optional] **item_id__in** | [**List[str]**](str.md)| Filter for item ids | [optional] **external_id__in** | [**List[str]**](str.md)| Filter for items by their external_id from the input payload | [optional] **state** | [**ItemState**](.md)| Filter items by their state | [optional] @@ -1152,6 +1572,92 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_share_tokens_v1_access_share_tokens_get** +> List[ShareTokenReadResponse] list_share_tokens_v1_access_share_tokens_get(run_id=run_id, created_by=created_by, revoked=revoked, page=page, page_size=page_size, sort=sort) + +List Share Tokens + +List share tokens. Service and Superadmin see all tokens; other users see only their own. + +### Example + +* OAuth Authentication (OAuth2AuthorizationCodeBearer): + +```python +import aignx.codegen +from aignx.codegen.models.share_token_read_response import ShareTokenReadResponse +from aignx.codegen.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api +# See configuration.py for a list of all supported configuration parameters. +configuration = aignx.codegen.Configuration( + host = "/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with aignx.codegen.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = aignx.codegen.PublicApi(api_client) + run_id = 'run_id_example' # str | Filter by run ID (optional) + created_by = 'created_by_example' # str | Filter by share token creator (optional) + revoked = True # bool | (optional) + page = 1 # int | (optional) (default to 1) + page_size = 50 # int | (optional) (default to 50) + sort = ['sort_example'] # List[str] | Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. (optional) + + try: + # List Share Tokens + api_response = api_instance.list_share_tokens_v1_access_share_tokens_get(run_id=run_id, created_by=created_by, revoked=revoked, page=page, page_size=page_size, sort=sort) + print("The response of PublicApi->list_share_tokens_v1_access_share_tokens_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PublicApi->list_share_tokens_v1_access_share_tokens_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **run_id** | **str**| Filter by run ID | [optional] + **created_by** | **str**| Filter by share token creator | [optional] + **revoked** | **bool**| | [optional] + **page** | **int**| | [optional] [default to 1] + **page_size** | **int**| | [optional] [default to 50] + **sort** | [**List[str]**](str.md)| Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. | [optional] + +### Return type + +[**List[ShareTokenReadResponse]**](ShareTokenReadResponse.md) + +### Authorization + +[OAuth2AuthorizationCodeBearer](../README.md#OAuth2AuthorizationCodeBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **list_version_documents** > List[VersionDocumentResponse] list_version_documents(application_id, version) @@ -1475,3 +1981,161 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **revoke_grant_v1_access_grants_grant_id_delete** +> GrantReadResponse revoke_grant_v1_access_grants_grant_id_delete(grant_id) + +Revoke Grant + +Revoke a grant by its ID. Sets the revoked_at timestamp on the grant. + +### Example + +* OAuth Authentication (OAuth2AuthorizationCodeBearer): + +```python +import aignx.codegen +from aignx.codegen.models.grant_read_response import GrantReadResponse +from aignx.codegen.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api +# See configuration.py for a list of all supported configuration parameters. +configuration = aignx.codegen.Configuration( + host = "/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with aignx.codegen.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = aignx.codegen.PublicApi(api_client) + grant_id = 'grant_id_example' # str | Grant ID + + try: + # Revoke Grant + api_response = api_instance.revoke_grant_v1_access_grants_grant_id_delete(grant_id) + print("The response of PublicApi->revoke_grant_v1_access_grants_grant_id_delete:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PublicApi->revoke_grant_v1_access_grants_grant_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **grant_id** | **str**| Grant ID | + +### Return type + +[**GrantReadResponse**](GrantReadResponse.md) + +### Authorization + +[OAuth2AuthorizationCodeBearer](../README.md#OAuth2AuthorizationCodeBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**403** | Forbidden - You don't have permission to revoke this grant | - | +**404** | Grant not found | - | +**409** | Conflict - Grant is already revoked | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **revoke_share_token_v1_access_share_tokens_share_token_id_delete** +> ShareTokenReadResponse revoke_share_token_v1_access_share_tokens_share_token_id_delete(share_token_id) + +Revoke Share Token + +Revoke a share token by its ID. Invalidates the credential regardless of any active grants. + +### Example + +* OAuth Authentication (OAuth2AuthorizationCodeBearer): + +```python +import aignx.codegen +from aignx.codegen.models.share_token_read_response import ShareTokenReadResponse +from aignx.codegen.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api +# See configuration.py for a list of all supported configuration parameters. +configuration = aignx.codegen.Configuration( + host = "/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with aignx.codegen.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = aignx.codegen.PublicApi(api_client) + share_token_id = 'share_token_id_example' # str | Share token ID + + try: + # Revoke Share Token + api_response = api_instance.revoke_share_token_v1_access_share_tokens_share_token_id_delete(share_token_id) + print("The response of PublicApi->revoke_share_token_v1_access_share_tokens_share_token_id_delete:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PublicApi->revoke_share_token_v1_access_share_tokens_share_token_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **share_token_id** | **str**| Share token ID | + +### Return type + +[**ShareTokenReadResponse**](ShareTokenReadResponse.md) + +### Authorization + +[OAuth2AuthorizationCodeBearer](../README.md#OAuth2AuthorizationCodeBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**403** | Forbidden - You don't have permission to revoke this share token | - | +**404** | Share token not found | - | +**409** | Conflict - Share token is already revoked | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/specifications/SPEC_PLATFORM_SERVICE.md b/specifications/SPEC_PLATFORM_SERVICE.md index 999bd0562..276d7eda3 100644 --- a/specifications/SPEC_PLATFORM_SERVICE.md +++ b/specifications/SPEC_PLATFORM_SERVICE.md @@ -395,8 +395,21 @@ class Runs(_AuthenticatedResource): # Constructor inherited from _AuthenticatedResource # def __init__(self, api: _AuthenticatedApi) -> None: - def create(self, application_version: str, items: list[ItemCreationRequest]) -> ApplicationRun: - """Creates a new application run.""" + def submit( + self, + application_version: str, + items: list[ItemCreationRequest], + callback_context: dict[str, Any] | None = None, + ) -> ApplicationRun: + """Submit run with automatic SDK metadata attachment.""" + + Args: + application_version: Version of the application to run. + items: Items (slides) to process. + callback_context: Optional opaque correlation payload (max 1 KB + serialized) forwarded verbatim to the platform and echoed in + state-change events. Not validated client-side. + """ def list( self, diff --git a/src/aignostics/platform/resources/runs.py b/src/aignostics/platform/resources/runs.py index 7a861c4b4..508a547bc 100644 --- a/src/aignostics/platform/resources/runs.py +++ b/src/aignostics/platform/resources/runs.py @@ -710,13 +710,14 @@ def __call__(self, run_id: str) -> Run: """ return Run(self._api, run_id) - def submit( + def submit( # noqa: PLR0913, PLR0917 self, application_id: str, items: list[ItemCreationRequest], application_version: str | None = None, custom_metadata: dict[str, Any] | None = None, scheduling: SchedulingRequest | None = None, + callback_context: dict[str, Any] | None = None, ) -> Run: """Submit a new application run. @@ -729,6 +730,9 @@ def submit( scheduling (SchedulingRequest | None): Optional scheduling constraints for the run. Supports 'due_date' (requested completion time, ISO 8601) and 'deadline' (hard deadline, ISO 8601). + callback_context (dict[str, Any] | None): Optional opaque correlation + payload (max 1 KB serialized) forwarded verbatim to the platform + and echoed in state-change events. Not validated client-side. Returns: Run: The submitted application run. @@ -750,6 +754,7 @@ def submit( custom_metadata=cast("dict[str, Any]", convert_to_json_serializable(custom_metadata)), items=items, scheduling=scheduling, + callback_context=callback_context, ) current_settings = settings() self._validate_input_items(payload) diff --git a/tests/aignostics/platform/resources/runs_test.py b/tests/aignostics/platform/resources/runs_test.py index e2427c308..949bc74bf 100644 --- a/tests/aignostics/platform/resources/runs_test.py +++ b/tests/aignostics/platform/resources/runs_test.py @@ -269,6 +269,55 @@ def test_runs_submit_returns_application_run(runs, mock_api) -> None: assert call_args.application_id == "test" assert call_args.items == mock_items assert call_args.version_number == "1.0.0" + assert call_args.callback_context is None + + +@pytest.mark.unit +def test_runs_submit_forwards_callback_context(runs, mock_api) -> None: + """Test that Runs.submit() forwards callback_context to RunCreationRequest verbatim.""" + run_id = "new-run-id" + mock_items = [ + ItemCreationRequest( + external_id="item-1", + input_artifacts=[ + InputArtifactCreationRequest(name="artifact-1", download_url="url", metadata={"key": "value"}) + ], + ) + ] + mock_api.create_run_v1_runs_post.return_value = RunCreationResponse(run_id=run_id) + runs._validate_input_items = Mock() + + callback_context = {"job_id": "abc-123", "trace_id": "t-7"} + runs.submit( + application_id="test", + items=mock_items, + application_version="1.0.0", + callback_context=callback_context, + ) + + call_args = mock_api.create_run_v1_runs_post.call_args[0][0] + assert call_args.callback_context == callback_context + + +@pytest.mark.unit +def test_runs_submit_omits_callback_context_when_not_provided(runs, mock_api) -> None: + """Test that Runs.submit() defaults callback_context to None on RunCreationRequest.""" + run_id = "new-run-id" + mock_items = [ + ItemCreationRequest( + external_id="item-1", + input_artifacts=[ + InputArtifactCreationRequest(name="artifact-1", download_url="url", metadata={"key": "value"}) + ], + ) + ] + mock_api.create_run_v1_runs_post.return_value = RunCreationResponse(run_id=run_id) + runs._validate_input_items = Mock() + + runs.submit(application_id="test", items=mock_items, application_version="1.0.0") + + call_args = mock_api.create_run_v1_runs_post.call_args[0][0] + assert call_args.callback_context is None @pytest.mark.unit