From 9ddfeea8b903bba093f1ac74e9f8a2b9f7c83528 Mon Sep 17 00:00:00 2001 From: Rudolf the Rabbit Date: Mon, 26 Jan 2026 18:15:06 +0000 Subject: [PATCH] chore: update OpenAPI client to 2026.01.26.1804-148d5a2 --- openapi/schemas/asset.openapi.json | 346 +++++ .../schemas/rapidata.filtered.openapi.json | 453 ++++++- openapi/schemas/rapidata.openapi.json | 453 ++++++- openapi/schemas/workflow.openapi.json | 6 +- src/rapidata/api_client/__init__.py | 1 + src/rapidata/api_client/api/__init__.py | 1 + .../api_client/api/batch_upload_api.py | 1133 +++++++++++++++++ .../api_client/models/batch_upload_status.py | 38 + .../models/batch_upload_url_status.py | 38 + .../create_batch_upload_endpoint_input.py | 87 ++ .../create_batch_upload_endpoint_output.py | 87 ++ ...get_batch_upload_result_endpoint_output.py | 106 ++ ...batch_upload_result_endpoint_url_output.py | 104 ++ ...get_batch_upload_status_endpoint_output.py | 94 ++ .../models/get_compare_ab_summary_result.py | 8 +- src/rapidata/api_client_README.md | 11 + 16 files changed, 2890 insertions(+), 76 deletions(-) create mode 100644 src/rapidata/api_client/api/batch_upload_api.py create mode 100644 src/rapidata/api_client/models/batch_upload_status.py create mode 100644 src/rapidata/api_client/models/batch_upload_url_status.py create mode 100644 src/rapidata/api_client/models/create_batch_upload_endpoint_input.py create mode 100644 src/rapidata/api_client/models/create_batch_upload_endpoint_output.py create mode 100644 src/rapidata/api_client/models/get_batch_upload_result_endpoint_output.py create mode 100644 src/rapidata/api_client/models/get_batch_upload_result_endpoint_url_output.py create mode 100644 src/rapidata/api_client/models/get_batch_upload_status_endpoint_output.py diff --git a/openapi/schemas/asset.openapi.json b/openapi/schemas/asset.openapi.json index 9b124d04a..bf937ed82 100644 --- a/openapi/schemas/asset.openapi.json +++ b/openapi/schemas/asset.openapi.json @@ -82,6 +82,186 @@ } } }, + "/asset/batch-upload/{batchUploadId}/abort": { + "post": { + "tags": [ + "BatchUpload" + ], + "summary": "Aborts the specified batch upload.", + "parameters": [ + { + "name": "batchUploadId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + } + } + }, + "/asset/batch-upload": { + "post": { + "tags": [ + "BatchUpload" + ], + "summary": "Creates a batch upload and queues processing for each URL.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBatchUploadEndpoint_Input" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBatchUploadEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + } + } + }, + "/asset/batch-upload/{batchUploadId}": { + "get": { + "tags": [ + "BatchUpload" + ], + "summary": "Gets the full result of a batch upload including all items.", + "parameters": [ + { + "name": "batchUploadId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBatchUploadResultEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + } + } + }, + "/asset/batch-upload/status": { + "get": { + "tags": [ + "BatchUpload" + ], + "summary": "Gets aggregated status (counts) for the specified batch uploads.", + "parameters": [ + { + "name": "batchUploadIds", + "in": "query", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBatchUploadStatusEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + } + } + }, "/asset/file": { "post": { "tags": [ @@ -236,12 +416,48 @@ }, "components": { "schemas": { + "BatchUploadStatus": { + "enum": [ + "Processing", + "Completed", + "Aborted" + ] + }, + "BatchUploadUrlStatus": { + "enum": [ + "Pending", + "Completed", + "Failed" + ] + }, "CompressionLibrary": { "enum": [ "ImageSharp", "NetVips" ] }, + "CreateBatchUploadEndpoint_Input": { + "required": [ + "urls" + ], + "type": "object", + "properties": { + "urls": { + "$ref": "#/components/schemas/ListOfUri" + } + } + }, + "CreateBatchUploadEndpoint_Output": { + "required": [ + "batchUploadId" + ], + "type": "object", + "properties": { + "batchUploadId": { + "type": "string" + } + } + }, "FileType": { "enum": [ "Unknown", @@ -250,6 +466,89 @@ "Audio" ] }, + "GetBatchUploadResultEndpoint_Output": { + "required": [ + "batchUploadId", + "status", + "totalCount", + "completedCount", + "failedCount", + "items" + ], + "type": "object", + "properties": { + "batchUploadId": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/BatchUploadStatus" + }, + "totalCount": { + "type": "integer", + "format": "int32" + }, + "completedCount": { + "type": "integer", + "format": "int32" + }, + "failedCount": { + "type": "integer", + "format": "int32" + }, + "items": { + "$ref": "#/components/schemas/ListOfGetBatchUploadResultEndpoint_UrlOutput" + } + } + }, + "GetBatchUploadResultEndpoint_UrlOutput": { + "required": [ + "url", + "status" + ], + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "fileName": { + "type": "string", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/BatchUploadUrlStatus" + }, + "errorMessage": { + "type": "string", + "nullable": true + } + } + }, + "GetBatchUploadStatusEndpoint_Output": { + "required": [ + "status", + "totalCount", + "completedCount", + "failedCount" + ], + "type": "object", + "properties": { + "status": { + "$ref": "#/components/schemas/BatchUploadStatus" + }, + "totalCount": { + "type": "integer", + "format": "int32" + }, + "completedCount": { + "type": "integer", + "format": "int32" + }, + "failedCount": { + "type": "integer", + "format": "int32" + } + } + }, "GetFileMetadataResult": { "required": [ "metadata" @@ -536,6 +835,19 @@ } } }, + "ListOfGetBatchUploadResultEndpoint_UrlOutput": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetBatchUploadResultEndpoint_UrlOutput" + } + }, + "ListOfUri": { + "type": "array", + "items": { + "type": "string", + "format": "uri" + } + }, "MetadataCollection": { "type": "object", "additionalProperties": { @@ -608,6 +920,40 @@ "format": "int64" } } + }, + "ValidationProblemDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer", + "format": "int32" + }, + "detail": { + "type": "string", + "nullable": true + }, + "instance": { + "type": "string", + "nullable": true + }, + "errors": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + } } }, "securitySchemes": { diff --git a/openapi/schemas/rapidata.filtered.openapi.json b/openapi/schemas/rapidata.filtered.openapi.json index 939fd182a..bbebfd590 100644 --- a/openapi/schemas/rapidata.filtered.openapi.json +++ b/openapi/schemas/rapidata.filtered.openapi.json @@ -15,6 +15,10 @@ "name": "Asset", "x-displayName": "Asset" }, + { + "name": "BatchUpload", + "x-displayName": "BatchUpload" + }, { "name": "Audience", "x-displayName": "Audience" @@ -207,6 +211,246 @@ ] } }, + "/asset/batch-upload/{batchUploadId}/abort": { + "post": { + "tags": [ + "BatchUpload" + ], + "summary": "Aborts the specified batch upload.", + "parameters": [ + { + "name": "batchUploadId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "Bearer": [], + "OpenIdConnect": [ + "openid", + "profile", + "email" + ], + "OAuth2": [ + "openid", + "profile", + "email" + ] + } + ] + } + }, + "/asset/batch-upload": { + "post": { + "tags": [ + "BatchUpload" + ], + "summary": "Creates a batch upload and queues processing for each URL.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBatchUploadEndpoint_Input" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBatchUploadEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "Bearer": [], + "OpenIdConnect": [ + "openid", + "profile", + "email" + ], + "OAuth2": [ + "openid", + "profile", + "email" + ] + } + ] + } + }, + "/asset/batch-upload/{batchUploadId}": { + "get": { + "tags": [ + "BatchUpload" + ], + "summary": "Gets the full result of a batch upload including all items.", + "parameters": [ + { + "name": "batchUploadId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBatchUploadResultEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "Bearer": [], + "OpenIdConnect": [ + "openid", + "profile", + "email" + ], + "OAuth2": [ + "openid", + "profile", + "email" + ] + } + ] + } + }, + "/asset/batch-upload/status": { + "get": { + "tags": [ + "BatchUpload" + ], + "summary": "Gets aggregated status (counts) for the specified batch uploads.", + "parameters": [ + { + "name": "batchUploadIds", + "in": "query", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBatchUploadStatusEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "Bearer": [], + "OpenIdConnect": [ + "openid", + "profile", + "email" + ], + "OAuth2": [ + "openid", + "profile", + "email" + ] + } + ] + } + }, "/asset/file": { "post": { "tags": [ @@ -9084,12 +9328,48 @@ }, "components": { "schemas": { + "BatchUploadStatus": { + "enum": [ + "Processing", + "Completed", + "Aborted" + ] + }, + "BatchUploadUrlStatus": { + "enum": [ + "Pending", + "Completed", + "Failed" + ] + }, "CompressionLibrary": { "enum": [ "ImageSharp", "NetVips" ] }, + "CreateBatchUploadEndpoint_Input": { + "required": [ + "urls" + ], + "type": "object", + "properties": { + "urls": { + "$ref": "#/components/schemas/ListOfUri" + } + } + }, + "CreateBatchUploadEndpoint_Output": { + "required": [ + "batchUploadId" + ], + "type": "object", + "properties": { + "batchUploadId": { + "type": "string" + } + } + }, "FileType": { "enum": [ "Unknown", @@ -9098,6 +9378,89 @@ "Audio" ] }, + "GetBatchUploadResultEndpoint_Output": { + "required": [ + "batchUploadId", + "status", + "totalCount", + "completedCount", + "failedCount", + "items" + ], + "type": "object", + "properties": { + "batchUploadId": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/BatchUploadStatus" + }, + "totalCount": { + "type": "integer", + "format": "int32" + }, + "completedCount": { + "type": "integer", + "format": "int32" + }, + "failedCount": { + "type": "integer", + "format": "int32" + }, + "items": { + "$ref": "#/components/schemas/ListOfGetBatchUploadResultEndpoint_UrlOutput" + } + } + }, + "GetBatchUploadResultEndpoint_UrlOutput": { + "required": [ + "url", + "status" + ], + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "fileName": { + "type": "string", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/BatchUploadUrlStatus" + }, + "errorMessage": { + "type": "string", + "nullable": true + } + } + }, + "GetBatchUploadStatusEndpoint_Output": { + "required": [ + "status", + "totalCount", + "completedCount", + "failedCount" + ], + "type": "object", + "properties": { + "status": { + "$ref": "#/components/schemas/BatchUploadStatus" + }, + "totalCount": { + "type": "integer", + "format": "int32" + }, + "completedCount": { + "type": "integer", + "format": "int32" + }, + "failedCount": { + "type": "integer", + "format": "int32" + } + } + }, "GetFileMetadataResult": { "required": [ "metadata" @@ -9384,6 +9747,19 @@ } } }, + "ListOfGetBatchUploadResultEndpoint_UrlOutput": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetBatchUploadResultEndpoint_UrlOutput" + } + }, + "ListOfUri": { + "type": "array", + "items": { + "type": "string", + "format": "uri" + } + }, "MetadataCollection": { "type": "object", "additionalProperties": { @@ -9457,6 +9833,40 @@ } } }, + "ValidationProblemDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer", + "format": "int32" + }, + "detail": { + "type": "string", + "nullable": true + }, + "instance": { + "type": "string", + "nullable": true + }, + "errors": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, "AddRapidToAudienceModel": { "required": [ "asset", @@ -11497,40 +11907,6 @@ } } }, - "ValidationProblemDetails": { - "type": "object", - "properties": { - "type": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true - }, - "status": { - "type": "integer", - "format": "int32" - }, - "detail": { - "type": "string", - "nullable": true - }, - "instance": { - "type": "string", - "nullable": true - }, - "errors": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, "BoostingProfile": { "type": "object", "properties": { @@ -19371,7 +19747,8 @@ }, "GetCompareAbSummaryResult": { "required": [ - "winCounter" + "winCounter", + "allTargetGroupsCompleted" ], "type": "object", "properties": { @@ -19381,6 +19758,9 @@ "type": "number", "format": "double" } + }, + "allTargetGroupsCompleted": { + "type": "boolean" } } }, @@ -20180,7 +20560,8 @@ { "name": "Rapidata Asset API", "tags": [ - "Asset" + "Asset", + "BatchUpload" ] }, { diff --git a/openapi/schemas/rapidata.openapi.json b/openapi/schemas/rapidata.openapi.json index 47ddff2e9..9fe7af956 100644 --- a/openapi/schemas/rapidata.openapi.json +++ b/openapi/schemas/rapidata.openapi.json @@ -15,6 +15,10 @@ "name": "Asset", "x-displayName": "Asset" }, + { + "name": "BatchUpload", + "x-displayName": "BatchUpload" + }, { "name": "Audience", "x-displayName": "Audience" @@ -207,6 +211,246 @@ ] } }, + "/asset/batch-upload/{batchUploadId}/abort": { + "post": { + "tags": [ + "BatchUpload" + ], + "summary": "Aborts the specified batch upload.", + "parameters": [ + { + "name": "batchUploadId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "Bearer": [], + "OpenIdConnect": [ + "openid", + "profile", + "email" + ], + "OAuth2": [ + "openid", + "profile", + "email" + ] + } + ] + } + }, + "/asset/batch-upload": { + "post": { + "tags": [ + "BatchUpload" + ], + "summary": "Creates a batch upload and queues processing for each URL.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBatchUploadEndpoint_Input" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBatchUploadEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "Bearer": [], + "OpenIdConnect": [ + "openid", + "profile", + "email" + ], + "OAuth2": [ + "openid", + "profile", + "email" + ] + } + ] + } + }, + "/asset/batch-upload/{batchUploadId}": { + "get": { + "tags": [ + "BatchUpload" + ], + "summary": "Gets the full result of a batch upload including all items.", + "parameters": [ + { + "name": "batchUploadId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBatchUploadResultEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "Bearer": [], + "OpenIdConnect": [ + "openid", + "profile", + "email" + ], + "OAuth2": [ + "openid", + "profile", + "email" + ] + } + ] + } + }, + "/asset/batch-upload/status": { + "get": { + "tags": [ + "BatchUpload" + ], + "summary": "Gets aggregated status (counts) for the specified batch uploads.", + "parameters": [ + { + "name": "batchUploadIds", + "in": "query", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBatchUploadStatusEndpoint_Output" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthenticated" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "Bearer": [], + "OpenIdConnect": [ + "openid", + "profile", + "email" + ], + "OAuth2": [ + "openid", + "profile", + "email" + ] + } + ] + } + }, "/asset/file": { "post": { "tags": [ @@ -10109,12 +10353,48 @@ }, "components": { "schemas": { + "BatchUploadStatus": { + "enum": [ + "Processing", + "Completed", + "Aborted" + ] + }, + "BatchUploadUrlStatus": { + "enum": [ + "Pending", + "Completed", + "Failed" + ] + }, "CompressionLibrary": { "enum": [ "ImageSharp", "NetVips" ] }, + "CreateBatchUploadEndpoint_Input": { + "required": [ + "urls" + ], + "type": "object", + "properties": { + "urls": { + "$ref": "#/components/schemas/ListOfUri" + } + } + }, + "CreateBatchUploadEndpoint_Output": { + "required": [ + "batchUploadId" + ], + "type": "object", + "properties": { + "batchUploadId": { + "type": "string" + } + } + }, "FileType": { "enum": [ "Unknown", @@ -10123,6 +10403,89 @@ "Audio" ] }, + "GetBatchUploadResultEndpoint_Output": { + "required": [ + "batchUploadId", + "status", + "totalCount", + "completedCount", + "failedCount", + "items" + ], + "type": "object", + "properties": { + "batchUploadId": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/BatchUploadStatus" + }, + "totalCount": { + "type": "integer", + "format": "int32" + }, + "completedCount": { + "type": "integer", + "format": "int32" + }, + "failedCount": { + "type": "integer", + "format": "int32" + }, + "items": { + "$ref": "#/components/schemas/ListOfGetBatchUploadResultEndpoint_UrlOutput" + } + } + }, + "GetBatchUploadResultEndpoint_UrlOutput": { + "required": [ + "url", + "status" + ], + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "fileName": { + "type": "string", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/BatchUploadUrlStatus" + }, + "errorMessage": { + "type": "string", + "nullable": true + } + } + }, + "GetBatchUploadStatusEndpoint_Output": { + "required": [ + "status", + "totalCount", + "completedCount", + "failedCount" + ], + "type": "object", + "properties": { + "status": { + "$ref": "#/components/schemas/BatchUploadStatus" + }, + "totalCount": { + "type": "integer", + "format": "int32" + }, + "completedCount": { + "type": "integer", + "format": "int32" + }, + "failedCount": { + "type": "integer", + "format": "int32" + } + } + }, "GetFileMetadataResult": { "required": [ "metadata" @@ -10409,6 +10772,19 @@ } } }, + "ListOfGetBatchUploadResultEndpoint_UrlOutput": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetBatchUploadResultEndpoint_UrlOutput" + } + }, + "ListOfUri": { + "type": "array", + "items": { + "type": "string", + "format": "uri" + } + }, "MetadataCollection": { "type": "object", "additionalProperties": { @@ -10482,6 +10858,40 @@ } } }, + "ValidationProblemDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer", + "format": "int32" + }, + "detail": { + "type": "string", + "nullable": true + }, + "instance": { + "type": "string", + "nullable": true + }, + "errors": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, "AddRapidToAudienceModel": { "required": [ "asset", @@ -12522,40 +12932,6 @@ } } }, - "ValidationProblemDetails": { - "type": "object", - "properties": { - "type": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true - }, - "status": { - "type": "integer", - "format": "int32" - }, - "detail": { - "type": "string", - "nullable": true - }, - "instance": { - "type": "string", - "nullable": true - }, - "errors": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, "BoostingProfile": { "type": "object", "properties": { @@ -20396,7 +20772,8 @@ }, "GetCompareAbSummaryResult": { "required": [ - "winCounter" + "winCounter", + "allTargetGroupsCompleted" ], "type": "object", "properties": { @@ -20406,6 +20783,9 @@ "type": "number", "format": "double" } + }, + "allTargetGroupsCompleted": { + "type": "boolean" } } }, @@ -21205,7 +21585,8 @@ { "name": "Rapidata Asset API", "tags": [ - "Asset" + "Asset", + "BatchUpload" ] }, { diff --git a/openapi/schemas/workflow.openapi.json b/openapi/schemas/workflow.openapi.json index c9f3adcd4..d67545ed5 100644 --- a/openapi/schemas/workflow.openapi.json +++ b/openapi/schemas/workflow.openapi.json @@ -595,7 +595,8 @@ }, "GetCompareAbSummaryResult": { "required": [ - "winCounter" + "winCounter", + "allTargetGroupsCompleted" ], "type": "object", "properties": { @@ -605,6 +606,9 @@ "type": "number", "format": "double" } + }, + "allTargetGroupsCompleted": { + "type": "boolean" } } }, diff --git a/src/rapidata/api_client/__init__.py b/src/rapidata/api_client/__init__.py index 386381a79..12be5c8fb 100644 --- a/src/rapidata/api_client/__init__.py +++ b/src/rapidata/api_client/__init__.py @@ -31,6 +31,7 @@ _API_IMPORTS = { "AssetApi": "rapidata.api_client.api.asset_api", "AudienceApi": "rapidata.api_client.api.audience_api", + "BatchUploadApi": "rapidata.api_client.api.batch_upload_api", "BenchmarkApi": "rapidata.api_client.api.benchmark_api", "CampaignApi": "rapidata.api_client.api.campaign_api", "ClientApi": "rapidata.api_client.api.client_api", diff --git a/src/rapidata/api_client/api/__init__.py b/src/rapidata/api_client/api/__init__.py index 95661e24e..f3c64b618 100644 --- a/src/rapidata/api_client/api/__init__.py +++ b/src/rapidata/api_client/api/__init__.py @@ -3,6 +3,7 @@ # import apis into api package from rapidata.api_client.api.asset_api import AssetApi from rapidata.api_client.api.audience_api import AudienceApi +from rapidata.api_client.api.batch_upload_api import BatchUploadApi from rapidata.api_client.api.benchmark_api import BenchmarkApi from rapidata.api_client.api.campaign_api import CampaignApi from rapidata.api_client.api.client_api import ClientApi diff --git a/src/rapidata/api_client/api/batch_upload_api.py b/src/rapidata/api_client/api/batch_upload_api.py new file mode 100644 index 000000000..9e30f44a6 --- /dev/null +++ b/src/rapidata/api_client/api/batch_upload_api.py @@ -0,0 +1,1133 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from typing import List +from rapidata.api_client.models.create_batch_upload_endpoint_input import CreateBatchUploadEndpointInput +from rapidata.api_client.models.create_batch_upload_endpoint_output import CreateBatchUploadEndpointOutput +from rapidata.api_client.models.get_batch_upload_result_endpoint_output import GetBatchUploadResultEndpointOutput +from rapidata.api_client.models.get_batch_upload_status_endpoint_output import GetBatchUploadStatusEndpointOutput + +from rapidata.api_client.api_client import ApiClient, RequestSerialized +from rapidata.api_client.api_response import ApiResponse +from rapidata.api_client.rest import RESTResponseType + + +class BatchUploadApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def asset_batch_upload_batch_upload_id_abort_post( + self, + batch_upload_id: 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: + """Aborts the specified batch upload. + + + :param batch_upload_id: (required) + :type batch_upload_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 + (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._asset_batch_upload_batch_upload_id_abort_post_serialize( + batch_upload_id=batch_upload_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + 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 asset_batch_upload_batch_upload_id_abort_post_with_http_info( + self, + batch_upload_id: 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]: + """Aborts the specified batch upload. + + + :param batch_upload_id: (required) + :type batch_upload_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 + (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._asset_batch_upload_batch_upload_id_abort_post_serialize( + batch_upload_id=batch_upload_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + 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 asset_batch_upload_batch_upload_id_abort_post_without_preload_content( + self, + batch_upload_id: 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: + """Aborts the specified batch upload. + + + :param batch_upload_id: (required) + :type batch_upload_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 + (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._asset_batch_upload_batch_upload_id_abort_post_serialize( + batch_upload_id=batch_upload_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _asset_batch_upload_batch_upload_id_abort_post_serialize( + self, + batch_upload_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 batch_upload_id is not None: + _path_params['batchUploadId'] = batch_upload_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] = [ + 'OAuth2', + 'OpenIdConnect', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/asset/batch-upload/{batchUploadId}/abort', + 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 asset_batch_upload_batch_upload_id_get( + self, + batch_upload_id: 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, + ) -> GetBatchUploadResultEndpointOutput: + """Gets the full result of a batch upload including all items. + + + :param batch_upload_id: (required) + :type batch_upload_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 + (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._asset_batch_upload_batch_upload_id_get_serialize( + batch_upload_id=batch_upload_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetBatchUploadResultEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + 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 asset_batch_upload_batch_upload_id_get_with_http_info( + self, + batch_upload_id: 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[GetBatchUploadResultEndpointOutput]: + """Gets the full result of a batch upload including all items. + + + :param batch_upload_id: (required) + :type batch_upload_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 + (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._asset_batch_upload_batch_upload_id_get_serialize( + batch_upload_id=batch_upload_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetBatchUploadResultEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + 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 asset_batch_upload_batch_upload_id_get_without_preload_content( + self, + batch_upload_id: 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: + """Gets the full result of a batch upload including all items. + + + :param batch_upload_id: (required) + :type batch_upload_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 + (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._asset_batch_upload_batch_upload_id_get_serialize( + batch_upload_id=batch_upload_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetBatchUploadResultEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _asset_batch_upload_batch_upload_id_get_serialize( + self, + batch_upload_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 batch_upload_id is not None: + _path_params['batchUploadId'] = batch_upload_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] = [ + 'OAuth2', + 'OpenIdConnect', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/asset/batch-upload/{batchUploadId}', + 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 asset_batch_upload_post( + self, + create_batch_upload_endpoint_input: CreateBatchUploadEndpointInput, + _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, + ) -> CreateBatchUploadEndpointOutput: + """Creates a batch upload and queues processing for each URL. + + + :param create_batch_upload_endpoint_input: (required) + :type create_batch_upload_endpoint_input: CreateBatchUploadEndpointInput + :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._asset_batch_upload_post_serialize( + create_batch_upload_endpoint_input=create_batch_upload_endpoint_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateBatchUploadEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + 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 asset_batch_upload_post_with_http_info( + self, + create_batch_upload_endpoint_input: CreateBatchUploadEndpointInput, + _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[CreateBatchUploadEndpointOutput]: + """Creates a batch upload and queues processing for each URL. + + + :param create_batch_upload_endpoint_input: (required) + :type create_batch_upload_endpoint_input: CreateBatchUploadEndpointInput + :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._asset_batch_upload_post_serialize( + create_batch_upload_endpoint_input=create_batch_upload_endpoint_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateBatchUploadEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + 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 asset_batch_upload_post_without_preload_content( + self, + create_batch_upload_endpoint_input: CreateBatchUploadEndpointInput, + _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: + """Creates a batch upload and queues processing for each URL. + + + :param create_batch_upload_endpoint_input: (required) + :type create_batch_upload_endpoint_input: CreateBatchUploadEndpointInput + :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._asset_batch_upload_post_serialize( + create_batch_upload_endpoint_input=create_batch_upload_endpoint_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateBatchUploadEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _asset_batch_upload_post_serialize( + self, + create_batch_upload_endpoint_input, + _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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_batch_upload_endpoint_input is not None: + _body_params = create_batch_upload_endpoint_input + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # 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] = [ + 'OAuth2', + 'OpenIdConnect', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/asset/batch-upload', + 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 asset_batch_upload_status_get( + self, + batch_upload_ids: List[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, + ) -> GetBatchUploadStatusEndpointOutput: + """Gets aggregated status (counts) for the specified batch uploads. + + + :param batch_upload_ids: (required) + :type batch_upload_ids: 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._asset_batch_upload_status_get_serialize( + batch_upload_ids=batch_upload_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetBatchUploadStatusEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + 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 asset_batch_upload_status_get_with_http_info( + self, + batch_upload_ids: List[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[GetBatchUploadStatusEndpointOutput]: + """Gets aggregated status (counts) for the specified batch uploads. + + + :param batch_upload_ids: (required) + :type batch_upload_ids: 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._asset_batch_upload_status_get_serialize( + batch_upload_ids=batch_upload_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetBatchUploadStatusEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + 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 asset_batch_upload_status_get_without_preload_content( + self, + batch_upload_ids: List[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: + """Gets aggregated status (counts) for the specified batch uploads. + + + :param batch_upload_ids: (required) + :type batch_upload_ids: 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._asset_batch_upload_status_get_serialize( + batch_upload_ids=batch_upload_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetBatchUploadStatusEndpointOutput", + '400': "ValidationProblemDetails", + '401': None, + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _asset_batch_upload_status_get_serialize( + self, + batch_upload_ids, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'batchUploadIds': '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 batch_upload_ids is not None: + + _query_params.append(('batchUploadIds', batch_upload_ids)) + + # 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] = [ + 'OAuth2', + 'OpenIdConnect', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/asset/batch-upload/status', + 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 + ) + + diff --git a/src/rapidata/api_client/models/batch_upload_status.py b/src/rapidata/api_client/models/batch_upload_status.py new file mode 100644 index 000000000..9af992a60 --- /dev/null +++ b/src/rapidata/api_client/models/batch_upload_status.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + 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 BatchUploadStatus(str, Enum): + """ + BatchUploadStatus + """ + + """ + allowed enum values + """ + PROCESSING = 'Processing' + COMPLETED = 'Completed' + ABORTED = 'Aborted' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BatchUploadStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/src/rapidata/api_client/models/batch_upload_url_status.py b/src/rapidata/api_client/models/batch_upload_url_status.py new file mode 100644 index 000000000..2c50925e4 --- /dev/null +++ b/src/rapidata/api_client/models/batch_upload_url_status.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + 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 BatchUploadUrlStatus(str, Enum): + """ + BatchUploadUrlStatus + """ + + """ + allowed enum values + """ + PENDING = 'Pending' + COMPLETED = 'Completed' + FAILED = 'Failed' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BatchUploadUrlStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/src/rapidata/api_client/models/create_batch_upload_endpoint_input.py b/src/rapidata/api_client/models/create_batch_upload_endpoint_input.py new file mode 100644 index 000000000..3c9f4c2ee --- /dev/null +++ b/src/rapidata/api_client/models/create_batch_upload_endpoint_input.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + 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 +from typing import Optional, Set +from typing_extensions import Self + +class CreateBatchUploadEndpointInput(BaseModel): + """ + CreateBatchUploadEndpointInput + """ # noqa: E501 + urls: List[StrictStr] + __properties: ClassVar[List[str]] = ["urls"] + + 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 CreateBatchUploadEndpointInput 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 CreateBatchUploadEndpointInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "urls": obj.get("urls") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/create_batch_upload_endpoint_output.py b/src/rapidata/api_client/models/create_batch_upload_endpoint_output.py new file mode 100644 index 000000000..9cf793dca --- /dev/null +++ b/src/rapidata/api_client/models/create_batch_upload_endpoint_output.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + 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, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreateBatchUploadEndpointOutput(BaseModel): + """ + CreateBatchUploadEndpointOutput + """ # noqa: E501 + batch_upload_id: StrictStr = Field(alias="batchUploadId") + __properties: ClassVar[List[str]] = ["batchUploadId"] + + 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 CreateBatchUploadEndpointOutput 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 CreateBatchUploadEndpointOutput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "batchUploadId": obj.get("batchUploadId") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/get_batch_upload_result_endpoint_output.py b/src/rapidata/api_client/models/get_batch_upload_result_endpoint_output.py new file mode 100644 index 000000000..69ab2bdd5 --- /dev/null +++ b/src/rapidata/api_client/models/get_batch_upload_result_endpoint_output.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + 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, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from rapidata.api_client.models.batch_upload_status import BatchUploadStatus +from rapidata.api_client.models.get_batch_upload_result_endpoint_url_output import GetBatchUploadResultEndpointUrlOutput +from typing import Optional, Set +from typing_extensions import Self + +class GetBatchUploadResultEndpointOutput(BaseModel): + """ + GetBatchUploadResultEndpointOutput + """ # noqa: E501 + batch_upload_id: StrictStr = Field(alias="batchUploadId") + status: BatchUploadStatus + total_count: StrictInt = Field(alias="totalCount") + completed_count: StrictInt = Field(alias="completedCount") + failed_count: StrictInt = Field(alias="failedCount") + items: List[GetBatchUploadResultEndpointUrlOutput] + __properties: ClassVar[List[str]] = ["batchUploadId", "status", "totalCount", "completedCount", "failedCount", "items"] + + 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 GetBatchUploadResultEndpointOutput 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetBatchUploadResultEndpointOutput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "batchUploadId": obj.get("batchUploadId"), + "status": obj.get("status"), + "totalCount": obj.get("totalCount"), + "completedCount": obj.get("completedCount"), + "failedCount": obj.get("failedCount"), + "items": [GetBatchUploadResultEndpointUrlOutput.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/src/rapidata/api_client/models/get_batch_upload_result_endpoint_url_output.py b/src/rapidata/api_client/models/get_batch_upload_result_endpoint_url_output.py new file mode 100644 index 000000000..3af493ba5 --- /dev/null +++ b/src/rapidata/api_client/models/get_batch_upload_result_endpoint_url_output.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + 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, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from rapidata.api_client.models.batch_upload_url_status import BatchUploadUrlStatus +from typing import Optional, Set +from typing_extensions import Self + +class GetBatchUploadResultEndpointUrlOutput(BaseModel): + """ + GetBatchUploadResultEndpointUrlOutput + """ # noqa: E501 + url: StrictStr + file_name: Optional[StrictStr] = Field(default=None, alias="fileName") + status: BatchUploadUrlStatus + error_message: Optional[StrictStr] = Field(default=None, alias="errorMessage") + __properties: ClassVar[List[str]] = ["url", "fileName", "status", "errorMessage"] + + 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 GetBatchUploadResultEndpointUrlOutput 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 file_name (nullable) is None + # and model_fields_set contains the field + if self.file_name is None and "file_name" in self.model_fields_set: + _dict['fileName'] = None + + # set to None if error_message (nullable) is None + # and model_fields_set contains the field + if self.error_message is None and "error_message" in self.model_fields_set: + _dict['errorMessage'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetBatchUploadResultEndpointUrlOutput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "url": obj.get("url"), + "fileName": obj.get("fileName"), + "status": obj.get("status"), + "errorMessage": obj.get("errorMessage") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/get_batch_upload_status_endpoint_output.py b/src/rapidata/api_client/models/get_batch_upload_status_endpoint_output.py new file mode 100644 index 000000000..ae9cb6026 --- /dev/null +++ b/src/rapidata/api_client/models/get_batch_upload_status_endpoint_output.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + 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, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from rapidata.api_client.models.batch_upload_status import BatchUploadStatus +from typing import Optional, Set +from typing_extensions import Self + +class GetBatchUploadStatusEndpointOutput(BaseModel): + """ + GetBatchUploadStatusEndpointOutput + """ # noqa: E501 + status: BatchUploadStatus + total_count: StrictInt = Field(alias="totalCount") + completed_count: StrictInt = Field(alias="completedCount") + failed_count: StrictInt = Field(alias="failedCount") + __properties: ClassVar[List[str]] = ["status", "totalCount", "completedCount", "failedCount"] + + 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 GetBatchUploadStatusEndpointOutput 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 GetBatchUploadStatusEndpointOutput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "totalCount": obj.get("totalCount"), + "completedCount": obj.get("completedCount"), + "failedCount": obj.get("failedCount") + }) + return _obj + + diff --git a/src/rapidata/api_client/models/get_compare_ab_summary_result.py b/src/rapidata/api_client/models/get_compare_ab_summary_result.py index e7835126b..8af72f459 100644 --- a/src/rapidata/api_client/models/get_compare_ab_summary_result.py +++ b/src/rapidata/api_client/models/get_compare_ab_summary_result.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self @@ -27,7 +27,8 @@ class GetCompareAbSummaryResult(BaseModel): GetCompareAbSummaryResult """ # noqa: E501 win_counter: Dict[str, Union[StrictFloat, StrictInt]] = Field(alias="winCounter") - __properties: ClassVar[List[str]] = ["winCounter"] + all_target_groups_completed: StrictBool = Field(alias="allTargetGroupsCompleted") + __properties: ClassVar[List[str]] = ["winCounter", "allTargetGroupsCompleted"] model_config = ConfigDict( populate_by_name=True, @@ -80,7 +81,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "winCounter": obj.get("winCounter") + "winCounter": obj.get("winCounter"), + "allTargetGroupsCompleted": obj.get("allTargetGroupsCompleted") }) return _obj diff --git a/src/rapidata/api_client_README.md b/src/rapidata/api_client_README.md index a07eef483..ecd27764c 100644 --- a/src/rapidata/api_client_README.md +++ b/src/rapidata/api_client_README.md @@ -91,6 +91,10 @@ Class | Method | HTTP request | Description *AudienceApi* | [**audience_audience_id_user_metrics_get**](rapidata/api_client/docs/AudienceApi.md#audience_audience_id_user_metrics_get) | **GET** /audience/{audienceId}/user-metrics | Gets the count of users in each state for the specified audience. *AudienceApi* | [**audience_post**](rapidata/api_client/docs/AudienceApi.md#audience_post) | **POST** /audience | Creates a new empty audience. *AudienceApi* | [**audiences_get**](rapidata/api_client/docs/AudienceApi.md#audiences_get) | **GET** /audiences | Queries all available audiences. +*BatchUploadApi* | [**asset_batch_upload_batch_upload_id_abort_post**](rapidata/api_client/docs/BatchUploadApi.md#asset_batch_upload_batch_upload_id_abort_post) | **POST** /asset/batch-upload/{batchUploadId}/abort | Aborts the specified batch upload. +*BatchUploadApi* | [**asset_batch_upload_batch_upload_id_get**](rapidata/api_client/docs/BatchUploadApi.md#asset_batch_upload_batch_upload_id_get) | **GET** /asset/batch-upload/{batchUploadId} | Gets the full result of a batch upload including all items. +*BatchUploadApi* | [**asset_batch_upload_post**](rapidata/api_client/docs/BatchUploadApi.md#asset_batch_upload_post) | **POST** /asset/batch-upload | Creates a batch upload and queues processing for each URL. +*BatchUploadApi* | [**asset_batch_upload_status_get**](rapidata/api_client/docs/BatchUploadApi.md#asset_batch_upload_status_get) | **GET** /asset/batch-upload/status | Gets aggregated status (counts) for the specified batch uploads. *BenchmarkApi* | [**benchmark_benchmark_id_delete**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_delete) | **DELETE** /benchmark/{benchmarkId} | Deletes a single benchmark. *BenchmarkApi* | [**benchmark_benchmark_id_fork_post**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_fork_post) | **POST** /benchmark/{benchmarkId}/fork | Creates a copy of a public benchmark and all of its related entities *BenchmarkApi* | [**benchmark_benchmark_id_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_get) | **GET** /benchmark/{benchmarkId} | Returns a single benchmark by its ID. @@ -242,6 +246,8 @@ Class | Method | HTTP request | Description - [AttachCategoryRapidBlueprintCategory](rapidata/api_client/docs/AttachCategoryRapidBlueprintCategory.md) - [AudienceJobState](rapidata/api_client/docs/AudienceJobState.md) - [AudienceStatus](rapidata/api_client/docs/AudienceStatus.md) + - [BatchUploadStatus](rapidata/api_client/docs/BatchUploadStatus.md) + - [BatchUploadUrlStatus](rapidata/api_client/docs/BatchUploadUrlStatus.md) - [BenchmarkQueryResult](rapidata/api_client/docs/BenchmarkQueryResult.md) - [BoostLeaderboardModel](rapidata/api_client/docs/BoostLeaderboardModel.md) - [BoostingProfile](rapidata/api_client/docs/BoostingProfile.md) @@ -261,6 +267,8 @@ Class | Method | HTTP request | Description - [ConfidenceInterval](rapidata/api_client/docs/ConfidenceInterval.md) - [CreateAudienceRequest](rapidata/api_client/docs/CreateAudienceRequest.md) - [CreateAudienceResult](rapidata/api_client/docs/CreateAudienceResult.md) + - [CreateBatchUploadEndpointInput](rapidata/api_client/docs/CreateBatchUploadEndpointInput.md) + - [CreateBatchUploadEndpointOutput](rapidata/api_client/docs/CreateBatchUploadEndpointOutput.md) - [CreateBenchmarkModel](rapidata/api_client/docs/CreateBenchmarkModel.md) - [CreateBenchmarkParticipantModel](rapidata/api_client/docs/CreateBenchmarkParticipantModel.md) - [CreateBenchmarkParticipantResult](rapidata/api_client/docs/CreateBenchmarkParticipantResult.md) @@ -307,6 +315,9 @@ Class | Method | HTTP request | Description - [GetAudienceByIdResult](rapidata/api_client/docs/GetAudienceByIdResult.md) - [GetAudienceUserStateMetricsResult](rapidata/api_client/docs/GetAudienceUserStateMetricsResult.md) - [GetAvailableValidationSetsResult](rapidata/api_client/docs/GetAvailableValidationSetsResult.md) + - [GetBatchUploadResultEndpointOutput](rapidata/api_client/docs/GetBatchUploadResultEndpointOutput.md) + - [GetBatchUploadResultEndpointUrlOutput](rapidata/api_client/docs/GetBatchUploadResultEndpointUrlOutput.md) + - [GetBatchUploadStatusEndpointOutput](rapidata/api_client/docs/GetBatchUploadStatusEndpointOutput.md) - [GetBenchmarkByIdResult](rapidata/api_client/docs/GetBenchmarkByIdResult.md) - [GetBoostResult](rapidata/api_client/docs/GetBoostResult.md) - [GetBoostResultBoostMode](rapidata/api_client/docs/GetBoostResultBoostMode.md)