diff --git a/deepsearch/core/util/ccs_utils.py b/deepsearch/core/util/ccs_utils.py deleted file mode 100644 index 313049aa..00000000 --- a/deepsearch/core/util/ccs_utils.py +++ /dev/null @@ -1,13 +0,0 @@ -from deepsearch import CpsApi -from deepsearch.cps.apis import public as sw_client - - -def get_ccs_project_key(api: CpsApi, cps_proj_key: str): - """ - Given a cps project key, returns ccs project key and collection name. - """ - sw_api = sw_client.ProjectApi(api.client.swagger_client) - request_ccs_project_key = sw_api.get_project_default_values(proj_key=cps_proj_key) - ccs_proj_key = request_ccs_project_key.ccs_project.proj_key - collection_name = request_ccs_project_key.ccs_project.collection_name - return (ccs_proj_key, collection_name) diff --git a/deepsearch/cps/apis/public_v2/__init__.py b/deepsearch/cps/apis/public_v2/__init__.py index 0347f6a8..2bd01157 100644 --- a/deepsearch/cps/apis/public_v2/__init__.py +++ b/deepsearch/cps/apis/public_v2/__init__.py @@ -42,70 +42,166 @@ from deepsearch.cps.apis.public_v2.exceptions import ApiException # import models into sdk package +from deepsearch.cps.apis.public_v2.models.abstract import Abstract +from deepsearch.cps.apis.public_v2.models.acquisition import Acquisition +from deepsearch.cps.apis.public_v2.models.add_annotations import AddAnnotations +from deepsearch.cps.apis.public_v2.models.add_raw_pages import AddRawPages +from deepsearch.cps.apis.public_v2.models.affiliation import Affiliation +from deepsearch.cps.apis.public_v2.models.affiliations import Affiliations +from deepsearch.cps.apis.public_v2.models.agent_name import AgentName +from deepsearch.cps.apis.public_v2.models.aggs import Aggs +from deepsearch.cps.apis.public_v2.models.alias import Alias +from deepsearch.cps.apis.public_v2.models.aliases import Aliases +from deepsearch.cps.apis.public_v2.models.alternate_names import AlternateNames +from deepsearch.cps.apis.public_v2.models.api_server_fastapi_server_public_models_data_indices_upload_models_http_source import ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource +from deepsearch.cps.apis.public_v2.models.api_server_fastapi_server_public_models_data_indices_upload_models_identifier import ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier +from deepsearch.cps.apis.public_v2.models.api_server_fastapi_server_public_models_project_models_http_source import ApiServerFastapiServerPublicModelsProjectModelsHttpSource from deepsearch.cps.apis.public_v2.models.assemble_mode import AssembleMode from deepsearch.cps.apis.public_v2.models.assemble_settings import AssembleSettings from deepsearch.cps.apis.public_v2.models.attachment_upload_data import AttachmentUploadData from deepsearch.cps.apis.public_v2.models.attachment_upload_request_body import AttachmentUploadRequestBody +from deepsearch.cps.apis.public_v2.models.author import Author +from deepsearch.cps.apis.public_v2.models.authors import Authors +from deepsearch.cps.apis.public_v2.models.backend import Backend +from deepsearch.cps.apis.public_v2.models.backend_settings import BackendSettings from deepsearch.cps.apis.public_v2.models.bag_flavour_full_data import BagFlavourFullData +from deepsearch.cps.apis.public_v2.models.begin_date import BeginDate from deepsearch.cps.apis.public_v2.models.ccs_project import CCSProject from deepsearch.cps.apis.public_v2.models.cps_package import CPSPackage from deepsearch.cps.apis.public_v2.models.cps_summary import CPSSummary -from deepsearch.cps.apis.public_v2.models.ccs_task import CcsTask +from deepsearch.cps.apis.public_v2.models.citation_count import CitationCount +from deepsearch.cps.apis.public_v2.models.citation_count_date import CitationCountDate +from deepsearch.cps.apis.public_v2.models.code import Code +from deepsearch.cps.apis.public_v2.models.collection_document_info_str import CollectionDocumentInfoStr from deepsearch.cps.apis.public_v2.models.collection_metadata_settings import CollectionMetadataSettings +from deepsearch.cps.apis.public_v2.models.comment import Comment +from deepsearch.cps.apis.public_v2.models.completed_at import CompletedAt from deepsearch.cps.apis.public_v2.models.config import Config +from deepsearch.cps.apis.public_v2.models.conversion_settings import ConversionSettings from deepsearch.cps.apis.public_v2.models.convert_document_request import ConvertDocumentRequest +from deepsearch.cps.apis.public_v2.models.convert_document_request_file_source import ConvertDocumentRequestFileSource +from deepsearch.cps.apis.public_v2.models.convert_document_request_http_source import ConvertDocumentRequestHttpSource +from deepsearch.cps.apis.public_v2.models.convert_document_request_image_urls import ConvertDocumentRequestImageUrls +from deepsearch.cps.apis.public_v2.models.convert_document_request_settings import ConvertDocumentRequestSettings from deepsearch.cps.apis.public_v2.models.convert_documents_request_body import ConvertDocumentsRequestBody +from deepsearch.cps.apis.public_v2.models.convert_documents_request_body_target_settings import ConvertDocumentsRequestBodyTargetSettings from deepsearch.cps.apis.public_v2.models.convert_documents_sources import ConvertDocumentsSources +from deepsearch.cps.apis.public_v2.models.convert_documents_sources_s3_source import ConvertDocumentsSourcesS3Source from deepsearch.cps.apis.public_v2.models.convert_upload_documents_request_body import ConvertUploadDocumentsRequestBody +from deepsearch.cps.apis.public_v2.models.convert_upload_documents_request_body_meta import ConvertUploadDocumentsRequestBodyMeta from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask +from deepsearch.cps.apis.public_v2.models.created import Created from deepsearch.cps.apis.public_v2.models.data import Data from deepsearch.cps.apis.public_v2.models.data_flow import DataFlow from deepsearch.cps.apis.public_v2.models.data_index_upload_file_source import DataIndexUploadFileSource +from deepsearch.cps.apis.public_v2.models.dc_key import DcKey +from deepsearch.cps.apis.public_v2.models.decode_secrets import DecodeSecrets from deepsearch.cps.apis.public_v2.models.default_values import DefaultValues +from deepsearch.cps.apis.public_v2.models.default_values_dataflow import DefaultValuesDataflow from deepsearch.cps.apis.public_v2.models.deployment import Deployment +from deepsearch.cps.apis.public_v2.models.description import Description +from deepsearch.cps.apis.public_v2.models.description_license import DescriptionLicense from deepsearch.cps.apis.public_v2.models.direct_model_config import DirectModelConfig +from deepsearch.cps.apis.public_v2.models.display_name import DisplayName +from deepsearch.cps.apis.public_v2.models.docling_core_types_base_identifier import DoclingCoreTypesBaseIdentifier from deepsearch.cps.apis.public_v2.models.document_artifacts import DocumentArtifacts +from deepsearch.cps.apis.public_v2.models.document_artifacts_document_meta_json import DocumentArtifactsDocumentMetaJson from deepsearch.cps.apis.public_v2.models.document_artifacts_item import DocumentArtifactsItem from deepsearch.cps.apis.public_v2.models.document_artifacts_page_item import DocumentArtifactsPageItem +from deepsearch.cps.apis.public_v2.models.document_description import DocumentDescription +from deepsearch.cps.apis.public_v2.models.document_description_acquisition import DocumentDescriptionAcquisition +from deepsearch.cps.apis.public_v2.models.document_description_advanced import DocumentDescriptionAdvanced +from deepsearch.cps.apis.public_v2.models.document_description_license import DocumentDescriptionLicense +from deepsearch.cps.apis.public_v2.models.document_hashes import DocumentHashes +from deepsearch.cps.apis.public_v2.models.document_meta import DocumentMeta +from deepsearch.cps.apis.public_v2.models.document_meta_description import DocumentMetaDescription from deepsearch.cps.apis.public_v2.models.document_statistics import DocumentStatistics +from deepsearch.cps.apis.public_v2.models.domain import Domain from deepsearch.cps.apis.public_v2.models.elastic_index_property_object import ElasticIndexPropertyObject from deepsearch.cps.apis.public_v2.models.elastic_index_property_primitive import ElasticIndexPropertyPrimitive from deepsearch.cps.apis.public_v2.models.elastic_index_search_query_options import ElasticIndexSearchQueryOptions from deepsearch.cps.apis.public_v2.models.elastic_index_source import ElasticIndexSource from deepsearch.cps.apis.public_v2.models.elastic_instance_data_index import ElasticInstanceDataIndex from deepsearch.cps.apis.public_v2.models.elastic_metadata import ElasticMetadata +from deepsearch.cps.apis.public_v2.models.enabled import Enabled +from deepsearch.cps.apis.public_v2.models.end_date import EndDate +from deepsearch.cps.apis.public_v2.models.error_reason import ErrorReason from deepsearch.cps.apis.public_v2.models.file_source import FileSource +from deepsearch.cps.apis.public_v2.models.file_uri import FileUri +from deepsearch.cps.apis.public_v2.models.file_url import FileUrl +from deepsearch.cps.apis.public_v2.models.filename import Filename from deepsearch.cps.apis.public_v2.models.flavour import Flavour from deepsearch.cps.apis.public_v2.models.flavours_default_quota import FlavoursDefaultQuota from deepsearch.cps.apis.public_v2.models.flavours_quota import FlavoursQuota from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock import GenAIAWSBedrock from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_config import GenAIAWSBedrockConfig +from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_proj_params import GenAIAWSBedrockProjParams from deepsearch.cps.apis.public_v2.models.gen_aibam import GenAIBAM from deepsearch.cps.apis.public_v2.models.gen_aibam_config import GenAIBAMConfig +from deepsearch.cps.apis.public_v2.models.gen_aicpd import GenAICPD +from deepsearch.cps.apis.public_v2.models.gen_aicpd_config import GenAICPDConfig from deepsearch.cps.apis.public_v2.models.gen_aihf_inference_api import GenAIHFInferenceApi from deepsearch.cps.apis.public_v2.models.gen_aihf_inference_api_config import GenAIHFInferenceApiConfig +from deepsearch.cps.apis.public_v2.models.gen_ai_openai import GenAIOpenai +from deepsearch.cps.apis.public_v2.models.gen_ai_openai_config import GenAIOpenaiConfig from deepsearch.cps.apis.public_v2.models.gen_ai_params import GenAIParams from deepsearch.cps.apis.public_v2.models.gen_ai_partial_params import GenAIPartialParams from deepsearch.cps.apis.public_v2.models.gen_ai_watsonx import GenAIWatsonx from deepsearch.cps.apis.public_v2.models.gen_ai_watsonx_config import GenAIWatsonxConfig +from deepsearch.cps.apis.public_v2.models.genai_cpd_api_key import GenaiCpdApiKey +from deepsearch.cps.apis.public_v2.models.genai_cpd_password import GenaiCpdPassword from deepsearch.cps.apis.public_v2.models.grouped_project_documents import GroupedProjectDocuments from deepsearch.cps.apis.public_v2.models.http_validation_error import HTTPValidationError +from deepsearch.cps.apis.public_v2.models.head_url import HeadUrl +from deepsearch.cps.apis.public_v2.models.headers import Headers from deepsearch.cps.apis.public_v2.models.http_source import HttpSource -from deepsearch.cps.apis.public_v2.models.internal_url import InternalUrl +from deepsearch.cps.apis.public_v2.models.id import Id +from deepsearch.cps.apis.public_v2.models.identifiers import Identifiers +from deepsearch.cps.apis.public_v2.models.identifiers1 import Identifiers1 +from deepsearch.cps.apis.public_v2.models.ignore_above import IgnoreAbove +from deepsearch.cps.apis.public_v2.models.image_urls_info import ImageUrlsInfo +from deepsearch.cps.apis.public_v2.models.issue import Issue from deepsearch.cps.apis.public_v2.models.json_upload_request_body import JsonUploadRequestBody +from deepsearch.cps.apis.public_v2.models.key_prefix import KeyPrefix +from deepsearch.cps.apis.public_v2.models.keywords import Keywords +from deepsearch.cps.apis.public_v2.models.kg_key import KgKey +from deepsearch.cps.apis.public_v2.models.languages import Languages +from deepsearch.cps.apis.public_v2.models.license import License +from deepsearch.cps.apis.public_v2.models.link import Link from deepsearch.cps.apis.public_v2.models.list_project_flavours import ListProjectFlavours +from deepsearch.cps.apis.public_v2.models.log import Log +from deepsearch.cps.apis.public_v2.models.merge_mode import MergeMode +from deepsearch.cps.apis.public_v2.models.model_date import ModelDate +from deepsearch.cps.apis.public_v2.models.model_from import ModelFrom +from deepsearch.cps.apis.public_v2.models.model_id import ModelId from deepsearch.cps.apis.public_v2.models.model_pipeline_settings import ModelPipelineSettings from deepsearch.cps.apis.public_v2.models.model_pipeline_settings_clusters_inner import ModelPipelineSettingsClustersInner from deepsearch.cps.apis.public_v2.models.modules_config import ModulesConfig +from deepsearch.cps.apis.public_v2.models.name import Name +from deepsearch.cps.apis.public_v2.models.number_pages import NumberPages +from deepsearch.cps.apis.public_v2.models.ocr_options import OCROptions +from deepsearch.cps.apis.public_v2.models.object_keys import ObjectKeys from deepsearch.cps.apis.public_v2.models.ocr_settings import OcrSettings from deepsearch.cps.apis.public_v2.models.package import Package +from deepsearch.cps.apis.public_v2.models.page import Page +from deepsearch.cps.apis.public_v2.models.page_labels import PageLabels +from deepsearch.cps.apis.public_v2.models.pages import Pages +from deepsearch.cps.apis.public_v2.models.params import Params from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters import PartialDirectConversionParameters +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_assemble import PartialDirectConversionParametersAssemble +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_metadata import PartialDirectConversionParametersMetadata +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_model_pipeline import PartialDirectConversionParametersModelPipeline +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_ocr import PartialDirectConversionParametersOcr +from deepsearch.cps.apis.public_v2.models.proj_key import ProjKey from deepsearch.cps.apis.public_v2.models.project_agent import ProjectAgent from deepsearch.cps.apis.public_v2.models.project_agents import ProjectAgents +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_input import ProjectDataIndexConversionSettingsInput +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_output import ProjectDataIndexConversionSettingsOutput from deepsearch.cps.apis.public_v2.models.project_data_index_non_view import ProjectDataIndexNonView from deepsearch.cps.apis.public_v2.models.project_data_index_source import ProjectDataIndexSource from deepsearch.cps.apis.public_v2.models.project_data_index_view import ProjectDataIndexView from deepsearch.cps.apis.public_v2.models.project_data_index_with_status import ProjectDataIndexWithStatus +from deepsearch.cps.apis.public_v2.models.project_data_index_with_status_metadata import ProjectDataIndexWithStatusMetadata from deepsearch.cps.apis.public_v2.models.project_document import ProjectDocument from deepsearch.cps.apis.public_v2.models.project_document_url import ProjectDocumentURL from deepsearch.cps.apis.public_v2.models.project_documents import ProjectDocuments @@ -116,35 +212,86 @@ from deepsearch.cps.apis.public_v2.models.project_scratch_files_paginated import ProjectScratchFilesPaginated from deepsearch.cps.apis.public_v2.models.project_source_data_index import ProjectSourceDataIndex from deepsearch.cps.apis.public_v2.models.projects_flavours import ProjectsFlavours +from deepsearch.cps.apis.public_v2.models.prompt_template import PromptTemplate from deepsearch.cps.apis.public_v2.models.properties import Properties +from deepsearch.cps.apis.public_v2.models.provenance import Provenance +from deepsearch.cps.apis.public_v2.models.publication import Publication +from deepsearch.cps.apis.public_v2.models.publication1 import Publication1 +from deepsearch.cps.apis.public_v2.models.publication_date import PublicationDate +from deepsearch.cps.apis.public_v2.models.publishers import Publishers +from deepsearch.cps.apis.public_v2.models.query import Query +from deepsearch.cps.apis.public_v2.models.record_properties import RecordProperties +from deepsearch.cps.apis.public_v2.models.ref_uri import RefUri +from deepsearch.cps.apis.public_v2.models.reference_count import ReferenceCount from deepsearch.cps.apis.public_v2.models.reference_to_model import ReferenceToModel +from deepsearch.cps.apis.public_v2.models.references import References +from deepsearch.cps.apis.public_v2.models.related_tasks import RelatedTasks from deepsearch.cps.apis.public_v2.models.response_document_artifacts import ResponseDocumentArtifacts +from deepsearch.cps.apis.public_v2.models.response_get_project_data_index_conversion_settings import ResponseGetProjectDataIndexConversionSettings from deepsearch.cps.apis.public_v2.models.response_get_project_integration_config_genai import ResponseGetProjectIntegrationConfigGenai from deepsearch.cps.apis.public_v2.models.response_grouped_documents import ResponseGroupedDocuments +from deepsearch.cps.apis.public_v2.models.response_update_project_data_index_conversion_settings import ResponseUpdateProjectDataIndexConversionSettings from deepsearch.cps.apis.public_v2.models.response_upload_jobs import ResponseUploadJobs from deepsearch.cps.apis.public_v2.models.s3_coordinates import S3Coordinates from deepsearch.cps.apis.public_v2.models.s3_document_source import S3DocumentSource +from deepsearch.cps.apis.public_v2.models.schema_key import SchemaKey +from deepsearch.cps.apis.public_v2.models.scratch_ids import ScratchIds +from deepsearch.cps.apis.public_v2.models.search_string import SearchString from deepsearch.cps.apis.public_v2.models.semantic_ingest_req_params import SemanticIngestReqParams from deepsearch.cps.apis.public_v2.models.semantic_ingest_request import SemanticIngestRequest from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_private_data_collection import SemanticIngestSourcePrivateDataCollection from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_private_data_document import SemanticIngestSourcePrivateDataDocument from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_public_data_document import SemanticIngestSourcePublicDataDocument from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_url import SemanticIngestSourceUrl +from deepsearch.cps.apis.public_v2.models.size import Size +from deepsearch.cps.apis.public_v2.models.size1 import Size1 +from deepsearch.cps.apis.public_v2.models.sort import Sort from deepsearch.cps.apis.public_v2.models.source import Source from deepsearch.cps.apis.public_v2.models.source1 import Source1 +from deepsearch.cps.apis.public_v2.models.source2 import Source2 +from deepsearch.cps.apis.public_v2.models.source3 import Source3 +from deepsearch.cps.apis.public_v2.models.source4 import Source4 +from deepsearch.cps.apis.public_v2.models.start_count import StartCount +from deepsearch.cps.apis.public_v2.models.started_at import StartedAt +from deepsearch.cps.apis.public_v2.models.status import Status +from deepsearch.cps.apis.public_v2.models.status_filter import StatusFilter +from deepsearch.cps.apis.public_v2.models.storage import Storage from deepsearch.cps.apis.public_v2.models.storage_summary_task import StorageSummaryTask +from deepsearch.cps.apis.public_v2.models.subjects import Subjects from deepsearch.cps.apis.public_v2.models.system_info import SystemInfo +from deepsearch.cps.apis.public_v2.models.table_former_mode import TableFormerMode +from deepsearch.cps.apis.public_v2.models.table_structure_options import TableStructureOptions from deepsearch.cps.apis.public_v2.models.target_conversion_parameters import TargetConversionParameters +from deepsearch.cps.apis.public_v2.models.task import Task from deepsearch.cps.apis.public_v2.models.task_context import TaskContext from deepsearch.cps.apis.public_v2.models.task_result import TaskResult +from deepsearch.cps.apis.public_v2.models.task_type import TaskType from deepsearch.cps.apis.public_v2.models.temporary_upload_file_result import TemporaryUploadFileResult from deepsearch.cps.apis.public_v2.models.temporary_url import TemporaryUrl from deepsearch.cps.apis.public_v2.models.temporary_url_fields import TemporaryUrlFields +from deepsearch.cps.apis.public_v2.models.term import Term +from deepsearch.cps.apis.public_v2.models.text import Text +from deepsearch.cps.apis.public_v2.models.timeout import Timeout +from deepsearch.cps.apis.public_v2.models.title import Title from deepsearch.cps.apis.public_v2.models.token_response import TokenResponse +from deepsearch.cps.apis.public_v2.models.truncate_pages import TruncatePages +from deepsearch.cps.apis.public_v2.models.type import Type +from deepsearch.cps.apis.public_v2.models.type1 import Type1 from deepsearch.cps.apis.public_v2.models.upload_date import UploadDate from deepsearch.cps.apis.public_v2.models.upload_elastic_request_body import UploadElasticRequestBody from deepsearch.cps.apis.public_v2.models.upload_job import UploadJob +from deepsearch.cps.apis.public_v2.models.upload_to_elastic import UploadToElastic +from deepsearch.cps.apis.public_v2.models.url import Url +from deepsearch.cps.apis.public_v2.models.url_refs import UrlRefs from deepsearch.cps.apis.public_v2.models.urls import Urls from deepsearch.cps.apis.public_v2.models.validation_error import ValidationError from deepsearch.cps.apis.public_v2.models.validation_error_loc_inner import ValidationErrorLocInner +from deepsearch.cps.apis.public_v2.models.version import Version +from deepsearch.cps.apis.public_v2.models.version1 import Version1 from deepsearch.cps.apis.public_v2.models.view_of import ViewOf +from deepsearch.cps.apis.public_v2.models.view_of1 import ViewOf1 +from deepsearch.cps.apis.public_v2.models.volume import Volume +from deepsearch.cps.apis.public_v2.models.wait import Wait +from deepsearch.cps.apis.public_v2.models.wait1 import Wait1 +from deepsearch.cps.apis.public_v2.models.with_operations import WithOperations +from deepsearch.cps.apis.public_v2.models.without_operations import WithoutOperations diff --git a/deepsearch/cps/apis/public_v2/api/content_manager_api.py b/deepsearch/cps/apis/public_v2/api/content_manager_api.py index 94930ef8..37068ae4 100644 --- a/deepsearch/cps/apis/public_v2/api/content_manager_api.py +++ b/deepsearch/cps/apis/public_v2/api/content_manager_api.py @@ -16,8 +16,9 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictInt, StrictStr, field_validator -from typing import Optional +from pydantic import StrictInt, StrictStr +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.document_meta import DocumentMeta from deepsearch.cps.apis.public_v2.models.document_statistics import DocumentStatistics from deepsearch.cps.apis.public_v2.models.project_agents import ProjectAgents from deepsearch.cps.apis.public_v2.models.project_document import ProjectDocument @@ -26,6 +27,7 @@ from deepsearch.cps.apis.public_v2.models.response_document_artifacts import ResponseDocumentArtifacts from deepsearch.cps.apis.public_v2.models.response_grouped_documents import ResponseGroupedDocuments from deepsearch.cps.apis.public_v2.models.response_upload_jobs import ResponseUploadJobs +from deepsearch.cps.apis.public_v2.models.status_filter import StatusFilter from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized from deepsearch.cps.apis.public_v2.api_response import ApiResponse @@ -45,6 +47,325 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def add_project_data_index_document_metadata( + self, + index_key: StrictStr, + document_hash: StrictStr, + proj_key: StrictStr, + document_meta: DocumentMeta, + _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: + """Add Project Data Index Document Metadata + + Insert project document metadata. + + :param index_key: (required) + :type index_key: str + :param document_hash: (required) + :type document_hash: str + :param proj_key: (required) + :type proj_key: str + :param document_meta: (required) + :type document_meta: DocumentMeta + :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._add_project_data_index_document_metadata_serialize( + index_key=index_key, + document_hash=document_hash, + proj_key=proj_key, + document_meta=document_meta, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 add_project_data_index_document_metadata_with_http_info( + self, + index_key: StrictStr, + document_hash: StrictStr, + proj_key: StrictStr, + document_meta: DocumentMeta, + _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]: + """Add Project Data Index Document Metadata + + Insert project document metadata. + + :param index_key: (required) + :type index_key: str + :param document_hash: (required) + :type document_hash: str + :param proj_key: (required) + :type proj_key: str + :param document_meta: (required) + :type document_meta: DocumentMeta + :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._add_project_data_index_document_metadata_serialize( + index_key=index_key, + document_hash=document_hash, + proj_key=proj_key, + document_meta=document_meta, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 add_project_data_index_document_metadata_without_preload_content( + self, + index_key: StrictStr, + document_hash: StrictStr, + proj_key: StrictStr, + document_meta: DocumentMeta, + _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: + """Add Project Data Index Document Metadata + + Insert project document metadata. + + :param index_key: (required) + :type index_key: str + :param document_hash: (required) + :type document_hash: str + :param proj_key: (required) + :type proj_key: str + :param document_meta: (required) + :type document_meta: DocumentMeta + :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._add_project_data_index_document_metadata_serialize( + index_key=index_key, + document_hash=document_hash, + proj_key=proj_key, + document_meta=document_meta, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_project_data_index_document_metadata_serialize( + self, + index_key, + document_hash, + proj_key, + document_meta, + _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, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if index_key is not None: + _path_params['index_key'] = index_key + if document_hash is not None: + _path_params['document_hash'] = document_hash + if proj_key is not None: + _path_params['proj_key'] = proj_key + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if document_meta is not None: + _body_params = document_meta + + + # set the HTTP header `Accept` + _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] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/metadata', + 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_all_project_data_index_documents( self, @@ -1189,8 +1510,8 @@ def get_project_data_index_document_events( index_key: StrictStr, document_hash: StrictStr, proj_key: StrictStr, - agent_name: Optional[StrictStr] = None, - status: Optional[StrictStr] = None, + agent_name: Optional[Any] = None, + status: Optional[StatusFilter] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1215,9 +1536,9 @@ def get_project_data_index_document_events( :param proj_key: (required) :type proj_key: str :param agent_name: - :type agent_name: str + :type agent_name: AgentName :param status: - :type status: str + :type status: StatusFilter :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 @@ -1273,8 +1594,8 @@ def get_project_data_index_document_events_with_http_info( index_key: StrictStr, document_hash: StrictStr, proj_key: StrictStr, - agent_name: Optional[StrictStr] = None, - status: Optional[StrictStr] = None, + agent_name: Optional[Any] = None, + status: Optional[StatusFilter] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1299,9 +1620,9 @@ def get_project_data_index_document_events_with_http_info( :param proj_key: (required) :type proj_key: str :param agent_name: - :type agent_name: str + :type agent_name: AgentName :param status: - :type status: str + :type status: StatusFilter :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 @@ -1357,8 +1678,8 @@ def get_project_data_index_document_events_without_preload_content( index_key: StrictStr, document_hash: StrictStr, proj_key: StrictStr, - agent_name: Optional[StrictStr] = None, - status: Optional[StrictStr] = None, + agent_name: Optional[Any] = None, + status: Optional[StatusFilter] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1383,9 +1704,9 @@ def get_project_data_index_document_events_without_preload_content( :param proj_key: (required) :type proj_key: str :param agent_name: - :type agent_name: str + :type agent_name: AgentName :param status: - :type status: str + :type status: StatusFilter :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 @@ -1470,7 +1791,7 @@ def _get_project_data_index_document_events_serialize( if status is not None: - _query_params.append(('status', status)) + _query_params.append(('status', status.value)) # process the header parameters # process the form parameters @@ -2096,7 +2417,7 @@ def get_project_data_index_documents( index_key: StrictStr, agent_name: StrictStr, proj_key: StrictStr, - status: Optional[StrictStr] = None, + status: Optional[StatusFilter] = None, page: Optional[StrictInt] = None, page_size: Optional[StrictInt] = None, _request_timeout: Union[ @@ -2123,7 +2444,7 @@ def get_project_data_index_documents( :param proj_key: (required) :type proj_key: str :param status: - :type status: str + :type status: StatusFilter :param page: :type page: int :param page_size: @@ -2184,7 +2505,7 @@ def get_project_data_index_documents_with_http_info( index_key: StrictStr, agent_name: StrictStr, proj_key: StrictStr, - status: Optional[StrictStr] = None, + status: Optional[StatusFilter] = None, page: Optional[StrictInt] = None, page_size: Optional[StrictInt] = None, _request_timeout: Union[ @@ -2211,7 +2532,7 @@ def get_project_data_index_documents_with_http_info( :param proj_key: (required) :type proj_key: str :param status: - :type status: str + :type status: StatusFilter :param page: :type page: int :param page_size: @@ -2272,7 +2593,7 @@ def get_project_data_index_documents_without_preload_content( index_key: StrictStr, agent_name: StrictStr, proj_key: StrictStr, - status: Optional[StrictStr] = None, + status: Optional[StatusFilter] = None, page: Optional[StrictInt] = None, page_size: Optional[StrictInt] = None, _request_timeout: Union[ @@ -2299,7 +2620,7 @@ def get_project_data_index_documents_without_preload_content( :param proj_key: (required) :type proj_key: str :param status: - :type status: str + :type status: StatusFilter :param page: :type page: int :param page_size: @@ -2386,7 +2707,7 @@ def _get_project_data_index_documents_serialize( # process the query parameters if status is not None: - _query_params.append(('status', status)) + _query_params.append(('status', status.value)) if page is not None: @@ -2438,7 +2759,7 @@ def get_project_data_index_grouped_documents( index_key: StrictStr, agent_name: StrictStr, proj_key: StrictStr, - status: Optional[StrictStr] = None, + status: Optional[StatusFilter] = None, page: Optional[StrictInt] = None, page_size: Optional[StrictInt] = None, _request_timeout: Union[ @@ -2465,7 +2786,7 @@ def get_project_data_index_grouped_documents( :param proj_key: (required) :type proj_key: str :param status: - :type status: str + :type status: StatusFilter :param page: :type page: int :param page_size: @@ -2526,7 +2847,7 @@ def get_project_data_index_grouped_documents_with_http_info( index_key: StrictStr, agent_name: StrictStr, proj_key: StrictStr, - status: Optional[StrictStr] = None, + status: Optional[StatusFilter] = None, page: Optional[StrictInt] = None, page_size: Optional[StrictInt] = None, _request_timeout: Union[ @@ -2553,7 +2874,7 @@ def get_project_data_index_grouped_documents_with_http_info( :param proj_key: (required) :type proj_key: str :param status: - :type status: str + :type status: StatusFilter :param page: :type page: int :param page_size: @@ -2614,7 +2935,7 @@ def get_project_data_index_grouped_documents_without_preload_content( index_key: StrictStr, agent_name: StrictStr, proj_key: StrictStr, - status: Optional[StrictStr] = None, + status: Optional[StatusFilter] = None, page: Optional[StrictInt] = None, page_size: Optional[StrictInt] = None, _request_timeout: Union[ @@ -2641,7 +2962,7 @@ def get_project_data_index_grouped_documents_without_preload_content( :param proj_key: (required) :type proj_key: str :param status: - :type status: str + :type status: StatusFilter :param page: :type page: int :param page_size: @@ -2728,7 +3049,7 @@ def _get_project_data_index_grouped_documents_serialize( # process the query parameters if status is not None: - _query_params.append(('status', status)) + _query_params.append(('status', status.value)) if page is not None: diff --git a/deepsearch/cps/apis/public_v2/api/data_indices_api.py b/deepsearch/cps/apis/public_v2/api/data_indices_api.py index f6824042..bd9578bc 100644 --- a/deepsearch/cps/apis/public_v2/api/data_indices_api.py +++ b/deepsearch/cps/apis/public_v2/api/data_indices_api.py @@ -18,7 +18,10 @@ from pydantic import StrictStr from deepsearch.cps.apis.public_v2.models.data import Data +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_input import ProjectDataIndexConversionSettingsInput from deepsearch.cps.apis.public_v2.models.project_data_index_with_status import ProjectDataIndexWithStatus +from deepsearch.cps.apis.public_v2.models.response_get_project_data_index_conversion_settings import ResponseGetProjectDataIndexConversionSettings +from deepsearch.cps.apis.public_v2.models.response_update_project_data_index_conversion_settings import ResponseUpdateProjectDataIndexConversionSettings from deepsearch.cps.apis.public_v2.models.token_response import TokenResponse from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized @@ -1173,6 +1176,282 @@ def _get_project_data_index_serialize( + @validate_call + def get_project_data_index_conversion_settings( + self, + index_key: StrictStr, + proj_key: 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, + ) -> ResponseGetProjectDataIndexConversionSettings: + """Get Project Data Index Conversion Settings + + Get project data index conversion settings. + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: 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_project_data_index_conversion_settings_serialize( + index_key=index_key, + proj_key=proj_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResponseGetProjectDataIndexConversionSettings", + '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_project_data_index_conversion_settings_with_http_info( + self, + index_key: StrictStr, + proj_key: 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[ResponseGetProjectDataIndexConversionSettings]: + """Get Project Data Index Conversion Settings + + Get project data index conversion settings. + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: 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_project_data_index_conversion_settings_serialize( + index_key=index_key, + proj_key=proj_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResponseGetProjectDataIndexConversionSettings", + '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_project_data_index_conversion_settings_without_preload_content( + self, + index_key: StrictStr, + proj_key: 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 Project Data Index Conversion Settings + + Get project data index conversion settings. + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: 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_project_data_index_conversion_settings_serialize( + index_key=index_key, + proj_key=proj_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResponseGetProjectDataIndexConversionSettings", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_project_data_index_conversion_settings_serialize( + self, + index_key, + proj_key, + _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, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if index_key is not None: + _path_params['index_key'] = index_key + if proj_key is not None: + _path_params['proj_key'] = proj_key + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/project/{proj_key}/data_indices/{index_key}/conversion_settings', + 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_project_data_indices( self, @@ -1189,7 +1468,143 @@ def get_project_data_indices( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[ProjectDataIndexWithStatus]: + ) -> List[ProjectDataIndexWithStatus]: + """Get Project Data Indices + + Get project data indices. + + :param proj_key: (required) + :type proj_key: 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_project_data_indices_serialize( + proj_key=proj_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectDataIndexWithStatus]", + '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_project_data_indices_with_http_info( + self, + proj_key: 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[List[ProjectDataIndexWithStatus]]: + """Get Project Data Indices + + Get project data indices. + + :param proj_key: (required) + :type proj_key: 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_project_data_indices_serialize( + proj_key=proj_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectDataIndexWithStatus]", + '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_project_data_indices_without_preload_content( + self, + proj_key: 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 Project Data Indices Get project data indices. @@ -1234,6 +1649,139 @@ def get_project_data_indices( *_param, _request_timeout=_request_timeout ) + return response_data.response + + + def _get_project_data_indices_serialize( + self, + proj_key, + _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, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if proj_key is not None: + _path_params['proj_key'] = proj_key + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/project/{proj_key}/data_indices', + 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 update_project_data_index( + self, + index_key: StrictStr, + proj_key: StrictStr, + data: Data, + _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, + ) -> ProjectDataIndexWithStatus: + """Update Project Data Index + + Update a project data index. + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param data: (required) + :type data: Data + :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._update_project_data_index_serialize( + index_key=index_key, + proj_key=proj_key, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectDataIndexWithStatus", + '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, @@ -1242,9 +1790,11 @@ def get_project_data_indices( @validate_call - def get_project_data_indices_with_http_info( + def update_project_data_index_with_http_info( self, + index_key: StrictStr, proj_key: StrictStr, + data: Data, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1257,13 +1807,17 @@ def get_project_data_indices_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[ProjectDataIndexWithStatus]]: - """Get Project Data Indices + ) -> ApiResponse[ProjectDataIndexWithStatus]: + """Update Project Data Index - Get project data indices. + Update a project data index. + :param index_key: (required) + :type index_key: str :param proj_key: (required) :type proj_key: str + :param data: (required) + :type data: Data :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,8 +1840,10 @@ def get_project_data_indices_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_project_data_indices_serialize( + _param = self._update_project_data_index_serialize( + index_key=index_key, proj_key=proj_key, + data=data, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1295,7 +1851,7 @@ def get_project_data_indices_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ProjectDataIndexWithStatus]", + '200': "ProjectDataIndexWithStatus", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1310,9 +1866,11 @@ def get_project_data_indices_with_http_info( @validate_call - def get_project_data_indices_without_preload_content( + def update_project_data_index_without_preload_content( self, + index_key: StrictStr, proj_key: StrictStr, + data: Data, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1326,12 +1884,16 @@ def get_project_data_indices_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Project Data Indices + """Update Project Data Index - Get project data indices. + Update a project data index. + :param index_key: (required) + :type index_key: str :param proj_key: (required) :type proj_key: str + :param data: (required) + :type data: Data :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 @@ -1354,8 +1916,10 @@ def get_project_data_indices_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_project_data_indices_serialize( + _param = self._update_project_data_index_serialize( + index_key=index_key, proj_key=proj_key, + data=data, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1363,7 +1927,7 @@ def get_project_data_indices_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ProjectDataIndexWithStatus]", + '200': "ProjectDataIndexWithStatus", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1373,9 +1937,11 @@ def get_project_data_indices_without_preload_content( return response_data.response - def _get_project_data_indices_serialize( + def _update_project_data_index_serialize( self, + index_key, proj_key, + data, _request_auth, _content_type, _headers, @@ -1395,12 +1961,16 @@ def _get_project_data_indices_serialize( _body_params: Optional[bytes] = None # process the path parameters + if index_key is not None: + _path_params['index_key'] = index_key if proj_key is not None: _path_params['proj_key'] = proj_key # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if data is not None: + _body_params = data # set the HTTP header `Accept` @@ -1410,6 +1980,19 @@ def _get_project_data_indices_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] = [ @@ -1417,8 +2000,8 @@ def _get_project_data_indices_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/project/{proj_key}/data_indices', + method='PATCH', + resource_path='/project/{proj_key}/data_indices/{index_key}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1435,11 +2018,11 @@ def _get_project_data_indices_serialize( @validate_call - def update_project_data_index( + def update_project_data_index_conversion_settings( self, index_key: StrictStr, proj_key: StrictStr, - data: Data, + project_data_index_conversion_settings_input: ProjectDataIndexConversionSettingsInput, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1452,17 +2035,17 @@ def update_project_data_index( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ProjectDataIndexWithStatus: - """Update Project Data Index + ) -> ResponseUpdateProjectDataIndexConversionSettings: + """Update Project Data Index Conversion Settings - Update a project data index. + Update a project data index conversion settings. :param index_key: (required) :type index_key: str :param proj_key: (required) :type proj_key: str - :param data: (required) - :type data: Data + :param project_data_index_conversion_settings_input: (required) + :type project_data_index_conversion_settings_input: ProjectDataIndexConversionSettingsInput :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 @@ -1485,10 +2068,10 @@ def update_project_data_index( :return: Returns the result object. """ # noqa: E501 - _param = self._update_project_data_index_serialize( + _param = self._update_project_data_index_conversion_settings_serialize( index_key=index_key, proj_key=proj_key, - data=data, + project_data_index_conversion_settings_input=project_data_index_conversion_settings_input, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1496,7 +2079,7 @@ def update_project_data_index( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectDataIndexWithStatus", + '200': "ResponseUpdateProjectDataIndexConversionSettings", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1511,11 +2094,11 @@ def update_project_data_index( @validate_call - def update_project_data_index_with_http_info( + def update_project_data_index_conversion_settings_with_http_info( self, index_key: StrictStr, proj_key: StrictStr, - data: Data, + project_data_index_conversion_settings_input: ProjectDataIndexConversionSettingsInput, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1528,17 +2111,17 @@ def update_project_data_index_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[ProjectDataIndexWithStatus]: - """Update Project Data Index + ) -> ApiResponse[ResponseUpdateProjectDataIndexConversionSettings]: + """Update Project Data Index Conversion Settings - Update a project data index. + Update a project data index conversion settings. :param index_key: (required) :type index_key: str :param proj_key: (required) :type proj_key: str - :param data: (required) - :type data: Data + :param project_data_index_conversion_settings_input: (required) + :type project_data_index_conversion_settings_input: ProjectDataIndexConversionSettingsInput :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 @@ -1561,10 +2144,10 @@ def update_project_data_index_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_project_data_index_serialize( + _param = self._update_project_data_index_conversion_settings_serialize( index_key=index_key, proj_key=proj_key, - data=data, + project_data_index_conversion_settings_input=project_data_index_conversion_settings_input, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1572,7 +2155,7 @@ def update_project_data_index_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectDataIndexWithStatus", + '200': "ResponseUpdateProjectDataIndexConversionSettings", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1587,11 +2170,11 @@ def update_project_data_index_with_http_info( @validate_call - def update_project_data_index_without_preload_content( + def update_project_data_index_conversion_settings_without_preload_content( self, index_key: StrictStr, proj_key: StrictStr, - data: Data, + project_data_index_conversion_settings_input: ProjectDataIndexConversionSettingsInput, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1605,16 +2188,16 @@ def update_project_data_index_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Project Data Index + """Update Project Data Index Conversion Settings - Update a project data index. + Update a project data index conversion settings. :param index_key: (required) :type index_key: str :param proj_key: (required) :type proj_key: str - :param data: (required) - :type data: Data + :param project_data_index_conversion_settings_input: (required) + :type project_data_index_conversion_settings_input: ProjectDataIndexConversionSettingsInput :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 @@ -1637,10 +2220,10 @@ def update_project_data_index_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_project_data_index_serialize( + _param = self._update_project_data_index_conversion_settings_serialize( index_key=index_key, proj_key=proj_key, - data=data, + project_data_index_conversion_settings_input=project_data_index_conversion_settings_input, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1648,7 +2231,7 @@ def update_project_data_index_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectDataIndexWithStatus", + '200': "ResponseUpdateProjectDataIndexConversionSettings", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1658,11 +2241,11 @@ def update_project_data_index_without_preload_content( return response_data.response - def _update_project_data_index_serialize( + def _update_project_data_index_conversion_settings_serialize( self, index_key, proj_key, - data, + project_data_index_conversion_settings_input, _request_auth, _content_type, _headers, @@ -1690,8 +2273,8 @@ def _update_project_data_index_serialize( # process the header parameters # process the form parameters # process the body parameter - if data is not None: - _body_params = data + if project_data_index_conversion_settings_input is not None: + _body_params = project_data_index_conversion_settings_input # set the HTTP header `Accept` @@ -1722,7 +2305,7 @@ def _update_project_data_index_serialize( return self.api_client.param_serialize( method='PATCH', - resource_path='/project/{proj_key}/data_indices/{index_key}', + resource_path='/project/{proj_key}/data_indices/{index_key}/conversion_settings', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/deepsearch/cps/apis/public_v2/api/project_api.py b/deepsearch/cps/apis/public_v2/api/project_api.py index 90905223..54305ee9 100644 --- a/deepsearch/cps/apis/public_v2/api/project_api.py +++ b/deepsearch/cps/apis/public_v2/api/project_api.py @@ -16,12 +16,12 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr -from typing import Optional, Union +from pydantic import Field, StrictStr +from typing import Any, Optional from typing_extensions import Annotated -from deepsearch.cps.apis.public_v2.models.ccs_task import CcsTask from deepsearch.cps.apis.public_v2.models.config import Config from deepsearch.cps.apis.public_v2.models.convert_document_request import ConvertDocumentRequest +from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask from deepsearch.cps.apis.public_v2.models.default_values import DefaultValues from deepsearch.cps.apis.public_v2.models.project_package_instalation_manifest import ProjectPackageInstalationManifest from deepsearch.cps.apis.public_v2.models.response_get_project_integration_config_genai import ResponseGetProjectIntegrationConfigGenai @@ -47,11 +47,10 @@ def __init__(self, api_client=None) -> None: @validate_call - def check_wait_ccs_task_task( + def convert_document( self, - task_id: StrictStr, proj_key: StrictStr, - wait: Annotated[Optional[Union[Annotated[float, Field(le=30.0, strict=True)], Annotated[int, Field(le=30, strict=True)]]], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, + convert_document_request: ConvertDocumentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -64,17 +63,15 @@ def check_wait_ccs_task_task( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> TaskResult: - """Check Wait Ccs Task Task + ) -> CpsTask: + """Convert Document - Check status of a CCS conversion task. + Convert a document directly with Docling. - :param task_id: (required) - :type task_id: str :param proj_key: (required) :type proj_key: str - :param wait: Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. - :type wait: float + :param convert_document_request: (required) + :type convert_document_request: ConvertDocumentRequest :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 @@ -97,10 +94,9 @@ def check_wait_ccs_task_task( :return: Returns the result object. """ # noqa: E501 - _param = self._check_wait_ccs_task_task_serialize( - task_id=task_id, + _param = self._convert_document_serialize( proj_key=proj_key, - wait=wait, + convert_document_request=convert_document_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -108,7 +104,7 @@ def check_wait_ccs_task_task( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TaskResult", + '200': "CpsTask", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -123,11 +119,10 @@ def check_wait_ccs_task_task( @validate_call - def check_wait_ccs_task_task_with_http_info( + def convert_document_with_http_info( self, - task_id: StrictStr, proj_key: StrictStr, - wait: Annotated[Optional[Union[Annotated[float, Field(le=30.0, strict=True)], Annotated[int, Field(le=30, strict=True)]]], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, + convert_document_request: ConvertDocumentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -140,17 +135,15 @@ def check_wait_ccs_task_task_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[TaskResult]: - """Check Wait Ccs Task Task + ) -> ApiResponse[CpsTask]: + """Convert Document - Check status of a CCS conversion task. + Convert a document directly with Docling. - :param task_id: (required) - :type task_id: str :param proj_key: (required) :type proj_key: str - :param wait: Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. - :type wait: float + :param convert_document_request: (required) + :type convert_document_request: ConvertDocumentRequest :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 @@ -173,10 +166,9 @@ def check_wait_ccs_task_task_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._check_wait_ccs_task_task_serialize( - task_id=task_id, + _param = self._convert_document_serialize( proj_key=proj_key, - wait=wait, + convert_document_request=convert_document_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -184,7 +176,7 @@ def check_wait_ccs_task_task_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TaskResult", + '200': "CpsTask", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -199,11 +191,10 @@ def check_wait_ccs_task_task_with_http_info( @validate_call - def check_wait_ccs_task_task_without_preload_content( + def convert_document_without_preload_content( self, - task_id: StrictStr, proj_key: StrictStr, - wait: Annotated[Optional[Union[Annotated[float, Field(le=30.0, strict=True)], Annotated[int, Field(le=30, strict=True)]]], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, + convert_document_request: ConvertDocumentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -217,16 +208,14 @@ def check_wait_ccs_task_task_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Check Wait Ccs Task Task + """Convert Document - Check status of a CCS conversion task. + Convert a document directly with Docling. - :param task_id: (required) - :type task_id: str :param proj_key: (required) :type proj_key: str - :param wait: Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. - :type wait: float + :param convert_document_request: (required) + :type convert_document_request: ConvertDocumentRequest :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 @@ -249,10 +238,9 @@ def check_wait_ccs_task_task_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._check_wait_ccs_task_task_serialize( - task_id=task_id, + _param = self._convert_document_serialize( proj_key=proj_key, - wait=wait, + convert_document_request=convert_document_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -260,7 +248,7 @@ def check_wait_ccs_task_task_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TaskResult", + '200': "CpsTask", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -270,11 +258,10 @@ def check_wait_ccs_task_task_without_preload_content( return response_data.response - def _check_wait_ccs_task_task_serialize( + def _convert_document_serialize( self, - task_id, proj_key, - wait, + convert_document_request, _request_auth, _content_type, _headers, @@ -294,18 +281,14 @@ def _check_wait_ccs_task_task_serialize( _body_params: Optional[bytes] = None # process the path parameters - if task_id is not None: - _path_params['task_id'] = task_id if proj_key is not None: _path_params['proj_key'] = proj_key # process the query parameters - if wait is not None: - - _query_params.append(('wait', wait)) - # process the header parameters # process the form parameters # process the body parameter + if convert_document_request is not None: + _body_params = convert_document_request # set the HTTP header `Accept` @@ -315,6 +298,19 @@ def _check_wait_ccs_task_task_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] = [ @@ -322,8 +318,8 @@ def _check_wait_ccs_task_task_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/project/{proj_key}/convert_tasks/{task_id}', + method='POST', + resource_path='/project/{proj_key}/convert', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -340,10 +336,9 @@ def _check_wait_ccs_task_task_serialize( @validate_call - def convert_pdf_document( + def delete_project_integration_config_genai( self, proj_key: StrictStr, - convert_document_request: ConvertDocumentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -356,15 +351,13 @@ def convert_pdf_document( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CcsTask: - """Convert Pdf Document + ) -> None: + """Delete Project Integration Config Genai - Convert a PDF document directly to CCS. + Delete the GenAI config for a given project integration. :param proj_key: (required) :type proj_key: str - :param convert_document_request: (required) - :type convert_document_request: ConvertDocumentRequest :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 @@ -387,9 +380,8 @@ def convert_pdf_document( :return: Returns the result object. """ # noqa: E501 - _param = self._convert_pdf_document_serialize( + _param = self._delete_project_integration_config_genai_serialize( proj_key=proj_key, - convert_document_request=convert_document_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -397,7 +389,7 @@ def convert_pdf_document( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CcsTask", + '204': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -412,10 +404,9 @@ def convert_pdf_document( @validate_call - def convert_pdf_document_with_http_info( + def delete_project_integration_config_genai_with_http_info( self, proj_key: StrictStr, - convert_document_request: ConvertDocumentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -428,15 +419,13 @@ def convert_pdf_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[CcsTask]: - """Convert Pdf Document + ) -> ApiResponse[None]: + """Delete Project Integration Config Genai - Convert a PDF document directly to CCS. + Delete the GenAI config for a given project integration. :param proj_key: (required) :type proj_key: str - :param convert_document_request: (required) - :type convert_document_request: ConvertDocumentRequest :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 @@ -459,9 +448,8 @@ def convert_pdf_document_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._convert_pdf_document_serialize( + _param = self._delete_project_integration_config_genai_serialize( proj_key=proj_key, - convert_document_request=convert_document_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -469,7 +457,7 @@ def convert_pdf_document_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CcsTask", + '204': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -484,10 +472,9 @@ def convert_pdf_document_with_http_info( @validate_call - def convert_pdf_document_without_preload_content( + def delete_project_integration_config_genai_without_preload_content( self, proj_key: StrictStr, - convert_document_request: ConvertDocumentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -501,14 +488,12 @@ def convert_pdf_document_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Convert Pdf Document + """Delete Project Integration Config Genai - Convert a PDF document directly to CCS. + Delete the GenAI config for a given project integration. :param proj_key: (required) :type proj_key: str - :param convert_document_request: (required) - :type convert_document_request: ConvertDocumentRequest :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 @@ -531,9 +516,8 @@ def convert_pdf_document_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._convert_pdf_document_serialize( + _param = self._delete_project_integration_config_genai_serialize( proj_key=proj_key, - convert_document_request=convert_document_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -541,7 +525,7 @@ def convert_pdf_document_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CcsTask", + '204': None, '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -551,10 +535,9 @@ def convert_pdf_document_without_preload_content( return response_data.response - def _convert_pdf_document_serialize( + def _delete_project_integration_config_genai_serialize( self, proj_key, - convert_document_request, _request_auth, _content_type, _headers, @@ -580,8 +563,6 @@ def _convert_pdf_document_serialize( # process the header parameters # process the form parameters # process the body parameter - if convert_document_request is not None: - _body_params = convert_document_request # set the HTTP header `Accept` @@ -591,19 +572,6 @@ def _convert_pdf_document_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] = [ @@ -611,8 +579,8 @@ def _convert_pdf_document_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/project/{proj_key}/convert', + method='DELETE', + resource_path='/project/{proj_key}/integrations/genai', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -629,9 +597,11 @@ def _convert_pdf_document_serialize( @validate_call - def delete_project_integration_config_genai( + def get_convert_task( self, + task_id: StrictStr, proj_key: StrictStr, + wait: Annotated[Optional[Any], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -644,13 +614,17 @@ def delete_project_integration_config_genai( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete Project Integration Config Genai + ) -> TaskResult: + """Get Convert Task - Delete the GenAI config for a given project integration. + Check status of a Docling conversion task; return presign urls for MD and JSON file if finished conversion successfully. + :param task_id: (required) + :type task_id: str :param proj_key: (required) :type proj_key: str + :param wait: Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. + :type wait: Wait :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 @@ -673,8 +647,10 @@ def delete_project_integration_config_genai( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_project_integration_config_genai_serialize( + _param = self._get_convert_task_serialize( + task_id=task_id, proj_key=proj_key, + wait=wait, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -682,7 +658,7 @@ def delete_project_integration_config_genai( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, + '200': "TaskResult", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -697,9 +673,11 @@ def delete_project_integration_config_genai( @validate_call - def delete_project_integration_config_genai_with_http_info( + def get_convert_task_with_http_info( self, + task_id: StrictStr, proj_key: StrictStr, + wait: Annotated[Optional[Any], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -712,13 +690,17 @@ def delete_project_integration_config_genai_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]: - """Delete Project Integration Config Genai + ) -> ApiResponse[TaskResult]: + """Get Convert Task - Delete the GenAI config for a given project integration. + Check status of a Docling conversion task; return presign urls for MD and JSON file if finished conversion successfully. + :param task_id: (required) + :type task_id: str :param proj_key: (required) :type proj_key: str + :param wait: Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. + :type wait: Wait :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 @@ -741,8 +723,10 @@ def delete_project_integration_config_genai_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_project_integration_config_genai_serialize( + _param = self._get_convert_task_serialize( + task_id=task_id, proj_key=proj_key, + wait=wait, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -750,7 +734,7 @@ def delete_project_integration_config_genai_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, + '200': "TaskResult", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -765,9 +749,11 @@ def delete_project_integration_config_genai_with_http_info( @validate_call - def delete_project_integration_config_genai_without_preload_content( + def get_convert_task_without_preload_content( self, + task_id: StrictStr, proj_key: StrictStr, + wait: Annotated[Optional[Any], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -781,12 +767,16 @@ def delete_project_integration_config_genai_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete Project Integration Config Genai + """Get Convert Task - Delete the GenAI config for a given project integration. + Check status of a Docling conversion task; return presign urls for MD and JSON file if finished conversion successfully. + :param task_id: (required) + :type task_id: str :param proj_key: (required) :type proj_key: str + :param wait: Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. + :type wait: Wait :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 @@ -809,8 +799,10 @@ def delete_project_integration_config_genai_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_project_integration_config_genai_serialize( + _param = self._get_convert_task_serialize( + task_id=task_id, proj_key=proj_key, + wait=wait, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -818,7 +810,7 @@ def delete_project_integration_config_genai_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, + '200': "TaskResult", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -828,9 +820,11 @@ def delete_project_integration_config_genai_without_preload_content( return response_data.response - def _delete_project_integration_config_genai_serialize( + def _get_convert_task_serialize( self, + task_id, proj_key, + wait, _request_auth, _content_type, _headers, @@ -850,9 +844,15 @@ def _delete_project_integration_config_genai_serialize( _body_params: Optional[bytes] = None # process the path parameters + if task_id is not None: + _path_params['task_id'] = task_id if proj_key is not None: _path_params['proj_key'] = proj_key # process the query parameters + if wait is not None: + + _query_params.append(('wait', wait)) + # process the header parameters # process the form parameters # process the body parameter @@ -872,8 +872,8 @@ def _delete_project_integration_config_genai_serialize( ] return self.api_client.param_serialize( - method='DELETE', - resource_path='/project/{proj_key}/integrations/genai', + method='GET', + resource_path='/project/{proj_key}/convert_tasks/{task_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1154,7 +1154,7 @@ def _get_project_default_values_serialize( def get_project_integration_config_genai( self, proj_key: StrictStr, - decode_secrets: Optional[StrictBool] = None, + decode_secrets: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1175,7 +1175,7 @@ def get_project_integration_config_genai( :param proj_key: (required) :type proj_key: str :param decode_secrets: - :type decode_secrets: bool + :type decode_secrets: DecodeSecrets :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 @@ -1226,7 +1226,7 @@ def get_project_integration_config_genai( def get_project_integration_config_genai_with_http_info( self, proj_key: StrictStr, - decode_secrets: Optional[StrictBool] = None, + decode_secrets: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1247,7 +1247,7 @@ def get_project_integration_config_genai_with_http_info( :param proj_key: (required) :type proj_key: str :param decode_secrets: - :type decode_secrets: bool + :type decode_secrets: DecodeSecrets :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 @@ -1298,7 +1298,7 @@ def get_project_integration_config_genai_with_http_info( def get_project_integration_config_genai_without_preload_content( self, proj_key: StrictStr, - decode_secrets: Optional[StrictBool] = None, + decode_secrets: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1319,7 +1319,7 @@ def get_project_integration_config_genai_without_preload_content( :param proj_key: (required) :type proj_key: str :param decode_secrets: - :type decode_secrets: bool + :type decode_secrets: DecodeSecrets :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 diff --git a/deepsearch/cps/apis/public_v2/api/system_api.py b/deepsearch/cps/apis/public_v2/api/system_api.py index a7007dd2..78905e14 100644 --- a/deepsearch/cps/apis/public_v2/api/system_api.py +++ b/deepsearch/cps/apis/public_v2/api/system_api.py @@ -16,8 +16,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictStr -from typing import Optional +from typing import Any, Optional from deepsearch.cps.apis.public_v2.models.cps_package import CPSPackage from deepsearch.cps.apis.public_v2.models.modules_config import ModulesConfig from deepsearch.cps.apis.public_v2.models.system_info import SystemInfo @@ -1012,8 +1011,8 @@ def _list_packages_serialize( @validate_call def list_system_knowledge_graphs( self, - proj_key: Optional[StrictStr] = None, - term: Optional[StrictStr] = None, + proj_key: Optional[Any] = None, + term: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1032,9 +1031,9 @@ def list_system_knowledge_graphs( List all Knowledge Graphs in the system. :param proj_key: - :type proj_key: str + :type proj_key: ProjKey :param term: - :type term: str + :type term: Term :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 @@ -1084,8 +1083,8 @@ def list_system_knowledge_graphs( @validate_call def list_system_knowledge_graphs_with_http_info( self, - proj_key: Optional[StrictStr] = None, - term: Optional[StrictStr] = None, + proj_key: Optional[Any] = None, + term: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1104,9 +1103,9 @@ def list_system_knowledge_graphs_with_http_info( List all Knowledge Graphs in the system. :param proj_key: - :type proj_key: str + :type proj_key: ProjKey :param term: - :type term: str + :type term: Term :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 @@ -1156,8 +1155,8 @@ def list_system_knowledge_graphs_with_http_info( @validate_call def list_system_knowledge_graphs_without_preload_content( self, - proj_key: Optional[StrictStr] = None, - term: Optional[StrictStr] = None, + proj_key: Optional[Any] = None, + term: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1176,9 +1175,9 @@ def list_system_knowledge_graphs_without_preload_content( List all Knowledge Graphs in the system. :param proj_key: - :type proj_key: str + :type proj_key: ProjKey :param term: - :type term: str + :type term: Term :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 diff --git a/deepsearch/cps/apis/public_v2/api/tasks_api.py b/deepsearch/cps/apis/public_v2/api/tasks_api.py index 63b66885..c51d72b6 100644 --- a/deepsearch/cps/apis/public_v2/api/tasks_api.py +++ b/deepsearch/cps/apis/public_v2/api/tasks_api.py @@ -17,7 +17,7 @@ from typing_extensions import Annotated from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import Optional, Union +from typing import Any, Optional from typing_extensions import Annotated from deepsearch.cps.apis.public_v2.models.task_context import TaskContext from deepsearch.cps.apis.public_v2.models.task_result import TaskResult @@ -321,7 +321,7 @@ def get_project_celery_task( self, task_id: StrictStr, proj_key: StrictStr, - wait: Annotated[Optional[Union[Annotated[float, Field(le=30.0, strict=True)], Annotated[int, Field(le=30, strict=True)]]], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, + wait: Annotated[Optional[Any], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -344,7 +344,7 @@ def get_project_celery_task( :param proj_key: (required) :type proj_key: str :param wait: Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. - :type wait: float + :type wait: Wait1 :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 @@ -397,7 +397,7 @@ def get_project_celery_task_with_http_info( self, task_id: StrictStr, proj_key: StrictStr, - wait: Annotated[Optional[Union[Annotated[float, Field(le=30.0, strict=True)], Annotated[int, Field(le=30, strict=True)]]], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, + wait: Annotated[Optional[Any], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -420,7 +420,7 @@ def get_project_celery_task_with_http_info( :param proj_key: (required) :type proj_key: str :param wait: Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. - :type wait: float + :type wait: Wait1 :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 @@ -473,7 +473,7 @@ def get_project_celery_task_without_preload_content( self, task_id: StrictStr, proj_key: StrictStr, - wait: Annotated[Optional[Union[Annotated[float, Field(le=30.0, strict=True)], Annotated[int, Field(le=30, strict=True)]]], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, + wait: Annotated[Optional[Any], Field(description="Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -496,7 +496,7 @@ def get_project_celery_task_without_preload_content( :param proj_key: (required) :type proj_key: str :param wait: Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. - :type wait: float + :type wait: Wait1 :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 @@ -889,7 +889,7 @@ def _get_project_task_serialize( def list_project_tasks( self, proj_key: StrictStr, - task_type: Optional[StrictStr] = None, + task_type: Optional[Any] = None, skip: Optional[StrictInt] = None, limit: Optional[StrictInt] = None, sort_by: Optional[StrictStr] = None, @@ -914,7 +914,7 @@ def list_project_tasks( :param proj_key: (required) :type proj_key: str :param task_type: - :type task_type: str + :type task_type: TaskType :param skip: :type skip: int :param limit: @@ -977,7 +977,7 @@ def list_project_tasks( def list_project_tasks_with_http_info( self, proj_key: StrictStr, - task_type: Optional[StrictStr] = None, + task_type: Optional[Any] = None, skip: Optional[StrictInt] = None, limit: Optional[StrictInt] = None, sort_by: Optional[StrictStr] = None, @@ -1002,7 +1002,7 @@ def list_project_tasks_with_http_info( :param proj_key: (required) :type proj_key: str :param task_type: - :type task_type: str + :type task_type: TaskType :param skip: :type skip: int :param limit: @@ -1065,7 +1065,7 @@ def list_project_tasks_with_http_info( def list_project_tasks_without_preload_content( self, proj_key: StrictStr, - task_type: Optional[StrictStr] = None, + task_type: Optional[Any] = None, skip: Optional[StrictInt] = None, limit: Optional[StrictInt] = None, sort_by: Optional[StrictStr] = None, @@ -1090,7 +1090,7 @@ def list_project_tasks_without_preload_content( :param proj_key: (required) :type proj_key: str :param task_type: - :type task_type: str + :type task_type: TaskType :param skip: :type skip: int :param limit: diff --git a/deepsearch/cps/apis/public_v2/api/upload_api.py b/deepsearch/cps/apis/public_v2/api/upload_api.py index a325c756..e6a552c0 100644 --- a/deepsearch/cps/apis/public_v2/api/upload_api.py +++ b/deepsearch/cps/apis/public_v2/api/upload_api.py @@ -17,7 +17,7 @@ from typing_extensions import Annotated from pydantic import StrictInt, StrictStr -from typing import Optional +from typing import Any, Optional from deepsearch.cps.apis.public_v2.models.project_scratch_files import ProjectScratchFiles from deepsearch.cps.apis.public_v2.models.project_scratch_files_paginated import ProjectScratchFilesPaginated from deepsearch.cps.apis.public_v2.models.temporary_upload_file_result import TemporaryUploadFileResult @@ -320,7 +320,7 @@ def _create_project_scratch_file_serialize( def list_project_scratch_files( self, proj_key: StrictStr, - scratch_ids: Optional[StrictStr] = None, + scratch_ids: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -341,7 +341,7 @@ def list_project_scratch_files( :param proj_key: (required) :type proj_key: str :param scratch_ids: - :type scratch_ids: str + :type scratch_ids: ScratchIds :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 @@ -392,7 +392,7 @@ def list_project_scratch_files( def list_project_scratch_files_with_http_info( self, proj_key: StrictStr, - scratch_ids: Optional[StrictStr] = None, + scratch_ids: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -413,7 +413,7 @@ def list_project_scratch_files_with_http_info( :param proj_key: (required) :type proj_key: str :param scratch_ids: - :type scratch_ids: str + :type scratch_ids: ScratchIds :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 @@ -464,7 +464,7 @@ def list_project_scratch_files_with_http_info( def list_project_scratch_files_without_preload_content( self, proj_key: StrictStr, - scratch_ids: Optional[StrictStr] = None, + scratch_ids: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -485,7 +485,7 @@ def list_project_scratch_files_without_preload_content( :param proj_key: (required) :type proj_key: str :param scratch_ids: - :type scratch_ids: str + :type scratch_ids: ScratchIds :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 @@ -598,11 +598,11 @@ def _list_project_scratch_files_serialize( def list_project_scratch_files_paginated( self, proj_key: StrictStr, - page: Optional[StrictInt] = None, + page: Optional[Any] = None, items_per_page: Optional[StrictInt] = None, - search_string: Optional[StrictStr] = None, - begin_date: Optional[StrictInt] = None, - end_date: Optional[StrictInt] = None, + search_string: Optional[Any] = None, + begin_date: Optional[Any] = None, + end_date: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -623,15 +623,15 @@ def list_project_scratch_files_paginated( :param proj_key: (required) :type proj_key: str :param page: - :type page: int + :type page: Page :param items_per_page: :type items_per_page: int :param search_string: - :type search_string: str + :type search_string: SearchString :param begin_date: - :type begin_date: int + :type begin_date: BeginDate :param end_date: - :type end_date: int + :type end_date: EndDate :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 @@ -686,11 +686,11 @@ def list_project_scratch_files_paginated( def list_project_scratch_files_paginated_with_http_info( self, proj_key: StrictStr, - page: Optional[StrictInt] = None, + page: Optional[Any] = None, items_per_page: Optional[StrictInt] = None, - search_string: Optional[StrictStr] = None, - begin_date: Optional[StrictInt] = None, - end_date: Optional[StrictInt] = None, + search_string: Optional[Any] = None, + begin_date: Optional[Any] = None, + end_date: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -711,15 +711,15 @@ def list_project_scratch_files_paginated_with_http_info( :param proj_key: (required) :type proj_key: str :param page: - :type page: int + :type page: Page :param items_per_page: :type items_per_page: int :param search_string: - :type search_string: str + :type search_string: SearchString :param begin_date: - :type begin_date: int + :type begin_date: BeginDate :param end_date: - :type end_date: int + :type end_date: EndDate :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 @@ -774,11 +774,11 @@ def list_project_scratch_files_paginated_with_http_info( def list_project_scratch_files_paginated_without_preload_content( self, proj_key: StrictStr, - page: Optional[StrictInt] = None, + page: Optional[Any] = None, items_per_page: Optional[StrictInt] = None, - search_string: Optional[StrictStr] = None, - begin_date: Optional[StrictInt] = None, - end_date: Optional[StrictInt] = None, + search_string: Optional[Any] = None, + begin_date: Optional[Any] = None, + end_date: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -799,15 +799,15 @@ def list_project_scratch_files_paginated_without_preload_content( :param proj_key: (required) :type proj_key: str :param page: - :type page: int + :type page: Page :param items_per_page: :type items_per_page: int :param search_string: - :type search_string: str + :type search_string: SearchString :param begin_date: - :type begin_date: int + :type begin_date: BeginDate :param end_date: - :type end_date: int + :type end_date: EndDate :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 diff --git a/deepsearch/cps/apis/public_v2/models/__init__.py b/deepsearch/cps/apis/public_v2/models/__init__.py index f8eb7591..05a5a685 100644 --- a/deepsearch/cps/apis/public_v2/models/__init__.py +++ b/deepsearch/cps/apis/public_v2/models/__init__.py @@ -14,70 +14,166 @@ # import models into model package +from deepsearch.cps.apis.public_v2.models.abstract import Abstract +from deepsearch.cps.apis.public_v2.models.acquisition import Acquisition +from deepsearch.cps.apis.public_v2.models.add_annotations import AddAnnotations +from deepsearch.cps.apis.public_v2.models.add_raw_pages import AddRawPages +from deepsearch.cps.apis.public_v2.models.affiliation import Affiliation +from deepsearch.cps.apis.public_v2.models.affiliations import Affiliations +from deepsearch.cps.apis.public_v2.models.agent_name import AgentName +from deepsearch.cps.apis.public_v2.models.aggs import Aggs +from deepsearch.cps.apis.public_v2.models.alias import Alias +from deepsearch.cps.apis.public_v2.models.aliases import Aliases +from deepsearch.cps.apis.public_v2.models.alternate_names import AlternateNames +from deepsearch.cps.apis.public_v2.models.api_server_fastapi_server_public_models_data_indices_upload_models_http_source import ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource +from deepsearch.cps.apis.public_v2.models.api_server_fastapi_server_public_models_data_indices_upload_models_identifier import ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier +from deepsearch.cps.apis.public_v2.models.api_server_fastapi_server_public_models_project_models_http_source import ApiServerFastapiServerPublicModelsProjectModelsHttpSource from deepsearch.cps.apis.public_v2.models.assemble_mode import AssembleMode from deepsearch.cps.apis.public_v2.models.assemble_settings import AssembleSettings from deepsearch.cps.apis.public_v2.models.attachment_upload_data import AttachmentUploadData from deepsearch.cps.apis.public_v2.models.attachment_upload_request_body import AttachmentUploadRequestBody +from deepsearch.cps.apis.public_v2.models.author import Author +from deepsearch.cps.apis.public_v2.models.authors import Authors +from deepsearch.cps.apis.public_v2.models.backend import Backend +from deepsearch.cps.apis.public_v2.models.backend_settings import BackendSettings from deepsearch.cps.apis.public_v2.models.bag_flavour_full_data import BagFlavourFullData +from deepsearch.cps.apis.public_v2.models.begin_date import BeginDate from deepsearch.cps.apis.public_v2.models.ccs_project import CCSProject from deepsearch.cps.apis.public_v2.models.cps_package import CPSPackage from deepsearch.cps.apis.public_v2.models.cps_summary import CPSSummary -from deepsearch.cps.apis.public_v2.models.ccs_task import CcsTask +from deepsearch.cps.apis.public_v2.models.citation_count import CitationCount +from deepsearch.cps.apis.public_v2.models.citation_count_date import CitationCountDate +from deepsearch.cps.apis.public_v2.models.code import Code +from deepsearch.cps.apis.public_v2.models.collection_document_info_str import CollectionDocumentInfoStr from deepsearch.cps.apis.public_v2.models.collection_metadata_settings import CollectionMetadataSettings +from deepsearch.cps.apis.public_v2.models.comment import Comment +from deepsearch.cps.apis.public_v2.models.completed_at import CompletedAt from deepsearch.cps.apis.public_v2.models.config import Config +from deepsearch.cps.apis.public_v2.models.conversion_settings import ConversionSettings from deepsearch.cps.apis.public_v2.models.convert_document_request import ConvertDocumentRequest +from deepsearch.cps.apis.public_v2.models.convert_document_request_file_source import ConvertDocumentRequestFileSource +from deepsearch.cps.apis.public_v2.models.convert_document_request_http_source import ConvertDocumentRequestHttpSource +from deepsearch.cps.apis.public_v2.models.convert_document_request_image_urls import ConvertDocumentRequestImageUrls +from deepsearch.cps.apis.public_v2.models.convert_document_request_settings import ConvertDocumentRequestSettings from deepsearch.cps.apis.public_v2.models.convert_documents_request_body import ConvertDocumentsRequestBody +from deepsearch.cps.apis.public_v2.models.convert_documents_request_body_target_settings import ConvertDocumentsRequestBodyTargetSettings from deepsearch.cps.apis.public_v2.models.convert_documents_sources import ConvertDocumentsSources +from deepsearch.cps.apis.public_v2.models.convert_documents_sources_s3_source import ConvertDocumentsSourcesS3Source from deepsearch.cps.apis.public_v2.models.convert_upload_documents_request_body import ConvertUploadDocumentsRequestBody +from deepsearch.cps.apis.public_v2.models.convert_upload_documents_request_body_meta import ConvertUploadDocumentsRequestBodyMeta from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask +from deepsearch.cps.apis.public_v2.models.created import Created from deepsearch.cps.apis.public_v2.models.data import Data from deepsearch.cps.apis.public_v2.models.data_flow import DataFlow from deepsearch.cps.apis.public_v2.models.data_index_upload_file_source import DataIndexUploadFileSource +from deepsearch.cps.apis.public_v2.models.dc_key import DcKey +from deepsearch.cps.apis.public_v2.models.decode_secrets import DecodeSecrets from deepsearch.cps.apis.public_v2.models.default_values import DefaultValues +from deepsearch.cps.apis.public_v2.models.default_values_dataflow import DefaultValuesDataflow from deepsearch.cps.apis.public_v2.models.deployment import Deployment +from deepsearch.cps.apis.public_v2.models.description import Description +from deepsearch.cps.apis.public_v2.models.description_license import DescriptionLicense from deepsearch.cps.apis.public_v2.models.direct_model_config import DirectModelConfig +from deepsearch.cps.apis.public_v2.models.display_name import DisplayName +from deepsearch.cps.apis.public_v2.models.docling_core_types_base_identifier import DoclingCoreTypesBaseIdentifier from deepsearch.cps.apis.public_v2.models.document_artifacts import DocumentArtifacts +from deepsearch.cps.apis.public_v2.models.document_artifacts_document_meta_json import DocumentArtifactsDocumentMetaJson from deepsearch.cps.apis.public_v2.models.document_artifacts_item import DocumentArtifactsItem from deepsearch.cps.apis.public_v2.models.document_artifacts_page_item import DocumentArtifactsPageItem +from deepsearch.cps.apis.public_v2.models.document_description import DocumentDescription +from deepsearch.cps.apis.public_v2.models.document_description_acquisition import DocumentDescriptionAcquisition +from deepsearch.cps.apis.public_v2.models.document_description_advanced import DocumentDescriptionAdvanced +from deepsearch.cps.apis.public_v2.models.document_description_license import DocumentDescriptionLicense +from deepsearch.cps.apis.public_v2.models.document_hashes import DocumentHashes +from deepsearch.cps.apis.public_v2.models.document_meta import DocumentMeta +from deepsearch.cps.apis.public_v2.models.document_meta_description import DocumentMetaDescription from deepsearch.cps.apis.public_v2.models.document_statistics import DocumentStatistics +from deepsearch.cps.apis.public_v2.models.domain import Domain from deepsearch.cps.apis.public_v2.models.elastic_index_property_object import ElasticIndexPropertyObject from deepsearch.cps.apis.public_v2.models.elastic_index_property_primitive import ElasticIndexPropertyPrimitive from deepsearch.cps.apis.public_v2.models.elastic_index_search_query_options import ElasticIndexSearchQueryOptions from deepsearch.cps.apis.public_v2.models.elastic_index_source import ElasticIndexSource from deepsearch.cps.apis.public_v2.models.elastic_instance_data_index import ElasticInstanceDataIndex from deepsearch.cps.apis.public_v2.models.elastic_metadata import ElasticMetadata +from deepsearch.cps.apis.public_v2.models.enabled import Enabled +from deepsearch.cps.apis.public_v2.models.end_date import EndDate +from deepsearch.cps.apis.public_v2.models.error_reason import ErrorReason from deepsearch.cps.apis.public_v2.models.file_source import FileSource +from deepsearch.cps.apis.public_v2.models.file_uri import FileUri +from deepsearch.cps.apis.public_v2.models.file_url import FileUrl +from deepsearch.cps.apis.public_v2.models.filename import Filename from deepsearch.cps.apis.public_v2.models.flavour import Flavour from deepsearch.cps.apis.public_v2.models.flavours_default_quota import FlavoursDefaultQuota from deepsearch.cps.apis.public_v2.models.flavours_quota import FlavoursQuota from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock import GenAIAWSBedrock from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_config import GenAIAWSBedrockConfig +from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_proj_params import GenAIAWSBedrockProjParams from deepsearch.cps.apis.public_v2.models.gen_aibam import GenAIBAM from deepsearch.cps.apis.public_v2.models.gen_aibam_config import GenAIBAMConfig +from deepsearch.cps.apis.public_v2.models.gen_aicpd import GenAICPD +from deepsearch.cps.apis.public_v2.models.gen_aicpd_config import GenAICPDConfig from deepsearch.cps.apis.public_v2.models.gen_aihf_inference_api import GenAIHFInferenceApi from deepsearch.cps.apis.public_v2.models.gen_aihf_inference_api_config import GenAIHFInferenceApiConfig +from deepsearch.cps.apis.public_v2.models.gen_ai_openai import GenAIOpenai +from deepsearch.cps.apis.public_v2.models.gen_ai_openai_config import GenAIOpenaiConfig from deepsearch.cps.apis.public_v2.models.gen_ai_params import GenAIParams from deepsearch.cps.apis.public_v2.models.gen_ai_partial_params import GenAIPartialParams from deepsearch.cps.apis.public_v2.models.gen_ai_watsonx import GenAIWatsonx from deepsearch.cps.apis.public_v2.models.gen_ai_watsonx_config import GenAIWatsonxConfig +from deepsearch.cps.apis.public_v2.models.genai_cpd_api_key import GenaiCpdApiKey +from deepsearch.cps.apis.public_v2.models.genai_cpd_password import GenaiCpdPassword from deepsearch.cps.apis.public_v2.models.grouped_project_documents import GroupedProjectDocuments from deepsearch.cps.apis.public_v2.models.http_validation_error import HTTPValidationError +from deepsearch.cps.apis.public_v2.models.head_url import HeadUrl +from deepsearch.cps.apis.public_v2.models.headers import Headers from deepsearch.cps.apis.public_v2.models.http_source import HttpSource -from deepsearch.cps.apis.public_v2.models.internal_url import InternalUrl +from deepsearch.cps.apis.public_v2.models.id import Id +from deepsearch.cps.apis.public_v2.models.identifiers import Identifiers +from deepsearch.cps.apis.public_v2.models.identifiers1 import Identifiers1 +from deepsearch.cps.apis.public_v2.models.ignore_above import IgnoreAbove +from deepsearch.cps.apis.public_v2.models.image_urls_info import ImageUrlsInfo +from deepsearch.cps.apis.public_v2.models.issue import Issue from deepsearch.cps.apis.public_v2.models.json_upload_request_body import JsonUploadRequestBody +from deepsearch.cps.apis.public_v2.models.key_prefix import KeyPrefix +from deepsearch.cps.apis.public_v2.models.keywords import Keywords +from deepsearch.cps.apis.public_v2.models.kg_key import KgKey +from deepsearch.cps.apis.public_v2.models.languages import Languages +from deepsearch.cps.apis.public_v2.models.license import License +from deepsearch.cps.apis.public_v2.models.link import Link from deepsearch.cps.apis.public_v2.models.list_project_flavours import ListProjectFlavours +from deepsearch.cps.apis.public_v2.models.log import Log +from deepsearch.cps.apis.public_v2.models.merge_mode import MergeMode +from deepsearch.cps.apis.public_v2.models.model_date import ModelDate +from deepsearch.cps.apis.public_v2.models.model_from import ModelFrom +from deepsearch.cps.apis.public_v2.models.model_id import ModelId from deepsearch.cps.apis.public_v2.models.model_pipeline_settings import ModelPipelineSettings from deepsearch.cps.apis.public_v2.models.model_pipeline_settings_clusters_inner import ModelPipelineSettingsClustersInner from deepsearch.cps.apis.public_v2.models.modules_config import ModulesConfig +from deepsearch.cps.apis.public_v2.models.name import Name +from deepsearch.cps.apis.public_v2.models.number_pages import NumberPages +from deepsearch.cps.apis.public_v2.models.ocr_options import OCROptions +from deepsearch.cps.apis.public_v2.models.object_keys import ObjectKeys from deepsearch.cps.apis.public_v2.models.ocr_settings import OcrSettings from deepsearch.cps.apis.public_v2.models.package import Package +from deepsearch.cps.apis.public_v2.models.page import Page +from deepsearch.cps.apis.public_v2.models.page_labels import PageLabels +from deepsearch.cps.apis.public_v2.models.pages import Pages +from deepsearch.cps.apis.public_v2.models.params import Params from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters import PartialDirectConversionParameters +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_assemble import PartialDirectConversionParametersAssemble +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_metadata import PartialDirectConversionParametersMetadata +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_model_pipeline import PartialDirectConversionParametersModelPipeline +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_ocr import PartialDirectConversionParametersOcr +from deepsearch.cps.apis.public_v2.models.proj_key import ProjKey from deepsearch.cps.apis.public_v2.models.project_agent import ProjectAgent from deepsearch.cps.apis.public_v2.models.project_agents import ProjectAgents +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_input import ProjectDataIndexConversionSettingsInput +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_output import ProjectDataIndexConversionSettingsOutput from deepsearch.cps.apis.public_v2.models.project_data_index_non_view import ProjectDataIndexNonView from deepsearch.cps.apis.public_v2.models.project_data_index_source import ProjectDataIndexSource from deepsearch.cps.apis.public_v2.models.project_data_index_view import ProjectDataIndexView from deepsearch.cps.apis.public_v2.models.project_data_index_with_status import ProjectDataIndexWithStatus +from deepsearch.cps.apis.public_v2.models.project_data_index_with_status_metadata import ProjectDataIndexWithStatusMetadata from deepsearch.cps.apis.public_v2.models.project_document import ProjectDocument from deepsearch.cps.apis.public_v2.models.project_document_url import ProjectDocumentURL from deepsearch.cps.apis.public_v2.models.project_documents import ProjectDocuments @@ -88,35 +184,86 @@ from deepsearch.cps.apis.public_v2.models.project_scratch_files_paginated import ProjectScratchFilesPaginated from deepsearch.cps.apis.public_v2.models.project_source_data_index import ProjectSourceDataIndex from deepsearch.cps.apis.public_v2.models.projects_flavours import ProjectsFlavours +from deepsearch.cps.apis.public_v2.models.prompt_template import PromptTemplate from deepsearch.cps.apis.public_v2.models.properties import Properties +from deepsearch.cps.apis.public_v2.models.provenance import Provenance +from deepsearch.cps.apis.public_v2.models.publication import Publication +from deepsearch.cps.apis.public_v2.models.publication1 import Publication1 +from deepsearch.cps.apis.public_v2.models.publication_date import PublicationDate +from deepsearch.cps.apis.public_v2.models.publishers import Publishers +from deepsearch.cps.apis.public_v2.models.query import Query +from deepsearch.cps.apis.public_v2.models.record_properties import RecordProperties +from deepsearch.cps.apis.public_v2.models.ref_uri import RefUri +from deepsearch.cps.apis.public_v2.models.reference_count import ReferenceCount from deepsearch.cps.apis.public_v2.models.reference_to_model import ReferenceToModel +from deepsearch.cps.apis.public_v2.models.references import References +from deepsearch.cps.apis.public_v2.models.related_tasks import RelatedTasks from deepsearch.cps.apis.public_v2.models.response_document_artifacts import ResponseDocumentArtifacts +from deepsearch.cps.apis.public_v2.models.response_get_project_data_index_conversion_settings import ResponseGetProjectDataIndexConversionSettings from deepsearch.cps.apis.public_v2.models.response_get_project_integration_config_genai import ResponseGetProjectIntegrationConfigGenai from deepsearch.cps.apis.public_v2.models.response_grouped_documents import ResponseGroupedDocuments +from deepsearch.cps.apis.public_v2.models.response_update_project_data_index_conversion_settings import ResponseUpdateProjectDataIndexConversionSettings from deepsearch.cps.apis.public_v2.models.response_upload_jobs import ResponseUploadJobs from deepsearch.cps.apis.public_v2.models.s3_coordinates import S3Coordinates from deepsearch.cps.apis.public_v2.models.s3_document_source import S3DocumentSource +from deepsearch.cps.apis.public_v2.models.schema_key import SchemaKey +from deepsearch.cps.apis.public_v2.models.scratch_ids import ScratchIds +from deepsearch.cps.apis.public_v2.models.search_string import SearchString from deepsearch.cps.apis.public_v2.models.semantic_ingest_req_params import SemanticIngestReqParams from deepsearch.cps.apis.public_v2.models.semantic_ingest_request import SemanticIngestRequest from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_private_data_collection import SemanticIngestSourcePrivateDataCollection from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_private_data_document import SemanticIngestSourcePrivateDataDocument from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_public_data_document import SemanticIngestSourcePublicDataDocument from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_url import SemanticIngestSourceUrl +from deepsearch.cps.apis.public_v2.models.size import Size +from deepsearch.cps.apis.public_v2.models.size1 import Size1 +from deepsearch.cps.apis.public_v2.models.sort import Sort from deepsearch.cps.apis.public_v2.models.source import Source from deepsearch.cps.apis.public_v2.models.source1 import Source1 +from deepsearch.cps.apis.public_v2.models.source2 import Source2 +from deepsearch.cps.apis.public_v2.models.source3 import Source3 +from deepsearch.cps.apis.public_v2.models.source4 import Source4 +from deepsearch.cps.apis.public_v2.models.start_count import StartCount +from deepsearch.cps.apis.public_v2.models.started_at import StartedAt +from deepsearch.cps.apis.public_v2.models.status import Status +from deepsearch.cps.apis.public_v2.models.status_filter import StatusFilter +from deepsearch.cps.apis.public_v2.models.storage import Storage from deepsearch.cps.apis.public_v2.models.storage_summary_task import StorageSummaryTask +from deepsearch.cps.apis.public_v2.models.subjects import Subjects from deepsearch.cps.apis.public_v2.models.system_info import SystemInfo +from deepsearch.cps.apis.public_v2.models.table_former_mode import TableFormerMode +from deepsearch.cps.apis.public_v2.models.table_structure_options import TableStructureOptions from deepsearch.cps.apis.public_v2.models.target_conversion_parameters import TargetConversionParameters +from deepsearch.cps.apis.public_v2.models.task import Task from deepsearch.cps.apis.public_v2.models.task_context import TaskContext from deepsearch.cps.apis.public_v2.models.task_result import TaskResult +from deepsearch.cps.apis.public_v2.models.task_type import TaskType from deepsearch.cps.apis.public_v2.models.temporary_upload_file_result import TemporaryUploadFileResult from deepsearch.cps.apis.public_v2.models.temporary_url import TemporaryUrl from deepsearch.cps.apis.public_v2.models.temporary_url_fields import TemporaryUrlFields +from deepsearch.cps.apis.public_v2.models.term import Term +from deepsearch.cps.apis.public_v2.models.text import Text +from deepsearch.cps.apis.public_v2.models.timeout import Timeout +from deepsearch.cps.apis.public_v2.models.title import Title from deepsearch.cps.apis.public_v2.models.token_response import TokenResponse +from deepsearch.cps.apis.public_v2.models.truncate_pages import TruncatePages +from deepsearch.cps.apis.public_v2.models.type import Type +from deepsearch.cps.apis.public_v2.models.type1 import Type1 from deepsearch.cps.apis.public_v2.models.upload_date import UploadDate from deepsearch.cps.apis.public_v2.models.upload_elastic_request_body import UploadElasticRequestBody from deepsearch.cps.apis.public_v2.models.upload_job import UploadJob +from deepsearch.cps.apis.public_v2.models.upload_to_elastic import UploadToElastic +from deepsearch.cps.apis.public_v2.models.url import Url +from deepsearch.cps.apis.public_v2.models.url_refs import UrlRefs from deepsearch.cps.apis.public_v2.models.urls import Urls from deepsearch.cps.apis.public_v2.models.validation_error import ValidationError from deepsearch.cps.apis.public_v2.models.validation_error_loc_inner import ValidationErrorLocInner +from deepsearch.cps.apis.public_v2.models.version import Version +from deepsearch.cps.apis.public_v2.models.version1 import Version1 from deepsearch.cps.apis.public_v2.models.view_of import ViewOf +from deepsearch.cps.apis.public_v2.models.view_of1 import ViewOf1 +from deepsearch.cps.apis.public_v2.models.volume import Volume +from deepsearch.cps.apis.public_v2.models.wait import Wait +from deepsearch.cps.apis.public_v2.models.wait1 import Wait1 +from deepsearch.cps.apis.public_v2.models.with_operations import WithOperations +from deepsearch.cps.apis.public_v2.models.without_operations import WithoutOperations diff --git a/deepsearch/cps/apis/public_v2/models/abstract.py b/deepsearch/cps/apis/public_v2/models/abstract.py new file mode 100644 index 00000000..a473d578 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/abstract.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ABSTRACT_ANY_OF_SCHEMAS = ["object"] + +class Abstract(BaseModel): + """ + Abstract + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Abstract.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Abstract with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Abstract with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/acquisition.py b/deepsearch/cps/apis/public_v2/models/acquisition.py new file mode 100644 index 00000000..5e23c5e8 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/acquisition.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.link import Link +from deepsearch.cps.apis.public_v2.models.model_date import ModelDate +from deepsearch.cps.apis.public_v2.models.size import Size +from typing import Optional, Set +from typing_extensions import Self + +class Acquisition(BaseModel): + """ + Information on how the data was obtained. + """ # noqa: E501 + type: StrictStr = Field(description="The method to obtain the data.") + var_date: Optional[ModelDate] = Field(default=None, alias="date") + link: Optional[Link] = None + size: Optional[Size] = None + __properties: ClassVar[List[str]] = ["type", "date", "link", "size"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['API', 'FTP', 'Download', 'Link', 'Web scraping/Crawling', 'Other']): + raise ValueError("must be one of enum values ('API', 'FTP', 'Download', 'Link', 'Web scraping/Crawling', 'Other')") + return value + + 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 Acquisition 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 var_date + if self.var_date: + _dict['date'] = self.var_date.to_dict() + # override the default output from pydantic by calling `to_dict()` of link + if self.link: + _dict['link'] = self.link.to_dict() + # override the default output from pydantic by calling `to_dict()` of size + if self.size: + _dict['size'] = self.size.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Acquisition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "date": ModelDate.from_dict(obj["date"]) if obj.get("date") is not None else None, + "link": Link.from_dict(obj["link"]) if obj.get("link") is not None else None, + "size": Size.from_dict(obj["size"]) if obj.get("size") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/add_annotations.py b/deepsearch/cps/apis/public_v2/models/add_annotations.py new file mode 100644 index 00000000..5648632e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/add_annotations.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ADDANNOTATIONS_ANY_OF_SCHEMAS = ["bool", "object"] + +class AddAnnotations(BaseModel): + """ + AddAnnotations + """ + + # data type: bool + anyof_schema_1_validator: Optional[StrictBool] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[bool, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["bool", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = AddAnnotations.model_construct() + error_messages = [] + # validate data type: bool + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in AddAnnotations with anyOf schemas: bool, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into bool + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into AddAnnotations with anyOf schemas: bool, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], bool, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/add_raw_pages.py b/deepsearch/cps/apis/public_v2/models/add_raw_pages.py new file mode 100644 index 00000000..df087c23 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/add_raw_pages.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ADDRAWPAGES_ANY_OF_SCHEMAS = ["bool", "object"] + +class AddRawPages(BaseModel): + """ + AddRawPages + """ + + # data type: bool + anyof_schema_1_validator: Optional[StrictBool] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[bool, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["bool", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = AddRawPages.model_construct() + error_messages = [] + # validate data type: bool + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in AddRawPages with anyOf schemas: bool, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into bool + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into AddRawPages with anyOf schemas: bool, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], bool, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/affiliation.py b/deepsearch/cps/apis/public_v2/models/affiliation.py new file mode 100644 index 00000000..602f9ab1 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/affiliation.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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 deepsearch.cps.apis.public_v2.models.id import Id +from deepsearch.cps.apis.public_v2.models.source import Source +from typing import Optional, Set +from typing_extensions import Self + +class Affiliation(BaseModel): + """ + Affiliation. + """ # noqa: E501 + name: StrictStr + id: Optional[Id] = None + source: Optional[Source] = None + __properties: ClassVar[List[str]] = ["name", "id", "source"] + + 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 Affiliation 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 id + if self.id: + _dict['id'] = self.id.to_dict() + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict['source'] = self.source.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Affiliation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "id": Id.from_dict(obj["id"]) if obj.get("id") is not None else None, + "source": Source.from_dict(obj["source"]) if obj.get("source") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/affiliations.py b/deepsearch/cps/apis/public_v2/models/affiliations.py new file mode 100644 index 00000000..762f9471 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/affiliations.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +AFFILIATIONS_ANY_OF_SCHEMAS = ["object"] + +class Affiliations(BaseModel): + """ + Affiliations + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Affiliations.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Affiliations with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Affiliations with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/agent_name.py b/deepsearch/cps/apis/public_v2/models/agent_name.py new file mode 100644 index 00000000..bf18dbfb --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/agent_name.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +AGENTNAME_ANY_OF_SCHEMAS = ["object", "str"] + +class AgentName(BaseModel): + """ + AgentName + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = AgentName.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in AgentName with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into AgentName with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/aggs.py b/deepsearch/cps/apis/public_v2/models/aggs.py new file mode 100644 index 00000000..efbd584b --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/aggs.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +AGGS_ANY_OF_SCHEMAS = ["object"] + +class Aggs(BaseModel): + """ + Aggs + """ + + # data type: object + anyof_schema_1_validator: Optional[Dict[str, Any]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Aggs.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Aggs with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Aggs with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/alias.py b/deepsearch/cps/apis/public_v2/models/alias.py new file mode 100644 index 00000000..88fec972 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/alias.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ALIAS_ANY_OF_SCHEMAS = ["object"] + +class Alias(BaseModel): + """ + A list of tags (aliases) for the collection. + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Alias.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Alias with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Alias with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/aliases.py b/deepsearch/cps/apis/public_v2/models/aliases.py new file mode 100644 index 00000000..3ed032e2 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/aliases.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ALIASES_ANY_OF_SCHEMAS = ["object"] + +class Aliases(BaseModel): + """ + Aliases + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Aliases.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Aliases with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Aliases with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/alternate_names.py b/deepsearch/cps/apis/public_v2/models/alternate_names.py new file mode 100644 index 00000000..1a7dffa0 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/alternate_names.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ALTERNATENAMES_ANY_OF_SCHEMAS = ["object"] + +class AlternateNames(BaseModel): + """ + Other names or abbreviations of this publication. + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = AlternateNames.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in AlternateNames with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into AlternateNames with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/api_server_fastapi_server_public_models_data_indices_upload_models_http_source.py b/deepsearch/cps/apis/public_v2/models/api_server_fastapi_server_public_models_data_indices_upload_models_http_source.py new file mode 100644 index 00000000..cc6e3fea --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/api_server_fastapi_server_public_models_data_indices_upload_models_http_source.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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 deepsearch.cps.apis.public_v2.models.head_url import HeadUrl +from typing import Optional, Set +from typing_extensions import Self + +class ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource(BaseModel): + """ + ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource + """ # noqa: E501 + download_url: StrictStr + head_url: Optional[HeadUrl] = None + headers: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["download_url", "head_url", "headers"] + + 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 ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource 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 head_url + if self.head_url: + _dict['head_url'] = self.head_url.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "download_url": obj.get("download_url"), + "head_url": HeadUrl.from_dict(obj["head_url"]) if obj.get("head_url") is not None else None, + "headers": obj.get("headers") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/internal_url.py b/deepsearch/cps/apis/public_v2/models/api_server_fastapi_server_public_models_data_indices_upload_models_identifier.py similarity index 74% rename from deepsearch/cps/apis/public_v2/models/internal_url.py rename to deepsearch/cps/apis/public_v2/models/api_server_fastapi_server_public_models_data_indices_upload_models_identifier.py index ba3c4f6a..0d1ee93a 100644 --- a/deepsearch/cps/apis/public_v2/models/internal_url.py +++ b/deepsearch/cps/apis/public_v2/models/api_server_fastapi_server_public_models_data_indices_upload_models_identifier.py @@ -17,18 +17,19 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr +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 InternalUrl(BaseModel): +class ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier(BaseModel): """ - InternalUrl + ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier """ # noqa: E501 - download_url: StrictStr - header_url: StrictStr - __properties: ClassVar[List[str]] = ["download_url", "header_url"] + type: StrictStr + name: StrictStr = Field(alias="_name") + value: StrictStr + __properties: ClassVar[List[str]] = ["type", "_name", "value"] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalUrl from a JSON string""" + """Create an instance of ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalUrl from a dict""" + """Create an instance of ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier from a dict""" if obj is None: return None @@ -81,8 +82,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "download_url": obj.get("download_url"), - "header_url": obj.get("header_url") + "type": obj.get("type"), + "_name": obj.get("_name"), + "value": obj.get("value") }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/ccs_task.py b/deepsearch/cps/apis/public_v2/models/api_server_fastapi_server_public_models_project_models_http_source.py similarity index 80% rename from deepsearch/cps/apis/public_v2/models/ccs_task.py rename to deepsearch/cps/apis/public_v2/models/api_server_fastapi_server_public_models_project_models_http_source.py index 0753215b..59a034e2 100644 --- a/deepsearch/cps/apis/public_v2/models/ccs_task.py +++ b/deepsearch/cps/apis/public_v2/models/api_server_fastapi_server_public_models_project_models_http_source.py @@ -22,14 +22,13 @@ from typing import Optional, Set from typing_extensions import Self -class CcsTask(BaseModel): +class ApiServerFastapiServerPublicModelsProjectModelsHttpSource(BaseModel): """ - CcsTask + ApiServerFastapiServerPublicModelsProjectModelsHttpSource """ # noqa: E501 - task_id: StrictStr - ccs_project_key: StrictStr - ccs_collection_name: StrictStr - __properties: ClassVar[List[str]] = ["task_id", "ccs_project_key", "ccs_collection_name"] + url: StrictStr + headers: Dict[str, Any] + __properties: ClassVar[List[str]] = ["url", "headers"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CcsTask from a JSON string""" + """Create an instance of ApiServerFastapiServerPublicModelsProjectModelsHttpSource from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CcsTask from a dict""" + """Create an instance of ApiServerFastapiServerPublicModelsProjectModelsHttpSource from a dict""" if obj is None: return None @@ -82,9 +81,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "task_id": obj.get("task_id"), - "ccs_project_key": obj.get("ccs_project_key"), - "ccs_collection_name": obj.get("ccs_collection_name") + "url": obj.get("url"), + "headers": obj.get("headers") }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/author.py b/deepsearch/cps/apis/public_v2/models/author.py new file mode 100644 index 00000000..bf8aba2e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/author.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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 deepsearch.cps.apis.public_v2.models.affiliations import Affiliations +from deepsearch.cps.apis.public_v2.models.id import Id +from deepsearch.cps.apis.public_v2.models.source import Source +from typing import Optional, Set +from typing_extensions import Self + +class Author(BaseModel): + """ + Author. + """ # noqa: E501 + name: StrictStr + id: Optional[Id] = None + source: Optional[Source] = None + affiliations: Optional[Affiliations] = None + __properties: ClassVar[List[str]] = ["name", "id", "source", "affiliations"] + + 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 Author 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 id + if self.id: + _dict['id'] = self.id.to_dict() + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict['source'] = self.source.to_dict() + # override the default output from pydantic by calling `to_dict()` of affiliations + if self.affiliations: + _dict['affiliations'] = self.affiliations.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Author from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "id": Id.from_dict(obj["id"]) if obj.get("id") is not None else None, + "source": Source.from_dict(obj["source"]) if obj.get("source") is not None else None, + "affiliations": Affiliations.from_dict(obj["affiliations"]) if obj.get("affiliations") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/authors.py b/deepsearch/cps/apis/public_v2/models/authors.py new file mode 100644 index 00000000..660e5107 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/authors.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +AUTHORS_ANY_OF_SCHEMAS = ["object"] + +class Authors(BaseModel): + """ + Authors + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Authors.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Authors with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Authors with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/backend.py b/deepsearch/cps/apis/public_v2/models/backend.py new file mode 100644 index 00000000..16cb21af --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/backend.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +BACKEND_ANY_OF_SCHEMAS = ["object", "str"] + +class Backend(BaseModel): + """ + Backend + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Backend.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Backend with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Backend with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/backend_settings.py b/deepsearch/cps/apis/public_v2/models/backend_settings.py new file mode 100644 index 00000000..686320c7 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/backend_settings.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +BACKENDSETTINGS_ANY_OF_SCHEMAS = ["object"] + +class BackendSettings(BaseModel): + """ + BackendSettings + """ + + # data type: object + anyof_schema_1_validator: Optional[Dict[str, Any]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = BackendSettings.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in BackendSettings with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into BackendSettings with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/begin_date.py b/deepsearch/cps/apis/public_v2/models/begin_date.py new file mode 100644 index 00000000..89332b33 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/begin_date.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +BEGINDATE_ANY_OF_SCHEMAS = ["int", "object"] + +class BeginDate(BaseModel): + """ + BeginDate + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = BeginDate.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in BeginDate with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into BeginDate with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/citation_count.py b/deepsearch/cps/apis/public_v2/models/citation_count.py new file mode 100644 index 00000000..2fb0f9fc --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/citation_count.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing_extensions import Annotated +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CITATIONCOUNT_ANY_OF_SCHEMAS = ["int", "object"] + +class CitationCount(BaseModel): + """ + Total number of citations that this document has received (number of documents in whose bibliography this document appears). + """ + + # data type: int + anyof_schema_1_validator: Optional[Annotated[int, Field(strict=True, ge=0)]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CitationCount.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CitationCount with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CitationCount with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/citation_count_date.py b/deepsearch/cps/apis/public_v2/models/citation_count_date.py new file mode 100644 index 00000000..18f09280 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/citation_count_date.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CITATIONCOUNTDATE_ANY_OF_SCHEMAS = ["datetime", "object"] + +class CitationCountDate(BaseModel): + """ + Last update date of the citation count. + """ + + # data type: datetime + anyof_schema_1_validator: Optional[datetime] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[datetime, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["datetime", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CitationCountDate.model_construct() + error_messages = [] + # validate data type: datetime + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CitationCountDate with anyOf schemas: datetime, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into datetime + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CitationCountDate with anyOf schemas: datetime, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], datetime, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/code.py b/deepsearch/cps/apis/public_v2/models/code.py new file mode 100644 index 00000000..17eb33f0 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/code.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CODE_ANY_OF_SCHEMAS = ["object", "str"] + +class Code(BaseModel): + """ + Code + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Code.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Code with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Code with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/collection_document_info_str.py b/deepsearch/cps/apis/public_v2/models/collection_document_info_str.py new file mode 100644 index 00000000..2a02d459 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/collection_document_info_str.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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, Field +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.alias import Alias +from deepsearch.cps.apis.public_v2.models.name import Name +from deepsearch.cps.apis.public_v2.models.version import Version +from typing import Optional, Set +from typing_extensions import Self + +class CollectionDocumentInfoStr(BaseModel): + """ + CollectionDocumentInfoStr + """ # noqa: E501 + name: Optional[Name] = None + type: Optional[Any] = Field(description="The collection type.") + version: Optional[Version] = None + alias: Optional[Alias] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name", "type", "version", "alias"] + + 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 CollectionDocumentInfoStr 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of name + if self.name: + _dict['name'] = self.name.to_dict() + # override the default output from pydantic by calling `to_dict()` of version + if self.version: + _dict['version'] = self.version.to_dict() + # override the default output from pydantic by calling `to_dict()` of alias + if self.alias: + _dict['alias'] = self.alias.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CollectionDocumentInfoStr from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": Name.from_dict(obj["name"]) if obj.get("name") is not None else None, + "type": obj.get("type"), + "version": Version.from_dict(obj["version"]) if obj.get("version") is not None else None, + "alias": Alias.from_dict(obj["alias"]) if obj.get("alias") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/collection_metadata_settings.py b/deepsearch/cps/apis/public_v2/models/collection_metadata_settings.py index e7091f9d..c912d998 100644 --- a/deepsearch/cps/apis/public_v2/models/collection_metadata_settings.py +++ b/deepsearch/cps/apis/public_v2/models/collection_metadata_settings.py @@ -17,8 +17,13 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.description import Description +from deepsearch.cps.apis.public_v2.models.display_name import DisplayName +from deepsearch.cps.apis.public_v2.models.license import License +from deepsearch.cps.apis.public_v2.models.source1 import Source1 +from deepsearch.cps.apis.public_v2.models.version1 import Version1 from typing import Optional, Set from typing_extensions import Self @@ -26,11 +31,11 @@ class CollectionMetadataSettings(BaseModel): """ CollectionMetadataSettings """ # noqa: E501 - description: Optional[StrictStr] = None - display_name: Optional[StrictStr] = None - license: Optional[StrictStr] = None - source: Optional[StrictStr] = None - version: Optional[StrictStr] = None + description: Optional[Description] = None + display_name: Optional[DisplayName] = None + license: Optional[License] = None + source: Optional[Source1] = None + version: Optional[Version1] = None __properties: ClassVar[List[str]] = ["description", "display_name", "license", "source", "version"] model_config = ConfigDict( @@ -72,6 +77,21 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of description + if self.description: + _dict['description'] = self.description.to_dict() + # override the default output from pydantic by calling `to_dict()` of display_name + if self.display_name: + _dict['display_name'] = self.display_name.to_dict() + # override the default output from pydantic by calling `to_dict()` of license + if self.license: + _dict['license'] = self.license.to_dict() + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict['source'] = self.source.to_dict() + # override the default output from pydantic by calling `to_dict()` of version + if self.version: + _dict['version'] = self.version.to_dict() return _dict @classmethod @@ -84,11 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "description": obj.get("description"), - "display_name": obj.get("display_name"), - "license": obj.get("license"), - "source": obj.get("source"), - "version": obj.get("version") + "description": Description.from_dict(obj["description"]) if obj.get("description") is not None else None, + "display_name": DisplayName.from_dict(obj["display_name"]) if obj.get("display_name") is not None else None, + "license": License.from_dict(obj["license"]) if obj.get("license") is not None else None, + "source": Source1.from_dict(obj["source"]) if obj.get("source") is not None else None, + "version": Version1.from_dict(obj["version"]) if obj.get("version") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/comment.py b/deepsearch/cps/apis/public_v2/models/comment.py new file mode 100644 index 00000000..24207ca4 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/comment.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +COMMENT_ANY_OF_SCHEMAS = ["object", "str"] + +class Comment(BaseModel): + """ + A description of the task or any comments in natural language. + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Comment.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Comment with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Comment with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/completed_at.py b/deepsearch/cps/apis/public_v2/models/completed_at.py new file mode 100644 index 00000000..8e1ca226 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/completed_at.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +COMPLETEDAT_ANY_OF_SCHEMAS = ["datetime", "object"] + +class CompletedAt(BaseModel): + """ + CompletedAt + """ + + # data type: datetime + anyof_schema_1_validator: Optional[datetime] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[datetime, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["datetime", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CompletedAt.model_construct() + error_messages = [] + # validate data type: datetime + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CompletedAt with anyOf schemas: datetime, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into datetime + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CompletedAt with anyOf schemas: datetime, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], datetime, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/config.py b/deepsearch/cps/apis/public_v2/models/config.py index 3e12f038..0ced84db 100644 --- a/deepsearch/cps/apis/public_v2/models/config.py +++ b/deepsearch/cps/apis/public_v2/models/config.py @@ -13,44 +13,48 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Optional +from typing import Any, List, Optional +from deepsearch.cps.apis.public_v2.models.gen_ai_openai import GenAIOpenai from deepsearch.cps.apis.public_v2.models.gen_ai_watsonx import GenAIWatsonx from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock import GenAIAWSBedrock from deepsearch.cps.apis.public_v2.models.gen_aibam import GenAIBAM +from deepsearch.cps.apis.public_v2.models.gen_aicpd import GenAICPD from deepsearch.cps.apis.public_v2.models.gen_aihf_inference_api import GenAIHFInferenceApi -from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict from typing_extensions import Literal, Self -from pydantic import Field -CONFIG_ANY_OF_SCHEMAS = ["GenAIAWSBedrock", "GenAIBAM", "GenAIHFInferenceApi", "GenAIWatsonx"] +CONFIG_ONE_OF_SCHEMAS = ["GenAIAWSBedrock", "GenAIBAM", "GenAICPD", "GenAIHFInferenceApi", "GenAIOpenai", "GenAIWatsonx"] class Config(BaseModel): """ Config """ - # data type: GenAIBAM - anyof_schema_1_validator: Optional[GenAIBAM] = None + oneof_schema_1_validator: Optional[GenAIBAM] = None # data type: GenAIWatsonx - anyof_schema_2_validator: Optional[GenAIWatsonx] = None + oneof_schema_2_validator: Optional[GenAIWatsonx] = None + # data type: GenAICPD + oneof_schema_3_validator: Optional[GenAICPD] = None # data type: GenAIHFInferenceApi - anyof_schema_3_validator: Optional[GenAIHFInferenceApi] = None + oneof_schema_4_validator: Optional[GenAIHFInferenceApi] = None + # data type: GenAIOpenai + oneof_schema_5_validator: Optional[GenAIOpenai] = None # data type: GenAIAWSBedrock - anyof_schema_4_validator: Optional[GenAIAWSBedrock] = None - if TYPE_CHECKING: - actual_instance: Optional[Union[GenAIAWSBedrock, GenAIBAM, GenAIHFInferenceApi, GenAIWatsonx]] = None - else: - actual_instance: Any = None - any_of_schemas: List[str] = Field(default=Literal["GenAIAWSBedrock", "GenAIBAM", "GenAIHFInferenceApi", "GenAIWatsonx"]) - - model_config = { - "validate_assignment": True, - "protected_namespaces": (), + oneof_schema_6_validator: Optional[GenAIAWSBedrock] = None + actual_instance: Optional[Union[GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx]] = None + one_of_schemas: List[str] = Field(default=Literal["GenAIAWSBedrock", "GenAIBAM", "GenAICPD", "GenAIHFInferenceApi", "GenAIOpenai", "GenAIWatsonx"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -64,41 +68,51 @@ def __init__(self, *args, **kwargs) -> None: super().__init__(**kwargs) @field_validator('actual_instance') - def actual_instance_must_validate_anyof(cls, v): + def actual_instance_must_validate_oneof(cls, v): instance = Config.model_construct() error_messages = [] + match = 0 # validate data type: GenAIBAM if not isinstance(v, GenAIBAM): error_messages.append(f"Error! Input type `{type(v)}` is not `GenAIBAM`") else: - return v - + match += 1 # validate data type: GenAIWatsonx if not isinstance(v, GenAIWatsonx): error_messages.append(f"Error! Input type `{type(v)}` is not `GenAIWatsonx`") else: - return v - + match += 1 + # validate data type: GenAICPD + if not isinstance(v, GenAICPD): + error_messages.append(f"Error! Input type `{type(v)}` is not `GenAICPD`") + else: + match += 1 # validate data type: GenAIHFInferenceApi if not isinstance(v, GenAIHFInferenceApi): error_messages.append(f"Error! Input type `{type(v)}` is not `GenAIHFInferenceApi`") else: - return v - + match += 1 + # validate data type: GenAIOpenai + if not isinstance(v, GenAIOpenai): + error_messages.append(f"Error! Input type `{type(v)}` is not `GenAIOpenai`") + else: + match += 1 # validate data type: GenAIAWSBedrock if not isinstance(v, GenAIAWSBedrock): error_messages.append(f"Error! Input type `{type(v)}` is not `GenAIAWSBedrock`") else: - return v - - if error_messages: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in Config with oneOf schemas: GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx. Details: " + ", ".join(error_messages)) + elif match == 0: # no match - raise ValueError("No match found when setting the actual_instance in Config with anyOf schemas: GenAIAWSBedrock, GenAIBAM, GenAIHFInferenceApi, GenAIWatsonx. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in Config with oneOf schemas: GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx. Details: " + ", ".join(error_messages)) else: return v @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Self: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod @@ -106,34 +120,51 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[GenAIBAM] = None + match = 0 + + # deserialize data into GenAIBAM try: instance.actual_instance = GenAIBAM.from_json(json_str) - return instance + match += 1 except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[GenAIWatsonx] = None + error_messages.append(str(e)) + # deserialize data into GenAIWatsonx try: instance.actual_instance = GenAIWatsonx.from_json(json_str) - return instance + match += 1 except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_3_validator: Optional[GenAIHFInferenceApi] = None + error_messages.append(str(e)) + # deserialize data into GenAICPD + try: + instance.actual_instance = GenAICPD.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into GenAIHFInferenceApi try: instance.actual_instance = GenAIHFInferenceApi.from_json(json_str) - return instance + match += 1 except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_4_validator: Optional[GenAIAWSBedrock] = None + error_messages.append(str(e)) + # deserialize data into GenAIOpenai + try: + instance.actual_instance = GenAIOpenai.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into GenAIAWSBedrock try: instance.actual_instance = GenAIAWSBedrock.from_json(json_str) - return instance + match += 1 except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + error_messages.append(str(e)) - if error_messages: + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into Config with oneOf schemas: GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx. Details: " + ", ".join(error_messages)) + elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into Config with anyOf schemas: GenAIAWSBedrock, GenAIBAM, GenAIHFInferenceApi, GenAIWatsonx. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Config with oneOf schemas: GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx. Details: " + ", ".join(error_messages)) else: return instance @@ -147,7 +178,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], GenAIAWSBedrock, GenAIBAM, GenAIHFInferenceApi, GenAIWatsonx]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None @@ -155,6 +186,7 @@ def to_dict(self) -> Optional[Union[Dict[str, Any], GenAIAWSBedrock, GenAIBAM, G if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: + # primitive type return self.actual_instance def to_str(self) -> str: diff --git a/deepsearch/cps/apis/public_v2/models/conversion_settings.py b/deepsearch/cps/apis/public_v2/models/conversion_settings.py new file mode 100644 index 00000000..c59c7dbc --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/conversion_settings.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters import PartialDirectConversionParameters +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_input import ProjectDataIndexConversionSettingsInput +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CONVERSIONSETTINGS_ANY_OF_SCHEMAS = ["PartialDirectConversionParameters", "ProjectDataIndexConversionSettingsInput", "object"] + +class ConversionSettings(BaseModel): + """ + Specify the conversion settings to use. + """ + + # data type: ProjectDataIndexConversionSettingsInput + anyof_schema_1_validator: Optional[ProjectDataIndexConversionSettingsInput] = None + # data type: PartialDirectConversionParameters + anyof_schema_2_validator: Optional[PartialDirectConversionParameters] = None + # data type: object + anyof_schema_3_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[PartialDirectConversionParameters, ProjectDataIndexConversionSettingsInput, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["PartialDirectConversionParameters", "ProjectDataIndexConversionSettingsInput", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ConversionSettings.model_construct() + error_messages = [] + # validate data type: ProjectDataIndexConversionSettingsInput + if not isinstance(v, ProjectDataIndexConversionSettingsInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `ProjectDataIndexConversionSettingsInput`") + else: + return v + + # validate data type: PartialDirectConversionParameters + if not isinstance(v, PartialDirectConversionParameters): + error_messages.append(f"Error! Input type `{type(v)}` is not `PartialDirectConversionParameters`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_3_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ConversionSettings with anyOf schemas: PartialDirectConversionParameters, ProjectDataIndexConversionSettingsInput, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[ProjectDataIndexConversionSettingsInput] = None + try: + instance.actual_instance = ProjectDataIndexConversionSettingsInput.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[PartialDirectConversionParameters] = None + try: + instance.actual_instance = PartialDirectConversionParameters.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_3_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_3_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ConversionSettings with anyOf schemas: PartialDirectConversionParameters, ProjectDataIndexConversionSettingsInput, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], PartialDirectConversionParameters, ProjectDataIndexConversionSettingsInput, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/convert_document_request.py b/deepsearch/cps/apis/public_v2/models/convert_document_request.py index e1e86c03..ba80ae4a 100644 --- a/deepsearch/cps/apis/public_v2/models/convert_document_request.py +++ b/deepsearch/cps/apis/public_v2/models/convert_document_request.py @@ -19,8 +19,11 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.file_source import FileSource -from deepsearch.cps.apis.public_v2.models.http_source import HttpSource +from deepsearch.cps.apis.public_v2.models.convert_document_request_file_source import ConvertDocumentRequestFileSource +from deepsearch.cps.apis.public_v2.models.convert_document_request_http_source import ConvertDocumentRequestHttpSource +from deepsearch.cps.apis.public_v2.models.convert_document_request_image_urls import ConvertDocumentRequestImageUrls +from deepsearch.cps.apis.public_v2.models.convert_document_request_settings import ConvertDocumentRequestSettings +from deepsearch.cps.apis.public_v2.models.truncate_pages import TruncatePages from typing import Optional, Set from typing_extensions import Self @@ -28,9 +31,12 @@ class ConvertDocumentRequest(BaseModel): """ ConvertDocumentRequest """ # noqa: E501 - http_source: Optional[HttpSource] = None - file_source: Optional[FileSource] = None - __properties: ClassVar[List[str]] = ["http_source", "file_source"] + http_source: Optional[ConvertDocumentRequestHttpSource] = None + file_source: Optional[ConvertDocumentRequestFileSource] = None + settings: Optional[ConvertDocumentRequestSettings] = None + image_urls: Optional[ConvertDocumentRequestImageUrls] = None + truncate_pages: Optional[TruncatePages] = None + __properties: ClassVar[List[str]] = ["http_source", "file_source", "settings", "image_urls", "truncate_pages"] model_config = ConfigDict( populate_by_name=True, @@ -77,6 +83,15 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of file_source if self.file_source: _dict['file_source'] = self.file_source.to_dict() + # override the default output from pydantic by calling `to_dict()` of settings + if self.settings: + _dict['settings'] = self.settings.to_dict() + # override the default output from pydantic by calling `to_dict()` of image_urls + if self.image_urls: + _dict['image_urls'] = self.image_urls.to_dict() + # override the default output from pydantic by calling `to_dict()` of truncate_pages + if self.truncate_pages: + _dict['truncate_pages'] = self.truncate_pages.to_dict() return _dict @classmethod @@ -89,8 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "http_source": HttpSource.from_dict(obj["http_source"]) if obj.get("http_source") is not None else None, - "file_source": FileSource.from_dict(obj["file_source"]) if obj.get("file_source") is not None else None + "http_source": ConvertDocumentRequestHttpSource.from_dict(obj["http_source"]) if obj.get("http_source") is not None else None, + "file_source": ConvertDocumentRequestFileSource.from_dict(obj["file_source"]) if obj.get("file_source") is not None else None, + "settings": ConvertDocumentRequestSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None, + "image_urls": ConvertDocumentRequestImageUrls.from_dict(obj["image_urls"]) if obj.get("image_urls") is not None else None, + "truncate_pages": TruncatePages.from_dict(obj["truncate_pages"]) if obj.get("truncate_pages") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/convert_document_request_file_source.py b/deepsearch/cps/apis/public_v2/models/convert_document_request_file_source.py new file mode 100644 index 00000000..6d173f8d --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/convert_document_request_file_source.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.file_source import FileSource +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CONVERTDOCUMENTREQUESTFILESOURCE_ANY_OF_SCHEMAS = ["FileSource", "object"] + +class ConvertDocumentRequestFileSource(BaseModel): + """ + ConvertDocumentRequestFileSource + """ + + # data type: FileSource + anyof_schema_1_validator: Optional[FileSource] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[FileSource, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["FileSource", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ConvertDocumentRequestFileSource.model_construct() + error_messages = [] + # validate data type: FileSource + if not isinstance(v, FileSource): + error_messages.append(f"Error! Input type `{type(v)}` is not `FileSource`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ConvertDocumentRequestFileSource with anyOf schemas: FileSource, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[FileSource] = None + try: + instance.actual_instance = FileSource.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ConvertDocumentRequestFileSource with anyOf schemas: FileSource, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], FileSource, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/convert_document_request_http_source.py b/deepsearch/cps/apis/public_v2/models/convert_document_request_http_source.py new file mode 100644 index 00000000..4580c689 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/convert_document_request_http_source.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.api_server_fastapi_server_public_models_project_models_http_source import ApiServerFastapiServerPublicModelsProjectModelsHttpSource +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CONVERTDOCUMENTREQUESTHTTPSOURCE_ANY_OF_SCHEMAS = ["ApiServerFastapiServerPublicModelsProjectModelsHttpSource", "object"] + +class ConvertDocumentRequestHttpSource(BaseModel): + """ + ConvertDocumentRequestHttpSource + """ + + # data type: ApiServerFastapiServerPublicModelsProjectModelsHttpSource + anyof_schema_1_validator: Optional[ApiServerFastapiServerPublicModelsProjectModelsHttpSource] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ApiServerFastapiServerPublicModelsProjectModelsHttpSource, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ApiServerFastapiServerPublicModelsProjectModelsHttpSource", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ConvertDocumentRequestHttpSource.model_construct() + error_messages = [] + # validate data type: ApiServerFastapiServerPublicModelsProjectModelsHttpSource + if not isinstance(v, ApiServerFastapiServerPublicModelsProjectModelsHttpSource): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiServerFastapiServerPublicModelsProjectModelsHttpSource`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ConvertDocumentRequestHttpSource with anyOf schemas: ApiServerFastapiServerPublicModelsProjectModelsHttpSource, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[ApiServerFastapiServerPublicModelsProjectModelsHttpSource] = None + try: + instance.actual_instance = ApiServerFastapiServerPublicModelsProjectModelsHttpSource.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ConvertDocumentRequestHttpSource with anyOf schemas: ApiServerFastapiServerPublicModelsProjectModelsHttpSource, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ApiServerFastapiServerPublicModelsProjectModelsHttpSource, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/convert_document_request_image_urls.py b/deepsearch/cps/apis/public_v2/models/convert_document_request_image_urls.py new file mode 100644 index 00000000..7127611b --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/convert_document_request_image_urls.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.image_urls_info import ImageUrlsInfo +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CONVERTDOCUMENTREQUESTIMAGEURLS_ANY_OF_SCHEMAS = ["ImageUrlsInfo", "object"] + +class ConvertDocumentRequestImageUrls(BaseModel): + """ + ConvertDocumentRequestImageUrls + """ + + # data type: ImageUrlsInfo + anyof_schema_1_validator: Optional[ImageUrlsInfo] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ImageUrlsInfo, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ImageUrlsInfo", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ConvertDocumentRequestImageUrls.model_construct() + error_messages = [] + # validate data type: ImageUrlsInfo + if not isinstance(v, ImageUrlsInfo): + error_messages.append(f"Error! Input type `{type(v)}` is not `ImageUrlsInfo`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ConvertDocumentRequestImageUrls with anyOf schemas: ImageUrlsInfo, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[ImageUrlsInfo] = None + try: + instance.actual_instance = ImageUrlsInfo.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ConvertDocumentRequestImageUrls with anyOf schemas: ImageUrlsInfo, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ImageUrlsInfo, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/convert_document_request_settings.py b/deepsearch/cps/apis/public_v2/models/convert_document_request_settings.py new file mode 100644 index 00000000..68e2f759 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/convert_document_request_settings.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_input import ProjectDataIndexConversionSettingsInput +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CONVERTDOCUMENTREQUESTSETTINGS_ANY_OF_SCHEMAS = ["ProjectDataIndexConversionSettingsInput", "object"] + +class ConvertDocumentRequestSettings(BaseModel): + """ + ConvertDocumentRequestSettings + """ + + # data type: ProjectDataIndexConversionSettingsInput + anyof_schema_1_validator: Optional[ProjectDataIndexConversionSettingsInput] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ProjectDataIndexConversionSettingsInput, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ProjectDataIndexConversionSettingsInput", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ConvertDocumentRequestSettings.model_construct() + error_messages = [] + # validate data type: ProjectDataIndexConversionSettingsInput + if not isinstance(v, ProjectDataIndexConversionSettingsInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `ProjectDataIndexConversionSettingsInput`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ConvertDocumentRequestSettings with anyOf schemas: ProjectDataIndexConversionSettingsInput, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[ProjectDataIndexConversionSettingsInput] = None + try: + instance.actual_instance = ProjectDataIndexConversionSettingsInput.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ConvertDocumentRequestSettings with anyOf schemas: ProjectDataIndexConversionSettingsInput, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ProjectDataIndexConversionSettingsInput, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/convert_documents_request_body.py b/deepsearch/cps/apis/public_v2/models/convert_documents_request_body.py index 204cb0f5..b38941b8 100644 --- a/deepsearch/cps/apis/public_v2/models/convert_documents_request_body.py +++ b/deepsearch/cps/apis/public_v2/models/convert_documents_request_body.py @@ -17,10 +17,13 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters import PartialDirectConversionParameters -from deepsearch.cps.apis.public_v2.models.target_conversion_parameters import TargetConversionParameters +from deepsearch.cps.apis.public_v2.models.conversion_settings import ConversionSettings +from deepsearch.cps.apis.public_v2.models.convert_documents_request_body_target_settings import ConvertDocumentsRequestBodyTargetSettings +from deepsearch.cps.apis.public_v2.models.document_hashes import DocumentHashes +from deepsearch.cps.apis.public_v2.models.upload_to_elastic import UploadToElastic +from deepsearch.cps.apis.public_v2.models.without_operations import WithoutOperations from typing import Optional, Set from typing_extensions import Self @@ -28,24 +31,13 @@ class ConvertDocumentsRequestBody(BaseModel): """ ConvertDocumentsRequestBody """ # noqa: E501 - conversion_settings: Optional[PartialDirectConversionParameters] = Field(default=None, description="Specify the conversion settings to use.") - target_settings: Optional[TargetConversionParameters] = Field(default=None, description="Specify the target settings to use.") - document_hashes: Optional[List[StrictStr]] = Field(default=None, description="List of document hashes to be used as filter.") - without_operations: Optional[List[StrictStr]] = Field(default=None, description="List of Operation Status documents don't have to be used as filter.") - upload_to_elastic: Optional[StrictBool] = None + conversion_settings: Optional[ConversionSettings] = None + target_settings: Optional[ConvertDocumentsRequestBodyTargetSettings] = None + document_hashes: Optional[DocumentHashes] = None + without_operations: Optional[WithoutOperations] = None + upload_to_elastic: Optional[UploadToElastic] = None __properties: ClassVar[List[str]] = ["conversion_settings", "target_settings", "document_hashes", "without_operations", "upload_to_elastic"] - @field_validator('without_operations') - def without_operations_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - for i in value: - if i not in set(['PENDING', 'FAILURE', 'SUCCESS']): - raise ValueError("each list item must be one of ('PENDING', 'FAILURE', 'SUCCESS')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -91,6 +83,15 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of target_settings if self.target_settings: _dict['target_settings'] = self.target_settings.to_dict() + # override the default output from pydantic by calling `to_dict()` of document_hashes + if self.document_hashes: + _dict['document_hashes'] = self.document_hashes.to_dict() + # override the default output from pydantic by calling `to_dict()` of without_operations + if self.without_operations: + _dict['without_operations'] = self.without_operations.to_dict() + # override the default output from pydantic by calling `to_dict()` of upload_to_elastic + if self.upload_to_elastic: + _dict['upload_to_elastic'] = self.upload_to_elastic.to_dict() return _dict @classmethod @@ -103,11 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conversion_settings": PartialDirectConversionParameters.from_dict(obj["conversion_settings"]) if obj.get("conversion_settings") is not None else None, - "target_settings": TargetConversionParameters.from_dict(obj["target_settings"]) if obj.get("target_settings") is not None else None, - "document_hashes": obj.get("document_hashes"), - "without_operations": obj.get("without_operations"), - "upload_to_elastic": obj.get("upload_to_elastic") + "conversion_settings": ConversionSettings.from_dict(obj["conversion_settings"]) if obj.get("conversion_settings") is not None else None, + "target_settings": ConvertDocumentsRequestBodyTargetSettings.from_dict(obj["target_settings"]) if obj.get("target_settings") is not None else None, + "document_hashes": DocumentHashes.from_dict(obj["document_hashes"]) if obj.get("document_hashes") is not None else None, + "without_operations": WithoutOperations.from_dict(obj["without_operations"]) if obj.get("without_operations") is not None else None, + "upload_to_elastic": UploadToElastic.from_dict(obj["upload_to_elastic"]) if obj.get("upload_to_elastic") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/convert_documents_request_body_target_settings.py b/deepsearch/cps/apis/public_v2/models/convert_documents_request_body_target_settings.py new file mode 100644 index 00000000..f3ab0555 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/convert_documents_request_body_target_settings.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.target_conversion_parameters import TargetConversionParameters +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CONVERTDOCUMENTSREQUESTBODYTARGETSETTINGS_ANY_OF_SCHEMAS = ["TargetConversionParameters", "object"] + +class ConvertDocumentsRequestBodyTargetSettings(BaseModel): + """ + Specify the target settings to use. + """ + + # data type: TargetConversionParameters + anyof_schema_1_validator: Optional[TargetConversionParameters] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[TargetConversionParameters, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["TargetConversionParameters", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ConvertDocumentsRequestBodyTargetSettings.model_construct() + error_messages = [] + # validate data type: TargetConversionParameters + if not isinstance(v, TargetConversionParameters): + error_messages.append(f"Error! Input type `{type(v)}` is not `TargetConversionParameters`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ConvertDocumentsRequestBodyTargetSettings with anyOf schemas: TargetConversionParameters, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[TargetConversionParameters] = None + try: + instance.actual_instance = TargetConversionParameters.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ConvertDocumentsRequestBodyTargetSettings with anyOf schemas: TargetConversionParameters, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], TargetConversionParameters, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/convert_documents_sources.py b/deepsearch/cps/apis/public_v2/models/convert_documents_sources.py index 72596258..a14d61f5 100644 --- a/deepsearch/cps/apis/public_v2/models/convert_documents_sources.py +++ b/deepsearch/cps/apis/public_v2/models/convert_documents_sources.py @@ -17,10 +17,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.internal_url import InternalUrl -from deepsearch.cps.apis.public_v2.models.s3_document_source import S3DocumentSource +from deepsearch.cps.apis.public_v2.models.convert_documents_sources_s3_source import ConvertDocumentsSourcesS3Source +from deepsearch.cps.apis.public_v2.models.file_url import FileUrl +from deepsearch.cps.apis.public_v2.models.http_source import HttpSource from typing import Optional, Set from typing_extensions import Self @@ -28,10 +29,10 @@ class ConvertDocumentsSources(BaseModel): """ ConvertDocumentsSources """ # noqa: E501 - file_url: Optional[List[StrictStr]] = Field(default=None, description="List of File's URL to be converted and uploaded to the data index.") - internal_file_url: Optional[List[InternalUrl]] = Field(default=None, description="List of Internal File's URLs to be converted and uploaded to the data index.") - s3_source: Optional[S3DocumentSource] = Field(default=None, description="Coordinates to object store to get files to convert. Can specify which files with object keys.") - __properties: ClassVar[List[str]] = ["file_url", "internal_file_url", "s3_source"] + file_url: Optional[FileUrl] = None + http_source: Optional[HttpSource] = None + s3_source: Optional[ConvertDocumentsSourcesS3Source] = None + __properties: ClassVar[List[str]] = ["file_url", "http_source", "s3_source"] model_config = ConfigDict( populate_by_name=True, @@ -72,13 +73,12 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in internal_file_url (list) - _items = [] - if self.internal_file_url: - for _item in self.internal_file_url: - if _item: - _items.append(_item.to_dict()) - _dict['internal_file_url'] = _items + # override the default output from pydantic by calling `to_dict()` of file_url + if self.file_url: + _dict['file_url'] = self.file_url.to_dict() + # override the default output from pydantic by calling `to_dict()` of http_source + if self.http_source: + _dict['http_source'] = self.http_source.to_dict() # override the default output from pydantic by calling `to_dict()` of s3_source if self.s3_source: _dict['s3_source'] = self.s3_source.to_dict() @@ -94,9 +94,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "file_url": obj.get("file_url"), - "internal_file_url": [InternalUrl.from_dict(_item) for _item in obj["internal_file_url"]] if obj.get("internal_file_url") is not None else None, - "s3_source": S3DocumentSource.from_dict(obj["s3_source"]) if obj.get("s3_source") is not None else None + "file_url": FileUrl.from_dict(obj["file_url"]) if obj.get("file_url") is not None else None, + "http_source": HttpSource.from_dict(obj["http_source"]) if obj.get("http_source") is not None else None, + "s3_source": ConvertDocumentsSourcesS3Source.from_dict(obj["s3_source"]) if obj.get("s3_source") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/convert_documents_sources_s3_source.py b/deepsearch/cps/apis/public_v2/models/convert_documents_sources_s3_source.py new file mode 100644 index 00000000..7a4735a9 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/convert_documents_sources_s3_source.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.s3_document_source import S3DocumentSource +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CONVERTDOCUMENTSSOURCESS3SOURCE_ANY_OF_SCHEMAS = ["S3DocumentSource", "object"] + +class ConvertDocumentsSourcesS3Source(BaseModel): + """ + Coordinates to object store to get files to convert. Can specify which files with object keys. + """ + + # data type: S3DocumentSource + anyof_schema_1_validator: Optional[S3DocumentSource] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[S3DocumentSource, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["S3DocumentSource", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ConvertDocumentsSourcesS3Source.model_construct() + error_messages = [] + # validate data type: S3DocumentSource + if not isinstance(v, S3DocumentSource): + error_messages.append(f"Error! Input type `{type(v)}` is not `S3DocumentSource`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ConvertDocumentsSourcesS3Source with anyOf schemas: S3DocumentSource, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[S3DocumentSource] = None + try: + instance.actual_instance = S3DocumentSource.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ConvertDocumentsSourcesS3Source with anyOf schemas: S3DocumentSource, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], S3DocumentSource, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/convert_upload_documents_request_body.py b/deepsearch/cps/apis/public_v2/models/convert_upload_documents_request_body.py index b316700a..39f202c1 100644 --- a/deepsearch/cps/apis/public_v2/models/convert_upload_documents_request_body.py +++ b/deepsearch/cps/apis/public_v2/models/convert_upload_documents_request_body.py @@ -17,12 +17,15 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.internal_url import InternalUrl -from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters import PartialDirectConversionParameters -from deepsearch.cps.apis.public_v2.models.s3_document_source import S3DocumentSource -from deepsearch.cps.apis.public_v2.models.target_conversion_parameters import TargetConversionParameters +from deepsearch.cps.apis.public_v2.models.conversion_settings import ConversionSettings +from deepsearch.cps.apis.public_v2.models.convert_documents_request_body_target_settings import ConvertDocumentsRequestBodyTargetSettings +from deepsearch.cps.apis.public_v2.models.convert_documents_sources_s3_source import ConvertDocumentsSourcesS3Source +from deepsearch.cps.apis.public_v2.models.convert_upload_documents_request_body_meta import ConvertUploadDocumentsRequestBodyMeta +from deepsearch.cps.apis.public_v2.models.file_url import FileUrl +from deepsearch.cps.apis.public_v2.models.http_source import HttpSource +from deepsearch.cps.apis.public_v2.models.upload_to_elastic import UploadToElastic from typing import Optional, Set from typing_extensions import Self @@ -30,13 +33,14 @@ class ConvertUploadDocumentsRequestBody(BaseModel): """ ConvertUploadDocumentsRequestBody """ # noqa: E501 - file_url: Optional[List[StrictStr]] = Field(default=None, description="List of File's URL to be converted and uploaded to the data index.") - internal_file_url: Optional[List[InternalUrl]] = Field(default=None, description="List of Internal File's URLs to be converted and uploaded to the data index.") - s3_source: Optional[S3DocumentSource] = Field(default=None, description="Coordinates to object store to get files to convert. Can specify which files with object keys.") - upload_to_elastic: Optional[StrictBool] = None - conversion_settings: Optional[PartialDirectConversionParameters] = Field(default=None, description="Specify the conversion settings to use.") - target_settings: Optional[TargetConversionParameters] = Field(default=None, description="Specify the target settings to use.") - __properties: ClassVar[List[str]] = ["file_url", "internal_file_url", "s3_source", "upload_to_elastic", "conversion_settings", "target_settings"] + file_url: Optional[FileUrl] = None + http_source: Optional[HttpSource] = None + s3_source: Optional[ConvertDocumentsSourcesS3Source] = None + upload_to_elastic: Optional[UploadToElastic] = None + meta: Optional[ConvertUploadDocumentsRequestBodyMeta] = None + conversion_settings: Optional[ConversionSettings] = None + target_settings: Optional[ConvertDocumentsRequestBodyTargetSettings] = None + __properties: ClassVar[List[str]] = ["file_url", "http_source", "s3_source", "upload_to_elastic", "meta", "conversion_settings", "target_settings"] model_config = ConfigDict( populate_by_name=True, @@ -77,16 +81,21 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in internal_file_url (list) - _items = [] - if self.internal_file_url: - for _item in self.internal_file_url: - if _item: - _items.append(_item.to_dict()) - _dict['internal_file_url'] = _items + # override the default output from pydantic by calling `to_dict()` of file_url + if self.file_url: + _dict['file_url'] = self.file_url.to_dict() + # override the default output from pydantic by calling `to_dict()` of http_source + if self.http_source: + _dict['http_source'] = self.http_source.to_dict() # override the default output from pydantic by calling `to_dict()` of s3_source if self.s3_source: _dict['s3_source'] = self.s3_source.to_dict() + # override the default output from pydantic by calling `to_dict()` of upload_to_elastic + if self.upload_to_elastic: + _dict['upload_to_elastic'] = self.upload_to_elastic.to_dict() + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() # override the default output from pydantic by calling `to_dict()` of conversion_settings if self.conversion_settings: _dict['conversion_settings'] = self.conversion_settings.to_dict() @@ -105,12 +114,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "file_url": obj.get("file_url"), - "internal_file_url": [InternalUrl.from_dict(_item) for _item in obj["internal_file_url"]] if obj.get("internal_file_url") is not None else None, - "s3_source": S3DocumentSource.from_dict(obj["s3_source"]) if obj.get("s3_source") is not None else None, - "upload_to_elastic": obj.get("upload_to_elastic"), - "conversion_settings": PartialDirectConversionParameters.from_dict(obj["conversion_settings"]) if obj.get("conversion_settings") is not None else None, - "target_settings": TargetConversionParameters.from_dict(obj["target_settings"]) if obj.get("target_settings") is not None else None + "file_url": FileUrl.from_dict(obj["file_url"]) if obj.get("file_url") is not None else None, + "http_source": HttpSource.from_dict(obj["http_source"]) if obj.get("http_source") is not None else None, + "s3_source": ConvertDocumentsSourcesS3Source.from_dict(obj["s3_source"]) if obj.get("s3_source") is not None else None, + "upload_to_elastic": UploadToElastic.from_dict(obj["upload_to_elastic"]) if obj.get("upload_to_elastic") is not None else None, + "meta": ConvertUploadDocumentsRequestBodyMeta.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "conversion_settings": ConversionSettings.from_dict(obj["conversion_settings"]) if obj.get("conversion_settings") is not None else None, + "target_settings": ConvertDocumentsRequestBodyTargetSettings.from_dict(obj["target_settings"]) if obj.get("target_settings") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/convert_upload_documents_request_body_meta.py b/deepsearch/cps/apis/public_v2/models/convert_upload_documents_request_body_meta.py new file mode 100644 index 00000000..55e649cd --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/convert_upload_documents_request_body_meta.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.document_meta import DocumentMeta +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CONVERTUPLOADDOCUMENTSREQUESTBODYMETA_ANY_OF_SCHEMAS = ["DocumentMeta", "object"] + +class ConvertUploadDocumentsRequestBodyMeta(BaseModel): + """ + ConvertUploadDocumentsRequestBodyMeta + """ + + # data type: DocumentMeta + anyof_schema_1_validator: Optional[DocumentMeta] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[DocumentMeta, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["DocumentMeta", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ConvertUploadDocumentsRequestBodyMeta.model_construct() + error_messages = [] + # validate data type: DocumentMeta + if not isinstance(v, DocumentMeta): + error_messages.append(f"Error! Input type `{type(v)}` is not `DocumentMeta`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ConvertUploadDocumentsRequestBodyMeta with anyOf schemas: DocumentMeta, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[DocumentMeta] = None + try: + instance.actual_instance = DocumentMeta.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ConvertUploadDocumentsRequestBodyMeta with anyOf schemas: DocumentMeta, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], DocumentMeta, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/created.py b/deepsearch/cps/apis/public_v2/models/created.py new file mode 100644 index 00000000..e8ec999b --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/created.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CREATED_ANY_OF_SCHEMAS = ["object", "str"] + +class Created(BaseModel): + """ + Created + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Created.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Created with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Created with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/data_index_upload_file_source.py b/deepsearch/cps/apis/public_v2/models/data_index_upload_file_source.py index 09625782..95514c0f 100644 --- a/deepsearch/cps/apis/public_v2/models/data_index_upload_file_source.py +++ b/deepsearch/cps/apis/public_v2/models/data_index_upload_file_source.py @@ -17,9 +17,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters import PartialDirectConversionParameters +from deepsearch.cps.apis.public_v2.models.conversion_settings import ConversionSettings +from deepsearch.cps.apis.public_v2.models.convert_documents_request_body_target_settings import ConvertDocumentsRequestBodyTargetSettings +from deepsearch.cps.apis.public_v2.models.headers import Headers from deepsearch.cps.apis.public_v2.models.urls import Urls from typing import Optional, Set from typing_extensions import Self @@ -28,9 +30,11 @@ class DataIndexUploadFileSource(BaseModel): """ DataIndexUploadFileSource """ # noqa: E501 + conversion_settings: Optional[ConversionSettings] = None + target_settings: Optional[ConvertDocumentsRequestBodyTargetSettings] = None urls: Urls - conversion_settings: Optional[PartialDirectConversionParameters] = Field(default=None, description="Specify the conversion settings to use.") - __properties: ClassVar[List[str]] = ["urls", "conversion_settings"] + headers: Optional[Headers] = None + __properties: ClassVar[List[str]] = ["conversion_settings", "target_settings", "urls", "headers"] model_config = ConfigDict( populate_by_name=True, @@ -71,12 +75,18 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of urls - if self.urls: - _dict['urls'] = self.urls.to_dict() # override the default output from pydantic by calling `to_dict()` of conversion_settings if self.conversion_settings: _dict['conversion_settings'] = self.conversion_settings.to_dict() + # override the default output from pydantic by calling `to_dict()` of target_settings + if self.target_settings: + _dict['target_settings'] = self.target_settings.to_dict() + # override the default output from pydantic by calling `to_dict()` of urls + if self.urls: + _dict['urls'] = self.urls.to_dict() + # override the default output from pydantic by calling `to_dict()` of headers + if self.headers: + _dict['headers'] = self.headers.to_dict() return _dict @classmethod @@ -89,8 +99,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "conversion_settings": ConversionSettings.from_dict(obj["conversion_settings"]) if obj.get("conversion_settings") is not None else None, + "target_settings": ConvertDocumentsRequestBodyTargetSettings.from_dict(obj["target_settings"]) if obj.get("target_settings") is not None else None, "urls": Urls.from_dict(obj["urls"]) if obj.get("urls") is not None else None, - "conversion_settings": PartialDirectConversionParameters.from_dict(obj["conversion_settings"]) if obj.get("conversion_settings") is not None else None + "headers": Headers.from_dict(obj["headers"]) if obj.get("headers") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/dc_key.py b/deepsearch/cps/apis/public_v2/models/dc_key.py new file mode 100644 index 00000000..8a6192a1 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/dc_key.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DCKEY_ANY_OF_SCHEMAS = ["object", "str"] + +class DcKey(BaseModel): + """ + DcKey + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = DcKey.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in DcKey with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into DcKey with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/decode_secrets.py b/deepsearch/cps/apis/public_v2/models/decode_secrets.py new file mode 100644 index 00000000..35be2019 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/decode_secrets.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DECODESECRETS_ANY_OF_SCHEMAS = ["bool", "object"] + +class DecodeSecrets(BaseModel): + """ + DecodeSecrets + """ + + # data type: bool + anyof_schema_1_validator: Optional[StrictBool] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[bool, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["bool", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = DecodeSecrets.model_construct() + error_messages = [] + # validate data type: bool + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in DecodeSecrets with anyOf schemas: bool, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into bool + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into DecodeSecrets with anyOf schemas: bool, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], bool, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/default_values.py b/deepsearch/cps/apis/public_v2/models/default_values.py index ac80f379..7f02cf03 100644 --- a/deepsearch/cps/apis/public_v2/models/default_values.py +++ b/deepsearch/cps/apis/public_v2/models/default_values.py @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from deepsearch.cps.apis.public_v2.models.ccs_project import CCSProject -from deepsearch.cps.apis.public_v2.models.data_flow import DataFlow +from deepsearch.cps.apis.public_v2.models.default_values_dataflow import DefaultValuesDataflow from typing import Optional, Set from typing_extensions import Self @@ -29,7 +29,7 @@ class DefaultValues(BaseModel): DefaultValues """ # noqa: E501 ccs_project: CCSProject - dataflow: Optional[DataFlow] = None + dataflow: Optional[DefaultValuesDataflow] = None __properties: ClassVar[List[str]] = ["ccs_project", "dataflow"] model_config = ConfigDict( @@ -90,7 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "ccs_project": CCSProject.from_dict(obj["ccs_project"]) if obj.get("ccs_project") is not None else None, - "dataflow": DataFlow.from_dict(obj["dataflow"]) if obj.get("dataflow") is not None else None + "dataflow": DefaultValuesDataflow.from_dict(obj["dataflow"]) if obj.get("dataflow") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/default_values_dataflow.py b/deepsearch/cps/apis/public_v2/models/default_values_dataflow.py new file mode 100644 index 00000000..c7efe488 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/default_values_dataflow.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.data_flow import DataFlow +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DEFAULTVALUESDATAFLOW_ANY_OF_SCHEMAS = ["DataFlow", "object"] + +class DefaultValuesDataflow(BaseModel): + """ + DefaultValuesDataflow + """ + + # data type: DataFlow + anyof_schema_1_validator: Optional[DataFlow] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[DataFlow, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["DataFlow", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = DefaultValuesDataflow.model_construct() + error_messages = [] + # validate data type: DataFlow + if not isinstance(v, DataFlow): + error_messages.append(f"Error! Input type `{type(v)}` is not `DataFlow`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in DefaultValuesDataflow with anyOf schemas: DataFlow, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[DataFlow] = None + try: + instance.actual_instance = DataFlow.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into DefaultValuesDataflow with anyOf schemas: DataFlow, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], DataFlow, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/description.py b/deepsearch/cps/apis/public_v2/models/description.py new file mode 100644 index 00000000..976470d4 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/description.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DESCRIPTION_ANY_OF_SCHEMAS = ["object", "str"] + +class Description(BaseModel): + """ + Description + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Description.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Description with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Description with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/description_license.py b/deepsearch/cps/apis/public_v2/models/description_license.py new file mode 100644 index 00000000..efa8bf29 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/description_license.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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 +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.code import Code +from deepsearch.cps.apis.public_v2.models.text import Text +from typing import Optional, Set +from typing_extensions import Self + +class DescriptionLicense(BaseModel): + """ + Licence in document description. + """ # noqa: E501 + code: Optional[Code] = None + text: Optional[Text] = None + __properties: ClassVar[List[str]] = ["code", "text"] + + 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 DescriptionLicense 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 code + if self.code: + _dict['code'] = self.code.to_dict() + # override the default output from pydantic by calling `to_dict()` of text + if self.text: + _dict['text'] = self.text.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DescriptionLicense from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": Code.from_dict(obj["code"]) if obj.get("code") is not None else None, + "text": Text.from_dict(obj["text"]) if obj.get("text") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/display_name.py b/deepsearch/cps/apis/public_v2/models/display_name.py new file mode 100644 index 00000000..3679698e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/display_name.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DISPLAYNAME_ANY_OF_SCHEMAS = ["object", "str"] + +class DisplayName(BaseModel): + """ + DisplayName + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = DisplayName.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in DisplayName with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into DisplayName with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/docling_core_types_base_identifier.py b/deepsearch/cps/apis/public_v2/models/docling_core_types_base_identifier.py new file mode 100644 index 00000000..31d8823e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/docling_core_types_base_identifier.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class DoclingCoreTypesBaseIdentifier(BaseModel): + """ + Unique identifier of a Docling data object. + """ # noqa: E501 + type: StrictStr = Field(description="A string representing a collection or database that contains this data object.") + value: StrictStr = Field(description="The identifier value of the data object within a collection or database.") + name: Annotated[str, Field(strict=True)] = Field(description="A unique identifier of the data object across Docling, consisting of the concatenation of type and value in lower case, separated by hash (#).", alias="_name") + __properties: ClassVar[List[str]] = ["type", "value", "_name"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^.+#.+$", value): + raise ValueError(r"must validate the regular expression /^.+#.+$/") + return value + + 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 DoclingCoreTypesBaseIdentifier 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 DoclingCoreTypesBaseIdentifier from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "value": obj.get("value"), + "_name": obj.get("_name") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/document_artifacts.py b/deepsearch/cps/apis/public_v2/models/document_artifacts.py index 483a59dd..415620fe 100644 --- a/deepsearch/cps/apis/public_v2/models/document_artifacts.py +++ b/deepsearch/cps/apis/public_v2/models/document_artifacts.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.document_artifacts_item import DocumentArtifactsItem +from deepsearch.cps.apis.public_v2.models.document_artifacts_document_meta_json import DocumentArtifactsDocumentMetaJson from deepsearch.cps.apis.public_v2.models.document_artifacts_page_item import DocumentArtifactsPageItem from typing import Optional, Set from typing_extensions import Self @@ -28,14 +28,14 @@ class DocumentArtifacts(BaseModel): """ DocumentArtifacts """ # noqa: E501 - document_meta_json: Optional[DocumentArtifactsItem] = None - document_pdf: Optional[DocumentArtifactsItem] = None - document_json: Optional[DocumentArtifactsItem] = None - document_glm_json: Optional[DocumentArtifactsItem] = None - document_md: Optional[DocumentArtifactsItem] = None + document_meta_json: Optional[DocumentArtifactsDocumentMetaJson] = None + document_pdf: Optional[DocumentArtifactsDocumentMetaJson] = None + document_json: Optional[DocumentArtifactsDocumentMetaJson] = None + document_legacy_json: Optional[DocumentArtifactsDocumentMetaJson] = None + document_md: Optional[DocumentArtifactsDocumentMetaJson] = None page_pdfs: Optional[List[DocumentArtifactsPageItem]] = None page_images: Optional[List[DocumentArtifactsPageItem]] = None - __properties: ClassVar[List[str]] = ["document_meta_json", "document_pdf", "document_json", "document_glm_json", "document_md", "page_pdfs", "page_images"] + __properties: ClassVar[List[str]] = ["document_meta_json", "document_pdf", "document_json", "document_legacy_json", "document_md", "page_pdfs", "page_images"] model_config = ConfigDict( populate_by_name=True, @@ -85,9 +85,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of document_json if self.document_json: _dict['document_json'] = self.document_json.to_dict() - # override the default output from pydantic by calling `to_dict()` of document_glm_json - if self.document_glm_json: - _dict['document_glm_json'] = self.document_glm_json.to_dict() + # override the default output from pydantic by calling `to_dict()` of document_legacy_json + if self.document_legacy_json: + _dict['document_legacy_json'] = self.document_legacy_json.to_dict() # override the default output from pydantic by calling `to_dict()` of document_md if self.document_md: _dict['document_md'] = self.document_md.to_dict() @@ -117,11 +117,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "document_meta_json": DocumentArtifactsItem.from_dict(obj["document_meta_json"]) if obj.get("document_meta_json") is not None else None, - "document_pdf": DocumentArtifactsItem.from_dict(obj["document_pdf"]) if obj.get("document_pdf") is not None else None, - "document_json": DocumentArtifactsItem.from_dict(obj["document_json"]) if obj.get("document_json") is not None else None, - "document_glm_json": DocumentArtifactsItem.from_dict(obj["document_glm_json"]) if obj.get("document_glm_json") is not None else None, - "document_md": DocumentArtifactsItem.from_dict(obj["document_md"]) if obj.get("document_md") is not None else None, + "document_meta_json": DocumentArtifactsDocumentMetaJson.from_dict(obj["document_meta_json"]) if obj.get("document_meta_json") is not None else None, + "document_pdf": DocumentArtifactsDocumentMetaJson.from_dict(obj["document_pdf"]) if obj.get("document_pdf") is not None else None, + "document_json": DocumentArtifactsDocumentMetaJson.from_dict(obj["document_json"]) if obj.get("document_json") is not None else None, + "document_legacy_json": DocumentArtifactsDocumentMetaJson.from_dict(obj["document_legacy_json"]) if obj.get("document_legacy_json") is not None else None, + "document_md": DocumentArtifactsDocumentMetaJson.from_dict(obj["document_md"]) if obj.get("document_md") is not None else None, "page_pdfs": [DocumentArtifactsPageItem.from_dict(_item) for _item in obj["page_pdfs"]] if obj.get("page_pdfs") is not None else None, "page_images": [DocumentArtifactsPageItem.from_dict(_item) for _item in obj["page_images"]] if obj.get("page_images") is not None else None }) diff --git a/deepsearch/cps/apis/public_v2/models/document_artifacts_document_meta_json.py b/deepsearch/cps/apis/public_v2/models/document_artifacts_document_meta_json.py new file mode 100644 index 00000000..3c7d1e58 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/document_artifacts_document_meta_json.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.document_artifacts_item import DocumentArtifactsItem +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DOCUMENTARTIFACTSDOCUMENTMETAJSON_ANY_OF_SCHEMAS = ["DocumentArtifactsItem", "object"] + +class DocumentArtifactsDocumentMetaJson(BaseModel): + """ + DocumentArtifactsDocumentMetaJson + """ + + # data type: DocumentArtifactsItem + anyof_schema_1_validator: Optional[DocumentArtifactsItem] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[DocumentArtifactsItem, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["DocumentArtifactsItem", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = DocumentArtifactsDocumentMetaJson.model_construct() + error_messages = [] + # validate data type: DocumentArtifactsItem + if not isinstance(v, DocumentArtifactsItem): + error_messages.append(f"Error! Input type `{type(v)}` is not `DocumentArtifactsItem`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in DocumentArtifactsDocumentMetaJson with anyOf schemas: DocumentArtifactsItem, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[DocumentArtifactsItem] = None + try: + instance.actual_instance = DocumentArtifactsItem.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into DocumentArtifactsDocumentMetaJson with anyOf schemas: DocumentArtifactsItem, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], DocumentArtifactsItem, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/document_description.py b/deepsearch/cps/apis/public_v2/models/document_description.py new file mode 100644 index 00000000..7cc517d3 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/document_description.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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 +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.abstract import Abstract +from deepsearch.cps.apis.public_v2.models.affiliations import Affiliations +from deepsearch.cps.apis.public_v2.models.authors import Authors +from deepsearch.cps.apis.public_v2.models.citation_count import CitationCount +from deepsearch.cps.apis.public_v2.models.citation_count_date import CitationCountDate +from deepsearch.cps.apis.public_v2.models.document_description_acquisition import DocumentDescriptionAcquisition +from deepsearch.cps.apis.public_v2.models.document_description_advanced import DocumentDescriptionAdvanced +from deepsearch.cps.apis.public_v2.models.document_description_license import DocumentDescriptionLicense +from deepsearch.cps.apis.public_v2.models.keywords import Keywords +from deepsearch.cps.apis.public_v2.models.languages import Languages +from deepsearch.cps.apis.public_v2.models.publication1 import Publication1 +from deepsearch.cps.apis.public_v2.models.publication_date import PublicationDate +from deepsearch.cps.apis.public_v2.models.publishers import Publishers +from deepsearch.cps.apis.public_v2.models.reference_count import ReferenceCount +from deepsearch.cps.apis.public_v2.models.references import References +from deepsearch.cps.apis.public_v2.models.subjects import Subjects +from deepsearch.cps.apis.public_v2.models.title import Title +from deepsearch.cps.apis.public_v2.models.url_refs import UrlRefs +from typing import Optional, Set +from typing_extensions import Self + +class DocumentDescription(BaseModel): + """ + DocumentDescription + """ # noqa: E501 + title: Optional[Title] = None + abstract: Optional[Abstract] = None + authors: Optional[Authors] = None + affiliations: Optional[Affiliations] = None + subjects: Optional[Subjects] = None + keywords: Optional[Keywords] = None + publication_date: Optional[PublicationDate] = None + languages: Optional[Languages] = None + license: Optional[DocumentDescriptionLicense] = None + publishers: Optional[Publishers] = None + url_refs: Optional[UrlRefs] = None + references: Optional[References] = None + publication: Optional[Publication1] = None + reference_count: Optional[ReferenceCount] = None + citation_count: Optional[CitationCount] = None + citation_date: Optional[CitationCountDate] = None + advanced: Optional[DocumentDescriptionAdvanced] = None + analytics: Optional[DocumentDescriptionAdvanced] = None + acquisition: Optional[DocumentDescriptionAcquisition] = None + __properties: ClassVar[List[str]] = ["title", "abstract", "authors", "affiliations", "subjects", "keywords", "publication_date", "languages", "license", "publishers", "url_refs", "references", "publication", "reference_count", "citation_count", "citation_date", "advanced", "analytics", "acquisition"] + + 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 DocumentDescription 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 title + if self.title: + _dict['title'] = self.title.to_dict() + # override the default output from pydantic by calling `to_dict()` of abstract + if self.abstract: + _dict['abstract'] = self.abstract.to_dict() + # override the default output from pydantic by calling `to_dict()` of authors + if self.authors: + _dict['authors'] = self.authors.to_dict() + # override the default output from pydantic by calling `to_dict()` of affiliations + if self.affiliations: + _dict['affiliations'] = self.affiliations.to_dict() + # override the default output from pydantic by calling `to_dict()` of subjects + if self.subjects: + _dict['subjects'] = self.subjects.to_dict() + # override the default output from pydantic by calling `to_dict()` of keywords + if self.keywords: + _dict['keywords'] = self.keywords.to_dict() + # override the default output from pydantic by calling `to_dict()` of publication_date + if self.publication_date: + _dict['publication_date'] = self.publication_date.to_dict() + # override the default output from pydantic by calling `to_dict()` of languages + if self.languages: + _dict['languages'] = self.languages.to_dict() + # override the default output from pydantic by calling `to_dict()` of license + if self.license: + _dict['license'] = self.license.to_dict() + # override the default output from pydantic by calling `to_dict()` of publishers + if self.publishers: + _dict['publishers'] = self.publishers.to_dict() + # override the default output from pydantic by calling `to_dict()` of url_refs + if self.url_refs: + _dict['url_refs'] = self.url_refs.to_dict() + # override the default output from pydantic by calling `to_dict()` of references + if self.references: + _dict['references'] = self.references.to_dict() + # override the default output from pydantic by calling `to_dict()` of publication + if self.publication: + _dict['publication'] = self.publication.to_dict() + # override the default output from pydantic by calling `to_dict()` of reference_count + if self.reference_count: + _dict['reference_count'] = self.reference_count.to_dict() + # override the default output from pydantic by calling `to_dict()` of citation_count + if self.citation_count: + _dict['citation_count'] = self.citation_count.to_dict() + # override the default output from pydantic by calling `to_dict()` of citation_date + if self.citation_date: + _dict['citation_date'] = self.citation_date.to_dict() + # override the default output from pydantic by calling `to_dict()` of advanced + if self.advanced: + _dict['advanced'] = self.advanced.to_dict() + # override the default output from pydantic by calling `to_dict()` of analytics + if self.analytics: + _dict['analytics'] = self.analytics.to_dict() + # override the default output from pydantic by calling `to_dict()` of acquisition + if self.acquisition: + _dict['acquisition'] = self.acquisition.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentDescription from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": Title.from_dict(obj["title"]) if obj.get("title") is not None else None, + "abstract": Abstract.from_dict(obj["abstract"]) if obj.get("abstract") is not None else None, + "authors": Authors.from_dict(obj["authors"]) if obj.get("authors") is not None else None, + "affiliations": Affiliations.from_dict(obj["affiliations"]) if obj.get("affiliations") is not None else None, + "subjects": Subjects.from_dict(obj["subjects"]) if obj.get("subjects") is not None else None, + "keywords": Keywords.from_dict(obj["keywords"]) if obj.get("keywords") is not None else None, + "publication_date": PublicationDate.from_dict(obj["publication_date"]) if obj.get("publication_date") is not None else None, + "languages": Languages.from_dict(obj["languages"]) if obj.get("languages") is not None else None, + "license": DocumentDescriptionLicense.from_dict(obj["license"]) if obj.get("license") is not None else None, + "publishers": Publishers.from_dict(obj["publishers"]) if obj.get("publishers") is not None else None, + "url_refs": UrlRefs.from_dict(obj["url_refs"]) if obj.get("url_refs") is not None else None, + "references": References.from_dict(obj["references"]) if obj.get("references") is not None else None, + "publication": Publication1.from_dict(obj["publication"]) if obj.get("publication") is not None else None, + "reference_count": ReferenceCount.from_dict(obj["reference_count"]) if obj.get("reference_count") is not None else None, + "citation_count": CitationCount.from_dict(obj["citation_count"]) if obj.get("citation_count") is not None else None, + "citation_date": CitationCountDate.from_dict(obj["citation_date"]) if obj.get("citation_date") is not None else None, + "advanced": DocumentDescriptionAdvanced.from_dict(obj["advanced"]) if obj.get("advanced") is not None else None, + "analytics": DocumentDescriptionAdvanced.from_dict(obj["analytics"]) if obj.get("analytics") is not None else None, + "acquisition": DocumentDescriptionAcquisition.from_dict(obj["acquisition"]) if obj.get("acquisition") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/document_description_acquisition.py b/deepsearch/cps/apis/public_v2/models/document_description_acquisition.py new file mode 100644 index 00000000..6744d555 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/document_description_acquisition.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.acquisition import Acquisition +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DOCUMENTDESCRIPTIONACQUISITION_ANY_OF_SCHEMAS = ["Acquisition", "object"] + +class DocumentDescriptionAcquisition(BaseModel): + """ + Information on how the document was obtained, for data governance purposes. + """ + + # data type: Acquisition + anyof_schema_1_validator: Optional[Acquisition] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[Acquisition, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["Acquisition", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = DocumentDescriptionAcquisition.model_construct() + error_messages = [] + # validate data type: Acquisition + if not isinstance(v, Acquisition): + error_messages.append(f"Error! Input type `{type(v)}` is not `Acquisition`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in DocumentDescriptionAcquisition with anyOf schemas: Acquisition, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[Acquisition] = None + try: + instance.actual_instance = Acquisition.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into DocumentDescriptionAcquisition with anyOf schemas: Acquisition, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Acquisition, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/document_description_advanced.py b/deepsearch/cps/apis/public_v2/models/document_description_advanced.py new file mode 100644 index 00000000..9bef3271 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/document_description_advanced.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DOCUMENTDESCRIPTIONADVANCED_ANY_OF_SCHEMAS = ["object"] + +class DocumentDescriptionAdvanced(BaseModel): + """ + DocumentDescriptionAdvanced + """ + + # data type: object + anyof_schema_1_validator: Optional[Dict[str, Any]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = DocumentDescriptionAdvanced.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in DocumentDescriptionAdvanced with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into DocumentDescriptionAdvanced with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/document_description_license.py b/deepsearch/cps/apis/public_v2/models/document_description_license.py new file mode 100644 index 00000000..24cfb802 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/document_description_license.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.description_license import DescriptionLicense +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DOCUMENTDESCRIPTIONLICENSE_ANY_OF_SCHEMAS = ["DescriptionLicense", "object"] + +class DocumentDescriptionLicense(BaseModel): + """ + DocumentDescriptionLicense + """ + + # data type: DescriptionLicense + anyof_schema_1_validator: Optional[DescriptionLicense] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[DescriptionLicense, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["DescriptionLicense", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = DocumentDescriptionLicense.model_construct() + error_messages = [] + # validate data type: DescriptionLicense + if not isinstance(v, DescriptionLicense): + error_messages.append(f"Error! Input type `{type(v)}` is not `DescriptionLicense`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in DocumentDescriptionLicense with anyOf schemas: DescriptionLicense, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[DescriptionLicense] = None + try: + instance.actual_instance = DescriptionLicense.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into DocumentDescriptionLicense with anyOf schemas: DescriptionLicense, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], DescriptionLicense, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/document_hashes.py b/deepsearch/cps/apis/public_v2/models/document_hashes.py new file mode 100644 index 00000000..ac4dc4bf --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/document_hashes.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DOCUMENTHASHES_ANY_OF_SCHEMAS = ["object"] + +class DocumentHashes(BaseModel): + """ + List of document hashes to be used as filter. + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = DocumentHashes.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in DocumentHashes with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into DocumentHashes with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/document_meta.py b/deepsearch/cps/apis/public_v2/models/document_meta.py new file mode 100644 index 00000000..6a0a18d1 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/document_meta.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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 +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.document_meta_description import DocumentMetaDescription +from deepsearch.cps.apis.public_v2.models.filename import Filename +from deepsearch.cps.apis.public_v2.models.identifiers import Identifiers +from typing import Optional, Set +from typing_extensions import Self + +class DocumentMeta(BaseModel): + """ + DocumentMeta + """ # noqa: E501 + filename: Optional[Filename] = None + description: Optional[DocumentMetaDescription] = None + identifiers: Optional[Identifiers] = None + __properties: ClassVar[List[str]] = ["filename", "description", "identifiers"] + + 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 DocumentMeta 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 filename + if self.filename: + _dict['filename'] = self.filename.to_dict() + # override the default output from pydantic by calling `to_dict()` of description + if self.description: + _dict['description'] = self.description.to_dict() + # override the default output from pydantic by calling `to_dict()` of identifiers + if self.identifiers: + _dict['identifiers'] = self.identifiers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentMeta from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "filename": Filename.from_dict(obj["filename"]) if obj.get("filename") is not None else None, + "description": DocumentMetaDescription.from_dict(obj["description"]) if obj.get("description") is not None else None, + "identifiers": Identifiers.from_dict(obj["identifiers"]) if obj.get("identifiers") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/document_meta_description.py b/deepsearch/cps/apis/public_v2/models/document_meta_description.py new file mode 100644 index 00000000..e73af64c --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/document_meta_description.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.document_description import DocumentDescription +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DOCUMENTMETADESCRIPTION_ANY_OF_SCHEMAS = ["DocumentDescription", "object"] + +class DocumentMetaDescription(BaseModel): + """ + DocumentMetaDescription + """ + + # data type: DocumentDescription + anyof_schema_1_validator: Optional[DocumentDescription] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[DocumentDescription, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["DocumentDescription", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = DocumentMetaDescription.model_construct() + error_messages = [] + # validate data type: DocumentDescription + if not isinstance(v, DocumentDescription): + error_messages.append(f"Error! Input type `{type(v)}` is not `DocumentDescription`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in DocumentMetaDescription with anyOf schemas: DocumentDescription, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[DocumentDescription] = None + try: + instance.actual_instance = DocumentDescription.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into DocumentMetaDescription with anyOf schemas: DocumentDescription, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], DocumentDescription, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/domain.py b/deepsearch/cps/apis/public_v2/models/domain.py new file mode 100644 index 00000000..d7386160 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/domain.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DOMAIN_ANY_OF_SCHEMAS = ["object"] + +class Domain(BaseModel): + """ + Domain + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Domain.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Domain with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Domain with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/elastic_index_property_object.py b/deepsearch/cps/apis/public_v2/models/elastic_index_property_object.py index 74f86fc8..0c0589c0 100644 --- a/deepsearch/cps/apis/public_v2/models/elastic_index_property_object.py +++ b/deepsearch/cps/apis/public_v2/models/elastic_index_property_object.py @@ -17,8 +17,10 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.enabled import Enabled +from deepsearch.cps.apis.public_v2.models.ignore_above import IgnoreAbove from typing import Optional, Set from typing_extensions import Self @@ -27,8 +29,8 @@ class ElasticIndexPropertyObject(BaseModel): ElasticIndexPropertyObject """ # noqa: E501 type: StrictStr - enabled: Optional[StrictBool] = None - ignore_above: Optional[StrictInt] = None + enabled: Optional[Enabled] = None + ignore_above: Optional[IgnoreAbove] = None __properties: ClassVar[List[str]] = ["type", "enabled", "ignore_above"] model_config = ConfigDict( @@ -70,6 +72,12 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of enabled + if self.enabled: + _dict['enabled'] = self.enabled.to_dict() + # override the default output from pydantic by calling `to_dict()` of ignore_above + if self.ignore_above: + _dict['ignore_above'] = self.ignore_above.to_dict() return _dict @classmethod @@ -83,8 +91,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "type": obj.get("type"), - "enabled": obj.get("enabled"), - "ignore_above": obj.get("ignore_above") + "enabled": Enabled.from_dict(obj["enabled"]) if obj.get("enabled") is not None else None, + "ignore_above": IgnoreAbove.from_dict(obj["ignore_above"]) if obj.get("ignore_above") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/elastic_index_search_query_options.py b/deepsearch/cps/apis/public_v2/models/elastic_index_search_query_options.py index 0deed05a..109d7866 100644 --- a/deepsearch/cps/apis/public_v2/models/elastic_index_search_query_options.py +++ b/deepsearch/cps/apis/public_v2/models/elastic_index_search_query_options.py @@ -17,8 +17,14 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.aggs import Aggs +from deepsearch.cps.apis.public_v2.models.model_from import ModelFrom +from deepsearch.cps.apis.public_v2.models.query import Query +from deepsearch.cps.apis.public_v2.models.size1 import Size1 +from deepsearch.cps.apis.public_v2.models.sort import Sort +from deepsearch.cps.apis.public_v2.models.source2 import Source2 from typing import Optional, Set from typing_extensions import Self @@ -26,12 +32,12 @@ class ElasticIndexSearchQueryOptions(BaseModel): """ ElasticIndexSearchQueryOptions """ # noqa: E501 - source: Optional[List[StrictStr]] = Field(default=None, alias="_source") - from_: Optional[StrictInt] = None - size: Optional[StrictInt] = None - query: Optional[Dict[str, Any]] = None - aggs: Optional[Dict[str, Any]] = None - sort: Optional[List[Dict[str, Any]]] = None + source: Optional[Source2] = Field(default=None, alias="_source") + from_: Optional[ModelFrom] = None + size: Optional[Size1] = None + query: Optional[Query] = None + aggs: Optional[Aggs] = None + sort: Optional[Sort] = None __properties: ClassVar[List[str]] = ["_source", "from_", "size", "query", "aggs", "sort"] model_config = ConfigDict( @@ -73,6 +79,24 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict['_source'] = self.source.to_dict() + # override the default output from pydantic by calling `to_dict()` of from_ + if self.from_: + _dict['from_'] = self.from_.to_dict() + # override the default output from pydantic by calling `to_dict()` of size + if self.size: + _dict['size'] = self.size.to_dict() + # override the default output from pydantic by calling `to_dict()` of query + if self.query: + _dict['query'] = self.query.to_dict() + # override the default output from pydantic by calling `to_dict()` of aggs + if self.aggs: + _dict['aggs'] = self.aggs.to_dict() + # override the default output from pydantic by calling `to_dict()` of sort + if self.sort: + _dict['sort'] = self.sort.to_dict() return _dict @classmethod @@ -85,12 +109,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "_source": obj.get("_source"), - "from_": obj.get("from_"), - "size": obj.get("size"), - "query": obj.get("query"), - "aggs": obj.get("aggs"), - "sort": obj.get("sort") + "_source": Source2.from_dict(obj["_source"]) if obj.get("_source") is not None else None, + "from_": ModelFrom.from_dict(obj["from_"]) if obj.get("from_") is not None else None, + "size": Size1.from_dict(obj["size"]) if obj.get("size") is not None else None, + "query": Query.from_dict(obj["query"]) if obj.get("query") is not None else None, + "aggs": Aggs.from_dict(obj["aggs"]) if obj.get("aggs") is not None else None, + "sort": Sort.from_dict(obj["sort"]) if obj.get("sort") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/elastic_metadata.py b/deepsearch/cps/apis/public_v2/models/elastic_metadata.py index 761d242c..6a1d4a49 100644 --- a/deepsearch/cps/apis/public_v2/models/elastic_metadata.py +++ b/deepsearch/cps/apis/public_v2/models/elastic_metadata.py @@ -19,6 +19,15 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.aliases import Aliases +from deepsearch.cps.apis.public_v2.models.created import Created +from deepsearch.cps.apis.public_v2.models.description import Description +from deepsearch.cps.apis.public_v2.models.display_name import DisplayName +from deepsearch.cps.apis.public_v2.models.domain import Domain +from deepsearch.cps.apis.public_v2.models.source1 import Source1 +from deepsearch.cps.apis.public_v2.models.storage import Storage +from deepsearch.cps.apis.public_v2.models.type import Type +from deepsearch.cps.apis.public_v2.models.version1 import Version1 from typing import Optional, Set from typing_extensions import Self @@ -26,15 +35,15 @@ class ElasticMetadata(BaseModel): """ ElasticMetadata """ # noqa: E501 - aliases: Optional[List[StrictStr]] = None - created: Optional[StrictStr] = None - description: Optional[StrictStr] = None - display_name: Optional[StrictStr] = None - source: Optional[StrictStr] = None - storage: Optional[StrictStr] = None - version: Optional[StrictStr] = None - type: Optional[StrictStr] = None - domain: Optional[List[StrictStr]] = None + aliases: Optional[Aliases] = None + created: Optional[Created] = None + description: Optional[Description] = None + display_name: Optional[DisplayName] = None + source: Optional[Source1] = None + storage: Optional[Storage] = None + version: Optional[Version1] = None + type: Optional[Type] = None + domain: Optional[Domain] = None classification: List[StrictStr] __properties: ClassVar[List[str]] = ["aliases", "created", "description", "display_name", "source", "storage", "version", "type", "domain", "classification"] @@ -77,6 +86,33 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of aliases + if self.aliases: + _dict['aliases'] = self.aliases.to_dict() + # override the default output from pydantic by calling `to_dict()` of created + if self.created: + _dict['created'] = self.created.to_dict() + # override the default output from pydantic by calling `to_dict()` of description + if self.description: + _dict['description'] = self.description.to_dict() + # override the default output from pydantic by calling `to_dict()` of display_name + if self.display_name: + _dict['display_name'] = self.display_name.to_dict() + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict['source'] = self.source.to_dict() + # override the default output from pydantic by calling `to_dict()` of storage + if self.storage: + _dict['storage'] = self.storage.to_dict() + # override the default output from pydantic by calling `to_dict()` of version + if self.version: + _dict['version'] = self.version.to_dict() + # override the default output from pydantic by calling `to_dict()` of type + if self.type: + _dict['type'] = self.type.to_dict() + # override the default output from pydantic by calling `to_dict()` of domain + if self.domain: + _dict['domain'] = self.domain.to_dict() return _dict @classmethod @@ -89,15 +125,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "aliases": obj.get("aliases"), - "created": obj.get("created"), - "description": obj.get("description"), - "display_name": obj.get("display_name"), - "source": obj.get("source"), - "storage": obj.get("storage"), - "version": obj.get("version"), - "type": obj.get("type"), - "domain": obj.get("domain"), + "aliases": Aliases.from_dict(obj["aliases"]) if obj.get("aliases") is not None else None, + "created": Created.from_dict(obj["created"]) if obj.get("created") is not None else None, + "description": Description.from_dict(obj["description"]) if obj.get("description") is not None else None, + "display_name": DisplayName.from_dict(obj["display_name"]) if obj.get("display_name") is not None else None, + "source": Source1.from_dict(obj["source"]) if obj.get("source") is not None else None, + "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "version": Version1.from_dict(obj["version"]) if obj.get("version") is not None else None, + "type": Type.from_dict(obj["type"]) if obj.get("type") is not None else None, + "domain": Domain.from_dict(obj["domain"]) if obj.get("domain") is not None else None, "classification": obj.get("classification") }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/enabled.py b/deepsearch/cps/apis/public_v2/models/enabled.py new file mode 100644 index 00000000..44ac6f48 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/enabled.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ENABLED_ANY_OF_SCHEMAS = ["bool", "object"] + +class Enabled(BaseModel): + """ + Enabled + """ + + # data type: bool + anyof_schema_1_validator: Optional[StrictBool] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[bool, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["bool", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Enabled.model_construct() + error_messages = [] + # validate data type: bool + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Enabled with anyOf schemas: bool, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into bool + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Enabled with anyOf schemas: bool, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], bool, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/end_date.py b/deepsearch/cps/apis/public_v2/models/end_date.py new file mode 100644 index 00000000..54fce473 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/end_date.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ENDDATE_ANY_OF_SCHEMAS = ["int", "object"] + +class EndDate(BaseModel): + """ + EndDate + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = EndDate.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in EndDate with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into EndDate with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/error_reason.py b/deepsearch/cps/apis/public_v2/models/error_reason.py new file mode 100644 index 00000000..fdd1d590 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/error_reason.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ERRORREASON_ANY_OF_SCHEMAS = ["object", "str"] + +class ErrorReason(BaseModel): + """ + ErrorReason + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ErrorReason.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ErrorReason with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ErrorReason with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/file_uri.py b/deepsearch/cps/apis/public_v2/models/file_uri.py new file mode 100644 index 00000000..71785b70 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/file_uri.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +FILEURI_ANY_OF_SCHEMAS = ["object", "str"] + +class FileUri(BaseModel): + """ + FileUri + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = FileUri.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in FileUri with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into FileUri with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/file_url.py b/deepsearch/cps/apis/public_v2/models/file_url.py new file mode 100644 index 00000000..c6c04c5e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/file_url.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +FILEURL_ANY_OF_SCHEMAS = ["object"] + +class FileUrl(BaseModel): + """ + List of File's URL to be converted and uploaded to the data index. + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = FileUrl.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in FileUrl with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into FileUrl with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/filename.py b/deepsearch/cps/apis/public_v2/models/filename.py new file mode 100644 index 00000000..4a31e99d --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/filename.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +FILENAME_ANY_OF_SCHEMAS = ["object", "str"] + +class Filename(BaseModel): + """ + Filename + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Filename.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Filename with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Filename with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/flavour.py b/deepsearch/cps/apis/public_v2/models/flavour.py index db23e683..9dee666f 100644 --- a/deepsearch/cps/apis/public_v2/models/flavour.py +++ b/deepsearch/cps/apis/public_v2/models/flavour.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.display_name import DisplayName from typing import Optional, Set from typing_extensions import Self @@ -27,7 +28,7 @@ class Flavour(BaseModel): Flavour """ # noqa: E501 name: StrictStr - display_name: Optional[StrictStr] = None + display_name: Optional[DisplayName] = None __properties: ClassVar[List[str]] = ["name", "display_name"] model_config = ConfigDict( @@ -69,6 +70,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of display_name + if self.display_name: + _dict['display_name'] = self.display_name.to_dict() return _dict @classmethod @@ -82,7 +86,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), - "display_name": obj.get("display_name") + "display_name": DisplayName.from_dict(obj["display_name"]) if obj.get("display_name") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/gen_ai_openai.py b/deepsearch/cps/apis/public_v2/models/gen_ai_openai.py new file mode 100644 index 00000000..71e2d135 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/gen_ai_openai.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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 deepsearch.cps.apis.public_v2.models.gen_ai_openai_config import GenAIOpenaiConfig +from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_proj_params import GenAIAWSBedrockProjParams +from typing import Optional, Set +from typing_extensions import Self + +class GenAIOpenai(BaseModel): + """ + GenAI integration for OpenAI API settings + """ # noqa: E501 + kind: Optional[StrictStr] = 'openai' + config: GenAIOpenaiConfig + proj_params: Optional[GenAIAWSBedrockProjParams] = None + __properties: ClassVar[List[str]] = ["kind", "config", "proj_params"] + + 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 GenAIOpenai 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 config + if self.config: + _dict['config'] = self.config.to_dict() + # override the default output from pydantic by calling `to_dict()` of proj_params + if self.proj_params: + _dict['proj_params'] = self.proj_params.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GenAIOpenai from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "kind": obj.get("kind") if obj.get("kind") is not None else 'openai', + "config": GenAIOpenaiConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, + "proj_params": GenAIAWSBedrockProjParams.from_dict(obj["proj_params"]) if obj.get("proj_params") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/gen_ai_openai_config.py b/deepsearch/cps/apis/public_v2/models/gen_ai_openai_config.py new file mode 100644 index 00000000..ecf3efed --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/gen_ai_openai_config.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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, Field, SecretStr, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class GenAIOpenaiConfig(BaseModel): + """ + Config for OpenAI API + """ # noqa: E501 + genai_openai_api_key: SecretStr = Field(alias="GENAI_OPENAI_API_KEY") + genai_openai_base_url: StrictStr = Field(alias="GENAI_OPENAI_BASE_URL") + genai_openai_verify_tls: Optional[StrictBool] = Field(default=True, alias="GENAI_OPENAI_VERIFY_TLS") + __properties: ClassVar[List[str]] = ["GENAI_OPENAI_API_KEY", "GENAI_OPENAI_BASE_URL", "GENAI_OPENAI_VERIFY_TLS"] + + 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 GenAIOpenaiConfig 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 GenAIOpenaiConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "GENAI_OPENAI_API_KEY": obj.get("GENAI_OPENAI_API_KEY"), + "GENAI_OPENAI_BASE_URL": obj.get("GENAI_OPENAI_BASE_URL"), + "GENAI_OPENAI_VERIFY_TLS": obj.get("GENAI_OPENAI_VERIFY_TLS") if obj.get("GENAI_OPENAI_VERIFY_TLS") is not None else True + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/gen_ai_partial_params.py b/deepsearch/cps/apis/public_v2/models/gen_ai_partial_params.py index efec0e4c..dc205b0d 100644 --- a/deepsearch/cps/apis/public_v2/models/gen_ai_partial_params.py +++ b/deepsearch/cps/apis/public_v2/models/gen_ai_partial_params.py @@ -17,8 +17,12 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.model_id import ModelId +from deepsearch.cps.apis.public_v2.models.params import Params +from deepsearch.cps.apis.public_v2.models.prompt_template import PromptTemplate +from deepsearch.cps.apis.public_v2.models.timeout import Timeout from typing import Optional, Set from typing_extensions import Self @@ -26,10 +30,10 @@ class GenAIPartialParams(BaseModel): """ GenAIPartialParams """ # noqa: E501 - model_id: Optional[StrictStr] = None - prompt_template: Optional[StrictStr] = None - params: Optional[Dict[str, Any]] = None - timeout: Optional[Union[StrictFloat, StrictInt]] = None + model_id: Optional[ModelId] = None + prompt_template: Optional[PromptTemplate] = None + params: Optional[Params] = None + timeout: Optional[Timeout] = None __properties: ClassVar[List[str]] = ["model_id", "prompt_template", "params", "timeout"] model_config = ConfigDict( @@ -71,6 +75,18 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of model_id + if self.model_id: + _dict['model_id'] = self.model_id.to_dict() + # override the default output from pydantic by calling `to_dict()` of prompt_template + if self.prompt_template: + _dict['prompt_template'] = self.prompt_template.to_dict() + # override the default output from pydantic by calling `to_dict()` of params + if self.params: + _dict['params'] = self.params.to_dict() + # override the default output from pydantic by calling `to_dict()` of timeout + if self.timeout: + _dict['timeout'] = self.timeout.to_dict() return _dict @classmethod @@ -83,10 +99,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "model_id": obj.get("model_id"), - "prompt_template": obj.get("prompt_template"), - "params": obj.get("params"), - "timeout": obj.get("timeout") + "model_id": ModelId.from_dict(obj["model_id"]) if obj.get("model_id") is not None else None, + "prompt_template": PromptTemplate.from_dict(obj["prompt_template"]) if obj.get("prompt_template") is not None else None, + "params": Params.from_dict(obj["params"]) if obj.get("params") is not None else None, + "timeout": Timeout.from_dict(obj["timeout"]) if obj.get("timeout") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/gen_ai_watsonx.py b/deepsearch/cps/apis/public_v2/models/gen_ai_watsonx.py index 2b7899a3..0303764c 100644 --- a/deepsearch/cps/apis/public_v2/models/gen_ai_watsonx.py +++ b/deepsearch/cps/apis/public_v2/models/gen_ai_watsonx.py @@ -17,10 +17,10 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.gen_ai_partial_params import GenAIPartialParams from deepsearch.cps.apis.public_v2.models.gen_ai_watsonx_config import GenAIWatsonxConfig +from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_proj_params import GenAIAWSBedrockProjParams from typing import Optional, Set from typing_extensions import Self @@ -30,19 +30,9 @@ class GenAIWatsonx(BaseModel): """ # noqa: E501 kind: Optional[StrictStr] = 'watsonx' config: GenAIWatsonxConfig - proj_params: Optional[GenAIPartialParams] = None + proj_params: Optional[GenAIAWSBedrockProjParams] = None __properties: ClassVar[List[str]] = ["kind", "config", "proj_params"] - @field_validator('kind') - def kind_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['watsonx']): - raise ValueError("must be one of enum values ('watsonx')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -102,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "kind": obj.get("kind") if obj.get("kind") is not None else 'watsonx', "config": GenAIWatsonxConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, - "proj_params": GenAIPartialParams.from_dict(obj["proj_params"]) if obj.get("proj_params") is not None else None + "proj_params": GenAIAWSBedrockProjParams.from_dict(obj["proj_params"]) if obj.get("proj_params") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/gen_aiaws_bedrock.py b/deepsearch/cps/apis/public_v2/models/gen_aiaws_bedrock.py index 74b0e4e9..8e6a9b7f 100644 --- a/deepsearch/cps/apis/public_v2/models/gen_aiaws_bedrock.py +++ b/deepsearch/cps/apis/public_v2/models/gen_aiaws_bedrock.py @@ -17,10 +17,10 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.gen_ai_partial_params import GenAIPartialParams from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_config import GenAIAWSBedrockConfig +from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_proj_params import GenAIAWSBedrockProjParams from typing import Optional, Set from typing_extensions import Self @@ -30,19 +30,9 @@ class GenAIAWSBedrock(BaseModel): """ # noqa: E501 kind: Optional[StrictStr] = 'aws_bedrock' config: GenAIAWSBedrockConfig - proj_params: Optional[GenAIPartialParams] = None + proj_params: Optional[GenAIAWSBedrockProjParams] = None __properties: ClassVar[List[str]] = ["kind", "config", "proj_params"] - @field_validator('kind') - def kind_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['aws_bedrock']): - raise ValueError("must be one of enum values ('aws_bedrock')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -102,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "kind": obj.get("kind") if obj.get("kind") is not None else 'aws_bedrock', "config": GenAIAWSBedrockConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, - "proj_params": GenAIPartialParams.from_dict(obj["proj_params"]) if obj.get("proj_params") is not None else None + "proj_params": GenAIAWSBedrockProjParams.from_dict(obj["proj_params"]) if obj.get("proj_params") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/gen_aiaws_bedrock_proj_params.py b/deepsearch/cps/apis/public_v2/models/gen_aiaws_bedrock_proj_params.py new file mode 100644 index 00000000..7538d446 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/gen_aiaws_bedrock_proj_params.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.gen_ai_partial_params import GenAIPartialParams +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +GENAIAWSBEDROCKPROJPARAMS_ANY_OF_SCHEMAS = ["GenAIPartialParams", "object"] + +class GenAIAWSBedrockProjParams(BaseModel): + """ + GenAIAWSBedrockProjParams + """ + + # data type: GenAIPartialParams + anyof_schema_1_validator: Optional[GenAIPartialParams] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[GenAIPartialParams, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["GenAIPartialParams", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = GenAIAWSBedrockProjParams.model_construct() + error_messages = [] + # validate data type: GenAIPartialParams + if not isinstance(v, GenAIPartialParams): + error_messages.append(f"Error! Input type `{type(v)}` is not `GenAIPartialParams`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in GenAIAWSBedrockProjParams with anyOf schemas: GenAIPartialParams, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[GenAIPartialParams] = None + try: + instance.actual_instance = GenAIPartialParams.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into GenAIAWSBedrockProjParams with anyOf schemas: GenAIPartialParams, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], GenAIPartialParams, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/gen_aibam.py b/deepsearch/cps/apis/public_v2/models/gen_aibam.py index f609491b..181fd6e9 100644 --- a/deepsearch/cps/apis/public_v2/models/gen_aibam.py +++ b/deepsearch/cps/apis/public_v2/models/gen_aibam.py @@ -17,9 +17,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.gen_ai_partial_params import GenAIPartialParams +from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_proj_params import GenAIAWSBedrockProjParams from deepsearch.cps.apis.public_v2.models.gen_aibam_config import GenAIBAMConfig from typing import Optional, Set from typing_extensions import Self @@ -30,19 +30,9 @@ class GenAIBAM(BaseModel): """ # noqa: E501 kind: Optional[StrictStr] = 'bam' config: GenAIBAMConfig - proj_params: Optional[GenAIPartialParams] = None + proj_params: Optional[GenAIAWSBedrockProjParams] = None __properties: ClassVar[List[str]] = ["kind", "config", "proj_params"] - @field_validator('kind') - def kind_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['bam']): - raise ValueError("must be one of enum values ('bam')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -102,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "kind": obj.get("kind") if obj.get("kind") is not None else 'bam', "config": GenAIBAMConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, - "proj_params": GenAIPartialParams.from_dict(obj["proj_params"]) if obj.get("proj_params") is not None else None + "proj_params": GenAIAWSBedrockProjParams.from_dict(obj["proj_params"]) if obj.get("proj_params") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/gen_aicpd.py b/deepsearch/cps/apis/public_v2/models/gen_aicpd.py new file mode 100644 index 00000000..65a1d253 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/gen_aicpd.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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 deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_proj_params import GenAIAWSBedrockProjParams +from deepsearch.cps.apis.public_v2.models.gen_aicpd_config import GenAICPDConfig +from typing import Optional, Set +from typing_extensions import Self + +class GenAICPD(BaseModel): + """ + GenAI integration for watsonx settings + """ # noqa: E501 + kind: Optional[StrictStr] = 'cpd' + config: GenAICPDConfig + proj_params: Optional[GenAIAWSBedrockProjParams] = None + __properties: ClassVar[List[str]] = ["kind", "config", "proj_params"] + + 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 GenAICPD 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 config + if self.config: + _dict['config'] = self.config.to_dict() + # override the default output from pydantic by calling `to_dict()` of proj_params + if self.proj_params: + _dict['proj_params'] = self.proj_params.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GenAICPD from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "kind": obj.get("kind") if obj.get("kind") is not None else 'cpd', + "config": GenAICPDConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, + "proj_params": GenAIAWSBedrockProjParams.from_dict(obj["proj_params"]) if obj.get("proj_params") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/gen_aicpd_config.py b/deepsearch/cps/apis/public_v2/models/gen_aicpd_config.py new file mode 100644 index 00000000..3a38a7b4 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/gen_aicpd_config.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.genai_cpd_api_key import GenaiCpdApiKey +from deepsearch.cps.apis.public_v2.models.genai_cpd_password import GenaiCpdPassword +from typing import Optional, Set +from typing_extensions import Self + +class GenAICPDConfig(BaseModel): + """ + Config for CPD watsonx + """ # noqa: E501 + genai_api: StrictStr = Field(alias="GENAI_API") + genai_project_id: StrictStr = Field(alias="GENAI_PROJECT_ID") + genai_cpd_url: StrictStr = Field(alias="GENAI_CPD_URL") + genai_cpd_verify_tls: Optional[StrictBool] = Field(default=True, alias="GENAI_CPD_VERIFY_TLS") + genai_cpd_username: StrictStr = Field(alias="GENAI_CPD_USERNAME") + genai_cpd_password: Optional[GenaiCpdPassword] = Field(default=None, alias="GENAI_CPD_PASSWORD") + genai_cpd_api_key: Optional[GenaiCpdApiKey] = Field(default=None, alias="GENAI_CPD_API_KEY") + __properties: ClassVar[List[str]] = ["GENAI_API", "GENAI_PROJECT_ID", "GENAI_CPD_URL", "GENAI_CPD_VERIFY_TLS", "GENAI_CPD_USERNAME", "GENAI_CPD_PASSWORD", "GENAI_CPD_API_KEY"] + + 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 GenAICPDConfig 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 genai_cpd_password + if self.genai_cpd_password: + _dict['GENAI_CPD_PASSWORD'] = self.genai_cpd_password.to_dict() + # override the default output from pydantic by calling `to_dict()` of genai_cpd_api_key + if self.genai_cpd_api_key: + _dict['GENAI_CPD_API_KEY'] = self.genai_cpd_api_key.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GenAICPDConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "GENAI_API": obj.get("GENAI_API"), + "GENAI_PROJECT_ID": obj.get("GENAI_PROJECT_ID"), + "GENAI_CPD_URL": obj.get("GENAI_CPD_URL"), + "GENAI_CPD_VERIFY_TLS": obj.get("GENAI_CPD_VERIFY_TLS") if obj.get("GENAI_CPD_VERIFY_TLS") is not None else True, + "GENAI_CPD_USERNAME": obj.get("GENAI_CPD_USERNAME"), + "GENAI_CPD_PASSWORD": GenaiCpdPassword.from_dict(obj["GENAI_CPD_PASSWORD"]) if obj.get("GENAI_CPD_PASSWORD") is not None else None, + "GENAI_CPD_API_KEY": GenaiCpdApiKey.from_dict(obj["GENAI_CPD_API_KEY"]) if obj.get("GENAI_CPD_API_KEY") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/gen_aihf_inference_api.py b/deepsearch/cps/apis/public_v2/models/gen_aihf_inference_api.py index 0f66a326..9acd9421 100644 --- a/deepsearch/cps/apis/public_v2/models/gen_aihf_inference_api.py +++ b/deepsearch/cps/apis/public_v2/models/gen_aihf_inference_api.py @@ -17,9 +17,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.gen_ai_partial_params import GenAIPartialParams +from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_proj_params import GenAIAWSBedrockProjParams from deepsearch.cps.apis.public_v2.models.gen_aihf_inference_api_config import GenAIHFInferenceApiConfig from typing import Optional, Set from typing_extensions import Self @@ -30,19 +30,9 @@ class GenAIHFInferenceApi(BaseModel): """ # noqa: E501 kind: Optional[StrictStr] = 'hf_api' config: GenAIHFInferenceApiConfig - proj_params: Optional[GenAIPartialParams] = None + proj_params: Optional[GenAIAWSBedrockProjParams] = None __properties: ClassVar[List[str]] = ["kind", "config", "proj_params"] - @field_validator('kind') - def kind_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['hf_api']): - raise ValueError("must be one of enum values ('hf_api')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -102,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "kind": obj.get("kind") if obj.get("kind") is not None else 'hf_api', "config": GenAIHFInferenceApiConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, - "proj_params": GenAIPartialParams.from_dict(obj["proj_params"]) if obj.get("proj_params") is not None else None + "proj_params": GenAIAWSBedrockProjParams.from_dict(obj["proj_params"]) if obj.get("proj_params") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/genai_cpd_api_key.py b/deepsearch/cps/apis/public_v2/models/genai_cpd_api_key.py new file mode 100644 index 00000000..9906db09 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/genai_cpd_api_key.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, SecretStr, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +GENAICPDAPIKEY_ANY_OF_SCHEMAS = ["object", "str"] + +class GenaiCpdApiKey(BaseModel): + """ + GenaiCpdApiKey + """ + + # data type: str + anyof_schema_1_validator: Optional[SecretStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = GenaiCpdApiKey.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in GenaiCpdApiKey with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into GenaiCpdApiKey with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/genai_cpd_password.py b/deepsearch/cps/apis/public_v2/models/genai_cpd_password.py new file mode 100644 index 00000000..0d66158d --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/genai_cpd_password.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, SecretStr, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +GENAICPDPASSWORD_ANY_OF_SCHEMAS = ["object", "str"] + +class GenaiCpdPassword(BaseModel): + """ + GenaiCpdPassword + """ + + # data type: str + anyof_schema_1_validator: Optional[SecretStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = GenaiCpdPassword.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in GenaiCpdPassword with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into GenaiCpdPassword with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/head_url.py b/deepsearch/cps/apis/public_v2/models/head_url.py new file mode 100644 index 00000000..2fd7a208 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/head_url.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +HEADURL_ANY_OF_SCHEMAS = ["object", "str"] + +class HeadUrl(BaseModel): + """ + HeadUrl + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = HeadUrl.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in HeadUrl with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into HeadUrl with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/headers.py b/deepsearch/cps/apis/public_v2/models/headers.py new file mode 100644 index 00000000..14217b59 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/headers.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +HEADERS_ANY_OF_SCHEMAS = ["object"] + +class Headers(BaseModel): + """ + Headers + """ + + # data type: object + anyof_schema_1_validator: Optional[Dict[str, Any]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Headers.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Headers with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Headers with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/http_source.py b/deepsearch/cps/apis/public_v2/models/http_source.py index 3aa2f191..4fc3264a 100644 --- a/deepsearch/cps/apis/public_v2/models/http_source.py +++ b/deepsearch/cps/apis/public_v2/models/http_source.py @@ -13,77 +13,126 @@ from __future__ import annotations +from inspect import getfullargspec +import json import pprint import re # noqa: F401 -import json +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self +HTTPSOURCE_ANY_OF_SCHEMAS = ["object"] class HttpSource(BaseModel): """ - HttpSource - """ # noqa: E501 - url: StrictStr - headers: Dict[str, Any] - __properties: ClassVar[List[str]] = ["url", "headers"] - - 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)) + List of Internal File's URLs to be converted and uploaded to the data index. + """ - 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()) + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = HttpSource.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in HttpSource with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HttpSource 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 + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of HttpSource from a dict""" - if obj is None: + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into HttpSource with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: return None - if not isinstance(obj, dict): - return cls.model_validate(obj) + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance - _obj = cls.model_validate({ - "url": obj.get("url"), - "headers": obj.get("headers") - }) - return _obj + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) diff --git a/deepsearch/cps/apis/public_v2/models/id.py b/deepsearch/cps/apis/public_v2/models/id.py new file mode 100644 index 00000000..d306ee3a --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/id.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ID_ANY_OF_SCHEMAS = ["object", "str"] + +class Id(BaseModel): + """ + Id + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Id.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Id with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Id with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/identifiers.py b/deepsearch/cps/apis/public_v2/models/identifiers.py new file mode 100644 index 00000000..3d939d4e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/identifiers.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +IDENTIFIERS_ANY_OF_SCHEMAS = ["object"] + +class Identifiers(BaseModel): + """ + Identifiers + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Identifiers.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Identifiers with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Identifiers with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/identifiers1.py b/deepsearch/cps/apis/public_v2/models/identifiers1.py new file mode 100644 index 00000000..333b4223 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/identifiers1.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +IDENTIFIERS1_ANY_OF_SCHEMAS = ["object"] + +class Identifiers1(BaseModel): + """ + Unique identifiers of a publication venue. + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Identifiers1.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Identifiers1 with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Identifiers1 with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/ignore_above.py b/deepsearch/cps/apis/public_v2/models/ignore_above.py new file mode 100644 index 00000000..4754a2aa --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/ignore_above.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +IGNOREABOVE_ANY_OF_SCHEMAS = ["int", "object"] + +class IgnoreAbove(BaseModel): + """ + IgnoreAbove + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = IgnoreAbove.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in IgnoreAbove with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into IgnoreAbove with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/image_urls_info.py b/deepsearch/cps/apis/public_v2/models/image_urls_info.py new file mode 100644 index 00000000..e4ae5e7a --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/image_urls_info.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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 ImageUrlsInfo(str, Enum): + """ + ImageUrlsInfo + """ + + """ + allowed enum values + """ + STORED = 'STORED' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ImageUrlsInfo from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/deepsearch/cps/apis/public_v2/models/issue.py b/deepsearch/cps/apis/public_v2/models/issue.py new file mode 100644 index 00000000..5fbe392d --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/issue.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ISSUE_ANY_OF_SCHEMAS = ["object", "str"] + +class Issue(BaseModel): + """ + Publication issue (issue number). + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Issue.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Issue with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Issue with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/key_prefix.py b/deepsearch/cps/apis/public_v2/models/key_prefix.py new file mode 100644 index 00000000..2f167d85 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/key_prefix.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +KEYPREFIX_ANY_OF_SCHEMAS = ["object", "str"] + +class KeyPrefix(BaseModel): + """ + KeyPrefix + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = KeyPrefix.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in KeyPrefix with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into KeyPrefix with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/keywords.py b/deepsearch/cps/apis/public_v2/models/keywords.py new file mode 100644 index 00000000..88d41b7b --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/keywords.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +KEYWORDS_ANY_OF_SCHEMAS = ["object"] + +class Keywords(BaseModel): + """ + Keywords + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Keywords.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Keywords with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Keywords with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/kg_key.py b/deepsearch/cps/apis/public_v2/models/kg_key.py new file mode 100644 index 00000000..75d6af24 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/kg_key.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +KGKEY_ANY_OF_SCHEMAS = ["object", "str"] + +class KgKey(BaseModel): + """ + KgKey + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = KgKey.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in KgKey with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into KgKey with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/languages.py b/deepsearch/cps/apis/public_v2/models/languages.py new file mode 100644 index 00000000..dd5f8637 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/languages.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +LANGUAGES_ANY_OF_SCHEMAS = ["object"] + +class Languages(BaseModel): + """ + Languages + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Languages.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Languages with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Languages with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/license.py b/deepsearch/cps/apis/public_v2/models/license.py new file mode 100644 index 00000000..fe78cd5e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/license.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +LICENSE_ANY_OF_SCHEMAS = ["object", "str"] + +class License(BaseModel): + """ + License + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = License.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in License with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into License with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/link.py b/deepsearch/cps/apis/public_v2/models/link.py new file mode 100644 index 00000000..bc0df170 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/link.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing_extensions import Annotated +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +LINK_ANY_OF_SCHEMAS = ["object", "str"] + +class Link(BaseModel): + """ + Link to the data source of this document. + """ + + # data type: str + anyof_schema_1_validator: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Link.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Link with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Link with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/log.py b/deepsearch/cps/apis/public_v2/models/log.py new file mode 100644 index 00000000..7e5b0213 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/log.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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, Field +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.comment import Comment +from deepsearch.cps.apis.public_v2.models.task import Task +from typing import Optional, Set +from typing_extensions import Self + +class Log(BaseModel): + """ + Log entry to describe an ETL task on a document. + """ # noqa: E501 + task: Optional[Task] = None + agent: Optional[Any] = Field(description="The Docling agent that performed the task, e.g., CCS or CXS.") + type: Optional[Any] = Field(description="A task category.") + comment: Optional[Comment] = None + var_date: Optional[Any] = Field(description="A string representation of the task execution datetime in ISO 8601 format.", alias="date") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["task", "agent", "type", "comment", "date"] + + 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 Log 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of task + if self.task: + _dict['task'] = self.task.to_dict() + # override the default output from pydantic by calling `to_dict()` of comment + if self.comment: + _dict['comment'] = self.comment.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if agent (nullable) is None + # and model_fields_set contains the field + if self.agent is None and "agent" in self.model_fields_set: + _dict['agent'] = None + + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + # set to None if var_date (nullable) is None + # and model_fields_set contains the field + if self.var_date is None and "var_date" in self.model_fields_set: + _dict['date'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Log from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "task": Task.from_dict(obj["task"]) if obj.get("task") is not None else None, + "agent": obj.get("agent"), + "type": obj.get("type"), + "comment": Comment.from_dict(obj["comment"]) if obj.get("comment") is not None else None, + "date": obj.get("date") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/merge_mode.py b/deepsearch/cps/apis/public_v2/models/merge_mode.py new file mode 100644 index 00000000..841ec5b0 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/merge_mode.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +MERGEMODE_ANY_OF_SCHEMAS = ["object", "str"] + +class MergeMode(BaseModel): + """ + MergeMode + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = MergeMode.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in MergeMode with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into MergeMode with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/model_date.py b/deepsearch/cps/apis/public_v2/models/model_date.py new file mode 100644 index 00000000..124d7a9f --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/model_date.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +MODELDATE_ANY_OF_SCHEMAS = ["datetime", "object"] + +class ModelDate(BaseModel): + """ + A string representation of the acquisition datetime in ISO 8601 format. + """ + + # data type: datetime + anyof_schema_1_validator: Optional[datetime] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[datetime, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["datetime", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ModelDate.model_construct() + error_messages = [] + # validate data type: datetime + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ModelDate with anyOf schemas: datetime, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into datetime + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ModelDate with anyOf schemas: datetime, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], datetime, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/model_from.py b/deepsearch/cps/apis/public_v2/models/model_from.py new file mode 100644 index 00000000..e94d5074 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/model_from.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +MODELFROM_ANY_OF_SCHEMAS = ["int", "object"] + +class ModelFrom(BaseModel): + """ + ModelFrom + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ModelFrom.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ModelFrom with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ModelFrom with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/model_id.py b/deepsearch/cps/apis/public_v2/models/model_id.py new file mode 100644 index 00000000..4bfecf32 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/model_id.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +MODELID_ANY_OF_SCHEMAS = ["object", "str"] + +class ModelId(BaseModel): + """ + ModelId + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ModelId.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ModelId with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ModelId with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/name.py b/deepsearch/cps/apis/public_v2/models/name.py new file mode 100644 index 00000000..337e8a82 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/name.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +NAME_ANY_OF_SCHEMAS = ["object", "str"] + +class Name(BaseModel): + """ + Name of the collection. + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Name.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Name with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Name with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/number_pages.py b/deepsearch/cps/apis/public_v2/models/number_pages.py new file mode 100644 index 00000000..64c328a2 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/number_pages.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +NUMBERPAGES_ANY_OF_SCHEMAS = ["int", "object"] + +class NumberPages(BaseModel): + """ + NumberPages + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = NumberPages.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in NumberPages with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into NumberPages with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/object_keys.py b/deepsearch/cps/apis/public_v2/models/object_keys.py new file mode 100644 index 00000000..adebe9ee --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/object_keys.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +OBJECTKEYS_ANY_OF_SCHEMAS = ["object"] + +class ObjectKeys(BaseModel): + """ + List of s3 object keys to retrieve from bucket to be converted and uploaded to the data index. + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ObjectKeys.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ObjectKeys with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ObjectKeys with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/ocr_options.py b/deepsearch/cps/apis/public_v2/models/ocr_options.py new file mode 100644 index 00000000..c834226b --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/ocr_options.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class OCROptions(BaseModel): + """ + OCROptions + """ # noqa: E501 + do_ocr: Optional[StrictBool] = True + kind: Optional[StrictStr] = 'easyocr' + __properties: ClassVar[List[str]] = ["do_ocr", "kind"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['easyocr', 'tesserocr']): + raise ValueError("must be one of enum values ('easyocr', 'tesserocr')") + return value + + 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 OCROptions 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 OCROptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "do_ocr": obj.get("do_ocr") if obj.get("do_ocr") is not None else True, + "kind": obj.get("kind") if obj.get("kind") is not None else 'easyocr' + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/ocr_settings.py b/deepsearch/cps/apis/public_v2/models/ocr_settings.py index 6bab580f..ead4a4ab 100644 --- a/deepsearch/cps/apis/public_v2/models/ocr_settings.py +++ b/deepsearch/cps/apis/public_v2/models/ocr_settings.py @@ -17,8 +17,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, StrictBool from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.backend import Backend +from deepsearch.cps.apis.public_v2.models.backend_settings import BackendSettings +from deepsearch.cps.apis.public_v2.models.merge_mode import MergeMode from typing import Optional, Set from typing_extensions import Self @@ -27,9 +30,9 @@ class OcrSettings(BaseModel): OcrSettings """ # noqa: E501 enabled: Optional[StrictBool] = False - backend: Optional[StrictStr] = None - backend_settings: Optional[Dict[str, Any]] = None - merge_mode: Optional[StrictStr] = None + backend: Optional[Backend] = None + backend_settings: Optional[BackendSettings] = None + merge_mode: Optional[MergeMode] = None __properties: ClassVar[List[str]] = ["enabled", "backend", "backend_settings", "merge_mode"] model_config = ConfigDict( @@ -71,6 +74,15 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of backend + if self.backend: + _dict['backend'] = self.backend.to_dict() + # override the default output from pydantic by calling `to_dict()` of backend_settings + if self.backend_settings: + _dict['backend_settings'] = self.backend_settings.to_dict() + # override the default output from pydantic by calling `to_dict()` of merge_mode + if self.merge_mode: + _dict['merge_mode'] = self.merge_mode.to_dict() return _dict @classmethod @@ -84,9 +96,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "enabled": obj.get("enabled") if obj.get("enabled") is not None else False, - "backend": obj.get("backend"), - "backend_settings": obj.get("backend_settings"), - "merge_mode": obj.get("merge_mode") + "backend": Backend.from_dict(obj["backend"]) if obj.get("backend") is not None else None, + "backend_settings": BackendSettings.from_dict(obj["backend_settings"]) if obj.get("backend_settings") is not None else None, + "merge_mode": MergeMode.from_dict(obj["merge_mode"]) if obj.get("merge_mode") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/page.py b/deepsearch/cps/apis/public_v2/models/page.py new file mode 100644 index 00000000..c7b54258 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/page.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PAGE_ANY_OF_SCHEMAS = ["int", "object"] + +class Page(BaseModel): + """ + Page + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Page.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Page with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Page with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/page_labels.py b/deepsearch/cps/apis/public_v2/models/page_labels.py new file mode 100644 index 00000000..116f9a74 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/page_labels.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PAGELABELS_ANY_OF_SCHEMAS = ["Dict[str, object]", "object"] + +class PageLabels(BaseModel): + """ + PageLabels + """ + + # data type: Dict[str, object] + anyof_schema_1_validator: Optional[Dict[str, Dict[str, Any]]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[Dict[str, object], object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["Dict[str, object]", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = PageLabels.model_construct() + error_messages = [] + # validate data type: Dict[str, object] + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in PageLabels with anyOf schemas: Dict[str, object], object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into Dict[str, object] + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into PageLabels with anyOf schemas: Dict[str, object], object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Dict[str, object], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/pages.py b/deepsearch/cps/apis/public_v2/models/pages.py new file mode 100644 index 00000000..c4cd8939 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/pages.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PAGES_ANY_OF_SCHEMAS = ["object", "str"] + +class Pages(BaseModel): + """ + Page range in the publication. + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Pages.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Pages with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Pages with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/params.py b/deepsearch/cps/apis/public_v2/models/params.py new file mode 100644 index 00000000..a540b7c9 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/params.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PARAMS_ANY_OF_SCHEMAS = ["object"] + +class Params(BaseModel): + """ + Params + """ + + # data type: object + anyof_schema_1_validator: Optional[Dict[str, Any]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Params.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Params with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Params with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters.py b/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters.py index 3d0e1bb9..33be2bfc 100644 --- a/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters.py +++ b/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters.py @@ -17,12 +17,13 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.assemble_settings import AssembleSettings -from deepsearch.cps.apis.public_v2.models.collection_metadata_settings import CollectionMetadataSettings -from deepsearch.cps.apis.public_v2.models.model_pipeline_settings import ModelPipelineSettings -from deepsearch.cps.apis.public_v2.models.ocr_settings import OcrSettings +from deepsearch.cps.apis.public_v2.models.page_labels import PageLabels +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_assemble import PartialDirectConversionParametersAssemble +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_metadata import PartialDirectConversionParametersMetadata +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_model_pipeline import PartialDirectConversionParametersModelPipeline +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_ocr import PartialDirectConversionParametersOcr from typing import Optional, Set from typing_extensions import Self @@ -31,23 +32,13 @@ class PartialDirectConversionParameters(BaseModel): Specify conversion settings (OCR, Assemble, ML Models) directly. Fields left null are set to platform defaults. """ # noqa: E501 type: Optional[StrictStr] = 'direct' - ocr: Optional[OcrSettings] = None - assemble: Optional[AssembleSettings] = None - metadata: Optional[CollectionMetadataSettings] = None - page_labels: Optional[Dict[str, Dict[str, Any]]] = None - model_pipeline: Optional[ModelPipelineSettings] = None + ocr: Optional[PartialDirectConversionParametersOcr] = None + assemble: Optional[PartialDirectConversionParametersAssemble] = None + metadata: Optional[PartialDirectConversionParametersMetadata] = None + page_labels: Optional[PageLabels] = None + model_pipeline: Optional[PartialDirectConversionParametersModelPipeline] = None __properties: ClassVar[List[str]] = ["type", "ocr", "assemble", "metadata", "page_labels", "model_pipeline"] - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['direct']): - raise ValueError("must be one of enum values ('direct')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -96,6 +87,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of page_labels + if self.page_labels: + _dict['page_labels'] = self.page_labels.to_dict() # override the default output from pydantic by calling `to_dict()` of model_pipeline if self.model_pipeline: _dict['model_pipeline'] = self.model_pipeline.to_dict() @@ -112,10 +106,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "type": obj.get("type") if obj.get("type") is not None else 'direct', - "ocr": OcrSettings.from_dict(obj["ocr"]) if obj.get("ocr") is not None else None, - "assemble": AssembleSettings.from_dict(obj["assemble"]) if obj.get("assemble") is not None else None, - "metadata": CollectionMetadataSettings.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "model_pipeline": ModelPipelineSettings.from_dict(obj["model_pipeline"]) if obj.get("model_pipeline") is not None else None + "ocr": PartialDirectConversionParametersOcr.from_dict(obj["ocr"]) if obj.get("ocr") is not None else None, + "assemble": PartialDirectConversionParametersAssemble.from_dict(obj["assemble"]) if obj.get("assemble") is not None else None, + "metadata": PartialDirectConversionParametersMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "page_labels": PageLabels.from_dict(obj["page_labels"]) if obj.get("page_labels") is not None else None, + "model_pipeline": PartialDirectConversionParametersModelPipeline.from_dict(obj["model_pipeline"]) if obj.get("model_pipeline") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_assemble.py b/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_assemble.py new file mode 100644 index 00000000..357dab36 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_assemble.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.assemble_settings import AssembleSettings +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PARTIALDIRECTCONVERSIONPARAMETERSASSEMBLE_ANY_OF_SCHEMAS = ["AssembleSettings", "object"] + +class PartialDirectConversionParametersAssemble(BaseModel): + """ + PartialDirectConversionParametersAssemble + """ + + # data type: AssembleSettings + anyof_schema_1_validator: Optional[AssembleSettings] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[AssembleSettings, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["AssembleSettings", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = PartialDirectConversionParametersAssemble.model_construct() + error_messages = [] + # validate data type: AssembleSettings + if not isinstance(v, AssembleSettings): + error_messages.append(f"Error! Input type `{type(v)}` is not `AssembleSettings`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in PartialDirectConversionParametersAssemble with anyOf schemas: AssembleSettings, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[AssembleSettings] = None + try: + instance.actual_instance = AssembleSettings.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into PartialDirectConversionParametersAssemble with anyOf schemas: AssembleSettings, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AssembleSettings, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_metadata.py b/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_metadata.py new file mode 100644 index 00000000..cb220d70 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_metadata.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.collection_metadata_settings import CollectionMetadataSettings +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PARTIALDIRECTCONVERSIONPARAMETERSMETADATA_ANY_OF_SCHEMAS = ["CollectionMetadataSettings", "object"] + +class PartialDirectConversionParametersMetadata(BaseModel): + """ + PartialDirectConversionParametersMetadata + """ + + # data type: CollectionMetadataSettings + anyof_schema_1_validator: Optional[CollectionMetadataSettings] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[CollectionMetadataSettings, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["CollectionMetadataSettings", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = PartialDirectConversionParametersMetadata.model_construct() + error_messages = [] + # validate data type: CollectionMetadataSettings + if not isinstance(v, CollectionMetadataSettings): + error_messages.append(f"Error! Input type `{type(v)}` is not `CollectionMetadataSettings`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in PartialDirectConversionParametersMetadata with anyOf schemas: CollectionMetadataSettings, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[CollectionMetadataSettings] = None + try: + instance.actual_instance = CollectionMetadataSettings.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into PartialDirectConversionParametersMetadata with anyOf schemas: CollectionMetadataSettings, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], CollectionMetadataSettings, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_model_pipeline.py b/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_model_pipeline.py new file mode 100644 index 00000000..f0029b42 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_model_pipeline.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.model_pipeline_settings import ModelPipelineSettings +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PARTIALDIRECTCONVERSIONPARAMETERSMODELPIPELINE_ANY_OF_SCHEMAS = ["ModelPipelineSettings", "object"] + +class PartialDirectConversionParametersModelPipeline(BaseModel): + """ + PartialDirectConversionParametersModelPipeline + """ + + # data type: ModelPipelineSettings + anyof_schema_1_validator: Optional[ModelPipelineSettings] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ModelPipelineSettings, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ModelPipelineSettings", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = PartialDirectConversionParametersModelPipeline.model_construct() + error_messages = [] + # validate data type: ModelPipelineSettings + if not isinstance(v, ModelPipelineSettings): + error_messages.append(f"Error! Input type `{type(v)}` is not `ModelPipelineSettings`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in PartialDirectConversionParametersModelPipeline with anyOf schemas: ModelPipelineSettings, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[ModelPipelineSettings] = None + try: + instance.actual_instance = ModelPipelineSettings.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into PartialDirectConversionParametersModelPipeline with anyOf schemas: ModelPipelineSettings, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ModelPipelineSettings, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_ocr.py b/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_ocr.py new file mode 100644 index 00000000..006a9850 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters_ocr.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.ocr_settings import OcrSettings +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PARTIALDIRECTCONVERSIONPARAMETERSOCR_ANY_OF_SCHEMAS = ["OcrSettings", "object"] + +class PartialDirectConversionParametersOcr(BaseModel): + """ + PartialDirectConversionParametersOcr + """ + + # data type: OcrSettings + anyof_schema_1_validator: Optional[OcrSettings] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[OcrSettings, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["OcrSettings", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = PartialDirectConversionParametersOcr.model_construct() + error_messages = [] + # validate data type: OcrSettings + if not isinstance(v, OcrSettings): + error_messages.append(f"Error! Input type `{type(v)}` is not `OcrSettings`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in PartialDirectConversionParametersOcr with anyOf schemas: OcrSettings, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[OcrSettings] = None + try: + instance.actual_instance = OcrSettings.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into PartialDirectConversionParametersOcr with anyOf schemas: OcrSettings, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], OcrSettings, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/proj_key.py b/deepsearch/cps/apis/public_v2/models/proj_key.py new file mode 100644 index 00000000..03ab8ada --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/proj_key.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PROJKEY_ANY_OF_SCHEMAS = ["object", "str"] + +class ProjKey(BaseModel): + """ + ProjKey + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ProjKey.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ProjKey with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ProjKey with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/project_data_index_conversion_settings_input.py b/deepsearch/cps/apis/public_v2/models/project_data_index_conversion_settings_input.py new file mode 100644 index 00000000..15d97389 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_data_index_conversion_settings_input.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.ocr_options import OCROptions +from deepsearch.cps.apis.public_v2.models.table_structure_options import TableStructureOptions +from typing import Optional, Set +from typing_extensions import Self + +class ProjectDataIndexConversionSettingsInput(BaseModel): + """ + ProjectDataIndexConversionSettingsInput + """ # noqa: E501 + ocr: Optional[OCROptions] = None + table_structure: Optional[TableStructureOptions] = None + generate_page_images: Optional[StrictBool] = True + __properties: ClassVar[List[str]] = ["ocr", "table_structure", "generate_page_images"] + + 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 ProjectDataIndexConversionSettingsInput 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 ocr + if self.ocr: + _dict['ocr'] = self.ocr.to_dict() + # override the default output from pydantic by calling `to_dict()` of table_structure + if self.table_structure: + _dict['table_structure'] = self.table_structure.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectDataIndexConversionSettingsInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ocr": OCROptions.from_dict(obj["ocr"]) if obj.get("ocr") is not None else None, + "table_structure": TableStructureOptions.from_dict(obj["table_structure"]) if obj.get("table_structure") is not None else None, + "generate_page_images": obj.get("generate_page_images") if obj.get("generate_page_images") is not None else True + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/project_data_index_conversion_settings_output.py b/deepsearch/cps/apis/public_v2/models/project_data_index_conversion_settings_output.py new file mode 100644 index 00000000..cbe5bd02 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_data_index_conversion_settings_output.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.ocr_options import OCROptions +from deepsearch.cps.apis.public_v2.models.table_structure_options import TableStructureOptions +from typing import Optional, Set +from typing_extensions import Self + +class ProjectDataIndexConversionSettingsOutput(BaseModel): + """ + ProjectDataIndexConversionSettingsOutput + """ # noqa: E501 + ocr: Optional[OCROptions] = None + table_structure: Optional[TableStructureOptions] = None + generate_page_images: Optional[StrictBool] = True + __properties: ClassVar[List[str]] = ["ocr", "table_structure", "generate_page_images"] + + 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 ProjectDataIndexConversionSettingsOutput 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 ocr + if self.ocr: + _dict['ocr'] = self.ocr.to_dict() + # override the default output from pydantic by calling `to_dict()` of table_structure + if self.table_structure: + _dict['table_structure'] = self.table_structure.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectDataIndexConversionSettingsOutput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ocr": OCROptions.from_dict(obj["ocr"]) if obj.get("ocr") is not None else None, + "table_structure": TableStructureOptions.from_dict(obj["table_structure"]) if obj.get("table_structure") is not None else None, + "generate_page_images": obj.get("generate_page_images") if obj.get("generate_page_images") is not None else True + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/project_data_index_non_view.py b/deepsearch/cps/apis/public_v2/models/project_data_index_non_view.py index c55efc5a..d24e5d2b 100644 --- a/deepsearch/cps/apis/public_v2/models/project_data_index_non_view.py +++ b/deepsearch/cps/apis/public_v2/models/project_data_index_non_view.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.description import Description from typing import Optional, Set from typing_extensions import Self @@ -27,7 +28,7 @@ class ProjectDataIndexNonView(BaseModel): ProjectDataIndexNonView """ # noqa: E501 name: StrictStr - description: Optional[StrictStr] = None + description: Optional[Description] = None schema_key: Optional[StrictStr] = 'generic' __properties: ClassVar[List[str]] = ["name", "description", "schema_key"] @@ -80,6 +81,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of description + if self.description: + _dict['description'] = self.description.to_dict() return _dict @classmethod @@ -93,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), - "description": obj.get("description"), + "description": Description.from_dict(obj["description"]) if obj.get("description") is not None else None, "schema_key": obj.get("schema_key") if obj.get("schema_key") is not None else 'generic' }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/project_data_index_view.py b/deepsearch/cps/apis/public_v2/models/project_data_index_view.py index 850877d1..b2a96a88 100644 --- a/deepsearch/cps/apis/public_v2/models/project_data_index_view.py +++ b/deepsearch/cps/apis/public_v2/models/project_data_index_view.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.description import Description from deepsearch.cps.apis.public_v2.models.view_of import ViewOf from typing import Optional, Set from typing_extensions import Self @@ -28,7 +29,7 @@ class ProjectDataIndexView(BaseModel): ProjectDataIndexView """ # noqa: E501 name: StrictStr - description: Optional[StrictStr] = None + description: Optional[Description] = None view_of: ViewOf __properties: ClassVar[List[str]] = ["name", "description", "view_of"] @@ -71,6 +72,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of description + if self.description: + _dict['description'] = self.description.to_dict() # override the default output from pydantic by calling `to_dict()` of view_of if self.view_of: _dict['view_of'] = self.view_of.to_dict() @@ -87,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), - "description": obj.get("description"), + "description": Description.from_dict(obj["description"]) if obj.get("description") is not None else None, "view_of": ViewOf.from_dict(obj["view_of"]) if obj.get("view_of") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/project_data_index_with_status.py b/deepsearch/cps/apis/public_v2/models/project_data_index_with_status.py index f0a9128b..73834c43 100644 --- a/deepsearch/cps/apis/public_v2/models/project_data_index_with_status.py +++ b/deepsearch/cps/apis/public_v2/models/project_data_index_with_status.py @@ -17,11 +17,14 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from deepsearch.cps.apis.public_v2.models.elastic_metadata import ElasticMetadata -from deepsearch.cps.apis.public_v2.models.source import Source -from deepsearch.cps.apis.public_v2.models.view_of import ViewOf +from deepsearch.cps.apis.public_v2.models.project_data_index_with_status_metadata import ProjectDataIndexWithStatusMetadata +from deepsearch.cps.apis.public_v2.models.provenance import Provenance +from deepsearch.cps.apis.public_v2.models.record_properties import RecordProperties +from deepsearch.cps.apis.public_v2.models.schema_key import SchemaKey +from deepsearch.cps.apis.public_v2.models.source3 import Source3 +from deepsearch.cps.apis.public_v2.models.view_of1 import ViewOf1 from typing import Optional, Set from typing_extensions import Self @@ -29,31 +32,21 @@ class ProjectDataIndexWithStatus(BaseModel): """ ProjectDataIndexWithStatus """ # noqa: E501 - source: Source + source: Source3 name: StrictStr documents: StrictInt health: StrictStr status: StrictStr creation_date: StrictStr - metadata: Optional[ElasticMetadata] = None + metadata: Optional[ProjectDataIndexWithStatusMetadata] = None description: StrictStr - schema_key: Optional[StrictStr] = None + schema_key: Optional[SchemaKey] = None type: StrictStr - view_of: Optional[ViewOf] = None - record_properties: Optional[Dict[str, Any]] = None - provenance: Optional[StrictStr] = None + view_of: Optional[ViewOf1] = None + record_properties: Optional[RecordProperties] = None + provenance: Optional[Provenance] = None __properties: ClassVar[List[str]] = ["source", "name", "documents", "health", "status", "creation_date", "metadata", "description", "schema_key", "type", "view_of", "record_properties", "provenance"] - @field_validator('schema_key') - def schema_key_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['deepsearch-doc', 'deepsearch-db', 'generic']): - raise ValueError("must be one of enum values ('deepsearch-doc', 'deepsearch-db', 'generic')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -99,9 +92,18 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of schema_key + if self.schema_key: + _dict['schema_key'] = self.schema_key.to_dict() # override the default output from pydantic by calling `to_dict()` of view_of if self.view_of: _dict['view_of'] = self.view_of.to_dict() + # override the default output from pydantic by calling `to_dict()` of record_properties + if self.record_properties: + _dict['record_properties'] = self.record_properties.to_dict() + # override the default output from pydantic by calling `to_dict()` of provenance + if self.provenance: + _dict['provenance'] = self.provenance.to_dict() return _dict @classmethod @@ -114,19 +116,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "source": Source.from_dict(obj["source"]) if obj.get("source") is not None else None, + "source": Source3.from_dict(obj["source"]) if obj.get("source") is not None else None, "name": obj.get("name"), "documents": obj.get("documents"), "health": obj.get("health"), "status": obj.get("status"), "creation_date": obj.get("creation_date"), - "metadata": ElasticMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "metadata": ProjectDataIndexWithStatusMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, "description": obj.get("description"), - "schema_key": obj.get("schema_key"), + "schema_key": SchemaKey.from_dict(obj["schema_key"]) if obj.get("schema_key") is not None else None, "type": obj.get("type"), - "view_of": ViewOf.from_dict(obj["view_of"]) if obj.get("view_of") is not None else None, - "record_properties": obj.get("record_properties"), - "provenance": obj.get("provenance") + "view_of": ViewOf1.from_dict(obj["view_of"]) if obj.get("view_of") is not None else None, + "record_properties": RecordProperties.from_dict(obj["record_properties"]) if obj.get("record_properties") is not None else None, + "provenance": Provenance.from_dict(obj["provenance"]) if obj.get("provenance") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/project_data_index_with_status_metadata.py b/deepsearch/cps/apis/public_v2/models/project_data_index_with_status_metadata.py new file mode 100644 index 00000000..bc15ff03 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_data_index_with_status_metadata.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.elastic_metadata import ElasticMetadata +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PROJECTDATAINDEXWITHSTATUSMETADATA_ANY_OF_SCHEMAS = ["ElasticMetadata", "object"] + +class ProjectDataIndexWithStatusMetadata(BaseModel): + """ + ProjectDataIndexWithStatusMetadata + """ + + # data type: ElasticMetadata + anyof_schema_1_validator: Optional[ElasticMetadata] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ElasticMetadata, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ElasticMetadata", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ProjectDataIndexWithStatusMetadata.model_construct() + error_messages = [] + # validate data type: ElasticMetadata + if not isinstance(v, ElasticMetadata): + error_messages.append(f"Error! Input type `{type(v)}` is not `ElasticMetadata`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ProjectDataIndexWithStatusMetadata with anyOf schemas: ElasticMetadata, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[ElasticMetadata] = None + try: + instance.actual_instance = ElasticMetadata.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ProjectDataIndexWithStatusMetadata with anyOf schemas: ElasticMetadata, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ElasticMetadata, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/project_document.py b/deepsearch/cps/apis/public_v2/models/project_document.py index 5ad5bb23..6e05925b 100644 --- a/deepsearch/cps/apis/public_v2/models/project_document.py +++ b/deepsearch/cps/apis/public_v2/models/project_document.py @@ -17,8 +17,13 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.file_uri import FileUri +from deepsearch.cps.apis.public_v2.models.filename import Filename +from deepsearch.cps.apis.public_v2.models.number_pages import NumberPages +from deepsearch.cps.apis.public_v2.models.ref_uri import RefUri +from deepsearch.cps.apis.public_v2.models.status import Status from typing import Optional, Set from typing_extensions import Self @@ -27,11 +32,11 @@ class ProjectDocument(BaseModel): ProjectDocument """ # noqa: E501 document_hash: StrictStr - filename: StrictStr - file_uri: Optional[StrictStr] = None - ref_uri: Optional[StrictStr] = None - number_pages: Optional[StrictInt] = None - status: Optional[StrictStr] = None + filename: Optional[Filename] = None + file_uri: Optional[FileUri] = None + ref_uri: Optional[RefUri] = None + number_pages: Optional[NumberPages] = None + status: Optional[Status] = None __properties: ClassVar[List[str]] = ["document_hash", "filename", "file_uri", "ref_uri", "number_pages", "status"] model_config = ConfigDict( @@ -73,6 +78,21 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of filename + if self.filename: + _dict['filename'] = self.filename.to_dict() + # override the default output from pydantic by calling `to_dict()` of file_uri + if self.file_uri: + _dict['file_uri'] = self.file_uri.to_dict() + # override the default output from pydantic by calling `to_dict()` of ref_uri + if self.ref_uri: + _dict['ref_uri'] = self.ref_uri.to_dict() + # override the default output from pydantic by calling `to_dict()` of number_pages + if self.number_pages: + _dict['number_pages'] = self.number_pages.to_dict() + # override the default output from pydantic by calling `to_dict()` of status + if self.status: + _dict['status'] = self.status.to_dict() return _dict @classmethod @@ -86,11 +106,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "document_hash": obj.get("document_hash"), - "filename": obj.get("filename"), - "file_uri": obj.get("file_uri"), - "ref_uri": obj.get("ref_uri"), - "number_pages": obj.get("number_pages"), - "status": obj.get("status") + "filename": Filename.from_dict(obj["filename"]) if obj.get("filename") is not None else None, + "file_uri": FileUri.from_dict(obj["file_uri"]) if obj.get("file_uri") is not None else None, + "ref_uri": RefUri.from_dict(obj["ref_uri"]) if obj.get("ref_uri") is not None else None, + "number_pages": NumberPages.from_dict(obj["number_pages"]) if obj.get("number_pages") is not None else None, + "status": Status.from_dict(obj["status"]) if obj.get("status") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/prompt_template.py b/deepsearch/cps/apis/public_v2/models/prompt_template.py new file mode 100644 index 00000000..0cdd5a05 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/prompt_template.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PROMPTTEMPLATE_ANY_OF_SCHEMAS = ["object", "str"] + +class PromptTemplate(BaseModel): + """ + PromptTemplate + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = PromptTemplate.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in PromptTemplate with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into PromptTemplate with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/provenance.py b/deepsearch/cps/apis/public_v2/models/provenance.py new file mode 100644 index 00000000..27865bd2 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/provenance.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PROVENANCE_ANY_OF_SCHEMAS = ["object", "str"] + +class Provenance(BaseModel): + """ + Provenance + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Provenance.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Provenance with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Provenance with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/publication.py b/deepsearch/cps/apis/public_v2/models/publication.py new file mode 100644 index 00000000..b56e2b75 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/publication.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.alternate_names import AlternateNames +from deepsearch.cps.apis.public_v2.models.identifiers1 import Identifiers1 +from deepsearch.cps.apis.public_v2.models.issue import Issue +from deepsearch.cps.apis.public_v2.models.pages import Pages +from deepsearch.cps.apis.public_v2.models.type1 import Type1 +from deepsearch.cps.apis.public_v2.models.url import Url +from deepsearch.cps.apis.public_v2.models.volume import Volume +from typing import Optional, Set +from typing_extensions import Self + +class Publication(BaseModel): + """ + Publication details of a journal or venue. + """ # noqa: E501 + identifiers: Optional[Identifiers1] = None + name: StrictStr = Field(description="Name of the publication.") + alternate_names: Optional[AlternateNames] = None + type: Optional[Type1] = None + pages: Optional[Pages] = None + issue: Optional[Issue] = None + volume: Optional[Volume] = None + url: Optional[Url] = None + __properties: ClassVar[List[str]] = ["identifiers", "name", "alternate_names", "type", "pages", "issue", "volume", "url"] + + 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 Publication 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 identifiers + if self.identifiers: + _dict['identifiers'] = self.identifiers.to_dict() + # override the default output from pydantic by calling `to_dict()` of alternate_names + if self.alternate_names: + _dict['alternate_names'] = self.alternate_names.to_dict() + # override the default output from pydantic by calling `to_dict()` of type + if self.type: + _dict['type'] = self.type.to_dict() + # override the default output from pydantic by calling `to_dict()` of pages + if self.pages: + _dict['pages'] = self.pages.to_dict() + # override the default output from pydantic by calling `to_dict()` of issue + if self.issue: + _dict['issue'] = self.issue.to_dict() + # override the default output from pydantic by calling `to_dict()` of volume + if self.volume: + _dict['volume'] = self.volume.to_dict() + # override the default output from pydantic by calling `to_dict()` of url + if self.url: + _dict['url'] = self.url.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Publication from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "identifiers": Identifiers1.from_dict(obj["identifiers"]) if obj.get("identifiers") is not None else None, + "name": obj.get("name"), + "alternate_names": AlternateNames.from_dict(obj["alternate_names"]) if obj.get("alternate_names") is not None else None, + "type": Type1.from_dict(obj["type"]) if obj.get("type") is not None else None, + "pages": Pages.from_dict(obj["pages"]) if obj.get("pages") is not None else None, + "issue": Issue.from_dict(obj["issue"]) if obj.get("issue") is not None else None, + "volume": Volume.from_dict(obj["volume"]) if obj.get("volume") is not None else None, + "url": Url.from_dict(obj["url"]) if obj.get("url") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/publication1.py b/deepsearch/cps/apis/public_v2/models/publication1.py new file mode 100644 index 00000000..9610d621 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/publication1.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PUBLICATION1_ANY_OF_SCHEMAS = ["object"] + +class Publication1(BaseModel): + """ + List of publication journals or venues. + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Publication1.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Publication1 with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Publication1 with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/publication_date.py b/deepsearch/cps/apis/public_v2/models/publication_date.py new file mode 100644 index 00000000..51d24eb9 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/publication_date.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PUBLICATIONDATE_ANY_OF_SCHEMAS = ["datetime", "object"] + +class PublicationDate(BaseModel): + """ + PublicationDate + """ + + # data type: datetime + anyof_schema_1_validator: Optional[datetime] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[datetime, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["datetime", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = PublicationDate.model_construct() + error_messages = [] + # validate data type: datetime + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in PublicationDate with anyOf schemas: datetime, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into datetime + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into PublicationDate with anyOf schemas: datetime, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], datetime, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/publishers.py b/deepsearch/cps/apis/public_v2/models/publishers.py new file mode 100644 index 00000000..f273f108 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/publishers.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PUBLISHERS_ANY_OF_SCHEMAS = ["object"] + +class Publishers(BaseModel): + """ + Publishers + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Publishers.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Publishers with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Publishers with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/query.py b/deepsearch/cps/apis/public_v2/models/query.py new file mode 100644 index 00000000..38cb4de0 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/query.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +QUERY_ANY_OF_SCHEMAS = ["object"] + +class Query(BaseModel): + """ + Query + """ + + # data type: object + anyof_schema_1_validator: Optional[Dict[str, Any]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Query.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Query with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Query with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/record_properties.py b/deepsearch/cps/apis/public_v2/models/record_properties.py new file mode 100644 index 00000000..b8de7587 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/record_properties.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +RECORDPROPERTIES_ANY_OF_SCHEMAS = ["object"] + +class RecordProperties(BaseModel): + """ + RecordProperties + """ + + # data type: object + anyof_schema_1_validator: Optional[Dict[str, Any]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = RecordProperties.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in RecordProperties with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into RecordProperties with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/ref_uri.py b/deepsearch/cps/apis/public_v2/models/ref_uri.py new file mode 100644 index 00000000..73241adc --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/ref_uri.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +REFURI_ANY_OF_SCHEMAS = ["object", "str"] + +class RefUri(BaseModel): + """ + RefUri + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = RefUri.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in RefUri with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into RefUri with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/reference_count.py b/deepsearch/cps/apis/public_v2/models/reference_count.py new file mode 100644 index 00000000..83279e95 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/reference_count.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing_extensions import Annotated +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +REFERENCECOUNT_ANY_OF_SCHEMAS = ["int", "object"] + +class ReferenceCount(BaseModel): + """ + Total number of documents referenced by this document. + """ + + # data type: int + anyof_schema_1_validator: Optional[Annotated[int, Field(strict=True, ge=0)]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ReferenceCount.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ReferenceCount with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ReferenceCount with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/references.py b/deepsearch/cps/apis/public_v2/models/references.py new file mode 100644 index 00000000..ad37e7fa --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/references.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +REFERENCES_ANY_OF_SCHEMAS = ["object"] + +class References(BaseModel): + """ + References + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = References.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in References with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into References with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/related_tasks.py b/deepsearch/cps/apis/public_v2/models/related_tasks.py new file mode 100644 index 00000000..42d75314 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/related_tasks.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +RELATEDTASKS_ANY_OF_SCHEMAS = ["object"] + +class RelatedTasks(BaseModel): + """ + RelatedTasks + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = RelatedTasks.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in RelatedTasks with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into RelatedTasks with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/response_get_project_data_index_conversion_settings.py b/deepsearch/cps/apis/public_v2/models/response_get_project_data_index_conversion_settings.py new file mode 100644 index 00000000..23de6d3a --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/response_get_project_data_index_conversion_settings.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_output import ProjectDataIndexConversionSettingsOutput +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +RESPONSEGETPROJECTDATAINDEXCONVERSIONSETTINGS_ANY_OF_SCHEMAS = ["ProjectDataIndexConversionSettingsOutput", "object"] + +class ResponseGetProjectDataIndexConversionSettings(BaseModel): + """ + ResponseGetProjectDataIndexConversionSettings + """ + + # data type: ProjectDataIndexConversionSettingsOutput + anyof_schema_1_validator: Optional[ProjectDataIndexConversionSettingsOutput] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ProjectDataIndexConversionSettingsOutput, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ProjectDataIndexConversionSettingsOutput", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ResponseGetProjectDataIndexConversionSettings.model_construct() + error_messages = [] + # validate data type: ProjectDataIndexConversionSettingsOutput + if not isinstance(v, ProjectDataIndexConversionSettingsOutput): + error_messages.append(f"Error! Input type `{type(v)}` is not `ProjectDataIndexConversionSettingsOutput`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ResponseGetProjectDataIndexConversionSettings with anyOf schemas: ProjectDataIndexConversionSettingsOutput, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[ProjectDataIndexConversionSettingsOutput] = None + try: + instance.actual_instance = ProjectDataIndexConversionSettingsOutput.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ResponseGetProjectDataIndexConversionSettings with anyOf schemas: ProjectDataIndexConversionSettingsOutput, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ProjectDataIndexConversionSettingsOutput, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/response_get_project_integration_config_genai.py b/deepsearch/cps/apis/public_v2/models/response_get_project_integration_config_genai.py index 5ec073bf..6e19e837 100644 --- a/deepsearch/cps/apis/public_v2/models/response_get_project_integration_config_genai.py +++ b/deepsearch/cps/apis/public_v2/models/response_get_project_integration_config_genai.py @@ -13,44 +13,48 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Optional +from typing import Any, List, Optional +from deepsearch.cps.apis.public_v2.models.gen_ai_openai import GenAIOpenai from deepsearch.cps.apis.public_v2.models.gen_ai_watsonx import GenAIWatsonx from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock import GenAIAWSBedrock from deepsearch.cps.apis.public_v2.models.gen_aibam import GenAIBAM +from deepsearch.cps.apis.public_v2.models.gen_aicpd import GenAICPD from deepsearch.cps.apis.public_v2.models.gen_aihf_inference_api import GenAIHFInferenceApi -from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict from typing_extensions import Literal, Self -from pydantic import Field -RESPONSEGETPROJECTINTEGRATIONCONFIGGENAI_ANY_OF_SCHEMAS = ["GenAIAWSBedrock", "GenAIBAM", "GenAIHFInferenceApi", "GenAIWatsonx"] +RESPONSEGETPROJECTINTEGRATIONCONFIGGENAI_ONE_OF_SCHEMAS = ["GenAIAWSBedrock", "GenAIBAM", "GenAICPD", "GenAIHFInferenceApi", "GenAIOpenai", "GenAIWatsonx"] class ResponseGetProjectIntegrationConfigGenai(BaseModel): """ ResponseGetProjectIntegrationConfigGenai """ - # data type: GenAIBAM - anyof_schema_1_validator: Optional[GenAIBAM] = None + oneof_schema_1_validator: Optional[GenAIBAM] = None # data type: GenAIWatsonx - anyof_schema_2_validator: Optional[GenAIWatsonx] = None + oneof_schema_2_validator: Optional[GenAIWatsonx] = None + # data type: GenAICPD + oneof_schema_3_validator: Optional[GenAICPD] = None # data type: GenAIHFInferenceApi - anyof_schema_3_validator: Optional[GenAIHFInferenceApi] = None + oneof_schema_4_validator: Optional[GenAIHFInferenceApi] = None + # data type: GenAIOpenai + oneof_schema_5_validator: Optional[GenAIOpenai] = None # data type: GenAIAWSBedrock - anyof_schema_4_validator: Optional[GenAIAWSBedrock] = None - if TYPE_CHECKING: - actual_instance: Optional[Union[GenAIAWSBedrock, GenAIBAM, GenAIHFInferenceApi, GenAIWatsonx]] = None - else: - actual_instance: Any = None - any_of_schemas: List[str] = Field(default=Literal["GenAIAWSBedrock", "GenAIBAM", "GenAIHFInferenceApi", "GenAIWatsonx"]) - - model_config = { - "validate_assignment": True, - "protected_namespaces": (), + oneof_schema_6_validator: Optional[GenAIAWSBedrock] = None + actual_instance: Optional[Union[GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx]] = None + one_of_schemas: List[str] = Field(default=Literal["GenAIAWSBedrock", "GenAIBAM", "GenAICPD", "GenAIHFInferenceApi", "GenAIOpenai", "GenAIWatsonx"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -64,41 +68,51 @@ def __init__(self, *args, **kwargs) -> None: super().__init__(**kwargs) @field_validator('actual_instance') - def actual_instance_must_validate_anyof(cls, v): + def actual_instance_must_validate_oneof(cls, v): instance = ResponseGetProjectIntegrationConfigGenai.model_construct() error_messages = [] + match = 0 # validate data type: GenAIBAM if not isinstance(v, GenAIBAM): error_messages.append(f"Error! Input type `{type(v)}` is not `GenAIBAM`") else: - return v - + match += 1 # validate data type: GenAIWatsonx if not isinstance(v, GenAIWatsonx): error_messages.append(f"Error! Input type `{type(v)}` is not `GenAIWatsonx`") else: - return v - + match += 1 + # validate data type: GenAICPD + if not isinstance(v, GenAICPD): + error_messages.append(f"Error! Input type `{type(v)}` is not `GenAICPD`") + else: + match += 1 # validate data type: GenAIHFInferenceApi if not isinstance(v, GenAIHFInferenceApi): error_messages.append(f"Error! Input type `{type(v)}` is not `GenAIHFInferenceApi`") else: - return v - + match += 1 + # validate data type: GenAIOpenai + if not isinstance(v, GenAIOpenai): + error_messages.append(f"Error! Input type `{type(v)}` is not `GenAIOpenai`") + else: + match += 1 # validate data type: GenAIAWSBedrock if not isinstance(v, GenAIAWSBedrock): error_messages.append(f"Error! Input type `{type(v)}` is not `GenAIAWSBedrock`") else: - return v - - if error_messages: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in ResponseGetProjectIntegrationConfigGenai with oneOf schemas: GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx. Details: " + ", ".join(error_messages)) + elif match == 0: # no match - raise ValueError("No match found when setting the actual_instance in ResponseGetProjectIntegrationConfigGenai with anyOf schemas: GenAIAWSBedrock, GenAIBAM, GenAIHFInferenceApi, GenAIWatsonx. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in ResponseGetProjectIntegrationConfigGenai with oneOf schemas: GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx. Details: " + ", ".join(error_messages)) else: return v @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Self: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod @@ -106,34 +120,51 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[GenAIBAM] = None + match = 0 + + # deserialize data into GenAIBAM try: instance.actual_instance = GenAIBAM.from_json(json_str) - return instance + match += 1 except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[GenAIWatsonx] = None + error_messages.append(str(e)) + # deserialize data into GenAIWatsonx try: instance.actual_instance = GenAIWatsonx.from_json(json_str) - return instance + match += 1 except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_3_validator: Optional[GenAIHFInferenceApi] = None + error_messages.append(str(e)) + # deserialize data into GenAICPD + try: + instance.actual_instance = GenAICPD.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into GenAIHFInferenceApi try: instance.actual_instance = GenAIHFInferenceApi.from_json(json_str) - return instance + match += 1 except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_4_validator: Optional[GenAIAWSBedrock] = None + error_messages.append(str(e)) + # deserialize data into GenAIOpenai + try: + instance.actual_instance = GenAIOpenai.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into GenAIAWSBedrock try: instance.actual_instance = GenAIAWSBedrock.from_json(json_str) - return instance + match += 1 except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + error_messages.append(str(e)) - if error_messages: + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into ResponseGetProjectIntegrationConfigGenai with oneOf schemas: GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx. Details: " + ", ".join(error_messages)) + elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into ResponseGetProjectIntegrationConfigGenai with anyOf schemas: GenAIAWSBedrock, GenAIBAM, GenAIHFInferenceApi, GenAIWatsonx. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into ResponseGetProjectIntegrationConfigGenai with oneOf schemas: GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx. Details: " + ", ".join(error_messages)) else: return instance @@ -147,7 +178,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], GenAIAWSBedrock, GenAIBAM, GenAIHFInferenceApi, GenAIWatsonx]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], GenAIAWSBedrock, GenAIBAM, GenAICPD, GenAIHFInferenceApi, GenAIOpenai, GenAIWatsonx]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None @@ -155,6 +186,7 @@ def to_dict(self) -> Optional[Union[Dict[str, Any], GenAIAWSBedrock, GenAIBAM, G if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: + # primitive type return self.actual_instance def to_str(self) -> str: diff --git a/deepsearch/cps/apis/public_v2/models/response_update_project_data_index_conversion_settings.py b/deepsearch/cps/apis/public_v2/models/response_update_project_data_index_conversion_settings.py new file mode 100644 index 00000000..9d229be7 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/response_update_project_data_index_conversion_settings.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_output import ProjectDataIndexConversionSettingsOutput +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +RESPONSEUPDATEPROJECTDATAINDEXCONVERSIONSETTINGS_ANY_OF_SCHEMAS = ["ProjectDataIndexConversionSettingsOutput", "object"] + +class ResponseUpdateProjectDataIndexConversionSettings(BaseModel): + """ + ResponseUpdateProjectDataIndexConversionSettings + """ + + # data type: ProjectDataIndexConversionSettingsOutput + anyof_schema_1_validator: Optional[ProjectDataIndexConversionSettingsOutput] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ProjectDataIndexConversionSettingsOutput, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ProjectDataIndexConversionSettingsOutput", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ResponseUpdateProjectDataIndexConversionSettings.model_construct() + error_messages = [] + # validate data type: ProjectDataIndexConversionSettingsOutput + if not isinstance(v, ProjectDataIndexConversionSettingsOutput): + error_messages.append(f"Error! Input type `{type(v)}` is not `ProjectDataIndexConversionSettingsOutput`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ResponseUpdateProjectDataIndexConversionSettings with anyOf schemas: ProjectDataIndexConversionSettingsOutput, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[ProjectDataIndexConversionSettingsOutput] = None + try: + instance.actual_instance = ProjectDataIndexConversionSettingsOutput.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ResponseUpdateProjectDataIndexConversionSettings with anyOf schemas: ProjectDataIndexConversionSettingsOutput, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ProjectDataIndexConversionSettingsOutput, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/s3_coordinates.py b/deepsearch/cps/apis/public_v2/models/s3_coordinates.py index 4868ff54..7fddc2cb 100644 --- a/deepsearch/cps/apis/public_v2/models/s3_coordinates.py +++ b/deepsearch/cps/apis/public_v2/models/s3_coordinates.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.key_prefix import KeyPrefix from typing import Optional, Set from typing_extensions import Self @@ -33,7 +34,7 @@ class S3Coordinates(BaseModel): access_key: StrictStr = Field(alias="access-key") secret_key: StrictStr = Field(alias="secret-key") bucket: StrictStr - key_prefix: Optional[StrictStr] = None + key_prefix: Optional[KeyPrefix] = None location: StrictStr __properties: ClassVar[List[str]] = ["host", "port", "ssl", "verifySSL", "access-key", "secret-key", "bucket", "key_prefix", "location"] @@ -76,6 +77,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of key_prefix + if self.key_prefix: + _dict['key_prefix'] = self.key_prefix.to_dict() return _dict @classmethod @@ -95,7 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "access-key": obj.get("access-key"), "secret-key": obj.get("secret-key"), "bucket": obj.get("bucket"), - "key_prefix": obj.get("key_prefix"), + "key_prefix": KeyPrefix.from_dict(obj["key_prefix"]) if obj.get("key_prefix") is not None else None, "location": obj.get("location") }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/s3_document_source.py b/deepsearch/cps/apis/public_v2/models/s3_document_source.py index 1931307a..110fd00b 100644 --- a/deepsearch/cps/apis/public_v2/models/s3_document_source.py +++ b/deepsearch/cps/apis/public_v2/models/s3_document_source.py @@ -17,8 +17,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.object_keys import ObjectKeys from deepsearch.cps.apis.public_v2.models.s3_coordinates import S3Coordinates from typing import Optional, Set from typing_extensions import Self @@ -28,7 +29,7 @@ class S3DocumentSource(BaseModel): Specifies documents to import from an S3 bucket """ # noqa: E501 coordinates: S3Coordinates - object_keys: Optional[List[StrictStr]] = Field(default=None, description="List of s3 object keys to retrieve from bucket to be converted and uploaded to the data index.") + object_keys: Optional[ObjectKeys] = None __properties: ClassVar[List[str]] = ["coordinates", "object_keys"] model_config = ConfigDict( @@ -73,6 +74,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of coordinates if self.coordinates: _dict['coordinates'] = self.coordinates.to_dict() + # override the default output from pydantic by calling `to_dict()` of object_keys + if self.object_keys: + _dict['object_keys'] = self.object_keys.to_dict() return _dict @classmethod @@ -86,7 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "coordinates": S3Coordinates.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None, - "object_keys": obj.get("object_keys") + "object_keys": ObjectKeys.from_dict(obj["object_keys"]) if obj.get("object_keys") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/schema_key.py b/deepsearch/cps/apis/public_v2/models/schema_key.py new file mode 100644 index 00000000..ed7b034e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/schema_key.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +SCHEMAKEY_ANY_OF_SCHEMAS = ["object", "str"] + +class SchemaKey(BaseModel): + """ + SchemaKey + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = SchemaKey.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in SchemaKey with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into SchemaKey with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/scratch_ids.py b/deepsearch/cps/apis/public_v2/models/scratch_ids.py new file mode 100644 index 00000000..655d1845 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/scratch_ids.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +SCRATCHIDS_ANY_OF_SCHEMAS = ["object", "str"] + +class ScratchIds(BaseModel): + """ + ScratchIds + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ScratchIds.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ScratchIds with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ScratchIds with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/search_string.py b/deepsearch/cps/apis/public_v2/models/search_string.py new file mode 100644 index 00000000..f905d8c6 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/search_string.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +SEARCHSTRING_ANY_OF_SCHEMAS = ["object", "str"] + +class SearchString(BaseModel): + """ + SearchString + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = SearchString.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in SearchString with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into SearchString with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/semantic_ingest_request.py b/deepsearch/cps/apis/public_v2/models/semantic_ingest_request.py index e865b671..a113d649 100644 --- a/deepsearch/cps/apis/public_v2/models/semantic_ingest_request.py +++ b/deepsearch/cps/apis/public_v2/models/semantic_ingest_request.py @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List from deepsearch.cps.apis.public_v2.models.semantic_ingest_req_params import SemanticIngestReqParams -from deepsearch.cps.apis.public_v2.models.source1 import Source1 +from deepsearch.cps.apis.public_v2.models.source4 import Source4 from typing import Optional, Set from typing_extensions import Self @@ -28,7 +28,7 @@ class SemanticIngestRequest(BaseModel): """ SemanticIngestRequest """ # noqa: E501 - source: Source1 + source: Source4 parameters: SemanticIngestReqParams __properties: ClassVar[List[str]] = ["source", "parameters"] @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "source": Source1.from_dict(obj["source"]) if obj.get("source") is not None else None, + "source": Source4.from_dict(obj["source"]) if obj.get("source") is not None else None, "parameters": SemanticIngestReqParams.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_private_data_collection.py b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_private_data_collection.py index b71a9ffb..c1304aba 100644 --- a/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_private_data_collection.py +++ b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_private_data_collection.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -31,13 +31,6 @@ class SemanticIngestSourcePrivateDataCollection(BaseModel): index_key: StrictStr __properties: ClassVar[List[str]] = ["type", "proj_key", "index_key"] - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['private_data_collection']): - raise ValueError("must be one of enum values ('private_data_collection')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_private_data_document.py b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_private_data_document.py index 657fd06c..8ada528e 100644 --- a/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_private_data_document.py +++ b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_private_data_document.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -32,13 +32,6 @@ class SemanticIngestSourcePrivateDataDocument(BaseModel): document_hash: StrictStr __properties: ClassVar[List[str]] = ["type", "proj_key", "index_key", "document_hash"] - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['private_data_document']): - raise ValueError("must be one of enum values ('private_data_document')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_public_data_document.py b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_public_data_document.py index 1756cf96..c3400f37 100644 --- a/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_public_data_document.py +++ b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_public_data_document.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -32,13 +32,6 @@ class SemanticIngestSourcePublicDataDocument(BaseModel): document_hash: StrictStr __properties: ClassVar[List[str]] = ["type", "elastic_id", "index_key", "document_hash"] - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['public_data_document']): - raise ValueError("must be one of enum values ('public_data_document')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_url.py b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_url.py index 0239c91c..45006643 100644 --- a/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_url.py +++ b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_url.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -30,13 +30,6 @@ class SemanticIngestSourceUrl(BaseModel): url: StrictStr __properties: ClassVar[List[str]] = ["type", "url"] - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['url']): - raise ValueError("must be one of enum values ('url')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/deepsearch/cps/apis/public_v2/models/size.py b/deepsearch/cps/apis/public_v2/models/size.py new file mode 100644 index 00000000..ed1a80bd --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/size.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing_extensions import Annotated +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +SIZE_ANY_OF_SCHEMAS = ["int", "object"] + +class Size(BaseModel): + """ + Size in bytes of the raw document from the data source. + """ + + # data type: int + anyof_schema_1_validator: Optional[Annotated[int, Field(strict=True, ge=0)]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Size.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Size with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Size with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/size1.py b/deepsearch/cps/apis/public_v2/models/size1.py new file mode 100644 index 00000000..1f3665e7 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/size1.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +SIZE1_ANY_OF_SCHEMAS = ["int", "object"] + +class Size1(BaseModel): + """ + Size1 + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Size1.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Size1 with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Size1 with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/sort.py b/deepsearch/cps/apis/public_v2/models/sort.py new file mode 100644 index 00000000..b2f63bfa --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/sort.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +SORT_ANY_OF_SCHEMAS = ["object"] + +class Sort(BaseModel): + """ + Sort + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Sort.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Sort with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Sort with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/source.py b/deepsearch/cps/apis/public_v2/models/source.py index 4b34e6b3..660c5d2f 100644 --- a/deepsearch/cps/apis/public_v2/models/source.py +++ b/deepsearch/cps/apis/public_v2/models/source.py @@ -18,29 +18,27 @@ import pprint import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Optional -from deepsearch.cps.apis.public_v2.models.elastic_index_source import ElasticIndexSource -from deepsearch.cps.apis.public_v2.models.project_data_index_source import ProjectDataIndexSource +from typing import Any, Optional from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -SOURCE_ANY_OF_SCHEMAS = ["ElasticIndexSource", "ProjectDataIndexSource"] +SOURCE_ANY_OF_SCHEMAS = ["object", "str"] class Source(BaseModel): """ Source """ - # data type: ElasticIndexSource - anyof_schema_1_validator: Optional[ElasticIndexSource] = None - # data type: ProjectDataIndexSource - anyof_schema_2_validator: Optional[ProjectDataIndexSource] = None + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None if TYPE_CHECKING: - actual_instance: Optional[Union[ElasticIndexSource, ProjectDataIndexSource]] = None + actual_instance: Optional[Union[object, str]] = None else: actual_instance: Any = None - any_of_schemas: List[str] = Field(default=Literal["ElasticIndexSource", "ProjectDataIndexSource"]) + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) model_config = { "validate_assignment": True, @@ -61,21 +59,21 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Source.model_construct() error_messages = [] - # validate data type: ElasticIndexSource - if not isinstance(v, ElasticIndexSource): - error_messages.append(f"Error! Input type `{type(v)}` is not `ElasticIndexSource`") - else: + # validate data type: str + try: + instance.anyof_schema_1_validator = v return v - - # validate data type: ProjectDataIndexSource - if not isinstance(v, ProjectDataIndexSource): - error_messages.append(f"Error! Input type `{type(v)}` is not `ProjectDataIndexSource`") - else: + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v return v - + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Source with anyOf schemas: ElasticIndexSource, ProjectDataIndexSource. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Source with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) else: return v @@ -88,22 +86,28 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[ElasticIndexSource] = None + # deserialize data into str try: - instance.actual_instance = ElasticIndexSource.from_json(json_str) + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator return instance except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[ProjectDataIndexSource] = None + error_messages.append(str(e)) + # deserialize data into object try: - instance.actual_instance = ProjectDataIndexSource.from_json(json_str) + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator return instance except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Source with anyOf schemas: ElasticIndexSource, ProjectDataIndexSource. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Source with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) else: return instance @@ -117,7 +121,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], ElasticIndexSource, ProjectDataIndexSource]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/deepsearch/cps/apis/public_v2/models/source1.py b/deepsearch/cps/apis/public_v2/models/source1.py index 96c4d3bf..a12f922b 100644 --- a/deepsearch/cps/apis/public_v2/models/source1.py +++ b/deepsearch/cps/apis/public_v2/models/source1.py @@ -18,35 +18,27 @@ import pprint import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Optional -from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_private_data_collection import SemanticIngestSourcePrivateDataCollection -from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_private_data_document import SemanticIngestSourcePrivateDataDocument -from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_public_data_document import SemanticIngestSourcePublicDataDocument -from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_url import SemanticIngestSourceUrl +from typing import Any, Optional from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -SOURCE1_ANY_OF_SCHEMAS = ["SemanticIngestSourcePrivateDataCollection", "SemanticIngestSourcePrivateDataDocument", "SemanticIngestSourcePublicDataDocument", "SemanticIngestSourceUrl"] +SOURCE1_ANY_OF_SCHEMAS = ["object", "str"] class Source1(BaseModel): """ Source1 """ - # data type: SemanticIngestSourceUrl - anyof_schema_1_validator: Optional[SemanticIngestSourceUrl] = None - # data type: SemanticIngestSourcePublicDataDocument - anyof_schema_2_validator: Optional[SemanticIngestSourcePublicDataDocument] = None - # data type: SemanticIngestSourcePrivateDataDocument - anyof_schema_3_validator: Optional[SemanticIngestSourcePrivateDataDocument] = None - # data type: SemanticIngestSourcePrivateDataCollection - anyof_schema_4_validator: Optional[SemanticIngestSourcePrivateDataCollection] = None + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None if TYPE_CHECKING: - actual_instance: Optional[Union[SemanticIngestSourcePrivateDataCollection, SemanticIngestSourcePrivateDataDocument, SemanticIngestSourcePublicDataDocument, SemanticIngestSourceUrl]] = None + actual_instance: Optional[Union[object, str]] = None else: actual_instance: Any = None - any_of_schemas: List[str] = Field(default=Literal["SemanticIngestSourcePrivateDataCollection", "SemanticIngestSourcePrivateDataDocument", "SemanticIngestSourcePublicDataDocument", "SemanticIngestSourceUrl"]) + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) model_config = { "validate_assignment": True, @@ -67,33 +59,21 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Source1.model_construct() error_messages = [] - # validate data type: SemanticIngestSourceUrl - if not isinstance(v, SemanticIngestSourceUrl): - error_messages.append(f"Error! Input type `{type(v)}` is not `SemanticIngestSourceUrl`") - else: - return v - - # validate data type: SemanticIngestSourcePublicDataDocument - if not isinstance(v, SemanticIngestSourcePublicDataDocument): - error_messages.append(f"Error! Input type `{type(v)}` is not `SemanticIngestSourcePublicDataDocument`") - else: - return v - - # validate data type: SemanticIngestSourcePrivateDataDocument - if not isinstance(v, SemanticIngestSourcePrivateDataDocument): - error_messages.append(f"Error! Input type `{type(v)}` is not `SemanticIngestSourcePrivateDataDocument`") - else: + # validate data type: str + try: + instance.anyof_schema_1_validator = v return v - - # validate data type: SemanticIngestSourcePrivateDataCollection - if not isinstance(v, SemanticIngestSourcePrivateDataCollection): - error_messages.append(f"Error! Input type `{type(v)}` is not `SemanticIngestSourcePrivateDataCollection`") - else: + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v return v - + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Source1 with anyOf schemas: SemanticIngestSourcePrivateDataCollection, SemanticIngestSourcePrivateDataDocument, SemanticIngestSourcePublicDataDocument, SemanticIngestSourceUrl. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Source1 with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) else: return v @@ -106,34 +86,28 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[SemanticIngestSourceUrl] = None - try: - instance.actual_instance = SemanticIngestSourceUrl.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[SemanticIngestSourcePublicDataDocument] = None - try: - instance.actual_instance = SemanticIngestSourcePublicDataDocument.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_3_validator: Optional[SemanticIngestSourcePrivateDataDocument] = None + # deserialize data into str try: - instance.actual_instance = SemanticIngestSourcePrivateDataDocument.from_json(json_str) + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator return instance except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_4_validator: Optional[SemanticIngestSourcePrivateDataCollection] = None + error_messages.append(str(e)) + # deserialize data into object try: - instance.actual_instance = SemanticIngestSourcePrivateDataCollection.from_json(json_str) + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator return instance except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Source1 with anyOf schemas: SemanticIngestSourcePrivateDataCollection, SemanticIngestSourcePrivateDataDocument, SemanticIngestSourcePublicDataDocument, SemanticIngestSourceUrl. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Source1 with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) else: return instance @@ -147,7 +121,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], SemanticIngestSourcePrivateDataCollection, SemanticIngestSourcePrivateDataDocument, SemanticIngestSourcePublicDataDocument, SemanticIngestSourceUrl]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/deepsearch/cps/apis/public_v2/models/source2.py b/deepsearch/cps/apis/public_v2/models/source2.py new file mode 100644 index 00000000..35d24b40 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/source2.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +SOURCE2_ANY_OF_SCHEMAS = ["object"] + +class Source2(BaseModel): + """ + Source2 + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Source2.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Source2 with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Source2 with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/source3.py b/deepsearch/cps/apis/public_v2/models/source3.py new file mode 100644 index 00000000..cb973f52 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/source3.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from deepsearch.cps.apis.public_v2.models.elastic_index_source import ElasticIndexSource +from deepsearch.cps.apis.public_v2.models.project_data_index_source import ProjectDataIndexSource +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +SOURCE3_ANY_OF_SCHEMAS = ["ElasticIndexSource", "ProjectDataIndexSource"] + +class Source3(BaseModel): + """ + Source3 + """ + + # data type: ElasticIndexSource + anyof_schema_1_validator: Optional[ElasticIndexSource] = None + # data type: ProjectDataIndexSource + anyof_schema_2_validator: Optional[ProjectDataIndexSource] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ElasticIndexSource, ProjectDataIndexSource]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ElasticIndexSource", "ProjectDataIndexSource"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Source3.model_construct() + error_messages = [] + # validate data type: ElasticIndexSource + if not isinstance(v, ElasticIndexSource): + error_messages.append(f"Error! Input type `{type(v)}` is not `ElasticIndexSource`") + else: + return v + + # validate data type: ProjectDataIndexSource + if not isinstance(v, ProjectDataIndexSource): + error_messages.append(f"Error! Input type `{type(v)}` is not `ProjectDataIndexSource`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Source3 with anyOf schemas: ElasticIndexSource, ProjectDataIndexSource. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[ElasticIndexSource] = None + try: + instance.actual_instance = ElasticIndexSource.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[ProjectDataIndexSource] = None + try: + instance.actual_instance = ProjectDataIndexSource.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Source3 with anyOf schemas: ElasticIndexSource, ProjectDataIndexSource. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ElasticIndexSource, ProjectDataIndexSource]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/source4.py b/deepsearch/cps/apis/public_v2/models/source4.py new file mode 100644 index 00000000..dc75ff0d --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/source4.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_private_data_collection import SemanticIngestSourcePrivateDataCollection +from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_private_data_document import SemanticIngestSourcePrivateDataDocument +from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_public_data_document import SemanticIngestSourcePublicDataDocument +from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_url import SemanticIngestSourceUrl +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +SOURCE4_ANY_OF_SCHEMAS = ["SemanticIngestSourcePrivateDataCollection", "SemanticIngestSourcePrivateDataDocument", "SemanticIngestSourcePublicDataDocument", "SemanticIngestSourceUrl"] + +class Source4(BaseModel): + """ + Source4 + """ + + # data type: SemanticIngestSourceUrl + anyof_schema_1_validator: Optional[SemanticIngestSourceUrl] = None + # data type: SemanticIngestSourcePublicDataDocument + anyof_schema_2_validator: Optional[SemanticIngestSourcePublicDataDocument] = None + # data type: SemanticIngestSourcePrivateDataDocument + anyof_schema_3_validator: Optional[SemanticIngestSourcePrivateDataDocument] = None + # data type: SemanticIngestSourcePrivateDataCollection + anyof_schema_4_validator: Optional[SemanticIngestSourcePrivateDataCollection] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[SemanticIngestSourcePrivateDataCollection, SemanticIngestSourcePrivateDataDocument, SemanticIngestSourcePublicDataDocument, SemanticIngestSourceUrl]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["SemanticIngestSourcePrivateDataCollection", "SemanticIngestSourcePrivateDataDocument", "SemanticIngestSourcePublicDataDocument", "SemanticIngestSourceUrl"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Source4.model_construct() + error_messages = [] + # validate data type: SemanticIngestSourceUrl + if not isinstance(v, SemanticIngestSourceUrl): + error_messages.append(f"Error! Input type `{type(v)}` is not `SemanticIngestSourceUrl`") + else: + return v + + # validate data type: SemanticIngestSourcePublicDataDocument + if not isinstance(v, SemanticIngestSourcePublicDataDocument): + error_messages.append(f"Error! Input type `{type(v)}` is not `SemanticIngestSourcePublicDataDocument`") + else: + return v + + # validate data type: SemanticIngestSourcePrivateDataDocument + if not isinstance(v, SemanticIngestSourcePrivateDataDocument): + error_messages.append(f"Error! Input type `{type(v)}` is not `SemanticIngestSourcePrivateDataDocument`") + else: + return v + + # validate data type: SemanticIngestSourcePrivateDataCollection + if not isinstance(v, SemanticIngestSourcePrivateDataCollection): + error_messages.append(f"Error! Input type `{type(v)}` is not `SemanticIngestSourcePrivateDataCollection`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Source4 with anyOf schemas: SemanticIngestSourcePrivateDataCollection, SemanticIngestSourcePrivateDataDocument, SemanticIngestSourcePublicDataDocument, SemanticIngestSourceUrl. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[SemanticIngestSourceUrl] = None + try: + instance.actual_instance = SemanticIngestSourceUrl.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[SemanticIngestSourcePublicDataDocument] = None + try: + instance.actual_instance = SemanticIngestSourcePublicDataDocument.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_3_validator: Optional[SemanticIngestSourcePrivateDataDocument] = None + try: + instance.actual_instance = SemanticIngestSourcePrivateDataDocument.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_4_validator: Optional[SemanticIngestSourcePrivateDataCollection] = None + try: + instance.actual_instance = SemanticIngestSourcePrivateDataCollection.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Source4 with anyOf schemas: SemanticIngestSourcePrivateDataCollection, SemanticIngestSourcePrivateDataDocument, SemanticIngestSourcePublicDataDocument, SemanticIngestSourceUrl. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], SemanticIngestSourcePrivateDataCollection, SemanticIngestSourcePrivateDataDocument, SemanticIngestSourcePublicDataDocument, SemanticIngestSourceUrl]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/start_count.py b/deepsearch/cps/apis/public_v2/models/start_count.py new file mode 100644 index 00000000..ff3cf435 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/start_count.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +STARTCOUNT_ANY_OF_SCHEMAS = ["int", "object"] + +class StartCount(BaseModel): + """ + StartCount + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = StartCount.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in StartCount with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into StartCount with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/started_at.py b/deepsearch/cps/apis/public_v2/models/started_at.py new file mode 100644 index 00000000..55456bdc --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/started_at.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +STARTEDAT_ANY_OF_SCHEMAS = ["datetime", "object"] + +class StartedAt(BaseModel): + """ + StartedAt + """ + + # data type: datetime + anyof_schema_1_validator: Optional[datetime] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[datetime, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["datetime", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = StartedAt.model_construct() + error_messages = [] + # validate data type: datetime + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in StartedAt with anyOf schemas: datetime, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into datetime + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into StartedAt with anyOf schemas: datetime, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], datetime, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/status.py b/deepsearch/cps/apis/public_v2/models/status.py new file mode 100644 index 00000000..bc481445 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/status.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +STATUS_ANY_OF_SCHEMAS = ["object", "str"] + +class Status(BaseModel): + """ + Status + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Status.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Status with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Status with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/status_filter.py b/deepsearch/cps/apis/public_v2/models/status_filter.py new file mode 100644 index 00000000..db32e686 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/status_filter.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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 StatusFilter(str, Enum): + """ + StatusFilter + """ + + """ + allowed enum values + """ + PENDING = 'PENDING' + FAILURE = 'FAILURE' + SUCCESS = 'SUCCESS' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of StatusFilter from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/deepsearch/cps/apis/public_v2/models/storage.py b/deepsearch/cps/apis/public_v2/models/storage.py new file mode 100644 index 00000000..871cc171 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/storage.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +STORAGE_ANY_OF_SCHEMAS = ["object", "str"] + +class Storage(BaseModel): + """ + Storage + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Storage.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Storage with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Storage with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/storage_summary_task.py b/deepsearch/cps/apis/public_v2/models/storage_summary_task.py index 7e09dae8..06a93da2 100644 --- a/deepsearch/cps/apis/public_v2/models/storage_summary_task.py +++ b/deepsearch/cps/apis/public_v2/models/storage_summary_task.py @@ -19,6 +19,8 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.dc_key import DcKey +from deepsearch.cps.apis.public_v2.models.kg_key import KgKey from typing import Optional, Set from typing_extensions import Self @@ -26,8 +28,8 @@ class StorageSummaryTask(BaseModel): """ StorageSummaryTask """ # noqa: E501 - dc_key: Optional[StrictStr] = None - kg_key: Optional[StrictStr] = None + dc_key: Optional[DcKey] = None + kg_key: Optional[KgKey] = None kind: StrictStr proj_key: StrictStr task_id: StrictStr @@ -79,6 +81,12 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of dc_key + if self.dc_key: + _dict['dc_key'] = self.dc_key.to_dict() + # override the default output from pydantic by calling `to_dict()` of kg_key + if self.kg_key: + _dict['kg_key'] = self.kg_key.to_dict() return _dict @classmethod @@ -91,8 +99,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "dc_key": obj.get("dc_key"), - "kg_key": obj.get("kg_key"), + "dc_key": DcKey.from_dict(obj["dc_key"]) if obj.get("dc_key") is not None else None, + "kg_key": KgKey.from_dict(obj["kg_key"]) if obj.get("kg_key") is not None else None, "kind": obj.get("kind"), "proj_key": obj.get("proj_key"), "task_id": obj.get("task_id") diff --git a/deepsearch/cps/apis/public_v2/models/subjects.py b/deepsearch/cps/apis/public_v2/models/subjects.py new file mode 100644 index 00000000..45fa13e9 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/subjects.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +SUBJECTS_ANY_OF_SCHEMAS = ["object"] + +class Subjects(BaseModel): + """ + Subjects + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Subjects.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Subjects with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Subjects with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/system_info.py b/deepsearch/cps/apis/public_v2/models/system_info.py index ce4e543c..b616e8aa 100644 --- a/deepsearch/cps/apis/public_v2/models/system_info.py +++ b/deepsearch/cps/apis/public_v2/models/system_info.py @@ -18,9 +18,10 @@ import json from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from deepsearch.cps.apis.public_v2.models.deployment import Deployment from deepsearch.cps.apis.public_v2.models.gen_ai_params import GenAIParams +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_output import ProjectDataIndexConversionSettingsOutput from typing import Optional, Set from typing_extensions import Self @@ -35,7 +36,8 @@ class SystemInfo(BaseModel): allow_non_admins_to_make_resources_public: StrictBool api: Dict[str, Any] genai_defaults: Dict[str, GenAIParams] - __properties: ClassVar[List[str]] = ["notifications", "default_project", "deployment", "toolkit", "allow_non_admins_to_make_resources_public", "api", "genai_defaults"] + conversion_settings_defaults: Optional[ProjectDataIndexConversionSettingsOutput] = None + __properties: ClassVar[List[str]] = ["notifications", "default_project", "deployment", "toolkit", "allow_non_admins_to_make_resources_public", "api", "genai_defaults", "conversion_settings_defaults"] model_config = ConfigDict( populate_by_name=True, @@ -79,6 +81,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of deployment if self.deployment: _dict['deployment'] = self.deployment.to_dict() + # override the default output from pydantic by calling `to_dict()` of conversion_settings_defaults + if self.conversion_settings_defaults: + _dict['conversion_settings_defaults'] = self.conversion_settings_defaults.to_dict() return _dict @classmethod @@ -97,6 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "toolkit": obj.get("toolkit"), "allow_non_admins_to_make_resources_public": obj.get("allow_non_admins_to_make_resources_public"), "api": obj.get("api"), + "conversion_settings_defaults": ProjectDataIndexConversionSettingsOutput.from_dict(obj["conversion_settings_defaults"]) if obj.get("conversion_settings_defaults") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/table_former_mode.py b/deepsearch/cps/apis/public_v2/models/table_former_mode.py new file mode 100644 index 00000000..f888358d --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/table_former_mode.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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 TableFormerMode(str, Enum): + """ + TableFormerMode + """ + + """ + allowed enum values + """ + FAST = 'fast' + ACCURATE = 'accurate' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TableFormerMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/deepsearch/cps/apis/public_v2/models/table_structure_options.py b/deepsearch/cps/apis/public_v2/models/table_structure_options.py new file mode 100644 index 00000000..dd521d21 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/table_structure_options.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.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, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.table_former_mode import TableFormerMode +from typing import Optional, Set +from typing_extensions import Self + +class TableStructureOptions(BaseModel): + """ + TableStructureOptions + """ # noqa: E501 + do_table_structure: Optional[StrictBool] = True + table_structure_mode: Optional[TableFormerMode] = None + __properties: ClassVar[List[str]] = ["do_table_structure", "table_structure_mode"] + + 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 TableStructureOptions 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 TableStructureOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "do_table_structure": obj.get("do_table_structure") if obj.get("do_table_structure") is not None else True, + "table_structure_mode": obj.get("table_structure_mode") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/target_conversion_parameters.py b/deepsearch/cps/apis/public_v2/models/target_conversion_parameters.py index 8bc9339b..3d4d3686 100644 --- a/deepsearch/cps/apis/public_v2/models/target_conversion_parameters.py +++ b/deepsearch/cps/apis/public_v2/models/target_conversion_parameters.py @@ -17,8 +17,10 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.add_annotations import AddAnnotations +from deepsearch.cps.apis.public_v2.models.add_raw_pages import AddRawPages from typing import Optional, Set from typing_extensions import Self @@ -26,8 +28,8 @@ class TargetConversionParameters(BaseModel): """ Specify target settings (add_raw_pages, add_annotations). Fields left null are set to platform defaults. """ # noqa: E501 - add_raw_pages: Optional[StrictBool] = None - add_annotations: Optional[StrictBool] = None + add_raw_pages: Optional[AddRawPages] = None + add_annotations: Optional[AddAnnotations] = None __properties: ClassVar[List[str]] = ["add_raw_pages", "add_annotations"] model_config = ConfigDict( @@ -69,6 +71,12 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of add_raw_pages + if self.add_raw_pages: + _dict['add_raw_pages'] = self.add_raw_pages.to_dict() + # override the default output from pydantic by calling `to_dict()` of add_annotations + if self.add_annotations: + _dict['add_annotations'] = self.add_annotations.to_dict() return _dict @classmethod @@ -81,8 +89,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "add_raw_pages": obj.get("add_raw_pages"), - "add_annotations": obj.get("add_annotations") + "add_raw_pages": AddRawPages.from_dict(obj["add_raw_pages"]) if obj.get("add_raw_pages") is not None else None, + "add_annotations": AddAnnotations.from_dict(obj["add_annotations"]) if obj.get("add_annotations") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/task.py b/deepsearch/cps/apis/public_v2/models/task.py new file mode 100644 index 00000000..02467bf0 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/task.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +TASK_ANY_OF_SCHEMAS = ["object", "str"] + +class Task(BaseModel): + """ + An identifier of this task. It may be used to identify this task from other tasks of the same agent and type. + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Task.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Task with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Task with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/task_context.py b/deepsearch/cps/apis/public_v2/models/task_context.py index 80a0b643..6051769b 100644 --- a/deepsearch/cps/apis/public_v2/models/task_context.py +++ b/deepsearch/cps/apis/public_v2/models/task_context.py @@ -20,6 +20,11 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union +from deepsearch.cps.apis.public_v2.models.completed_at import CompletedAt +from deepsearch.cps.apis.public_v2.models.error_reason import ErrorReason +from deepsearch.cps.apis.public_v2.models.related_tasks import RelatedTasks +from deepsearch.cps.apis.public_v2.models.start_count import StartCount +from deepsearch.cps.apis.public_v2.models.started_at import StartedAt from typing import Optional, Set from typing_extensions import Self @@ -36,11 +41,11 @@ class TaskContext(BaseModel): progress: Union[StrictFloat, StrictInt] meta: Dict[str, Any] created_at: datetime - started_at: Optional[datetime] = None - completed_at: Optional[datetime] = None - start_count: Optional[StrictInt] = None - error_reason: Optional[StrictStr] = None - related_tasks: Optional[List[Any]] = None + started_at: Optional[StartedAt] = None + completed_at: Optional[CompletedAt] = None + start_count: Optional[StartCount] = None + error_reason: Optional[ErrorReason] = None + related_tasks: Optional[RelatedTasks] = None __properties: ClassVar[List[str]] = ["proj_key", "user_key", "task_type", "task_id", "task_status", "execution_mode", "progress", "meta", "created_at", "started_at", "completed_at", "start_count", "error_reason", "related_tasks"] model_config = ConfigDict( @@ -82,6 +87,21 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of started_at + if self.started_at: + _dict['started_at'] = self.started_at.to_dict() + # override the default output from pydantic by calling `to_dict()` of completed_at + if self.completed_at: + _dict['completed_at'] = self.completed_at.to_dict() + # override the default output from pydantic by calling `to_dict()` of start_count + if self.start_count: + _dict['start_count'] = self.start_count.to_dict() + # override the default output from pydantic by calling `to_dict()` of error_reason + if self.error_reason: + _dict['error_reason'] = self.error_reason.to_dict() + # override the default output from pydantic by calling `to_dict()` of related_tasks + if self.related_tasks: + _dict['related_tasks'] = self.related_tasks.to_dict() return _dict @classmethod @@ -103,11 +123,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "progress": obj.get("progress"), "meta": obj.get("meta"), "created_at": obj.get("created_at"), - "started_at": obj.get("started_at"), - "completed_at": obj.get("completed_at"), - "start_count": obj.get("start_count"), - "error_reason": obj.get("error_reason"), - "related_tasks": obj.get("related_tasks") + "started_at": StartedAt.from_dict(obj["started_at"]) if obj.get("started_at") is not None else None, + "completed_at": CompletedAt.from_dict(obj["completed_at"]) if obj.get("completed_at") is not None else None, + "start_count": StartCount.from_dict(obj["start_count"]) if obj.get("start_count") is not None else None, + "error_reason": ErrorReason.from_dict(obj["error_reason"]) if obj.get("error_reason") is not None else None, + "related_tasks": RelatedTasks.from_dict(obj["related_tasks"]) if obj.get("related_tasks") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/task_type.py b/deepsearch/cps/apis/public_v2/models/task_type.py new file mode 100644 index 00000000..46c1bc62 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/task_type.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +TASKTYPE_ANY_OF_SCHEMAS = ["object", "str"] + +class TaskType(BaseModel): + """ + TaskType + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = TaskType.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in TaskType with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into TaskType with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/term.py b/deepsearch/cps/apis/public_v2/models/term.py new file mode 100644 index 00000000..5f927068 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/term.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +TERM_ANY_OF_SCHEMAS = ["object", "str"] + +class Term(BaseModel): + """ + Term + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Term.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Term with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Term with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/text.py b/deepsearch/cps/apis/public_v2/models/text.py new file mode 100644 index 00000000..aeaa3a66 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/text.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +TEXT_ANY_OF_SCHEMAS = ["object", "str"] + +class Text(BaseModel): + """ + Text + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Text.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Text with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Text with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/timeout.py b/deepsearch/cps/apis/public_v2/models/timeout.py new file mode 100644 index 00000000..4d6ca005 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/timeout.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, Optional, Union +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +TIMEOUT_ANY_OF_SCHEMAS = ["float", "object"] + +class Timeout(BaseModel): + """ + Timeout + """ + + # data type: float + anyof_schema_1_validator: Optional[Union[StrictFloat, StrictInt]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[float, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["float", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Timeout.model_construct() + error_messages = [] + # validate data type: float + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Timeout with anyOf schemas: float, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into float + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Timeout with anyOf schemas: float, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/title.py b/deepsearch/cps/apis/public_v2/models/title.py new file mode 100644 index 00000000..74dbd45f --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/title.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +TITLE_ANY_OF_SCHEMAS = ["object", "str"] + +class Title(BaseModel): + """ + Title + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Title.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Title with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Title with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/truncate_pages.py b/deepsearch/cps/apis/public_v2/models/truncate_pages.py new file mode 100644 index 00000000..74678932 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/truncate_pages.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +TRUNCATEPAGES_ANY_OF_SCHEMAS = ["int", "object"] + +class TruncatePages(BaseModel): + """ + TruncatePages + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = TruncatePages.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in TruncatePages with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into TruncatePages with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/type.py b/deepsearch/cps/apis/public_v2/models/type.py new file mode 100644 index 00000000..ec193f6d --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/type.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +TYPE_ANY_OF_SCHEMAS = ["object", "str"] + +class Type(BaseModel): + """ + Type + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Type.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Type with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Type with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/type1.py b/deepsearch/cps/apis/public_v2/models/type1.py new file mode 100644 index 00000000..e98b41c7 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/type1.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +TYPE1_ANY_OF_SCHEMAS = ["object"] + +class Type1(BaseModel): + """ + Type of publication (journal article, conference, review,...). + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Type1.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Type1 with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Type1 with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/upload_elastic_request_body.py b/deepsearch/cps/apis/public_v2/models/upload_elastic_request_body.py index 48226e25..588978c8 100644 --- a/deepsearch/cps/apis/public_v2/models/upload_elastic_request_body.py +++ b/deepsearch/cps/apis/public_v2/models/upload_elastic_request_body.py @@ -17,8 +17,10 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.document_hashes import DocumentHashes +from deepsearch.cps.apis.public_v2.models.with_operations import WithOperations from typing import Optional, Set from typing_extensions import Self @@ -26,21 +28,10 @@ class UploadElasticRequestBody(BaseModel): """ UploadElasticRequestBody """ # noqa: E501 - document_hashes: Optional[List[StrictStr]] = Field(default=None, description="List of document hashes to be used as filter.") - with_operations: Optional[List[StrictStr]] = Field(default=None, description="List of Operation Status documents don't have to be used as filter.") + document_hashes: Optional[DocumentHashes] = None + with_operations: Optional[WithOperations] = None __properties: ClassVar[List[str]] = ["document_hashes", "with_operations"] - @field_validator('with_operations') - def with_operations_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - for i in value: - if i not in set(['PENDING', 'FAILURE', 'SUCCESS']): - raise ValueError("each list item must be one of ('PENDING', 'FAILURE', 'SUCCESS')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -80,6 +71,12 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of document_hashes + if self.document_hashes: + _dict['document_hashes'] = self.document_hashes.to_dict() + # override the default output from pydantic by calling `to_dict()` of with_operations + if self.with_operations: + _dict['with_operations'] = self.with_operations.to_dict() return _dict @classmethod @@ -92,8 +89,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "document_hashes": obj.get("document_hashes"), - "with_operations": obj.get("with_operations") + "document_hashes": DocumentHashes.from_dict(obj["document_hashes"]) if obj.get("document_hashes") is not None else None, + "with_operations": WithOperations.from_dict(obj["with_operations"]) if obj.get("with_operations") is not None else None }) return _obj diff --git a/deepsearch/cps/apis/public_v2/models/upload_to_elastic.py b/deepsearch/cps/apis/public_v2/models/upload_to_elastic.py new file mode 100644 index 00000000..4214b8f8 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/upload_to_elastic.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +UPLOADTOELASTIC_ANY_OF_SCHEMAS = ["bool", "object"] + +class UploadToElastic(BaseModel): + """ + UploadToElastic + """ + + # data type: bool + anyof_schema_1_validator: Optional[StrictBool] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[bool, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["bool", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = UploadToElastic.model_construct() + error_messages = [] + # validate data type: bool + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in UploadToElastic with anyOf schemas: bool, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into bool + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into UploadToElastic with anyOf schemas: bool, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], bool, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/url.py b/deepsearch/cps/apis/public_v2/models/url.py new file mode 100644 index 00000000..01964f9e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/url.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing_extensions import Annotated +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +URL_ANY_OF_SCHEMAS = ["object", "str"] + +class Url(BaseModel): + """ + URL on the publication site. + """ + + # data type: str + anyof_schema_1_validator: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Url.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Url with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Url with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/url_refs.py b/deepsearch/cps/apis/public_v2/models/url_refs.py new file mode 100644 index 00000000..5fe8d576 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/url_refs.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +URLREFS_ANY_OF_SCHEMAS = ["object"] + +class UrlRefs(BaseModel): + """ + UrlRefs + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = UrlRefs.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in UrlRefs with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into UrlRefs with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/version.py b/deepsearch/cps/apis/public_v2/models/version.py new file mode 100644 index 00000000..45804888 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/version.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +VERSION_ANY_OF_SCHEMAS = ["object"] + +class Version(BaseModel): + """ + The version of this collection model. + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Version.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Version with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Version with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/version1.py b/deepsearch/cps/apis/public_v2/models/version1.py new file mode 100644 index 00000000..da903538 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/version1.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +VERSION1_ANY_OF_SCHEMAS = ["object", "str"] + +class Version1(BaseModel): + """ + Version1 + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Version1.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Version1 with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Version1 with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/view_of1.py b/deepsearch/cps/apis/public_v2/models/view_of1.py new file mode 100644 index 00000000..65c559d3 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/view_of1.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from deepsearch.cps.apis.public_v2.models.elastic_instance_data_index import ElasticInstanceDataIndex +from deepsearch.cps.apis.public_v2.models.project_source_data_index import ProjectSourceDataIndex +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +VIEWOF1_ANY_OF_SCHEMAS = ["ElasticInstanceDataIndex", "ProjectSourceDataIndex", "object"] + +class ViewOf1(BaseModel): + """ + ViewOf1 + """ + + # data type: ProjectSourceDataIndex + anyof_schema_1_validator: Optional[ProjectSourceDataIndex] = None + # data type: ElasticInstanceDataIndex + anyof_schema_2_validator: Optional[ElasticInstanceDataIndex] = None + # data type: object + anyof_schema_3_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ElasticInstanceDataIndex, ProjectSourceDataIndex, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ElasticInstanceDataIndex", "ProjectSourceDataIndex", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ViewOf1.model_construct() + error_messages = [] + # validate data type: ProjectSourceDataIndex + if not isinstance(v, ProjectSourceDataIndex): + error_messages.append(f"Error! Input type `{type(v)}` is not `ProjectSourceDataIndex`") + else: + return v + + # validate data type: ElasticInstanceDataIndex + if not isinstance(v, ElasticInstanceDataIndex): + error_messages.append(f"Error! Input type `{type(v)}` is not `ElasticInstanceDataIndex`") + else: + return v + + # validate data type: object + try: + instance.anyof_schema_3_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ViewOf1 with anyOf schemas: ElasticInstanceDataIndex, ProjectSourceDataIndex, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[ProjectSourceDataIndex] = None + try: + instance.actual_instance = ProjectSourceDataIndex.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[ElasticInstanceDataIndex] = None + try: + instance.actual_instance = ElasticInstanceDataIndex.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_3_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_3_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ViewOf1 with anyOf schemas: ElasticInstanceDataIndex, ProjectSourceDataIndex, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ElasticInstanceDataIndex, ProjectSourceDataIndex, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/volume.py b/deepsearch/cps/apis/public_v2/models/volume.py new file mode 100644 index 00000000..63c2c71e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/volume.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +VOLUME_ANY_OF_SCHEMAS = ["object", "str"] + +class Volume(BaseModel): + """ + Publication volume. + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Volume.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Volume with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Volume with anyOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/wait.py b/deepsearch/cps/apis/public_v2/models/wait.py new file mode 100644 index 00000000..33a2eee4 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/wait.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing_extensions import Annotated +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +WAIT_ANY_OF_SCHEMAS = ["int", "object"] + +class Wait(BaseModel): + """ + Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. + """ + + # data type: int + anyof_schema_1_validator: Optional[Annotated[int, Field(le=30, strict=True)]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Wait.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Wait with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Wait with anyOf schemas: int, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/wait1.py b/deepsearch/cps/apis/public_v2/models/wait1.py new file mode 100644 index 00000000..52f7f8dc --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/wait1.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional, Union +from typing_extensions import Annotated +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +WAIT1_ANY_OF_SCHEMAS = ["float", "object"] + +class Wait1(BaseModel): + """ + Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. + """ + + # data type: float + anyof_schema_1_validator: Optional[Union[Annotated[float, Field(le=30.0, strict=True)], Annotated[int, Field(le=30, strict=True)]]] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[float, object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["float", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Wait1.model_construct() + error_messages = [] + # validate data type: float + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Wait1 with anyOf schemas: float, object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into float + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Wait1 with anyOf schemas: float, object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/with_operations.py b/deepsearch/cps/apis/public_v2/models/with_operations.py new file mode 100644 index 00000000..26c0d60f --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/with_operations.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +WITHOPERATIONS_ANY_OF_SCHEMAS = ["object"] + +class WithOperations(BaseModel): + """ + List of Operation Status documents don't have to be used as filter. + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = WithOperations.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in WithOperations with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into WithOperations with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/apis/public_v2/models/without_operations.py b/deepsearch/cps/apis/public_v2/models/without_operations.py new file mode 100644 index 00000000..eeb7af81 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/without_operations.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +WITHOUTOPERATIONS_ANY_OF_SCHEMAS = ["object"] + +class WithoutOperations(BaseModel): + """ + List of Operation Status documents don't have to be used as filter. + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = WithoutOperations.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in WithoutOperations with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into WithoutOperations with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/deepsearch/cps/cli/cli_options.py b/deepsearch/cps/cli/cli_options.py index 220cdbe7..ee78e2c8 100644 --- a/deepsearch/cps/cli/cli_options.py +++ b/deepsearch/cps/cli/cli_options.py @@ -19,9 +19,7 @@ None, "--url", "-u", - help="""Provide single url or - absolute path to file containing - multiple urls separated by empty lines.""", + help="""Provide single url""", ) COORDINATES_PATH = typer.Option( @@ -86,6 +84,14 @@ help="Generate report after document conversion", ) +EXPORT_MD = typer.Option( + False, + "--export-md", + "-md", + is_flag=True, + help="Download MD file after document conversion", +) + TASK_IDS = typer.Option( None, "--task-ids", diff --git a/deepsearch/cps/cli/data_indices_typer.py b/deepsearch/cps/cli/data_indices_typer.py index 9bbefa04..9b8baaa9 100644 --- a/deepsearch/cps/cli/data_indices_typer.py +++ b/deepsearch/cps/cli/data_indices_typer.py @@ -183,7 +183,7 @@ def upload_files( else: final_target_settings = None - utils.upload_files( + task_status = utils.upload_files( api=api, coords=coords, url=urls, @@ -193,7 +193,7 @@ def upload_files( target_settings=final_target_settings, ) - typer.echo("Tasks have been queued successfully") + typer.echo(f"Tasks finished with status: {task_status}") @app.command( diff --git a/deepsearch/cps/cli/elastic_data.py b/deepsearch/cps/cli/elastic_data.py index c841c2a7..1e9d7e0b 100644 --- a/deepsearch/cps/cli/elastic_data.py +++ b/deepsearch/cps/cli/elastic_data.py @@ -20,7 +20,7 @@ def list( results = [ { "name": c.name, - "instance": ElasticDataCollectionSource.parse_obj(c.source).elastic_id, + "instance": ElasticDataCollectionSource.model_validate(c.source).elastic_id, "index": c.source.index_key, "domains": c.metadata.domain, "documents": c.documents, diff --git a/deepsearch/cps/data_indices/utils.py b/deepsearch/cps/data_indices/utils.py index d8169c6a..52a24aff 100644 --- a/deepsearch/cps/data_indices/utils.py +++ b/deepsearch/cps/data_indices/utils.py @@ -12,10 +12,10 @@ from deepsearch.cps.client.api import CpsApi from deepsearch.cps.client.components.data_indices import S3Coordinates from deepsearch.cps.client.components.elastic import ElasticProjectDataCollectionSource -from deepsearch.documents.core import convert, input_process +from deepsearch.documents.core import convert from deepsearch.documents.core.common_routines import progressbar from deepsearch.documents.core.models import ConversionSettings, TargetSettings -from deepsearch.documents.core.utils import cleanup, create_root_dir +from deepsearch.documents.core.utils import batch_single_files, cleanup, create_root_dir logger = logging.getLogger(__name__) @@ -106,7 +106,7 @@ def process_url_input( api=api, cps_proj_key=coords.proj_key, task_ids=task_ids ) - return + return statuses def process_local_file( @@ -124,9 +124,7 @@ def process_local_file( # process multiple files from local directory root_dir = create_root_dir() # batch individual pdfs into zips and add them to root_dir - batched_files = input_process.batch_single_files( - source_path=local_file, root_dir=root_dir - ) + batched_files = batch_single_files(source_path=local_file, root_dir=root_dir) # collect'em all files_zip: List[Any] = [] @@ -166,7 +164,7 @@ def process_local_file( "file_url": file_url_array, } if conv_settings is not None: - payload["conversion_settings"] = conv_settings.to_ccs_spec() + payload["conversion_settings"] = conv_settings.model_dump() if target_settings is not None: payload["target_settings"] = target_settings.model_dump( exclude_none=True @@ -182,7 +180,8 @@ def process_local_file( api=api, cps_proj_key=coords.proj_key, task_ids=task_ids ) cleanup(root_dir=root_dir) - return + + return statuses def process_external_cos( @@ -218,4 +217,4 @@ def process_external_cos( statuses = convert.check_cps_status_running_tasks( api=api, cps_proj_key=coords.proj_key, task_ids=task_ids ) - return + return statuses diff --git a/deepsearch/documents/cli/main.py b/deepsearch/documents/cli/main.py index 7ac3eac2..d4d95399 100644 --- a/deepsearch/documents/cli/main.py +++ b/deepsearch/documents/cli/main.py @@ -1,5 +1,4 @@ import urllib -from enum import Enum import urllib3 @@ -11,7 +10,9 @@ import typer +from deepsearch.cps.apis import public_v2 as sw_client from deepsearch.cps.cli.cli_options import ( + EXPORT_MD, GET_REPORT, PROGRESS_BAR, PROJ_KEY, @@ -20,14 +21,10 @@ URL, ) from deepsearch.cps.client.api import CpsApi -from deepsearch.documents.core.create_report import get_multiple_reports +from deepsearch.documents.core.convert import get_wait_task_result +from deepsearch.documents.core.create_report import generate_report_csv from deepsearch.documents.core.main import convert_documents -from deepsearch.documents.core.utils import ( - create_root_dir, - iterate_converted_files, - read_lines, - write_taskids, -) +from deepsearch.documents.core.utils import create_root_dir, read_lines, write_taskids app = typer.Typer(no_args_is_help=True) @@ -40,11 +37,11 @@ @cli_handler() def convert( proj_key: str = PROJ_KEY, - urls: str = URL, + url: str = URL, source_path: Path = SOURCE_PATH, progress_bar: bool = PROGRESS_BAR, get_report: bool = GET_REPORT, - export_md: bool = False, + export_md: bool = EXPORT_MD, ): """ Document conversion via Deep Search Technology. @@ -58,30 +55,29 @@ def convert( For converting a document from the web, please provide its url. source_path : string/path [OPTIONAL] - For converting local files, please provide absolute path to file or to directory - containing multiple files. + For converting local files, please provide absolute path to file. NOTE: Either url or source_path should be supplied. """ api = CpsApi.from_env() - input_urls = None - if urls is not None: - if urllib.parse.urlparse(urls).scheme in ("http", "https"): - input_urls = [urls] - else: - input_urls = read_lines(Path(urls)) + input_url = None + if url is not None and urllib.parse.urlparse(url).scheme in ("http", "https"): + input_url = url + + print(export_md) result = convert_documents( proj_key=proj_key, - urls=input_urls, + url=input_url, source_path=source_path, progress_bar=progress_bar, api=api, + export_md=export_md, ) result_dir = create_root_dir() # save task ids - write_taskids(result_dir=result_dir, list_to_write=result.task_ids) + write_taskids(result_dir=result_dir, list_to_write=[result.task_id]) result.download_all(progress_bar=True, result_dir=result_dir) typer.echo( f""" @@ -90,35 +86,6 @@ def convert( """ ) - if export_md: - markdown_output_dir = result_dir / "export_markdown" - markdown_output_dir.mkdir(exist_ok=True) - - for converted_document in iterate_converted_files(result_dir): - # The output exported filename will be composed by - # - the name of the zip file where it is contained - # - the name of the file inside the zip archive - # For example json_000001_2206.00785.md, where "json_000001" is the name of the zip archive and "2206.00785" the filename - clean_archive_name = converted_document.archive_path.name.replace( - "/", "_" - ).replace(".zip", "") - clean_filename = converted_document.file_path.name.replace( - "/", "_" - ).replace(".json", "") - exported_filename = ( - markdown_output_dir / f"{clean_archive_name}_{clean_filename}.md" - ) - markdown_content = converted_document.document.export_to_markdown() - with exported_filename.open("w") as f: - f.write(markdown_content) - - typer.echo( - f""" - The converted documents have been exported to markdown. You can find them in folder - {markdown_output_dir} - """ - ) - if get_report: info = result.generate_report(result_dir=result_dir, progress_bar=True) for key in info: @@ -156,13 +123,14 @@ def get_report(proj_key: str = PROJ_KEY, source_taskids: Path = TASK_IDS): api = CpsApi.from_env() task_ids = read_lines(source_taskids) result_dir = Path(source_taskids).parent.expanduser().resolve() - info = get_multiple_reports( - api=api, - cps_proj_key=proj_key, - task_ids=task_ids, - source_files=None, + sw_api = sw_client.ProjectApi(api.client.swagger_client_v2) + task_result = get_wait_task_result( + sw_api=sw_api, cps_proj_key=proj_key, task_id=task_ids[0] + ) + info = generate_report_csv( + task_result=task_result, + task_id=task_ids[0], result_dir=result_dir, - progress_bar=True, ) for key in info: pad = 35 diff --git a/deepsearch/documents/core/convert.py b/deepsearch/documents/core/convert.py index d2b08afa..f5bee5b1 100644 --- a/deepsearch/documents/core/convert.py +++ b/deepsearch/documents/core/convert.py @@ -1,23 +1,28 @@ import logging import os import time +import urllib.parse from pathlib import Path -from typing import Any, List, Optional +from typing import List, Optional, Union -import requests import urllib3 from tqdm import tqdm -from deepsearch.cps.apis import public as sw_client -from deepsearch.cps.apis.public.models.temporary_upload_file_result import ( - TemporaryUploadFileResult, +from deepsearch.cps.apis import public_v2 as sw_client +from deepsearch.cps.apis.public_v2.models.api_server_fastapi_server_public_models_project_models_http_source import ( + ApiServerFastapiServerPublicModelsProjectModelsHttpSource, +) +from deepsearch.cps.apis.public_v2.models.convert_document_request import ( + ConvertDocumentRequest, +) +from deepsearch.cps.apis.public_v2.models.convert_document_request_http_source import ( + ConvertDocumentRequestHttpSource, ) from deepsearch.cps.client.api import CpsApi -from ...core.util.ccs_utils import get_ccs_project_key -from .common_routines import ERROR_MSG, progressbar -from .models import ConversionSettings, ExportTarget, ZipTarget -from .utils import URLNavigator, collect_all_local_files, download_url +from .common_routines import progressbar +from .models import ConversionSettings +from .utils import download_url urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) logger = logging.getLogger(__name__) @@ -27,46 +32,42 @@ def make_payload( - source: dict, - target: Optional[ExportTarget], + url: str, conversion_settings: Optional[ConversionSettings], - collection_name: str = "_default", -): +) -> ConvertDocumentRequest: """ Create payload for requesting conversion """ - target = target or ZipTarget() - - ccs_conv_settings: Optional[dict] = None + doc_conv_settings: Optional[dict] = None if conversion_settings is not None: - ccs_conv_settings = conversion_settings.to_ccs_spec() + doc_conv_settings = conversion_settings.model_dump() - payload = { - "source": {**source}, - "context": { - "collection_name": collection_name, - "conversion_settings": ccs_conv_settings, - "keep_documents": "false", - }, - "target": target.dict(), - } - return payload + return ConvertDocumentRequest( + http_source=ConvertDocumentRequestHttpSource( + ApiServerFastapiServerPublicModelsProjectModelsHttpSource( + url=url, headers={} + ) + ), + settings=doc_conv_settings, + ) -def check_ccs_single_task_status(api: CpsApi, ccs_proj_key: str, task_id: str): +def get_wait_task_result( + sw_api: sw_client.ProjectApi, cps_proj_key: str, task_id: str, wait: int = 2 +): """ - Check status of individual tasks. + Wait and get task result that. """ - current_state = False - while current_state is False: - request_status = api.client.session.get( - url=URLNavigator(api).url_request_status( - ccs_proj_key=ccs_proj_key, task_id=task_id - ) + while True: + r: sw_client.TaskResult = sw_api.get_convert_task( + proj_key=cps_proj_key, task_id=task_id ) - current_state = request_status.json()["done"] - return request_status + request_status = r.to_dict() + if request_status["task_status"] in TASK_STOP_STATUS: + return request_status + else: + time.sleep(wait) def check_cps_single_task_status( @@ -76,7 +77,7 @@ def check_cps_single_task_status( Check cps status of individual tasks. """ while True: - r: sw_client.CpsTask = sw_api.get_project_celery_task( + r: sw_client.TaskResult = sw_api.get_project_celery_task( proj_key=cps_proj_key, task_id=task_id ) request_status = r.to_dict() @@ -89,120 +90,56 @@ def check_cps_single_task_status( def submit_conversion_payload( api: CpsApi, cps_proj_key: str, - source: dict, - target: Optional[ExportTarget], + url: str, conversion_settings: Optional[ConversionSettings], ) -> str: """ Convert an online pdf using DeepSearch Technology. """ - # get ccs project key and collection name - ccs_proj_key, collection_name = get_ccs_project_key( - api=api, cps_proj_key=cps_proj_key - ) + sw_api = sw_client.ProjectApi(api.client.swagger_client_v2) # submit conversion request - payload = make_payload(source, target, conversion_settings, collection_name) + payload = make_payload(url, conversion_settings) - try: - request_conversion_task_id = api.client.session.post( - url=URLNavigator(api).url_convert(ccs_proj_key=ccs_proj_key), - json=payload, - ) - request_conversion_task_id.raise_for_status() - - except requests.exceptions.HTTPError as err: - logger.error(f"HTTPError {err}.\n{ERROR_MSG}\nAborting!") - raise - - task_id = list(request_conversion_task_id.json().values())[0] + r: sw_client.CpsTask = sw_api.convert_document( + proj_key=cps_proj_key, convert_document_request=payload + ) - return task_id + return r.task_id -def send_files_for_conversion( +def send_file_for_conversion( api: CpsApi, cps_proj_key: str, source_path: Path, - target: Optional[ExportTarget], conversion_settings: Optional[ConversionSettings], - root_dir: Path, progress_bar: bool = False, -) -> list: +) -> str: """ - Send multiple files for conversion. + Send file for conversion. """ - files_zip = collect_all_local_files(source_path=source_path, root_dir=root_dir) - # container for task_ids - task_ids = [] - - # start loop with tqdm( - total=len(files_zip), + total=1, desc=f"{'Submitting input:': <{progressbar.padding}}", disable=not (progress_bar), colour=progressbar.colour, bar_format=progressbar.bar_format, ) as progress: - # loop over all files - for single_zip in files_zip: - # upload file - uploaded_file = api.uploader.upload_file( - project=cps_proj_key, source_path=Path(single_zip) - ) - # submit url for conversion - task_id = submit_conversion_payload( - api=api, - cps_proj_key=cps_proj_key, - source={ - "type": "url", - "download_url": uploaded_file.internal_url, - }, - target=target, - conversion_settings=conversion_settings, - ) - task_ids.append(task_id) - progress.update(1) - - return task_ids - - -def check_status_running_tasks( - cps_proj_key: str, - task_ids: List[str], - api: Optional[CpsApi] = None, - progress_bar: bool = False, -) -> List[str]: - """ - Check status of multiple running tasks and optionally display progress with progress bar. - """ - if api is None: - api = CpsApi.from_env() - count_total = len(task_ids) - - # get ccs proj keys - ccs_proj_key, collection_name = get_ccs_project_key( - api=api, cps_proj_key=cps_proj_key - ) - statuses = [] - - with tqdm( - total=count_total, - desc=f"{'Converting input:': <{progressbar.padding}}", - disable=not (progress_bar), - colour=progressbar.colour, - bar_format=progressbar.bar_format, - ) as progress: - for task_id in task_ids: - request_status = check_ccs_single_task_status( - api=api, ccs_proj_key=ccs_proj_key, task_id=task_id - ) - if request_status.json()["done"]: - progress.update(1) - statuses.append(str(request_status.json()["state"])) + # upload file + uploaded_file = api.uploader.upload_file( + project=cps_proj_key, source_path=source_path + ) + # submit url for conversion + task_id = submit_conversion_payload( + api=api, + cps_proj_key=cps_proj_key, + url=uploaded_file.internal_url, + conversion_settings=conversion_settings, + ) + progress.update(1) - return statuses + return task_id def check_cps_status_running_tasks( @@ -212,7 +149,7 @@ def check_cps_status_running_tasks( Check status of multiple running cps tasks and optionally display progress with progress bar. """ - sw_api = sw_client.TasksApi(api.client.swagger_client) + sw_api = sw_client.TasksApi(api.client.swagger_client_v2) count_total = len(task_ids) statuses = [] @@ -234,35 +171,6 @@ def check_cps_status_running_tasks( return statuses -def get_download_url( - cps_proj_key: str, - task_ids: list, - api: Optional[CpsApi] = None, -) -> List[str]: - """ - Get the urls of converted documents. - """ - if api is None: - api = CpsApi.from_env() - # get ccs proj keys - ccs_proj_key, collection_name = get_ccs_project_key( - api=api, cps_proj_key=cps_proj_key - ) - urls = [] - for task_id in task_ids: - request_result = api.client.session.get( - url=URLNavigator(api).url_result(ccs_proj_key=ccs_proj_key, task_id=task_id) - ) - request_result.raise_for_status() - try: - packages = request_result.json()["packages"] - for p in packages: - urls.append(p["url"]) - except IndexError: - logger.error(f"Error: Empty package received.\n{ERROR_MSG}") - return urls - - def download_converted_documents( result_dir: Path, download_urls: List[str], progress_bar: bool = False ): @@ -289,44 +197,36 @@ def download_converted_documents( ) as progress: count = 1 for url in download_urls: - download_name = Path(os.path.join(result_dir, f"json_{count:06}.zip")) + filename = Path(urllib.parse.urlparse(url).path).name + download_name = Path(os.path.join(result_dir, filename[-10:])) download_url(url, download_name), count += 1 progress.update(1) return -def send_urls_for_conversion( +def send_url_for_conversion( api: CpsApi, cps_proj_key: str, - urls: List[str], - target: Optional[ExportTarget], + url: str, conversion_settings: Optional[ConversionSettings], progress_bar: bool = False, -) -> List[Any]: +) -> str: """ - Send multiple online documents for conversion. + Send online document for conversion. """ - count_urls = len(urls) - task_ids = [] with tqdm( - total=count_urls, + total=1, desc=f"{'Submitting input:': <{progressbar.padding}}", disable=not (progress_bar), colour=progressbar.colour, bar_format=progressbar.bar_format, ) as progress: - for url in urls: - task_id = submit_conversion_payload( - api=api, - cps_proj_key=cps_proj_key, - source={ - "type": "url", - "download_url": url, - }, - target=target, - conversion_settings=conversion_settings, - ) - task_ids.append(task_id) - progress.update(1) - return task_ids + task_id = submit_conversion_payload( + api=api, + cps_proj_key=cps_proj_key, + url=url, + conversion_settings=conversion_settings, + ) + progress.update(1) + return task_id diff --git a/deepsearch/documents/core/create_report.py b/deepsearch/documents/core/create_report.py index 12c74843..4dc630c3 100644 --- a/deepsearch/documents/core/create_report.py +++ b/deepsearch/documents/core/create_report.py @@ -2,126 +2,46 @@ import logging import os from pathlib import Path -from typing import Any, List, Union -import requests from tqdm import tqdm -from deepsearch.core.util.ccs_utils import get_ccs_project_key -from deepsearch.cps.client.api import CpsApi -from deepsearch.documents.core.common_routines import ERROR_MSG, progressbar -from deepsearch.documents.core.utils import URLNavigator +from deepsearch.documents.core.common_routines import progressbar logger = logging.getLogger(__name__) -def get_single_report(api: CpsApi, cps_proj_key: str, task_id: str): +def generate_report_csv( + task_result: dict, task_id: str, result_dir: Path, progress_bar=False +): """ - Get report of document conversion per individual task id + Generate report of a document conversion task id and saves in a csv file """ - # get ccs project key and collection name - ccs_proj_key, collection_name = get_ccs_project_key( - api=api, cps_proj_key=cps_proj_key - ) - try: - request_report = api.client.session.get( - url=URLNavigator(api).url_report_metrics( - ccs_proj_key=ccs_proj_key, task_id=task_id - ) - ) - request_report.raise_for_status() - - # we do not expose the full report but filter it a bit: - keys = [ - "document_count", - "failed_document_count", - "page_count", - "created", - "completed", - ] - report = {key: request_report.json()[key] for key in keys} - return report - - except requests.exceptions.HTTPError as err: - # TODO Group all errors in the toolkit into proper classes - logger.error(f"HTTPError {err}.\n{ERROR_MSG}\nAborting!") - raise + # we do not expose the full report but filter it a bit: + keys = ["total_pages", "processed_pages", "truncated_pages"] + report = {key: task_result[key] for key in keys} -def get_multiple_reports( - api: CpsApi, - cps_proj_key: str, - task_ids: List[str], - source_files: Union[List[List[str]], List[str], Any], - result_dir: Path, - progress_bar=False, -): - """ - Generates reports for multiple tasks_ids and associated documents. - """ - reports = [] - ( - count, - count_doc, - count_failed_doc, - ) = ( - 0, - 0, - 0, - ) - # start disk writing report_name = os.path.join(result_dir, "report.csv") with open(report_name, mode="a", newline="") as csvfile: - writer = csv.writer(csvfile) - writer.writerow(["batch_number", "task_id", "status", "document"]) - - # start loop with tqdm( - total=len(task_ids), + total=1, desc=f"{'Generating report:': <{progressbar.padding}}", disable=not (progress_bar), colour=progressbar.colour, bar_format=progressbar.bar_format, ) as progress: - # loop over all files - for index in range(len(task_ids)): - count += 1 - report = get_single_report( - api=api, cps_proj_key=cps_proj_key, task_id=task_ids[index] - ) - count_doc += report["document_count"] - count_failed_doc += report["failed_document_count"] - - # batches which have partial failures are identified: - if report["failed_document_count"] == 0: - status = "SUCCESS" - elif report["failed_document_count"] < report["document_count"]: - status = "PARTIAL_SUCCESS" - elif report["failed_document_count"] == report["document_count"]: - status = "FAILURE" - else: - status = "ERROR" # empty reports are marked as errors - - # update disk report - if source_files == None: - writer.writerow( - [ - count, - task_ids[index], - status, - ] - ) - else: - writer.writerow( - [count, task_ids[index], status, source_files[index]] - ) - reports.append(report) - progress.update(1) - - # generate cumulative report - info = { - "Total documents": count_doc, - "Successfully converted documents": count_doc - count_failed_doc, - } + writer = csv.writer(csvfile) + writer.writerow( + ["task_id", "total_pages", "processed_pages", "truncated_pages"] + ) + writer.writerow( + [ + task_id, + report["total_pages"], + report["processed_pages"], + report["truncated_pages"], + ] + ) + progress.update(1) - return info + return report diff --git a/deepsearch/documents/core/input_process.py b/deepsearch/documents/core/input_process.py index 8d007c2f..1fe1dd33 100644 --- a/deepsearch/documents/core/input_process.py +++ b/deepsearch/documents/core/input_process.py @@ -1,23 +1,21 @@ import os -import tempfile from pathlib import Path -from typing import List, Optional +from typing import Optional import urllib3 +from deepsearch.cps.apis import public_v2 as sw_client from deepsearch.cps.client.api import CpsApi from deepsearch.documents.core.results import DocumentConversionResult -from .models import ConversionSettings, ExportTarget, S3Coordinates -from .utils import batch_single_files +from .models import ConversionSettings urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) from .convert import ( - check_status_running_tasks, - send_files_for_conversion, - send_urls_for_conversion, - submit_conversion_payload, + get_wait_task_result, + send_file_for_conversion, + send_url_for_conversion, ) @@ -25,9 +23,9 @@ def process_local_input( api: CpsApi, cps_proj_key: str, source_path: Path, - target: Optional[ExportTarget], conversion_settings: Optional[ConversionSettings], progress_bar=False, + export_md=False, ) -> DocumentConversionResult: """ Classify the user provided local input and take appropriate action. @@ -35,98 +33,54 @@ def process_local_input( if not os.path.exists(source_path): raise ValueError("File not found. Check input.") else: - with tempfile.TemporaryDirectory() as tmpdir: - batched_files = batch_single_files( - source_path=source_path, - root_dir=Path(tmpdir), - progress_bar=progress_bar, - ) - task_ids = send_files_for_conversion( - api=api, - cps_proj_key=cps_proj_key, - source_path=source_path, - target=target, - conversion_settings=conversion_settings, - root_dir=Path(tmpdir), - progress_bar=progress_bar, - ) - statuses = check_status_running_tasks( - api=api, - cps_proj_key=cps_proj_key, - task_ids=task_ids, - progress_bar=progress_bar, - ) + task_id = send_file_for_conversion( + api=api, + cps_proj_key=cps_proj_key, + source_path=source_path, + conversion_settings=conversion_settings, + progress_bar=progress_bar, + ) + sw_api = sw_client.ProjectApi(api.client.swagger_client_v2) + result = get_wait_task_result( + sw_api=sw_api, cps_proj_key=cps_proj_key, task_id=task_id + ) return DocumentConversionResult( proj_key=cps_proj_key, - task_ids=task_ids, - statuses=statuses, + task_id=task_id, + result=result, source_path=source_path, api=api, - batched_files=batched_files, + export_md=export_md, ) -def process_urls_input( +def process_url_input( api: CpsApi, cps_proj_key: str, - urls: List[str], - target: Optional[ExportTarget], + url: str, conversion_settings: Optional[ConversionSettings], progress_bar=False, + export_md=False, ): """ Classify user provided url(s) and take appropriate action. """ - task_ids = send_urls_for_conversion( + task_id = send_url_for_conversion( api=api, cps_proj_key=cps_proj_key, - urls=urls, - target=target, + url=url, conversion_settings=conversion_settings, progress_bar=progress_bar, ) - statuses = check_status_running_tasks( - api=api, cps_proj_key=cps_proj_key, task_ids=task_ids, progress_bar=progress_bar - ) - return DocumentConversionResult( - proj_key=cps_proj_key, - task_ids=task_ids, - statuses=statuses, - source_urls=urls, - api=api, - ) - - -def process_cos_input( - api: CpsApi, - cps_proj_key: str, - source_cos: S3Coordinates, - target: Optional[ExportTarget], - conversion_settings: Optional[ConversionSettings], - progress_bar=False, -): - """ - Classify user provided url(s) and take appropriate action. - """ - - task_id = submit_conversion_payload( - api=api, - cps_proj_key=cps_proj_key, - source={ - "type": "s3", - "coordinates": source_cos.model_dump(), - }, - target=target, - conversion_settings=conversion_settings, - ) - - task_ids = [task_id] - statuses = check_status_running_tasks( - api=api, cps_proj_key=cps_proj_key, task_ids=task_ids, progress_bar=progress_bar + sw_api = sw_client.ProjectApi(api.client.swagger_client_v2) + result = get_wait_task_result( + sw_api=sw_api, cps_proj_key=cps_proj_key, task_id=task_id ) return DocumentConversionResult( proj_key=cps_proj_key, - task_ids=task_ids, - statuses=statuses, + task_id=task_id, + result=result, + source_url=url, api=api, + export_md=export_md, ) diff --git a/deepsearch/documents/core/main.py b/deepsearch/documents/core/main.py index 5e8fe84a..8b1cdd46 100644 --- a/deepsearch/documents/core/main.py +++ b/deepsearch/documents/core/main.py @@ -1,19 +1,14 @@ from pathlib import Path -from typing import List, Optional, Union +from typing import Optional import urllib3 from deepsearch.cps.client.api import CpsApi from deepsearch.documents.core.input_process import ( - process_cos_input, process_local_input, - process_urls_input, -) -from deepsearch.documents.core.models import ( - ConversionSettings, - ExportTarget, - S3Coordinates, + process_url_input, ) +from deepsearch.documents.core.models import ConversionSettings urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) @@ -21,12 +16,11 @@ def convert_documents( proj_key: str, api: CpsApi, - urls: Optional[Union[str, List[str]]] = None, + url: Optional[str] = None, source_path: Optional[Path] = None, - source_cos: Optional[S3Coordinates] = None, - target: Optional[ExportTarget] = None, conversion_settings: Optional[ConversionSettings] = None, progress_bar=False, + export_md=False, ): """ Document conversion via Deep Search Technology. Function to orchestrate document conversion. @@ -37,19 +31,12 @@ def convert_documents( Your DeepSearch CPS Project Key. Contact DeepSearch Developers to request one. url : string [OPTIONAL] - For converting documents from the web, please provide a single url or list of urls. + For converting documents from the web, please provide a single url. source_file : path [OPTIONAL] For converting local files, please provide absolute path to file or to directory containing multiple files. - source_cos : S3Coordinates [OPTIONAL] - For converting all documents in a COS bucket, please provide the S3 credentials, including bucket and key_prefix. - - target : deepsearch.documents.core.models.ExportTargets [OPTIONAL] - Specify to which target the documents should be exported. Available options: ZIP file, - Elastic index, MongoDB collection - progress_bar : Boolean (default is False in code, True in CLI) Show progress bar for processing, submitting, converting input and downloading converted document. @@ -57,39 +44,26 @@ def convert_documents( NOTE: Either url or source_path should be supplied. """ # check required inputs are present - if urls is None and source_path is None and source_cos is None: + if url is None and source_path is None: raise ValueError( - "No input provided. Please provide either a url, a local file or references to an object store for conversion." + "No input provided. Please provide either a url or a local file." ) - elif urls is not None and source_path is None and source_cos is None: - if isinstance(urls, str): - urls = [urls] - - return process_urls_input( + elif url is not None and source_path is None: + return process_url_input( api=api, cps_proj_key=proj_key, - urls=urls, - target=target, + url=url, conversion_settings=conversion_settings, progress_bar=progress_bar, + export_md=export_md, ) - elif urls is None and source_path is not None and source_cos is None: + elif url is None and source_path is not None: return process_local_input( api=api, cps_proj_key=proj_key, source_path=Path(source_path).expanduser().resolve(), - target=target, - conversion_settings=conversion_settings, - progress_bar=progress_bar, - ) - elif urls is None and source_path is None and source_cos is not None: - return process_cos_input( - api=api, - cps_proj_key=proj_key, - source_cos=source_cos, - target=target, conversion_settings=conversion_settings, progress_bar=progress_bar, + export_md=export_md, ) - raise ValueError("Please provide only one input: url or local file.") diff --git a/deepsearch/documents/core/models.py b/deepsearch/documents/core/models.py index f3c83e80..1ea3bdaa 100644 --- a/deepsearch/documents/core/models.py +++ b/deepsearch/documents/core/models.py @@ -1,26 +1,8 @@ -import collections from enum import Enum from textwrap import dedent -from typing import ( - ClassVar, - Dict, - Hashable, - List, - Literal, - Optional, - TypeVar, - Union, - get_args, -) - -from pydantic import AfterValidator, BaseModel, ConfigDict, Field, model_validator -from pydantic_core import PydanticCustomError -from typing_extensions import Annotated - -from deepsearch import CpsApi -from deepsearch.core.util.ccs_utils import get_ccs_project_key -from deepsearch.cps.apis import public as sw_client -from deepsearch.documents.core.utils import URLNavigator +from typing import List, Literal, Optional, Union + +from pydantic import BaseModel, Field, model_validator class S3Coordinates(BaseModel): @@ -182,478 +164,19 @@ class COSTarget(BaseModel): ] -class AlpineOcrLanguage(str, Enum): - English = "en" - Japanese = "ja" - Chinese = "zh" - - -class TesseractOcrLanguage(str, Enum): - Arabic = "Arabic" - Armenian = "Armenian" - Bengali = "Bengali" - Canadian_Aboriginal = "Canadian_Aboriginal" - Cherokee = "Cherokee" - Cyrillic = "Cyrillic" - Devanagari = "Devanagari" - Ethiopic = "Ethiopic" - Fraktur = "Fraktur" - Georgian = "Georgian" - Greek = "Greek" - Gujarati = "Gujarati" - Gurmukhi = "Gurmukhi" - HanS = "HanS" - HanS_vert = "HanS_vert" - HanT = "HanT" - HanT_vert = "HanT_vert" - Hangul = "Hangul" - Hangul_vert = "Hangul_vert" - Hebrew = "Hebrew" - Japanese = "Japanese" - Japanese_vert = "Japanese_vert" - Kannada = "Kannada" - Khmer = "Khmer" - Lao = "Lao" - Latin = "Latin" - Malayalam = "Malayalam" - Myanmar = "Myanmar" - Oriya = "Oriya" - Sinhala = "Sinhala" - Syriac = "Syriac" - Tamil = "Tamil" - Telugu = "Telugu" - Thaana = "Thaana" - Thai = "Thai" - Tibetan = "Tibetan" - Vietnamese = "Vietnamese" - afr = "afr" - amh = "amh" - ara = "ara" - asm = "asm" - aze = "aze" - aze_cyrl = "aze_cyrl" - bel = "bel" - ben = "ben" - bod = "bod" - bos = "bos" - bre = "bre" - bul = "bul" - cat = "cat" - ceb = "ceb" - ces = "ces" - chi_sim = "chi_sim" - chi_sim_vert = "chi_sim_vert" - chi_tra = "chi_tra" - chi_tra_vert = "chi_tra_vert" - chr = "chr" - cos = "cos" - cym = "cym" - dan = "dan" - deu = "deu" - div = "div" - dzo = "dzo" - ell = "ell" - eng = "eng" - enm = "enm" - epo = "epo" - est = "est" - eus = "eus" - fao = "fao" - fas = "fas" - fil = "fil" - fin = "fin" - fra = "fra" - frk = "frk" - frm = "frm" - fry = "fry" - gla = "gla" - gle = "gle" - glg = "glg" - grc = "grc" - guj = "guj" - hat = "hat" - heb = "heb" - hin = "hin" - hrv = "hrv" - hun = "hun" - hye = "hye" - iku = "iku" - ind = "ind" - isl = "isl" - ita = "ita" - ita_old = "ita_old" - jav = "jav" - jpn = "jpn" - jpn_vert = "jpn_vert" - kan = "kan" - kat = "kat" - kat_old = "kat_old" - kaz = "kaz" - khm = "khm" - kir = "kir" - kmr = "kmr" - kor = "kor" - kor_vert = "kor_vert" - lao = "lao" - lat = "lat" - lav = "lav" - lit = "lit" - ltz = "ltz" - mal = "mal" - mar = "mar" - mkd = "mkd" - mlt = "mlt" - mon = "mon" - mri = "mri" - msa = "msa" - mya = "mya" - nep = "nep" - nld = "nld" - nor = "nor" - oci = "oci" - ori = "ori" - osd = "osd" - pan = "pan" - pol = "pol" - por = "por" - pus = "pus" - que = "que" - ron = "ron" - rus = "rus" - san = "san" - sin = "sin" - slk = "slk" - slv = "slv" - snd = "snd" - spa = "spa" - spa_old = "spa_old" - sqi = "sqi" - srp = "srp" - srp_latn = "srp_latn" - sun = "sun" - swa = "swa" - swe = "swe" - syr = "syr" - tam = "tam" - tat = "tat" - tel = "tel" - tgk = "tgk" - tha = "tha" - tir = "tir" - ton = "ton" - tur = "tur" - uig = "uig" - ukr = "ukr" - urd = "urd" - uzb = "uzb" - uzb_cyrl = "uzb_cyrl" - vie = "vie" - yid = "yid" - yor = "yor" - - -# Unique check, https://github.com/pydantic/pydantic-core/pull/820#issuecomment-1670475909 - -T = TypeVar("T", bound=Hashable) - - -def _validate_unique_list(v: List[T]) -> List[T]: - if len(v) != len(set(v)): - raise PydanticCustomError("unique_list", "List must be unique") - return v - - -UniqueList = Annotated[ - List[T], - AfterValidator(_validate_unique_list), - Field(json_schema_extra={"uniqueItems": True}), -] - - -class TesseractOcrEngine(BaseModel): - id: ClassVar[str] = "tesseract-ocr" - languages: Annotated[UniqueList[TesseractOcrLanguage], Field(min_length=1)] = [ - TesseractOcrLanguage.eng, - TesseractOcrLanguage.deu, - ] - model_config = ConfigDict(use_enum_values=True) - - -class AlpineOcrEngine(BaseModel): - id: ClassVar[str] = "alpine-ocr" - languages: Annotated[ - UniqueList[AlpineOcrLanguage], - Field(min_length=1, max_length=1), - ] = [AlpineOcrLanguage.English] - model_config = ConfigDict(use_enum_values=True) - - -OcrEngine = Union[AlpineOcrEngine, TesseractOcrEngine] - - -class ProjectConversionModel(BaseModel): - name: Optional[str] = None # named model (config) - config_id: str # the model config key. Validate with available models CCS project. - proj_key: str - - @classmethod - def get_models( - cls, api: CpsApi, proj_key: str - ) -> Dict[ - str, List["ProjectConversionModel"] - ]: # get list of available project models - - stages_to_models = collections.defaultdict(list) - - proj_key, _ = get_ccs_project_key(api, proj_key) - - request_project_models = api.client.session.get( - url=URLNavigator(api).url_project_models(proj_key) - ) - request_project_models.raise_for_status() - models_dict = request_project_models.json() - - for elem in models_dict: - for stage in elem["supported_stages"]: - stages_to_models[stage].append( - ProjectConversionModel.from_ccs_spec(elem) - ) - - return stages_to_models # FIXME: Dummy - - def to_ccs_spec(self): - obj = { - "name": self.name, - "description": "", - "proj_key": self.proj_key, - "model_config_key": self.config_id, - } - - return obj - - @classmethod - def from_ccs_spec(cls, obj): - return cls( - name=obj.get("name"), - config_id=obj.get("model_config_key"), - proj_key=obj.get("proj_key"), - ) - - -class DefaultConversionModel(BaseModel): - type: str # system model "type". Validate with available options on CCS API. - config: dict = {} # model configuration dict - - @classmethod - def get_models( - cls, api: CpsApi - ) -> Dict[ - str, List["DefaultConversionModel"] - ]: # get list of available default models - - stages_to_models = collections.defaultdict(list) - - request_system_models = api.client.session.get( - url=URLNavigator(api).url_system_models() - ) - request_system_models.raise_for_status() - models_dict = request_system_models.json() - - for elem in models_dict: - for stage in elem["supported_stages"]: - stages_to_models[stage].append( - DefaultConversionModel.from_ccs_spec(elem) - ) - - return stages_to_models # FIXME: Dummy - - def to_ccs_spec(self): - return self.model_dump() - - @classmethod - def from_ccs_spec(cls, obj): - return cls.model_validate(obj) +class TableStructureOptions(BaseModel): + do_table_structure: bool = True + table_structure_mode: Literal["fast", "accurate"] = "fast" -ConversionModel = Union[DefaultConversionModel, ProjectConversionModel] - - -class ConversionPipelineSettings(BaseModel): - clusters: ConversionModel - tables: Optional[ConversionModel] = None - - @classmethod - def from_ccs_spec(cls, obj): - if obj is None: - raise ValueError("CCS spec can not be None") - if obj.get("clusters") and len(obj.get("clusters")): - model_dict = obj.get("clusters")[0] - - clusters = cls._make_conversion_model(model_dict) - - instance = cls(clusters=clusters) - if obj.get("tables") and len(obj.get("tables")): - model_dict = obj.get("tables")[0] - - instance.tables = cls._make_conversion_model(model_dict) - - return instance - else: - raise ValueError("CCS spec must have non-empty clusters") - - @classmethod - def _make_conversion_model(cls, model_dict): - if "model_config_key" in model_dict.keys(): - return ProjectConversionModel.from_ccs_spec(model_dict) - else: - return DefaultConversionModel.from_ccs_spec(model_dict) - - def to_ccs_spec(self): - obj = { - "clusters": [self.clusters.to_ccs_spec()], - "page": [], - "tables": [self.tables.to_ccs_spec()] if self.tables else [], - "normalization": [], - } - - return obj - - -class OCRModeEnum(str, Enum): - auto = "auto" - keep_only_ocr = "keep-only-ocr" - prioritize_programmatic = "prioritize-programmatic" - prioritize_ocr = "prioritize-ocr" - - -class OCRSettings(BaseModel): - enabled: bool = False - engine: Optional[OcrEngine] = None - merge_mode: OCRModeEnum = OCRModeEnum.prioritize_ocr - - @classmethod - def get_backends( - cls, api: CpsApi - ) -> List[OcrEngine]: # get list of available OCR backends - request_backends = api.client.session.get( - url=URLNavigator(api).url_system_ocr_backends() - ) - request_backends.raise_for_status() - backend_list = request_backends.json() - engines = [] - for item in backend_list: - for engine_cls in get_args(OcrEngine): - if engine_cls.id == item["id"]: - engines.append(engine_cls()) # create default instance - - return engines - - def to_ccs_spec(self): - if self.enabled and not self.engine: - raise ValueError("OCR can't be enabled because no OCR engine is available.") - - if not self.engine: - return { - "enabled": False, - "backend": "", - "backend_settings": {}, - "merge_mode": OCRModeEnum.prioritize_ocr.value, - } - - return { - "enabled": self.enabled, - "backend": self.engine.id, - "backend_settings": self.engine.model_dump(), - "merge_mode": self.merge_mode, - } - - @classmethod - def from_ccs_spec(cls, obj): - engine = None - for engine_cls in get_args(OcrEngine): - if engine_cls.id == obj["backend"]: - engine = engine_cls() - break - - s = OCRSettings(enabled=obj["enabled"], engine=engine) - if obj["merge_mode"]: - s.merge_mode = OCRModeEnum(obj["merge_mode"]) - - return s - - -class ConversionMetadata(BaseModel): - description: str = "" - display_name: str = "" - license: str = "" - source: str = "" - version: str = "" - - @classmethod - def from_ccs_spec(cls, obj): - return cls.model_validate(obj or {}) - - def to_ccs_spec(self): - return self.model_dump() +class OCROptions(BaseModel): + do_ocr: bool = True + kind: Literal["easyocr", "tesserocr"] = "easyocr" class ConversionSettings(BaseModel): - pipeline: Optional[ConversionPipelineSettings] = None - ocr: Optional[OCRSettings] = None - metadata: Optional[ConversionMetadata] = None - - @classmethod - def from_project(cls, api: CpsApi, proj_key: str) -> "ConversionSettings": - proj_key, _ = get_ccs_project_key(api, proj_key) - - request_conv_settings = api.client.session.get( - url=URLNavigator(api).url_collection_settings(proj_key, "_default") - ) - request_conv_settings.raise_for_status() - settings_dict = request_conv_settings.json() - - pipeline = ConversionPipelineSettings.from_ccs_spec( - settings_dict.get("model_pipeline") - ) - ocr = OCRSettings.from_ccs_spec(settings_dict.get("ocr")) - metadata = ConversionMetadata.from_ccs_spec(settings_dict.get("metadata")) - return cls( - pipeline=pipeline, - ocr=ocr, - metadata=metadata, - ) - - @classmethod - def from_defaults(cls, api: CpsApi) -> "ConversionSettings": - request_conv_settings = api.client.session.get( - url=URLNavigator(api).url_conversion_defaults() - ) - request_conv_settings.raise_for_status() - settings_dict = request_conv_settings.json() - - pipeline = ConversionPipelineSettings.from_ccs_spec( - settings_dict.get("model_pipeline") - ) - ocr = OCRSettings.from_ccs_spec(settings_dict.get("ocr")) - metadata = ConversionMetadata.from_ccs_spec(settings_dict.get("metadata")) - - return cls( - pipeline=pipeline, - ocr=ocr, - metadata=metadata, - ) - - def to_ccs_spec(self): - obj = {} - - if self.pipeline: - obj["model_pipeline"] = self.pipeline.to_ccs_spec() - if self.ocr: - obj["ocr"] = self.ocr.to_ccs_spec() - if self.metadata: - obj["metadata"] = self.metadata.to_ccs_spec() - - return obj + ocr: OCROptions = OCROptions() + table_structure: TableStructureOptions = TableStructureOptions() class TargetSettings(BaseModel): diff --git a/deepsearch/documents/core/results.py b/deepsearch/documents/core/results.py index 53adc63c..d031a5dc 100644 --- a/deepsearch/documents/core/results.py +++ b/deepsearch/documents/core/results.py @@ -1,16 +1,11 @@ -import os from pathlib import Path -from typing import Any, List, Optional, Union +from typing import Optional import urllib3 from deepsearch.cps.client.api import CpsApi -from deepsearch.documents.core.convert import ( - download_converted_documents, - get_download_url, -) -from deepsearch.documents.core.create_report import get_multiple_reports -from deepsearch.documents.core.models import S3Coordinates +from deepsearch.documents.core.convert import download_converted_documents +from deepsearch.documents.core.create_report import generate_report_csv urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) @@ -23,20 +18,22 @@ class DocumentConversionResult: def __init__( self, proj_key: str, - task_ids: list, - statuses: List[str], + task_id: str, + result: dict, api: CpsApi, source_path: Optional[Path] = None, - source_urls: Optional[List[str]] = None, + source_url: Optional[str] = None, batched_files=None, + export_md: bool = False, ) -> None: self.proj_key = proj_key - self.task_ids = task_ids - self.statuses = statuses + self.task_id = task_id + self.result = result self._source_path = source_path - self._source_urls = source_urls + self._source_url = source_url self._api = api self._batched_files = batched_files + self.export_md = export_md def download_all(self, result_dir: Path, progress_bar=False): """ @@ -52,10 +49,11 @@ def download_all(self, result_dir: Path, progress_bar=False): result_dir = Path(result_dir) result_dir.mkdir(parents=True, exist_ok=True) + urls = [] + urls.append(self.result.get("result", {}).get("json_file_url")) + if self.export_md: + urls.append(self.result.get("result", {}).get("md_file_url")) - urls = get_download_url( - cps_proj_key=self.proj_key, task_ids=self.task_ids, api=self._api - ) download_converted_documents( result_dir=result_dir, download_urls=urls, progress_bar=progress_bar ) @@ -66,92 +64,13 @@ def generate_report(self, result_dir: Path, progress_bar=False): Saves a csv report file for detailed information about the document conversion job. Returns a dictionary object containing counts of files/urls converted. - progress_bar: boolean, optional (default = False) - shows progress bar is True - """ result_dir = Path(result_dir) result_dir.mkdir(parents=True, exist_ok=True) - if self._source_path is not None: - info = get_multiple_reports( - api=self._api, - cps_proj_key=self.proj_key, - task_ids=self.task_ids, - source_files=self._batched_files, - result_dir=result_dir, - progress_bar=progress_bar, - ) - return info - elif self._source_urls is not None: - info = get_multiple_reports( - api=self._api, - cps_proj_key=self.proj_key, - task_ids=self.task_ids, - source_files=self._source_urls, - result_dir=result_dir, - progress_bar=progress_bar, - ) - return info - else: - info = get_multiple_reports( - api=self._api, - cps_proj_key=self.proj_key, - task_ids=self.task_ids, - source_files=None, - result_dir=result_dir, - progress_bar=progress_bar, - ) - return info - - def __iter__(self): - for index in range(len(self.task_ids)): - yield DocumentResult( - proj_key=self.proj_key, - task_id=self.task_ids[index], - status=self.statuses[index], - api=self._api, - ) - - -class DocumentResult: - """ - Instance of an individual DocumentConversionResult. - """ - - def __init__(self, proj_key: str, task_id: str, status: str, api: CpsApi): - self.proj_key = proj_key - self.task_id = task_id - self.status = status - self._api = api - - def url_json(self): - """ - Returns the url of a converted json object. - """ - return get_download_url( - cps_proj_key=self.proj_key, task_ids=[self.task_id], api=self._api - )[0] - - def download(self, result_dir: Path, progress_bar=False): - """ - Download result of an individual conversion task. - - Input - ----- - result_dir : path - local directory where converted documents are stored - progress_bar: boolean, optional (default = False) - shows progress bar is True - """ - if not os.path.isdir(result_dir): - os.makedirs(result_dir) - url = get_download_url( - cps_proj_key=self.proj_key, task_ids=[self.task_id], api=self._api - ) - download_converted_documents( + return generate_report_csv( + task_result=self.result.get("result", {}), + task_id=self.task_id, result_dir=result_dir, - download_urls=url, progress_bar=progress_bar, ) - return diff --git a/deepsearch/documents/core/utils.py b/deepsearch/documents/core/utils.py index 501bc7a6..4edad057 100644 --- a/deepsearch/documents/core/utils.py +++ b/deepsearch/documents/core/utils.py @@ -1,69 +1,19 @@ import datetime import glob -import json import os import pathlib -import urllib import zipfile as z from pathlib import Path -from typing import Any, Dict, Iterator, List, Optional +from typing import Any, List import requests -from docling_core.types.legacy_doc.document import ExportedCCSDocument as DsDocument -from pydantic import BaseModel from tqdm import tqdm -from deepsearch.cps.client.api import CpsApi - from .common_routines import progressbar ALLOWED_FILE_EXTENSIONS = [".pdf", ".jpg", ".jpeg", ".tiff", ".tif", ".png", ".gif"] -class URLNavigator: - def __init__(self, api: CpsApi) -> None: - self.api = api - self.url_host = self.api.client.swagger_client.configuration.host - self.url_linked_ccs = urllib.parse.urljoin(self.url_host, "/api/linked-ccs") - self.url_user_management = "/user/v1" - self.url_public_apis = "/public/v4" - - def url_request_status(self, ccs_proj_key: str, task_id: str): - wait = 5 - return f"{self.url_linked_ccs}{self.url_public_apis}/projects/{ccs_proj_key}/tasks/{task_id}/status?wait={wait}" - - def url_convert(self, ccs_proj_key: str): - return f"{self.url_linked_ccs}{self.url_public_apis}/projects/{ccs_proj_key}/pipelines/convert" - - def url_result(self, ccs_proj_key: str, task_id: str): - return f"{self.url_linked_ccs}{self.url_public_apis}/projects/{ccs_proj_key}/document_conversions/{task_id}/result" - - def url_report_tasks(self, ccs_proj_key: str, task_id: str): - report_name = "tasks" - return f"{self.url_linked_ccs}{self.url_public_apis}/projects/{ccs_proj_key}/document_conversions/{task_id}/reports/{report_name}" - - def url_report_metrics(self, ccs_proj_key: str, task_id: str): - report_name = "metrics" - return f"{self.url_linked_ccs}{self.url_public_apis}/projects/{ccs_proj_key}/document_conversions/{task_id}/reports/{report_name}" - - def url_conversion_defaults(self): - return ( - f"{self.url_linked_ccs}{self.url_public_apis}/settings/conversion_defaults" - ) - - def url_collection_settings(self, ccs_proj_key: str, collection_name: str): - return f"{self.url_linked_ccs}{self.url_public_apis}/projects/{ccs_proj_key}/collections/{collection_name}/settings" - - def url_system_models(self): - return f"{self.url_linked_ccs}{self.url_public_apis}/settings/system_models" - - def url_project_models(self, ccs_proj_key: str): - return f"{self.url_linked_ccs}{self.url_public_apis}/projects/{ccs_proj_key}/models" - - def url_system_ocr_backends(self): - return f"{self.url_linked_ccs}{self.url_public_apis}/settings/ocr_backends" - - def batch_single_files( source_path: Path, root_dir: Path, progress_bar=False ) -> List[List[str]]: @@ -168,38 +118,6 @@ def batch_single_files( return bfiles -def collect_all_local_files(source_path: Path, root_dir: Path): - """ - Function to scan directory and collect all batches for conversion - - Input: - ----- - - source_path : Path - user provided path - - root_dir : Path - path for temporary batched files - """ - files_zip: List[Any] = [] - # scan for existing zips - if os.path.isdir(source_path): - files_zip = glob.glob(os.path.join(source_path, "**/*.zip"), recursive=True) - elif os.path.isfile(source_path): - file_extension = pathlib.Path(source_path).suffix - if file_extension == ".zip": - files_zip = [source_path] - - # scan for batched zips - if root_dir is not None: - files_tmpzip = glob.glob( - os.path.join(root_dir, "tmpzip/**/*.zip"), recursive=True - ) - files_zip = files_tmpzip + files_zip # order is important! - - return files_zip - - def create_root_dir() -> Path: """ Creates root directory labelled with timestamp @@ -260,38 +178,3 @@ def write_taskids(result_dir: Path, list_to_write: List[str]) -> None: for t in list_to_write: text_file.write(t + "\n") return - - -class IteratedDocument(BaseModel): - archive_path: Path - file_path: Path - document: DsDocument - cells: Optional[Dict[str, Any]] = None - - -def iterate_converted_files(result_dir: Path) -> Iterator[IteratedDocument]: - """ - Iterate through all the converted documents in the downloaded results. - """ - for output_file in Path(result_dir).rglob("json*.zip"): - with z.ZipFile(output_file) as archive: - all_files = archive.namelist() - for name in all_files: - if not name.endswith(".json"): - continue - - basename = name.rstrip(".json") - doc: DsDocument = DsDocument.model_validate_json( - archive.read(f"{basename}.json") - ) - - cells_data = None - if f"{basename}.cells" in all_files: - cells_data = json.loads(archive.read(f"{basename}.cells")) - - yield IteratedDocument( - archive_path=output_file, - file_path=Path(name), - document=doc, - cells=cells_data, - ) diff --git a/docs/apis/public_v2/README.md b/docs/apis/public_v2/README.md index 09f733ac..0d9f301f 100644 --- a/docs/apis/public_v2/README.md +++ b/docs/apis/public_v2/README.md @@ -80,17 +80,15 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = deepsearch.cps.apis.public_v2.ContentManagerApi(api_client) index_key = 'index_key_example' # str | + document_hash = 'document_hash_example' # str | proj_key = 'proj_key_example' # str | - page = 1 # int | (optional) (default to 1) - page_size = 25 # int | (optional) (default to 25) + document_meta = deepsearch.cps.apis.public_v2.DocumentMeta() # DocumentMeta | try: - # Get All Project Data Index Documents - api_response = api_instance.get_all_project_data_index_documents(index_key, proj_key, page=page, page_size=page_size) - print("The response of ContentManagerApi->get_all_project_data_index_documents:\n") - pprint(api_response) + # Add Project Data Index Document Metadata + api_instance.add_project_data_index_document_metadata(index_key, document_hash, proj_key, document_meta) except ApiException as e: - print("Exception when calling ContentManagerApi->get_all_project_data_index_documents: %s\n" % e) + print("Exception when calling ContentManagerApi->add_project_data_index_document_metadata: %s\n" % e) ``` @@ -100,6 +98,7 @@ All URIs are relative to */api/cps/public/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*ContentManagerApi* | [**add_project_data_index_document_metadata**](docs/ContentManagerApi.md#add_project_data_index_document_metadata) | **POST** /project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/metadata | Add Project Data Index Document Metadata *ContentManagerApi* | [**get_all_project_data_index_documents**](docs/ContentManagerApi.md#get_all_project_data_index_documents) | **GET** /project/{proj_key}/data_indices/{index_key}/documents/ | Get All Project Data Index Documents *ContentManagerApi* | [**get_project_agents**](docs/ContentManagerApi.md#get_project_agents) | **GET** /project/{proj_key}/data_indices/documents/agents | Get Project Agents *ContentManagerApi* | [**get_project_conversion_statistics**](docs/ContentManagerApi.md#get_project_conversion_statistics) | **GET** /project/{proj_key}/data_indices/{index_key}/documents/statistics | Get Project Conversion Statistics @@ -117,8 +116,10 @@ Class | Method | HTTP request | Description *DataIndicesApi* | [**create_project_data_index_delete_token**](docs/DataIndicesApi.md#create_project_data_index_delete_token) | **POST** /project/{proj_key}/data_indices/{index_key}/delete_token | Create Project Data Index Delete Token *DataIndicesApi* | [**delete_project_data_index**](docs/DataIndicesApi.md#delete_project_data_index) | **DELETE** /project/{proj_key}/data_indices/{index_key} | Delete Project Data Index *DataIndicesApi* | [**get_project_data_index**](docs/DataIndicesApi.md#get_project_data_index) | **GET** /project/{proj_key}/data_indices/{index_key} | Get Project Data Index +*DataIndicesApi* | [**get_project_data_index_conversion_settings**](docs/DataIndicesApi.md#get_project_data_index_conversion_settings) | **GET** /project/{proj_key}/data_indices/{index_key}/conversion_settings | Get Project Data Index Conversion Settings *DataIndicesApi* | [**get_project_data_indices**](docs/DataIndicesApi.md#get_project_data_indices) | **GET** /project/{proj_key}/data_indices | Get Project Data Indices *DataIndicesApi* | [**update_project_data_index**](docs/DataIndicesApi.md#update_project_data_index) | **PATCH** /project/{proj_key}/data_indices/{index_key} | Update Project Data Index +*DataIndicesApi* | [**update_project_data_index_conversion_settings**](docs/DataIndicesApi.md#update_project_data_index_conversion_settings) | **PATCH** /project/{proj_key}/data_indices/{index_key}/conversion_settings | Update Project Data Index Conversion Settings *DataIndicesUploadApi* | [**ccs_convert_file_project_data_index**](docs/DataIndicesUploadApi.md#ccs_convert_file_project_data_index) | **POST** /project/{proj_key}/data_indices/{index_key}/actions/ccs_convert | Ccs Convert File Project Data Index *DataIndicesUploadApi* | [**ccs_convert_upload_file_project_data_index**](docs/DataIndicesUploadApi.md#ccs_convert_upload_file_project_data_index) | **POST** /project/{proj_key}/data_indices/{index_key}/actions/ccs_convert_upload | Ccs Convert Upload File Project Data Index *DataIndicesUploadApi* | [**get_attachment_upload_data**](docs/DataIndicesUploadApi.md#get_attachment_upload_data) | **GET** /project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment_url/{filename} | Get Attachment Upload Data @@ -131,9 +132,9 @@ Class | Method | HTTP request | Description *KnowledgeGraphsApi* | [**create_project_knowledge_graph**](docs/KnowledgeGraphsApi.md#create_project_knowledge_graph) | **POST** /backend/project/{proj_key}/bags | Create Project Knowledge Graph *KnowledgeGraphsApi* | [**list_public_knowledge_graphs**](docs/KnowledgeGraphsApi.md#list_public_knowledge_graphs) | **GET** /project/public/bags | List Public Knowledge Graphs *KnowledgeGraphsApi* | [**update_project_knowledge_graph_metadata**](docs/KnowledgeGraphsApi.md#update_project_knowledge_graph_metadata) | **PATCH** /backend/project/{proj_key}/bags/{bag_key} | Update Project Knowledge Graph Metadata -*ProjectApi* | [**check_wait_ccs_task_task**](docs/ProjectApi.md#check_wait_ccs_task_task) | **GET** /project/{proj_key}/convert_tasks/{task_id} | Check Wait Ccs Task Task -*ProjectApi* | [**convert_pdf_document**](docs/ProjectApi.md#convert_pdf_document) | **POST** /project/{proj_key}/convert | Convert Pdf Document +*ProjectApi* | [**convert_document**](docs/ProjectApi.md#convert_document) | **POST** /project/{proj_key}/convert | Convert Document *ProjectApi* | [**delete_project_integration_config_genai**](docs/ProjectApi.md#delete_project_integration_config_genai) | **DELETE** /project/{proj_key}/integrations/genai | Delete Project Integration Config Genai +*ProjectApi* | [**get_convert_task**](docs/ProjectApi.md#get_convert_task) | **GET** /project/{proj_key}/convert_tasks/{task_id} | Get Convert Task *ProjectApi* | [**get_project_default_values**](docs/ProjectApi.md#get_project_default_values) | **GET** /project/{proj_key}/default_values | Get Project Default Values *ProjectApi* | [**get_project_integration_config_genai**](docs/ProjectApi.md#get_project_integration_config_genai) | **GET** /project/{proj_key}/integrations/genai | Get Project Integration Config Genai *ProjectApi* | [**provision_project_packages**](docs/ProjectApi.md#provision_project_packages) | **POST** /project/{proj_key}/packages | Provision Project Packages @@ -174,70 +175,166 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [Abstract](docs/Abstract.md) + - [Acquisition](docs/Acquisition.md) + - [AddAnnotations](docs/AddAnnotations.md) + - [AddRawPages](docs/AddRawPages.md) + - [Affiliation](docs/Affiliation.md) + - [Affiliations](docs/Affiliations.md) + - [AgentName](docs/AgentName.md) + - [Aggs](docs/Aggs.md) + - [Alias](docs/Alias.md) + - [Aliases](docs/Aliases.md) + - [AlternateNames](docs/AlternateNames.md) + - [ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource](docs/ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource.md) + - [ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier](docs/ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier.md) + - [ApiServerFastapiServerPublicModelsProjectModelsHttpSource](docs/ApiServerFastapiServerPublicModelsProjectModelsHttpSource.md) - [AssembleMode](docs/AssembleMode.md) - [AssembleSettings](docs/AssembleSettings.md) - [AttachmentUploadData](docs/AttachmentUploadData.md) - [AttachmentUploadRequestBody](docs/AttachmentUploadRequestBody.md) + - [Author](docs/Author.md) + - [Authors](docs/Authors.md) + - [Backend](docs/Backend.md) + - [BackendSettings](docs/BackendSettings.md) - [BagFlavourFullData](docs/BagFlavourFullData.md) + - [BeginDate](docs/BeginDate.md) - [CCSProject](docs/CCSProject.md) - [CPSPackage](docs/CPSPackage.md) - [CPSSummary](docs/CPSSummary.md) - - [CcsTask](docs/CcsTask.md) + - [CitationCount](docs/CitationCount.md) + - [CitationCountDate](docs/CitationCountDate.md) + - [Code](docs/Code.md) + - [CollectionDocumentInfoStr](docs/CollectionDocumentInfoStr.md) - [CollectionMetadataSettings](docs/CollectionMetadataSettings.md) + - [Comment](docs/Comment.md) + - [CompletedAt](docs/CompletedAt.md) - [Config](docs/Config.md) + - [ConversionSettings](docs/ConversionSettings.md) - [ConvertDocumentRequest](docs/ConvertDocumentRequest.md) + - [ConvertDocumentRequestFileSource](docs/ConvertDocumentRequestFileSource.md) + - [ConvertDocumentRequestHttpSource](docs/ConvertDocumentRequestHttpSource.md) + - [ConvertDocumentRequestImageUrls](docs/ConvertDocumentRequestImageUrls.md) + - [ConvertDocumentRequestSettings](docs/ConvertDocumentRequestSettings.md) - [ConvertDocumentsRequestBody](docs/ConvertDocumentsRequestBody.md) + - [ConvertDocumentsRequestBodyTargetSettings](docs/ConvertDocumentsRequestBodyTargetSettings.md) - [ConvertDocumentsSources](docs/ConvertDocumentsSources.md) + - [ConvertDocumentsSourcesS3Source](docs/ConvertDocumentsSourcesS3Source.md) - [ConvertUploadDocumentsRequestBody](docs/ConvertUploadDocumentsRequestBody.md) + - [ConvertUploadDocumentsRequestBodyMeta](docs/ConvertUploadDocumentsRequestBodyMeta.md) - [CpsTask](docs/CpsTask.md) + - [Created](docs/Created.md) - [Data](docs/Data.md) - [DataFlow](docs/DataFlow.md) - [DataIndexUploadFileSource](docs/DataIndexUploadFileSource.md) + - [DcKey](docs/DcKey.md) + - [DecodeSecrets](docs/DecodeSecrets.md) - [DefaultValues](docs/DefaultValues.md) + - [DefaultValuesDataflow](docs/DefaultValuesDataflow.md) - [Deployment](docs/Deployment.md) + - [Description](docs/Description.md) + - [DescriptionLicense](docs/DescriptionLicense.md) - [DirectModelConfig](docs/DirectModelConfig.md) + - [DisplayName](docs/DisplayName.md) + - [DoclingCoreTypesBaseIdentifier](docs/DoclingCoreTypesBaseIdentifier.md) - [DocumentArtifacts](docs/DocumentArtifacts.md) + - [DocumentArtifactsDocumentMetaJson](docs/DocumentArtifactsDocumentMetaJson.md) - [DocumentArtifactsItem](docs/DocumentArtifactsItem.md) - [DocumentArtifactsPageItem](docs/DocumentArtifactsPageItem.md) + - [DocumentDescription](docs/DocumentDescription.md) + - [DocumentDescriptionAcquisition](docs/DocumentDescriptionAcquisition.md) + - [DocumentDescriptionAdvanced](docs/DocumentDescriptionAdvanced.md) + - [DocumentDescriptionLicense](docs/DocumentDescriptionLicense.md) + - [DocumentHashes](docs/DocumentHashes.md) + - [DocumentMeta](docs/DocumentMeta.md) + - [DocumentMetaDescription](docs/DocumentMetaDescription.md) - [DocumentStatistics](docs/DocumentStatistics.md) + - [Domain](docs/Domain.md) - [ElasticIndexPropertyObject](docs/ElasticIndexPropertyObject.md) - [ElasticIndexPropertyPrimitive](docs/ElasticIndexPropertyPrimitive.md) - [ElasticIndexSearchQueryOptions](docs/ElasticIndexSearchQueryOptions.md) - [ElasticIndexSource](docs/ElasticIndexSource.md) - [ElasticInstanceDataIndex](docs/ElasticInstanceDataIndex.md) - [ElasticMetadata](docs/ElasticMetadata.md) + - [Enabled](docs/Enabled.md) + - [EndDate](docs/EndDate.md) + - [ErrorReason](docs/ErrorReason.md) - [FileSource](docs/FileSource.md) + - [FileUri](docs/FileUri.md) + - [FileUrl](docs/FileUrl.md) + - [Filename](docs/Filename.md) - [Flavour](docs/Flavour.md) - [FlavoursDefaultQuota](docs/FlavoursDefaultQuota.md) - [FlavoursQuota](docs/FlavoursQuota.md) - [GenAIAWSBedrock](docs/GenAIAWSBedrock.md) - [GenAIAWSBedrockConfig](docs/GenAIAWSBedrockConfig.md) + - [GenAIAWSBedrockProjParams](docs/GenAIAWSBedrockProjParams.md) - [GenAIBAM](docs/GenAIBAM.md) - [GenAIBAMConfig](docs/GenAIBAMConfig.md) + - [GenAICPD](docs/GenAICPD.md) + - [GenAICPDConfig](docs/GenAICPDConfig.md) - [GenAIHFInferenceApi](docs/GenAIHFInferenceApi.md) - [GenAIHFInferenceApiConfig](docs/GenAIHFInferenceApiConfig.md) + - [GenAIOpenai](docs/GenAIOpenai.md) + - [GenAIOpenaiConfig](docs/GenAIOpenaiConfig.md) - [GenAIParams](docs/GenAIParams.md) - [GenAIPartialParams](docs/GenAIPartialParams.md) - [GenAIWatsonx](docs/GenAIWatsonx.md) - [GenAIWatsonxConfig](docs/GenAIWatsonxConfig.md) + - [GenaiCpdApiKey](docs/GenaiCpdApiKey.md) + - [GenaiCpdPassword](docs/GenaiCpdPassword.md) - [GroupedProjectDocuments](docs/GroupedProjectDocuments.md) - [HTTPValidationError](docs/HTTPValidationError.md) + - [HeadUrl](docs/HeadUrl.md) + - [Headers](docs/Headers.md) - [HttpSource](docs/HttpSource.md) - - [InternalUrl](docs/InternalUrl.md) + - [Id](docs/Id.md) + - [Identifiers](docs/Identifiers.md) + - [Identifiers1](docs/Identifiers1.md) + - [IgnoreAbove](docs/IgnoreAbove.md) + - [ImageUrlsInfo](docs/ImageUrlsInfo.md) + - [Issue](docs/Issue.md) - [JsonUploadRequestBody](docs/JsonUploadRequestBody.md) + - [KeyPrefix](docs/KeyPrefix.md) + - [Keywords](docs/Keywords.md) + - [KgKey](docs/KgKey.md) + - [Languages](docs/Languages.md) + - [License](docs/License.md) + - [Link](docs/Link.md) - [ListProjectFlavours](docs/ListProjectFlavours.md) + - [Log](docs/Log.md) + - [MergeMode](docs/MergeMode.md) + - [ModelDate](docs/ModelDate.md) + - [ModelFrom](docs/ModelFrom.md) + - [ModelId](docs/ModelId.md) - [ModelPipelineSettings](docs/ModelPipelineSettings.md) - [ModelPipelineSettingsClustersInner](docs/ModelPipelineSettingsClustersInner.md) - [ModulesConfig](docs/ModulesConfig.md) + - [Name](docs/Name.md) + - [NumberPages](docs/NumberPages.md) + - [OCROptions](docs/OCROptions.md) + - [ObjectKeys](docs/ObjectKeys.md) - [OcrSettings](docs/OcrSettings.md) - [Package](docs/Package.md) + - [Page](docs/Page.md) + - [PageLabels](docs/PageLabels.md) + - [Pages](docs/Pages.md) + - [Params](docs/Params.md) - [PartialDirectConversionParameters](docs/PartialDirectConversionParameters.md) + - [PartialDirectConversionParametersAssemble](docs/PartialDirectConversionParametersAssemble.md) + - [PartialDirectConversionParametersMetadata](docs/PartialDirectConversionParametersMetadata.md) + - [PartialDirectConversionParametersModelPipeline](docs/PartialDirectConversionParametersModelPipeline.md) + - [PartialDirectConversionParametersOcr](docs/PartialDirectConversionParametersOcr.md) + - [ProjKey](docs/ProjKey.md) - [ProjectAgent](docs/ProjectAgent.md) - [ProjectAgents](docs/ProjectAgents.md) + - [ProjectDataIndexConversionSettingsInput](docs/ProjectDataIndexConversionSettingsInput.md) + - [ProjectDataIndexConversionSettingsOutput](docs/ProjectDataIndexConversionSettingsOutput.md) - [ProjectDataIndexNonView](docs/ProjectDataIndexNonView.md) - [ProjectDataIndexSource](docs/ProjectDataIndexSource.md) - [ProjectDataIndexView](docs/ProjectDataIndexView.md) - [ProjectDataIndexWithStatus](docs/ProjectDataIndexWithStatus.md) + - [ProjectDataIndexWithStatusMetadata](docs/ProjectDataIndexWithStatusMetadata.md) - [ProjectDocument](docs/ProjectDocument.md) - [ProjectDocumentURL](docs/ProjectDocumentURL.md) - [ProjectDocuments](docs/ProjectDocuments.md) @@ -248,38 +345,89 @@ Class | Method | HTTP request | Description - [ProjectScratchFilesPaginated](docs/ProjectScratchFilesPaginated.md) - [ProjectSourceDataIndex](docs/ProjectSourceDataIndex.md) - [ProjectsFlavours](docs/ProjectsFlavours.md) + - [PromptTemplate](docs/PromptTemplate.md) - [Properties](docs/Properties.md) + - [Provenance](docs/Provenance.md) + - [Publication](docs/Publication.md) + - [Publication1](docs/Publication1.md) + - [PublicationDate](docs/PublicationDate.md) + - [Publishers](docs/Publishers.md) + - [Query](docs/Query.md) + - [RecordProperties](docs/RecordProperties.md) + - [RefUri](docs/RefUri.md) + - [ReferenceCount](docs/ReferenceCount.md) - [ReferenceToModel](docs/ReferenceToModel.md) + - [References](docs/References.md) + - [RelatedTasks](docs/RelatedTasks.md) - [ResponseDocumentArtifacts](docs/ResponseDocumentArtifacts.md) + - [ResponseGetProjectDataIndexConversionSettings](docs/ResponseGetProjectDataIndexConversionSettings.md) - [ResponseGetProjectIntegrationConfigGenai](docs/ResponseGetProjectIntegrationConfigGenai.md) - [ResponseGroupedDocuments](docs/ResponseGroupedDocuments.md) + - [ResponseUpdateProjectDataIndexConversionSettings](docs/ResponseUpdateProjectDataIndexConversionSettings.md) - [ResponseUploadJobs](docs/ResponseUploadJobs.md) - [S3Coordinates](docs/S3Coordinates.md) - [S3DocumentSource](docs/S3DocumentSource.md) + - [SchemaKey](docs/SchemaKey.md) + - [ScratchIds](docs/ScratchIds.md) + - [SearchString](docs/SearchString.md) - [SemanticIngestReqParams](docs/SemanticIngestReqParams.md) - [SemanticIngestRequest](docs/SemanticIngestRequest.md) - [SemanticIngestSourcePrivateDataCollection](docs/SemanticIngestSourcePrivateDataCollection.md) - [SemanticIngestSourcePrivateDataDocument](docs/SemanticIngestSourcePrivateDataDocument.md) - [SemanticIngestSourcePublicDataDocument](docs/SemanticIngestSourcePublicDataDocument.md) - [SemanticIngestSourceUrl](docs/SemanticIngestSourceUrl.md) + - [Size](docs/Size.md) + - [Size1](docs/Size1.md) + - [Sort](docs/Sort.md) - [Source](docs/Source.md) - [Source1](docs/Source1.md) + - [Source2](docs/Source2.md) + - [Source3](docs/Source3.md) + - [Source4](docs/Source4.md) + - [StartCount](docs/StartCount.md) + - [StartedAt](docs/StartedAt.md) + - [Status](docs/Status.md) + - [StatusFilter](docs/StatusFilter.md) + - [Storage](docs/Storage.md) - [StorageSummaryTask](docs/StorageSummaryTask.md) + - [Subjects](docs/Subjects.md) - [SystemInfo](docs/SystemInfo.md) + - [TableFormerMode](docs/TableFormerMode.md) + - [TableStructureOptions](docs/TableStructureOptions.md) - [TargetConversionParameters](docs/TargetConversionParameters.md) + - [Task](docs/Task.md) - [TaskContext](docs/TaskContext.md) - [TaskResult](docs/TaskResult.md) + - [TaskType](docs/TaskType.md) - [TemporaryUploadFileResult](docs/TemporaryUploadFileResult.md) - [TemporaryUrl](docs/TemporaryUrl.md) - [TemporaryUrlFields](docs/TemporaryUrlFields.md) + - [Term](docs/Term.md) + - [Text](docs/Text.md) + - [Timeout](docs/Timeout.md) + - [Title](docs/Title.md) - [TokenResponse](docs/TokenResponse.md) + - [TruncatePages](docs/TruncatePages.md) + - [Type](docs/Type.md) + - [Type1](docs/Type1.md) - [UploadDate](docs/UploadDate.md) - [UploadElasticRequestBody](docs/UploadElasticRequestBody.md) - [UploadJob](docs/UploadJob.md) + - [UploadToElastic](docs/UploadToElastic.md) + - [Url](docs/Url.md) + - [UrlRefs](docs/UrlRefs.md) - [Urls](docs/Urls.md) - [ValidationError](docs/ValidationError.md) - [ValidationErrorLocInner](docs/ValidationErrorLocInner.md) + - [Version](docs/Version.md) + - [Version1](docs/Version1.md) - [ViewOf](docs/ViewOf.md) + - [ViewOf1](docs/ViewOf1.md) + - [Volume](docs/Volume.md) + - [Wait](docs/Wait.md) + - [Wait1](docs/Wait1.md) + - [WithOperations](docs/WithOperations.md) + - [WithoutOperations](docs/WithoutOperations.md) diff --git a/docs/apis/public_v2/docs/Abstract.md b/docs/apis/public_v2/docs/Abstract.md new file mode 100644 index 00000000..76faa433 --- /dev/null +++ b/docs/apis/public_v2/docs/Abstract.md @@ -0,0 +1,28 @@ +# Abstract + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.abstract import Abstract + +# TODO update the JSON string below +json = "{}" +# create an instance of Abstract from a JSON string +abstract_instance = Abstract.from_json(json) +# print the JSON string representation of the object +print(Abstract.to_json()) + +# convert the object into a dict +abstract_dict = abstract_instance.to_dict() +# create an instance of Abstract from a dict +abstract_form_dict = abstract.from_dict(abstract_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Acquisition.md b/docs/apis/public_v2/docs/Acquisition.md new file mode 100644 index 00000000..d660c734 --- /dev/null +++ b/docs/apis/public_v2/docs/Acquisition.md @@ -0,0 +1,33 @@ +# Acquisition + +Information on how the data was obtained. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | The method to obtain the data. | +**var_date** | [**ModelDate**](ModelDate.md) | | [optional] +**link** | [**Link**](Link.md) | | [optional] +**size** | [**Size**](Size.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.acquisition import Acquisition + +# TODO update the JSON string below +json = "{}" +# create an instance of Acquisition from a JSON string +acquisition_instance = Acquisition.from_json(json) +# print the JSON string representation of the object +print(Acquisition.to_json()) + +# convert the object into a dict +acquisition_dict = acquisition_instance.to_dict() +# create an instance of Acquisition from a dict +acquisition_form_dict = acquisition.from_dict(acquisition_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/AddAnnotations.md b/docs/apis/public_v2/docs/AddAnnotations.md new file mode 100644 index 00000000..13b14e2c --- /dev/null +++ b/docs/apis/public_v2/docs/AddAnnotations.md @@ -0,0 +1,28 @@ +# AddAnnotations + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.add_annotations import AddAnnotations + +# TODO update the JSON string below +json = "{}" +# create an instance of AddAnnotations from a JSON string +add_annotations_instance = AddAnnotations.from_json(json) +# print the JSON string representation of the object +print(AddAnnotations.to_json()) + +# convert the object into a dict +add_annotations_dict = add_annotations_instance.to_dict() +# create an instance of AddAnnotations from a dict +add_annotations_form_dict = add_annotations.from_dict(add_annotations_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/AddRawPages.md b/docs/apis/public_v2/docs/AddRawPages.md new file mode 100644 index 00000000..544c880b --- /dev/null +++ b/docs/apis/public_v2/docs/AddRawPages.md @@ -0,0 +1,28 @@ +# AddRawPages + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.add_raw_pages import AddRawPages + +# TODO update the JSON string below +json = "{}" +# create an instance of AddRawPages from a JSON string +add_raw_pages_instance = AddRawPages.from_json(json) +# print the JSON string representation of the object +print(AddRawPages.to_json()) + +# convert the object into a dict +add_raw_pages_dict = add_raw_pages_instance.to_dict() +# create an instance of AddRawPages from a dict +add_raw_pages_form_dict = add_raw_pages.from_dict(add_raw_pages_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Affiliation.md b/docs/apis/public_v2/docs/Affiliation.md new file mode 100644 index 00000000..d9753ecd --- /dev/null +++ b/docs/apis/public_v2/docs/Affiliation.md @@ -0,0 +1,32 @@ +# Affiliation + +Affiliation. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**id** | [**Id**](Id.md) | | [optional] +**source** | [**Source**](Source.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.affiliation import Affiliation + +# TODO update the JSON string below +json = "{}" +# create an instance of Affiliation from a JSON string +affiliation_instance = Affiliation.from_json(json) +# print the JSON string representation of the object +print(Affiliation.to_json()) + +# convert the object into a dict +affiliation_dict = affiliation_instance.to_dict() +# create an instance of Affiliation from a dict +affiliation_form_dict = affiliation.from_dict(affiliation_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Affiliations.md b/docs/apis/public_v2/docs/Affiliations.md new file mode 100644 index 00000000..f8d0ab21 --- /dev/null +++ b/docs/apis/public_v2/docs/Affiliations.md @@ -0,0 +1,28 @@ +# Affiliations + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.affiliations import Affiliations + +# TODO update the JSON string below +json = "{}" +# create an instance of Affiliations from a JSON string +affiliations_instance = Affiliations.from_json(json) +# print the JSON string representation of the object +print(Affiliations.to_json()) + +# convert the object into a dict +affiliations_dict = affiliations_instance.to_dict() +# create an instance of Affiliations from a dict +affiliations_form_dict = affiliations.from_dict(affiliations_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/AgentName.md b/docs/apis/public_v2/docs/AgentName.md new file mode 100644 index 00000000..9e545732 --- /dev/null +++ b/docs/apis/public_v2/docs/AgentName.md @@ -0,0 +1,28 @@ +# AgentName + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.agent_name import AgentName + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentName from a JSON string +agent_name_instance = AgentName.from_json(json) +# print the JSON string representation of the object +print(AgentName.to_json()) + +# convert the object into a dict +agent_name_dict = agent_name_instance.to_dict() +# create an instance of AgentName from a dict +agent_name_form_dict = agent_name.from_dict(agent_name_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Aggs.md b/docs/apis/public_v2/docs/Aggs.md new file mode 100644 index 00000000..ffecd641 --- /dev/null +++ b/docs/apis/public_v2/docs/Aggs.md @@ -0,0 +1,28 @@ +# Aggs + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.aggs import Aggs + +# TODO update the JSON string below +json = "{}" +# create an instance of Aggs from a JSON string +aggs_instance = Aggs.from_json(json) +# print the JSON string representation of the object +print(Aggs.to_json()) + +# convert the object into a dict +aggs_dict = aggs_instance.to_dict() +# create an instance of Aggs from a dict +aggs_form_dict = aggs.from_dict(aggs_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Alias.md b/docs/apis/public_v2/docs/Alias.md new file mode 100644 index 00000000..2a3acf59 --- /dev/null +++ b/docs/apis/public_v2/docs/Alias.md @@ -0,0 +1,29 @@ +# Alias + +A list of tags (aliases) for the collection. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.alias import Alias + +# TODO update the JSON string below +json = "{}" +# create an instance of Alias from a JSON string +alias_instance = Alias.from_json(json) +# print the JSON string representation of the object +print(Alias.to_json()) + +# convert the object into a dict +alias_dict = alias_instance.to_dict() +# create an instance of Alias from a dict +alias_form_dict = alias.from_dict(alias_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Aliases.md b/docs/apis/public_v2/docs/Aliases.md new file mode 100644 index 00000000..6fb4a657 --- /dev/null +++ b/docs/apis/public_v2/docs/Aliases.md @@ -0,0 +1,28 @@ +# Aliases + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.aliases import Aliases + +# TODO update the JSON string below +json = "{}" +# create an instance of Aliases from a JSON string +aliases_instance = Aliases.from_json(json) +# print the JSON string representation of the object +print(Aliases.to_json()) + +# convert the object into a dict +aliases_dict = aliases_instance.to_dict() +# create an instance of Aliases from a dict +aliases_form_dict = aliases.from_dict(aliases_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/AlternateNames.md b/docs/apis/public_v2/docs/AlternateNames.md new file mode 100644 index 00000000..b4d182ea --- /dev/null +++ b/docs/apis/public_v2/docs/AlternateNames.md @@ -0,0 +1,29 @@ +# AlternateNames + +Other names or abbreviations of this publication. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.alternate_names import AlternateNames + +# TODO update the JSON string below +json = "{}" +# create an instance of AlternateNames from a JSON string +alternate_names_instance = AlternateNames.from_json(json) +# print the JSON string representation of the object +print(AlternateNames.to_json()) + +# convert the object into a dict +alternate_names_dict = alternate_names_instance.to_dict() +# create an instance of AlternateNames from a dict +alternate_names_form_dict = alternate_names.from_dict(alternate_names_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource.md b/docs/apis/public_v2/docs/ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource.md new file mode 100644 index 00000000..2a6cc4ac --- /dev/null +++ b/docs/apis/public_v2/docs/ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource.md @@ -0,0 +1,31 @@ +# ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**download_url** | **str** | | +**head_url** | [**HeadUrl**](HeadUrl.md) | | [optional] +**headers** | **object** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.api_server_fastapi_server_public_models_data_indices_upload_models_http_source import ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource from a JSON string +api_server_fastapi_server_public_models_data_indices_upload_models_http_source_instance = ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource.from_json(json) +# print the JSON string representation of the object +print(ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource.to_json()) + +# convert the object into a dict +api_server_fastapi_server_public_models_data_indices_upload_models_http_source_dict = api_server_fastapi_server_public_models_data_indices_upload_models_http_source_instance.to_dict() +# create an instance of ApiServerFastapiServerPublicModelsDataIndicesUploadModelsHttpSource from a dict +api_server_fastapi_server_public_models_data_indices_upload_models_http_source_form_dict = api_server_fastapi_server_public_models_data_indices_upload_models_http_source.from_dict(api_server_fastapi_server_public_models_data_indices_upload_models_http_source_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier.md b/docs/apis/public_v2/docs/ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier.md new file mode 100644 index 00000000..c5c27399 --- /dev/null +++ b/docs/apis/public_v2/docs/ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier.md @@ -0,0 +1,31 @@ +# ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | +**name** | **str** | | +**value** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.api_server_fastapi_server_public_models_data_indices_upload_models_identifier import ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier from a JSON string +api_server_fastapi_server_public_models_data_indices_upload_models_identifier_instance = ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier.from_json(json) +# print the JSON string representation of the object +print(ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier.to_json()) + +# convert the object into a dict +api_server_fastapi_server_public_models_data_indices_upload_models_identifier_dict = api_server_fastapi_server_public_models_data_indices_upload_models_identifier_instance.to_dict() +# create an instance of ApiServerFastapiServerPublicModelsDataIndicesUploadModelsIdentifier from a dict +api_server_fastapi_server_public_models_data_indices_upload_models_identifier_form_dict = api_server_fastapi_server_public_models_data_indices_upload_models_identifier.from_dict(api_server_fastapi_server_public_models_data_indices_upload_models_identifier_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ApiServerFastapiServerPublicModelsProjectModelsHttpSource.md b/docs/apis/public_v2/docs/ApiServerFastapiServerPublicModelsProjectModelsHttpSource.md new file mode 100644 index 00000000..c51abee6 --- /dev/null +++ b/docs/apis/public_v2/docs/ApiServerFastapiServerPublicModelsProjectModelsHttpSource.md @@ -0,0 +1,30 @@ +# ApiServerFastapiServerPublicModelsProjectModelsHttpSource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | | +**headers** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.api_server_fastapi_server_public_models_project_models_http_source import ApiServerFastapiServerPublicModelsProjectModelsHttpSource + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiServerFastapiServerPublicModelsProjectModelsHttpSource from a JSON string +api_server_fastapi_server_public_models_project_models_http_source_instance = ApiServerFastapiServerPublicModelsProjectModelsHttpSource.from_json(json) +# print the JSON string representation of the object +print(ApiServerFastapiServerPublicModelsProjectModelsHttpSource.to_json()) + +# convert the object into a dict +api_server_fastapi_server_public_models_project_models_http_source_dict = api_server_fastapi_server_public_models_project_models_http_source_instance.to_dict() +# create an instance of ApiServerFastapiServerPublicModelsProjectModelsHttpSource from a dict +api_server_fastapi_server_public_models_project_models_http_source_form_dict = api_server_fastapi_server_public_models_project_models_http_source.from_dict(api_server_fastapi_server_public_models_project_models_http_source_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Author.md b/docs/apis/public_v2/docs/Author.md new file mode 100644 index 00000000..e45f7fde --- /dev/null +++ b/docs/apis/public_v2/docs/Author.md @@ -0,0 +1,33 @@ +# Author + +Author. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**id** | [**Id**](Id.md) | | [optional] +**source** | [**Source**](Source.md) | | [optional] +**affiliations** | [**Affiliations**](Affiliations.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.author import Author + +# TODO update the JSON string below +json = "{}" +# create an instance of Author from a JSON string +author_instance = Author.from_json(json) +# print the JSON string representation of the object +print(Author.to_json()) + +# convert the object into a dict +author_dict = author_instance.to_dict() +# create an instance of Author from a dict +author_form_dict = author.from_dict(author_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Authors.md b/docs/apis/public_v2/docs/Authors.md new file mode 100644 index 00000000..486939c7 --- /dev/null +++ b/docs/apis/public_v2/docs/Authors.md @@ -0,0 +1,28 @@ +# Authors + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.authors import Authors + +# TODO update the JSON string below +json = "{}" +# create an instance of Authors from a JSON string +authors_instance = Authors.from_json(json) +# print the JSON string representation of the object +print(Authors.to_json()) + +# convert the object into a dict +authors_dict = authors_instance.to_dict() +# create an instance of Authors from a dict +authors_form_dict = authors.from_dict(authors_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Backend.md b/docs/apis/public_v2/docs/Backend.md new file mode 100644 index 00000000..d8871731 --- /dev/null +++ b/docs/apis/public_v2/docs/Backend.md @@ -0,0 +1,28 @@ +# Backend + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.backend import Backend + +# TODO update the JSON string below +json = "{}" +# create an instance of Backend from a JSON string +backend_instance = Backend.from_json(json) +# print the JSON string representation of the object +print(Backend.to_json()) + +# convert the object into a dict +backend_dict = backend_instance.to_dict() +# create an instance of Backend from a dict +backend_form_dict = backend.from_dict(backend_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/BackendSettings.md b/docs/apis/public_v2/docs/BackendSettings.md new file mode 100644 index 00000000..ef91b87c --- /dev/null +++ b/docs/apis/public_v2/docs/BackendSettings.md @@ -0,0 +1,28 @@ +# BackendSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.backend_settings import BackendSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of BackendSettings from a JSON string +backend_settings_instance = BackendSettings.from_json(json) +# print the JSON string representation of the object +print(BackendSettings.to_json()) + +# convert the object into a dict +backend_settings_dict = backend_settings_instance.to_dict() +# create an instance of BackendSettings from a dict +backend_settings_form_dict = backend_settings.from_dict(backend_settings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/BeginDate.md b/docs/apis/public_v2/docs/BeginDate.md new file mode 100644 index 00000000..33a4ea97 --- /dev/null +++ b/docs/apis/public_v2/docs/BeginDate.md @@ -0,0 +1,28 @@ +# BeginDate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.begin_date import BeginDate + +# TODO update the JSON string below +json = "{}" +# create an instance of BeginDate from a JSON string +begin_date_instance = BeginDate.from_json(json) +# print the JSON string representation of the object +print(BeginDate.to_json()) + +# convert the object into a dict +begin_date_dict = begin_date_instance.to_dict() +# create an instance of BeginDate from a dict +begin_date_form_dict = begin_date.from_dict(begin_date_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/CcsTask.md b/docs/apis/public_v2/docs/CcsTask.md deleted file mode 100644 index 262395fc..00000000 --- a/docs/apis/public_v2/docs/CcsTask.md +++ /dev/null @@ -1,31 +0,0 @@ -# CcsTask - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**task_id** | **str** | | -**ccs_project_key** | **str** | | -**ccs_collection_name** | **str** | | - -## Example - -```python -from deepsearch.cps.apis.public_v2.models.ccs_task import CcsTask - -# TODO update the JSON string below -json = "{}" -# create an instance of CcsTask from a JSON string -ccs_task_instance = CcsTask.from_json(json) -# print the JSON string representation of the object -print(CcsTask.to_json()) - -# convert the object into a dict -ccs_task_dict = ccs_task_instance.to_dict() -# create an instance of CcsTask from a dict -ccs_task_form_dict = ccs_task.from_dict(ccs_task_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/apis/public_v2/docs/CitationCount.md b/docs/apis/public_v2/docs/CitationCount.md new file mode 100644 index 00000000..797c9983 --- /dev/null +++ b/docs/apis/public_v2/docs/CitationCount.md @@ -0,0 +1,29 @@ +# CitationCount + +Total number of citations that this document has received (number of documents in whose bibliography this document appears). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.citation_count import CitationCount + +# TODO update the JSON string below +json = "{}" +# create an instance of CitationCount from a JSON string +citation_count_instance = CitationCount.from_json(json) +# print the JSON string representation of the object +print(CitationCount.to_json()) + +# convert the object into a dict +citation_count_dict = citation_count_instance.to_dict() +# create an instance of CitationCount from a dict +citation_count_form_dict = citation_count.from_dict(citation_count_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/CitationCountDate.md b/docs/apis/public_v2/docs/CitationCountDate.md new file mode 100644 index 00000000..1955963f --- /dev/null +++ b/docs/apis/public_v2/docs/CitationCountDate.md @@ -0,0 +1,29 @@ +# CitationCountDate + +Last update date of the citation count. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.citation_count_date import CitationCountDate + +# TODO update the JSON string below +json = "{}" +# create an instance of CitationCountDate from a JSON string +citation_count_date_instance = CitationCountDate.from_json(json) +# print the JSON string representation of the object +print(CitationCountDate.to_json()) + +# convert the object into a dict +citation_count_date_dict = citation_count_date_instance.to_dict() +# create an instance of CitationCountDate from a dict +citation_count_date_form_dict = citation_count_date.from_dict(citation_count_date_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Code.md b/docs/apis/public_v2/docs/Code.md new file mode 100644 index 00000000..4cd08eb7 --- /dev/null +++ b/docs/apis/public_v2/docs/Code.md @@ -0,0 +1,28 @@ +# Code + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.code import Code + +# TODO update the JSON string below +json = "{}" +# create an instance of Code from a JSON string +code_instance = Code.from_json(json) +# print the JSON string representation of the object +print(Code.to_json()) + +# convert the object into a dict +code_dict = code_instance.to_dict() +# create an instance of Code from a dict +code_form_dict = code.from_dict(code_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/CollectionDocumentInfoStr.md b/docs/apis/public_v2/docs/CollectionDocumentInfoStr.md new file mode 100644 index 00000000..5c28deb3 --- /dev/null +++ b/docs/apis/public_v2/docs/CollectionDocumentInfoStr.md @@ -0,0 +1,32 @@ +# CollectionDocumentInfoStr + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | [**Name**](Name.md) | | [optional] +**type** | **object** | The collection type. | +**version** | [**Version**](Version.md) | | [optional] +**alias** | [**Alias**](Alias.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.collection_document_info_str import CollectionDocumentInfoStr + +# TODO update the JSON string below +json = "{}" +# create an instance of CollectionDocumentInfoStr from a JSON string +collection_document_info_str_instance = CollectionDocumentInfoStr.from_json(json) +# print the JSON string representation of the object +print(CollectionDocumentInfoStr.to_json()) + +# convert the object into a dict +collection_document_info_str_dict = collection_document_info_str_instance.to_dict() +# create an instance of CollectionDocumentInfoStr from a dict +collection_document_info_str_form_dict = collection_document_info_str.from_dict(collection_document_info_str_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/CollectionMetadataSettings.md b/docs/apis/public_v2/docs/CollectionMetadataSettings.md index 6b9dd94f..75c69f99 100644 --- a/docs/apis/public_v2/docs/CollectionMetadataSettings.md +++ b/docs/apis/public_v2/docs/CollectionMetadataSettings.md @@ -5,11 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**description** | **str** | | [optional] -**display_name** | **str** | | [optional] -**license** | **str** | | [optional] -**source** | **str** | | [optional] -**version** | **str** | | [optional] +**description** | [**Description**](Description.md) | | [optional] +**display_name** | [**DisplayName**](DisplayName.md) | | [optional] +**license** | [**License**](License.md) | | [optional] +**source** | [**Source1**](Source1.md) | | [optional] +**version** | [**Version1**](Version1.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/Comment.md b/docs/apis/public_v2/docs/Comment.md new file mode 100644 index 00000000..7f131b29 --- /dev/null +++ b/docs/apis/public_v2/docs/Comment.md @@ -0,0 +1,29 @@ +# Comment + +A description of the task or any comments in natural language. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.comment import Comment + +# TODO update the JSON string below +json = "{}" +# create an instance of Comment from a JSON string +comment_instance = Comment.from_json(json) +# print the JSON string representation of the object +print(Comment.to_json()) + +# convert the object into a dict +comment_dict = comment_instance.to_dict() +# create an instance of Comment from a dict +comment_form_dict = comment.from_dict(comment_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/CompletedAt.md b/docs/apis/public_v2/docs/CompletedAt.md new file mode 100644 index 00000000..5b23c7ae --- /dev/null +++ b/docs/apis/public_v2/docs/CompletedAt.md @@ -0,0 +1,28 @@ +# CompletedAt + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.completed_at import CompletedAt + +# TODO update the JSON string below +json = "{}" +# create an instance of CompletedAt from a JSON string +completed_at_instance = CompletedAt.from_json(json) +# print the JSON string representation of the object +print(CompletedAt.to_json()) + +# convert the object into a dict +completed_at_dict = completed_at_instance.to_dict() +# create an instance of CompletedAt from a dict +completed_at_form_dict = completed_at.from_dict(completed_at_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Config.md b/docs/apis/public_v2/docs/Config.md index 94ddf9a6..ce10fffa 100644 --- a/docs/apis/public_v2/docs/Config.md +++ b/docs/apis/public_v2/docs/Config.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **kind** | **object** | | [optional] **config** | [**GenAIAWSBedrockConfig**](GenAIAWSBedrockConfig.md) | | -**proj_params** | [**GenAIPartialParams**](GenAIPartialParams.md) | | [optional] +**proj_params** | [**GenAIAWSBedrockProjParams**](GenAIAWSBedrockProjParams.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/ContentManagerApi.md b/docs/apis/public_v2/docs/ContentManagerApi.md index 3ad6ca46..afa11905 100644 --- a/docs/apis/public_v2/docs/ContentManagerApi.md +++ b/docs/apis/public_v2/docs/ContentManagerApi.md @@ -4,6 +4,7 @@ All URIs are relative to */api/cps/public/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**add_project_data_index_document_metadata**](ContentManagerApi.md#add_project_data_index_document_metadata) | **POST** /project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/metadata | Add Project Data Index Document Metadata [**get_all_project_data_index_documents**](ContentManagerApi.md#get_all_project_data_index_documents) | **GET** /project/{proj_key}/data_indices/{index_key}/documents/ | Get All Project Data Index Documents [**get_project_agents**](ContentManagerApi.md#get_project_agents) | **GET** /project/{proj_key}/data_indices/documents/agents | Get Project Agents [**get_project_conversion_statistics**](ContentManagerApi.md#get_project_conversion_statistics) | **GET** /project/{proj_key}/data_indices/{index_key}/documents/statistics | Get Project Conversion Statistics @@ -19,6 +20,90 @@ Method | HTTP request | Description [**get_project_index_upload_jobs**](ContentManagerApi.md#get_project_index_upload_jobs) | **GET** /project/{proj_key}/data_indices/{index_key}/documents/upload_jobs | Get Project Index Upload Jobs +# **add_project_data_index_document_metadata** +> add_project_data_index_document_metadata(index_key, document_hash, proj_key, document_meta) + +Add Project Data Index Document Metadata + +Insert project document metadata. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.document_meta import DocumentMeta +from deepsearch.cps.apis.public_v2.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/cps/public/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = deepsearch.cps.apis.public_v2.Configuration( + host = "/api/cps/public/v2" +) + +# 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. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = deepsearch.cps.apis.public_v2.ContentManagerApi(api_client) + index_key = 'index_key_example' # str | + document_hash = 'document_hash_example' # str | + proj_key = 'proj_key_example' # str | + document_meta = deepsearch.cps.apis.public_v2.DocumentMeta() # DocumentMeta | + + try: + # Add Project Data Index Document Metadata + api_instance.add_project_data_index_document_metadata(index_key, document_hash, proj_key, document_meta) + except Exception as e: + print("Exception when calling ContentManagerApi->add_project_data_index_document_metadata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **document_hash** | **str**| | + **proj_key** | **str**| | + **document_meta** | [**DocumentMeta**](DocumentMeta.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | 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) + # **get_all_project_data_index_documents** > ProjectDocuments get_all_project_data_index_documents(index_key, proj_key, page=page, page_size=page_size) @@ -364,6 +449,7 @@ Get events of a project document. ```python import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.status_filter import StatusFilter from deepsearch.cps.apis.public_v2.rest import ApiException from pprint import pprint @@ -391,8 +477,8 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: index_key = 'index_key_example' # str | document_hash = 'document_hash_example' # str | proj_key = 'proj_key_example' # str | - agent_name = 'agent_name_example' # str | (optional) - status = 'status_example' # str | (optional) + agent_name = deepsearch.cps.apis.public_v2.AgentName() # AgentName | (optional) + status = deepsearch.cps.apis.public_v2.StatusFilter() # StatusFilter | (optional) try: # Get Project Data Index Document Events @@ -413,8 +499,8 @@ Name | Type | Description | Notes **index_key** | **str**| | **document_hash** | **str**| | **proj_key** | **str**| | - **agent_name** | **str**| | [optional] - **status** | **str**| | [optional] + **agent_name** | [**AgentName**](.md)| | [optional] + **status** | [**StatusFilter**](.md)| | [optional] ### Return type @@ -620,6 +706,7 @@ Get project documents, can be filter by status. ```python import deepsearch.cps.apis.public_v2 from deepsearch.cps.apis.public_v2.models.project_documents import ProjectDocuments +from deepsearch.cps.apis.public_v2.models.status_filter import StatusFilter from deepsearch.cps.apis.public_v2.rest import ApiException from pprint import pprint @@ -647,7 +734,7 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: index_key = 'index_key_example' # str | agent_name = 'agent_name_example' # str | proj_key = 'proj_key_example' # str | - status = 'status_example' # str | (optional) + status = deepsearch.cps.apis.public_v2.StatusFilter() # StatusFilter | (optional) page = 1 # int | (optional) (default to 1) page_size = 25 # int | (optional) (default to 25) @@ -670,7 +757,7 @@ Name | Type | Description | Notes **index_key** | **str**| | **agent_name** | **str**| | **proj_key** | **str**| | - **status** | **str**| | [optional] + **status** | [**StatusFilter**](.md)| | [optional] **page** | **int**| | [optional] [default to 1] **page_size** | **int**| | [optional] [default to 25] @@ -710,6 +797,7 @@ Get project documents grouped by upload. ```python import deepsearch.cps.apis.public_v2 from deepsearch.cps.apis.public_v2.models.response_grouped_documents import ResponseGroupedDocuments +from deepsearch.cps.apis.public_v2.models.status_filter import StatusFilter from deepsearch.cps.apis.public_v2.rest import ApiException from pprint import pprint @@ -737,7 +825,7 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: index_key = 'index_key_example' # str | agent_name = 'agent_name_example' # str | proj_key = 'proj_key_example' # str | - status = 'status_example' # str | (optional) + status = deepsearch.cps.apis.public_v2.StatusFilter() # StatusFilter | (optional) page = 1 # int | (optional) (default to 1) page_size = 25 # int | (optional) (default to 25) @@ -760,7 +848,7 @@ Name | Type | Description | Notes **index_key** | **str**| | **agent_name** | **str**| | **proj_key** | **str**| | - **status** | **str**| | [optional] + **status** | [**StatusFilter**](.md)| | [optional] **page** | **int**| | [optional] [default to 1] **page_size** | **int**| | [optional] [default to 25] diff --git a/docs/apis/public_v2/docs/ConversionSettings.md b/docs/apis/public_v2/docs/ConversionSettings.md new file mode 100644 index 00000000..66340169 --- /dev/null +++ b/docs/apis/public_v2/docs/ConversionSettings.md @@ -0,0 +1,37 @@ +# ConversionSettings + +Specify the conversion settings to use. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ocr** | [**PartialDirectConversionParametersOcr**](PartialDirectConversionParametersOcr.md) | | [optional] +**table_structure** | [**TableStructureOptions**](TableStructureOptions.md) | | [optional] +**generate_page_images** | **object** | | [optional] +**type** | **object** | | [optional] +**assemble** | [**PartialDirectConversionParametersAssemble**](PartialDirectConversionParametersAssemble.md) | | [optional] +**metadata** | [**PartialDirectConversionParametersMetadata**](PartialDirectConversionParametersMetadata.md) | | [optional] +**page_labels** | [**PageLabels**](PageLabels.md) | | [optional] +**model_pipeline** | [**PartialDirectConversionParametersModelPipeline**](PartialDirectConversionParametersModelPipeline.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.conversion_settings import ConversionSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of ConversionSettings from a JSON string +conversion_settings_instance = ConversionSettings.from_json(json) +# print the JSON string representation of the object +print(ConversionSettings.to_json()) + +# convert the object into a dict +conversion_settings_dict = conversion_settings_instance.to_dict() +# create an instance of ConversionSettings from a dict +conversion_settings_form_dict = conversion_settings.from_dict(conversion_settings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ConvertDocumentRequest.md b/docs/apis/public_v2/docs/ConvertDocumentRequest.md index dfce43de..3a232833 100644 --- a/docs/apis/public_v2/docs/ConvertDocumentRequest.md +++ b/docs/apis/public_v2/docs/ConvertDocumentRequest.md @@ -5,8 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**http_source** | [**HttpSource**](HttpSource.md) | | [optional] -**file_source** | [**FileSource**](FileSource.md) | | [optional] +**http_source** | [**ConvertDocumentRequestHttpSource**](ConvertDocumentRequestHttpSource.md) | | [optional] +**file_source** | [**ConvertDocumentRequestFileSource**](ConvertDocumentRequestFileSource.md) | | [optional] +**settings** | [**ConvertDocumentRequestSettings**](ConvertDocumentRequestSettings.md) | | [optional] +**image_urls** | [**ConvertDocumentRequestImageUrls**](ConvertDocumentRequestImageUrls.md) | | [optional] +**truncate_pages** | [**TruncatePages**](TruncatePages.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/ConvertDocumentRequestFileSource.md b/docs/apis/public_v2/docs/ConvertDocumentRequestFileSource.md new file mode 100644 index 00000000..ea9f2731 --- /dev/null +++ b/docs/apis/public_v2/docs/ConvertDocumentRequestFileSource.md @@ -0,0 +1,30 @@ +# ConvertDocumentRequestFileSource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**base64_string** | **object** | | +**filename** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.convert_document_request_file_source import ConvertDocumentRequestFileSource + +# TODO update the JSON string below +json = "{}" +# create an instance of ConvertDocumentRequestFileSource from a JSON string +convert_document_request_file_source_instance = ConvertDocumentRequestFileSource.from_json(json) +# print the JSON string representation of the object +print(ConvertDocumentRequestFileSource.to_json()) + +# convert the object into a dict +convert_document_request_file_source_dict = convert_document_request_file_source_instance.to_dict() +# create an instance of ConvertDocumentRequestFileSource from a dict +convert_document_request_file_source_form_dict = convert_document_request_file_source.from_dict(convert_document_request_file_source_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ConvertDocumentRequestHttpSource.md b/docs/apis/public_v2/docs/ConvertDocumentRequestHttpSource.md new file mode 100644 index 00000000..1bd1f0be --- /dev/null +++ b/docs/apis/public_v2/docs/ConvertDocumentRequestHttpSource.md @@ -0,0 +1,30 @@ +# ConvertDocumentRequestHttpSource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **object** | | +**headers** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.convert_document_request_http_source import ConvertDocumentRequestHttpSource + +# TODO update the JSON string below +json = "{}" +# create an instance of ConvertDocumentRequestHttpSource from a JSON string +convert_document_request_http_source_instance = ConvertDocumentRequestHttpSource.from_json(json) +# print the JSON string representation of the object +print(ConvertDocumentRequestHttpSource.to_json()) + +# convert the object into a dict +convert_document_request_http_source_dict = convert_document_request_http_source_instance.to_dict() +# create an instance of ConvertDocumentRequestHttpSource from a dict +convert_document_request_http_source_form_dict = convert_document_request_http_source.from_dict(convert_document_request_http_source_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ConvertDocumentRequestImageUrls.md b/docs/apis/public_v2/docs/ConvertDocumentRequestImageUrls.md new file mode 100644 index 00000000..a33b6570 --- /dev/null +++ b/docs/apis/public_v2/docs/ConvertDocumentRequestImageUrls.md @@ -0,0 +1,28 @@ +# ConvertDocumentRequestImageUrls + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.convert_document_request_image_urls import ConvertDocumentRequestImageUrls + +# TODO update the JSON string below +json = "{}" +# create an instance of ConvertDocumentRequestImageUrls from a JSON string +convert_document_request_image_urls_instance = ConvertDocumentRequestImageUrls.from_json(json) +# print the JSON string representation of the object +print(ConvertDocumentRequestImageUrls.to_json()) + +# convert the object into a dict +convert_document_request_image_urls_dict = convert_document_request_image_urls_instance.to_dict() +# create an instance of ConvertDocumentRequestImageUrls from a dict +convert_document_request_image_urls_form_dict = convert_document_request_image_urls.from_dict(convert_document_request_image_urls_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ConvertDocumentRequestSettings.md b/docs/apis/public_v2/docs/ConvertDocumentRequestSettings.md new file mode 100644 index 00000000..d1cc56c7 --- /dev/null +++ b/docs/apis/public_v2/docs/ConvertDocumentRequestSettings.md @@ -0,0 +1,31 @@ +# ConvertDocumentRequestSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ocr** | [**OCROptions**](OCROptions.md) | | [optional] +**table_structure** | [**TableStructureOptions**](TableStructureOptions.md) | | [optional] +**generate_page_images** | **object** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.convert_document_request_settings import ConvertDocumentRequestSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of ConvertDocumentRequestSettings from a JSON string +convert_document_request_settings_instance = ConvertDocumentRequestSettings.from_json(json) +# print the JSON string representation of the object +print(ConvertDocumentRequestSettings.to_json()) + +# convert the object into a dict +convert_document_request_settings_dict = convert_document_request_settings_instance.to_dict() +# create an instance of ConvertDocumentRequestSettings from a dict +convert_document_request_settings_form_dict = convert_document_request_settings.from_dict(convert_document_request_settings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ConvertDocumentsRequestBody.md b/docs/apis/public_v2/docs/ConvertDocumentsRequestBody.md index 93f757c1..83cecd49 100644 --- a/docs/apis/public_v2/docs/ConvertDocumentsRequestBody.md +++ b/docs/apis/public_v2/docs/ConvertDocumentsRequestBody.md @@ -5,11 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**conversion_settings** | [**PartialDirectConversionParameters**](PartialDirectConversionParameters.md) | Specify the conversion settings to use. | [optional] -**target_settings** | [**TargetConversionParameters**](TargetConversionParameters.md) | Specify the target settings to use. | [optional] -**document_hashes** | **List[str]** | List of document hashes to be used as filter. | [optional] -**without_operations** | **List[str]** | List of Operation Status documents don't have to be used as filter. | [optional] -**upload_to_elastic** | **bool** | | [optional] +**conversion_settings** | [**ConversionSettings**](ConversionSettings.md) | | [optional] +**target_settings** | [**ConvertDocumentsRequestBodyTargetSettings**](ConvertDocumentsRequestBodyTargetSettings.md) | | [optional] +**document_hashes** | [**DocumentHashes**](DocumentHashes.md) | | [optional] +**without_operations** | [**WithoutOperations**](WithoutOperations.md) | | [optional] +**upload_to_elastic** | [**UploadToElastic**](UploadToElastic.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/ConvertDocumentsRequestBodyTargetSettings.md b/docs/apis/public_v2/docs/ConvertDocumentsRequestBodyTargetSettings.md new file mode 100644 index 00000000..0c7dc7a8 --- /dev/null +++ b/docs/apis/public_v2/docs/ConvertDocumentsRequestBodyTargetSettings.md @@ -0,0 +1,31 @@ +# ConvertDocumentsRequestBodyTargetSettings + +Specify the target settings to use. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**add_raw_pages** | [**AddRawPages**](AddRawPages.md) | | [optional] +**add_annotations** | [**AddAnnotations**](AddAnnotations.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.convert_documents_request_body_target_settings import ConvertDocumentsRequestBodyTargetSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of ConvertDocumentsRequestBodyTargetSettings from a JSON string +convert_documents_request_body_target_settings_instance = ConvertDocumentsRequestBodyTargetSettings.from_json(json) +# print the JSON string representation of the object +print(ConvertDocumentsRequestBodyTargetSettings.to_json()) + +# convert the object into a dict +convert_documents_request_body_target_settings_dict = convert_documents_request_body_target_settings_instance.to_dict() +# create an instance of ConvertDocumentsRequestBodyTargetSettings from a dict +convert_documents_request_body_target_settings_form_dict = convert_documents_request_body_target_settings.from_dict(convert_documents_request_body_target_settings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ConvertDocumentsSources.md b/docs/apis/public_v2/docs/ConvertDocumentsSources.md index 6ce0a065..3a8cbde1 100644 --- a/docs/apis/public_v2/docs/ConvertDocumentsSources.md +++ b/docs/apis/public_v2/docs/ConvertDocumentsSources.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**file_url** | **List[str]** | List of File's URL to be converted and uploaded to the data index. | [optional] -**internal_file_url** | [**List[InternalUrl]**](InternalUrl.md) | List of Internal File's URLs to be converted and uploaded to the data index. | [optional] -**s3_source** | [**S3DocumentSource**](S3DocumentSource.md) | Coordinates to object store to get files to convert. Can specify which files with object keys. | [optional] +**file_url** | [**FileUrl**](FileUrl.md) | | [optional] +**http_source** | [**HttpSource**](HttpSource.md) | | [optional] +**s3_source** | [**ConvertDocumentsSourcesS3Source**](ConvertDocumentsSourcesS3Source.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/ConvertDocumentsSourcesS3Source.md b/docs/apis/public_v2/docs/ConvertDocumentsSourcesS3Source.md new file mode 100644 index 00000000..37eaf4f2 --- /dev/null +++ b/docs/apis/public_v2/docs/ConvertDocumentsSourcesS3Source.md @@ -0,0 +1,31 @@ +# ConvertDocumentsSourcesS3Source + +Coordinates to object store to get files to convert. Can specify which files with object keys. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**coordinates** | [**S3Coordinates**](S3Coordinates.md) | | +**object_keys** | [**ObjectKeys**](ObjectKeys.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.convert_documents_sources_s3_source import ConvertDocumentsSourcesS3Source + +# TODO update the JSON string below +json = "{}" +# create an instance of ConvertDocumentsSourcesS3Source from a JSON string +convert_documents_sources_s3_source_instance = ConvertDocumentsSourcesS3Source.from_json(json) +# print the JSON string representation of the object +print(ConvertDocumentsSourcesS3Source.to_json()) + +# convert the object into a dict +convert_documents_sources_s3_source_dict = convert_documents_sources_s3_source_instance.to_dict() +# create an instance of ConvertDocumentsSourcesS3Source from a dict +convert_documents_sources_s3_source_form_dict = convert_documents_sources_s3_source.from_dict(convert_documents_sources_s3_source_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ConvertUploadDocumentsRequestBody.md b/docs/apis/public_v2/docs/ConvertUploadDocumentsRequestBody.md index b03b375b..ce983f33 100644 --- a/docs/apis/public_v2/docs/ConvertUploadDocumentsRequestBody.md +++ b/docs/apis/public_v2/docs/ConvertUploadDocumentsRequestBody.md @@ -5,12 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**file_url** | **List[str]** | List of File's URL to be converted and uploaded to the data index. | [optional] -**internal_file_url** | [**List[InternalUrl]**](InternalUrl.md) | List of Internal File's URLs to be converted and uploaded to the data index. | [optional] -**s3_source** | [**S3DocumentSource**](S3DocumentSource.md) | Coordinates to object store to get files to convert. Can specify which files with object keys. | [optional] -**upload_to_elastic** | **bool** | | [optional] -**conversion_settings** | [**PartialDirectConversionParameters**](PartialDirectConversionParameters.md) | Specify the conversion settings to use. | [optional] -**target_settings** | [**TargetConversionParameters**](TargetConversionParameters.md) | Specify the target settings to use. | [optional] +**file_url** | [**FileUrl**](FileUrl.md) | | [optional] +**http_source** | [**HttpSource**](HttpSource.md) | | [optional] +**s3_source** | [**ConvertDocumentsSourcesS3Source**](ConvertDocumentsSourcesS3Source.md) | | [optional] +**upload_to_elastic** | [**UploadToElastic**](UploadToElastic.md) | | [optional] +**meta** | [**ConvertUploadDocumentsRequestBodyMeta**](ConvertUploadDocumentsRequestBodyMeta.md) | | [optional] +**conversion_settings** | [**ConversionSettings**](ConversionSettings.md) | | [optional] +**target_settings** | [**ConvertDocumentsRequestBodyTargetSettings**](ConvertDocumentsRequestBodyTargetSettings.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/ConvertUploadDocumentsRequestBodyMeta.md b/docs/apis/public_v2/docs/ConvertUploadDocumentsRequestBodyMeta.md new file mode 100644 index 00000000..26e91d1c --- /dev/null +++ b/docs/apis/public_v2/docs/ConvertUploadDocumentsRequestBodyMeta.md @@ -0,0 +1,31 @@ +# ConvertUploadDocumentsRequestBodyMeta + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filename** | [**Filename**](Filename.md) | | [optional] +**description** | [**DocumentMetaDescription**](DocumentMetaDescription.md) | | [optional] +**identifiers** | [**Identifiers**](Identifiers.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.convert_upload_documents_request_body_meta import ConvertUploadDocumentsRequestBodyMeta + +# TODO update the JSON string below +json = "{}" +# create an instance of ConvertUploadDocumentsRequestBodyMeta from a JSON string +convert_upload_documents_request_body_meta_instance = ConvertUploadDocumentsRequestBodyMeta.from_json(json) +# print the JSON string representation of the object +print(ConvertUploadDocumentsRequestBodyMeta.to_json()) + +# convert the object into a dict +convert_upload_documents_request_body_meta_dict = convert_upload_documents_request_body_meta_instance.to_dict() +# create an instance of ConvertUploadDocumentsRequestBodyMeta from a dict +convert_upload_documents_request_body_meta_form_dict = convert_upload_documents_request_body_meta.from_dict(convert_upload_documents_request_body_meta_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Created.md b/docs/apis/public_v2/docs/Created.md new file mode 100644 index 00000000..bf4cc01a --- /dev/null +++ b/docs/apis/public_v2/docs/Created.md @@ -0,0 +1,28 @@ +# Created + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.created import Created + +# TODO update the JSON string below +json = "{}" +# create an instance of Created from a JSON string +created_instance = Created.from_json(json) +# print the JSON string representation of the object +print(Created.to_json()) + +# convert the object into a dict +created_dict = created_instance.to_dict() +# create an instance of Created from a dict +created_form_dict = created.from_dict(created_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Data.md b/docs/apis/public_v2/docs/Data.md index 0c83e8da..cbb4a612 100644 --- a/docs/apis/public_v2/docs/Data.md +++ b/docs/apis/public_v2/docs/Data.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **object** | | -**description** | **object** | | [optional] +**description** | [**Description**](Description.md) | | [optional] **view_of** | [**ViewOf**](ViewOf.md) | | **schema_key** | **object** | | [optional] diff --git a/docs/apis/public_v2/docs/DataIndexUploadFileSource.md b/docs/apis/public_v2/docs/DataIndexUploadFileSource.md index b435419e..9496b9c8 100644 --- a/docs/apis/public_v2/docs/DataIndexUploadFileSource.md +++ b/docs/apis/public_v2/docs/DataIndexUploadFileSource.md @@ -5,8 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**conversion_settings** | [**ConversionSettings**](ConversionSettings.md) | | [optional] +**target_settings** | [**ConvertDocumentsRequestBodyTargetSettings**](ConvertDocumentsRequestBodyTargetSettings.md) | | [optional] **urls** | [**Urls**](Urls.md) | | -**conversion_settings** | [**PartialDirectConversionParameters**](PartialDirectConversionParameters.md) | Specify the conversion settings to use. | [optional] +**headers** | [**Headers**](Headers.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/DataIndicesApi.md b/docs/apis/public_v2/docs/DataIndicesApi.md index 69ade51f..0b7b0189 100644 --- a/docs/apis/public_v2/docs/DataIndicesApi.md +++ b/docs/apis/public_v2/docs/DataIndicesApi.md @@ -8,8 +8,10 @@ Method | HTTP request | Description [**create_project_data_index_delete_token**](DataIndicesApi.md#create_project_data_index_delete_token) | **POST** /project/{proj_key}/data_indices/{index_key}/delete_token | Create Project Data Index Delete Token [**delete_project_data_index**](DataIndicesApi.md#delete_project_data_index) | **DELETE** /project/{proj_key}/data_indices/{index_key} | Delete Project Data Index [**get_project_data_index**](DataIndicesApi.md#get_project_data_index) | **GET** /project/{proj_key}/data_indices/{index_key} | Get Project Data Index +[**get_project_data_index_conversion_settings**](DataIndicesApi.md#get_project_data_index_conversion_settings) | **GET** /project/{proj_key}/data_indices/{index_key}/conversion_settings | Get Project Data Index Conversion Settings [**get_project_data_indices**](DataIndicesApi.md#get_project_data_indices) | **GET** /project/{proj_key}/data_indices | Get Project Data Indices [**update_project_data_index**](DataIndicesApi.md#update_project_data_index) | **PATCH** /project/{proj_key}/data_indices/{index_key} | Update Project Data Index +[**update_project_data_index_conversion_settings**](DataIndicesApi.md#update_project_data_index_conversion_settings) | **PATCH** /project/{proj_key}/data_indices/{index_key}/conversion_settings | Update Project Data Index Conversion Settings # **create_project_data_index** @@ -342,6 +344,88 @@ 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_project_data_index_conversion_settings** +> ResponseGetProjectDataIndexConversionSettings get_project_data_index_conversion_settings(index_key, proj_key) + +Get Project Data Index Conversion Settings + +Get project data index conversion settings. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.response_get_project_data_index_conversion_settings import ResponseGetProjectDataIndexConversionSettings +from deepsearch.cps.apis.public_v2.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/cps/public/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = deepsearch.cps.apis.public_v2.Configuration( + host = "/api/cps/public/v2" +) + +# 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. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = deepsearch.cps.apis.public_v2.DataIndicesApi(api_client) + index_key = 'index_key_example' # str | + proj_key = 'proj_key_example' # str | + + try: + # Get Project Data Index Conversion Settings + api_response = api_instance.get_project_data_index_conversion_settings(index_key, proj_key) + print("The response of DataIndicesApi->get_project_data_index_conversion_settings:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesApi->get_project_data_index_conversion_settings: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **proj_key** | **str**| | + +### Return type + +[**ResponseGetProjectDataIndexConversionSettings**](ResponseGetProjectDataIndexConversionSettings.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### 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) + # **get_project_data_indices** > List[ProjectDataIndexWithStatus] get_project_data_indices(proj_key) @@ -507,3 +591,88 @@ 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) +# **update_project_data_index_conversion_settings** +> ResponseUpdateProjectDataIndexConversionSettings update_project_data_index_conversion_settings(index_key, proj_key, project_data_index_conversion_settings_input) + +Update Project Data Index Conversion Settings + +Update a project data index conversion settings. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_input import ProjectDataIndexConversionSettingsInput +from deepsearch.cps.apis.public_v2.models.response_update_project_data_index_conversion_settings import ResponseUpdateProjectDataIndexConversionSettings +from deepsearch.cps.apis.public_v2.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/cps/public/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = deepsearch.cps.apis.public_v2.Configuration( + host = "/api/cps/public/v2" +) + +# 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. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = deepsearch.cps.apis.public_v2.DataIndicesApi(api_client) + index_key = 'index_key_example' # str | + proj_key = 'proj_key_example' # str | + project_data_index_conversion_settings_input = deepsearch.cps.apis.public_v2.ProjectDataIndexConversionSettingsInput() # ProjectDataIndexConversionSettingsInput | + + try: + # Update Project Data Index Conversion Settings + api_response = api_instance.update_project_data_index_conversion_settings(index_key, proj_key, project_data_index_conversion_settings_input) + print("The response of DataIndicesApi->update_project_data_index_conversion_settings:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesApi->update_project_data_index_conversion_settings: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **proj_key** | **str**| | + **project_data_index_conversion_settings_input** | [**ProjectDataIndexConversionSettingsInput**](ProjectDataIndexConversionSettingsInput.md)| | + +### Return type + +[**ResponseUpdateProjectDataIndexConversionSettings**](ResponseUpdateProjectDataIndexConversionSettings.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + diff --git a/docs/apis/public_v2/docs/DcKey.md b/docs/apis/public_v2/docs/DcKey.md new file mode 100644 index 00000000..0531d154 --- /dev/null +++ b/docs/apis/public_v2/docs/DcKey.md @@ -0,0 +1,28 @@ +# DcKey + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.dc_key import DcKey + +# TODO update the JSON string below +json = "{}" +# create an instance of DcKey from a JSON string +dc_key_instance = DcKey.from_json(json) +# print the JSON string representation of the object +print(DcKey.to_json()) + +# convert the object into a dict +dc_key_dict = dc_key_instance.to_dict() +# create an instance of DcKey from a dict +dc_key_form_dict = dc_key.from_dict(dc_key_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DecodeSecrets.md b/docs/apis/public_v2/docs/DecodeSecrets.md new file mode 100644 index 00000000..c2dfc0d6 --- /dev/null +++ b/docs/apis/public_v2/docs/DecodeSecrets.md @@ -0,0 +1,28 @@ +# DecodeSecrets + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.decode_secrets import DecodeSecrets + +# TODO update the JSON string below +json = "{}" +# create an instance of DecodeSecrets from a JSON string +decode_secrets_instance = DecodeSecrets.from_json(json) +# print the JSON string representation of the object +print(DecodeSecrets.to_json()) + +# convert the object into a dict +decode_secrets_dict = decode_secrets_instance.to_dict() +# create an instance of DecodeSecrets from a dict +decode_secrets_form_dict = decode_secrets.from_dict(decode_secrets_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DefaultValues.md b/docs/apis/public_v2/docs/DefaultValues.md index 680c5f6a..a57e20d0 100644 --- a/docs/apis/public_v2/docs/DefaultValues.md +++ b/docs/apis/public_v2/docs/DefaultValues.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ccs_project** | [**CCSProject**](CCSProject.md) | | -**dataflow** | [**DataFlow**](DataFlow.md) | | [optional] +**dataflow** | [**DefaultValuesDataflow**](DefaultValuesDataflow.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/DefaultValuesDataflow.md b/docs/apis/public_v2/docs/DefaultValuesDataflow.md new file mode 100644 index 00000000..1dc9612f --- /dev/null +++ b/docs/apis/public_v2/docs/DefaultValuesDataflow.md @@ -0,0 +1,30 @@ +# DefaultValuesDataflow + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**df_tpl_key** | **object** | | +**name** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.default_values_dataflow import DefaultValuesDataflow + +# TODO update the JSON string below +json = "{}" +# create an instance of DefaultValuesDataflow from a JSON string +default_values_dataflow_instance = DefaultValuesDataflow.from_json(json) +# print the JSON string representation of the object +print(DefaultValuesDataflow.to_json()) + +# convert the object into a dict +default_values_dataflow_dict = default_values_dataflow_instance.to_dict() +# create an instance of DefaultValuesDataflow from a dict +default_values_dataflow_form_dict = default_values_dataflow.from_dict(default_values_dataflow_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Description.md b/docs/apis/public_v2/docs/Description.md new file mode 100644 index 00000000..b1724036 --- /dev/null +++ b/docs/apis/public_v2/docs/Description.md @@ -0,0 +1,28 @@ +# Description + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.description import Description + +# TODO update the JSON string below +json = "{}" +# create an instance of Description from a JSON string +description_instance = Description.from_json(json) +# print the JSON string representation of the object +print(Description.to_json()) + +# convert the object into a dict +description_dict = description_instance.to_dict() +# create an instance of Description from a dict +description_form_dict = description.from_dict(description_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DescriptionLicense.md b/docs/apis/public_v2/docs/DescriptionLicense.md new file mode 100644 index 00000000..54e1610f --- /dev/null +++ b/docs/apis/public_v2/docs/DescriptionLicense.md @@ -0,0 +1,31 @@ +# DescriptionLicense + +Licence in document description. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**Code**](Code.md) | | [optional] +**text** | [**Text**](Text.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.description_license import DescriptionLicense + +# TODO update the JSON string below +json = "{}" +# create an instance of DescriptionLicense from a JSON string +description_license_instance = DescriptionLicense.from_json(json) +# print the JSON string representation of the object +print(DescriptionLicense.to_json()) + +# convert the object into a dict +description_license_dict = description_license_instance.to_dict() +# create an instance of DescriptionLicense from a dict +description_license_form_dict = description_license.from_dict(description_license_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DisplayName.md b/docs/apis/public_v2/docs/DisplayName.md new file mode 100644 index 00000000..de6263ad --- /dev/null +++ b/docs/apis/public_v2/docs/DisplayName.md @@ -0,0 +1,28 @@ +# DisplayName + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.display_name import DisplayName + +# TODO update the JSON string below +json = "{}" +# create an instance of DisplayName from a JSON string +display_name_instance = DisplayName.from_json(json) +# print the JSON string representation of the object +print(DisplayName.to_json()) + +# convert the object into a dict +display_name_dict = display_name_instance.to_dict() +# create an instance of DisplayName from a dict +display_name_form_dict = display_name.from_dict(display_name_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DoclingCoreTypesBaseIdentifier.md b/docs/apis/public_v2/docs/DoclingCoreTypesBaseIdentifier.md new file mode 100644 index 00000000..721ae84e --- /dev/null +++ b/docs/apis/public_v2/docs/DoclingCoreTypesBaseIdentifier.md @@ -0,0 +1,32 @@ +# DoclingCoreTypesBaseIdentifier + +Unique identifier of a Docling data object. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A string representing a collection or database that contains this data object. | +**value** | **str** | The identifier value of the data object within a collection or database. | +**name** | **str** | A unique identifier of the data object across Docling, consisting of the concatenation of type and value in lower case, separated by hash (#). | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.docling_core_types_base_identifier import DoclingCoreTypesBaseIdentifier + +# TODO update the JSON string below +json = "{}" +# create an instance of DoclingCoreTypesBaseIdentifier from a JSON string +docling_core_types_base_identifier_instance = DoclingCoreTypesBaseIdentifier.from_json(json) +# print the JSON string representation of the object +print(DoclingCoreTypesBaseIdentifier.to_json()) + +# convert the object into a dict +docling_core_types_base_identifier_dict = docling_core_types_base_identifier_instance.to_dict() +# create an instance of DoclingCoreTypesBaseIdentifier from a dict +docling_core_types_base_identifier_form_dict = docling_core_types_base_identifier.from_dict(docling_core_types_base_identifier_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DocumentArtifacts.md b/docs/apis/public_v2/docs/DocumentArtifacts.md index 36333173..ee4e6d88 100644 --- a/docs/apis/public_v2/docs/DocumentArtifacts.md +++ b/docs/apis/public_v2/docs/DocumentArtifacts.md @@ -5,11 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**document_meta_json** | [**DocumentArtifactsItem**](DocumentArtifactsItem.md) | | [optional] -**document_pdf** | [**DocumentArtifactsItem**](DocumentArtifactsItem.md) | | [optional] -**document_json** | [**DocumentArtifactsItem**](DocumentArtifactsItem.md) | | [optional] -**document_glm_json** | [**DocumentArtifactsItem**](DocumentArtifactsItem.md) | | [optional] -**document_md** | [**DocumentArtifactsItem**](DocumentArtifactsItem.md) | | [optional] +**document_meta_json** | [**DocumentArtifactsDocumentMetaJson**](DocumentArtifactsDocumentMetaJson.md) | | [optional] +**document_pdf** | [**DocumentArtifactsDocumentMetaJson**](DocumentArtifactsDocumentMetaJson.md) | | [optional] +**document_json** | [**DocumentArtifactsDocumentMetaJson**](DocumentArtifactsDocumentMetaJson.md) | | [optional] +**document_legacy_json** | [**DocumentArtifactsDocumentMetaJson**](DocumentArtifactsDocumentMetaJson.md) | | [optional] +**document_md** | [**DocumentArtifactsDocumentMetaJson**](DocumentArtifactsDocumentMetaJson.md) | | [optional] **page_pdfs** | [**List[DocumentArtifactsPageItem]**](DocumentArtifactsPageItem.md) | | [optional] [default to []] **page_images** | [**List[DocumentArtifactsPageItem]**](DocumentArtifactsPageItem.md) | | [optional] [default to []] diff --git a/docs/apis/public_v2/docs/DocumentArtifactsDocumentMetaJson.md b/docs/apis/public_v2/docs/DocumentArtifactsDocumentMetaJson.md new file mode 100644 index 00000000..dda75af9 --- /dev/null +++ b/docs/apis/public_v2/docs/DocumentArtifactsDocumentMetaJson.md @@ -0,0 +1,31 @@ +# DocumentArtifactsDocumentMetaJson + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mime** | **object** | | +**path** | **object** | | +**url** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.document_artifacts_document_meta_json import DocumentArtifactsDocumentMetaJson + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentArtifactsDocumentMetaJson from a JSON string +document_artifacts_document_meta_json_instance = DocumentArtifactsDocumentMetaJson.from_json(json) +# print the JSON string representation of the object +print(DocumentArtifactsDocumentMetaJson.to_json()) + +# convert the object into a dict +document_artifacts_document_meta_json_dict = document_artifacts_document_meta_json_instance.to_dict() +# create an instance of DocumentArtifactsDocumentMetaJson from a dict +document_artifacts_document_meta_json_form_dict = document_artifacts_document_meta_json.from_dict(document_artifacts_document_meta_json_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DocumentDescription.md b/docs/apis/public_v2/docs/DocumentDescription.md new file mode 100644 index 00000000..385e1a46 --- /dev/null +++ b/docs/apis/public_v2/docs/DocumentDescription.md @@ -0,0 +1,47 @@ +# DocumentDescription + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | [**Title**](Title.md) | | [optional] +**abstract** | [**Abstract**](Abstract.md) | | [optional] +**authors** | [**Authors**](Authors.md) | | [optional] +**affiliations** | [**Affiliations**](Affiliations.md) | | [optional] +**subjects** | [**Subjects**](Subjects.md) | | [optional] +**keywords** | [**Keywords**](Keywords.md) | | [optional] +**publication_date** | [**PublicationDate**](PublicationDate.md) | | [optional] +**languages** | [**Languages**](Languages.md) | | [optional] +**license** | [**DocumentDescriptionLicense**](DocumentDescriptionLicense.md) | | [optional] +**publishers** | [**Publishers**](Publishers.md) | | [optional] +**url_refs** | [**UrlRefs**](UrlRefs.md) | | [optional] +**references** | [**References**](References.md) | | [optional] +**publication** | [**Publication1**](Publication1.md) | | [optional] +**reference_count** | [**ReferenceCount**](ReferenceCount.md) | | [optional] +**citation_count** | [**CitationCount**](CitationCount.md) | | [optional] +**citation_date** | [**CitationCountDate**](CitationCountDate.md) | | [optional] +**advanced** | [**DocumentDescriptionAdvanced**](DocumentDescriptionAdvanced.md) | | [optional] +**analytics** | [**DocumentDescriptionAdvanced**](DocumentDescriptionAdvanced.md) | | [optional] +**acquisition** | [**DocumentDescriptionAcquisition**](DocumentDescriptionAcquisition.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.document_description import DocumentDescription + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentDescription from a JSON string +document_description_instance = DocumentDescription.from_json(json) +# print the JSON string representation of the object +print(DocumentDescription.to_json()) + +# convert the object into a dict +document_description_dict = document_description_instance.to_dict() +# create an instance of DocumentDescription from a dict +document_description_form_dict = document_description.from_dict(document_description_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DocumentDescriptionAcquisition.md b/docs/apis/public_v2/docs/DocumentDescriptionAcquisition.md new file mode 100644 index 00000000..3bf618cc --- /dev/null +++ b/docs/apis/public_v2/docs/DocumentDescriptionAcquisition.md @@ -0,0 +1,33 @@ +# DocumentDescriptionAcquisition + +Information on how the document was obtained, for data governance purposes. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **object** | The method to obtain the data. | +**var_date** | [**ModelDate**](ModelDate.md) | | [optional] +**link** | [**Link**](Link.md) | | [optional] +**size** | [**Size**](Size.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.document_description_acquisition import DocumentDescriptionAcquisition + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentDescriptionAcquisition from a JSON string +document_description_acquisition_instance = DocumentDescriptionAcquisition.from_json(json) +# print the JSON string representation of the object +print(DocumentDescriptionAcquisition.to_json()) + +# convert the object into a dict +document_description_acquisition_dict = document_description_acquisition_instance.to_dict() +# create an instance of DocumentDescriptionAcquisition from a dict +document_description_acquisition_form_dict = document_description_acquisition.from_dict(document_description_acquisition_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DocumentDescriptionAdvanced.md b/docs/apis/public_v2/docs/DocumentDescriptionAdvanced.md new file mode 100644 index 00000000..90365d8b --- /dev/null +++ b/docs/apis/public_v2/docs/DocumentDescriptionAdvanced.md @@ -0,0 +1,28 @@ +# DocumentDescriptionAdvanced + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.document_description_advanced import DocumentDescriptionAdvanced + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentDescriptionAdvanced from a JSON string +document_description_advanced_instance = DocumentDescriptionAdvanced.from_json(json) +# print the JSON string representation of the object +print(DocumentDescriptionAdvanced.to_json()) + +# convert the object into a dict +document_description_advanced_dict = document_description_advanced_instance.to_dict() +# create an instance of DocumentDescriptionAdvanced from a dict +document_description_advanced_form_dict = document_description_advanced.from_dict(document_description_advanced_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DocumentDescriptionLicense.md b/docs/apis/public_v2/docs/DocumentDescriptionLicense.md new file mode 100644 index 00000000..5fb31f97 --- /dev/null +++ b/docs/apis/public_v2/docs/DocumentDescriptionLicense.md @@ -0,0 +1,30 @@ +# DocumentDescriptionLicense + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**Code**](Code.md) | | [optional] +**text** | [**Text**](Text.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.document_description_license import DocumentDescriptionLicense + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentDescriptionLicense from a JSON string +document_description_license_instance = DocumentDescriptionLicense.from_json(json) +# print the JSON string representation of the object +print(DocumentDescriptionLicense.to_json()) + +# convert the object into a dict +document_description_license_dict = document_description_license_instance.to_dict() +# create an instance of DocumentDescriptionLicense from a dict +document_description_license_form_dict = document_description_license.from_dict(document_description_license_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DocumentHashes.md b/docs/apis/public_v2/docs/DocumentHashes.md new file mode 100644 index 00000000..3c6668d3 --- /dev/null +++ b/docs/apis/public_v2/docs/DocumentHashes.md @@ -0,0 +1,29 @@ +# DocumentHashes + +List of document hashes to be used as filter. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.document_hashes import DocumentHashes + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentHashes from a JSON string +document_hashes_instance = DocumentHashes.from_json(json) +# print the JSON string representation of the object +print(DocumentHashes.to_json()) + +# convert the object into a dict +document_hashes_dict = document_hashes_instance.to_dict() +# create an instance of DocumentHashes from a dict +document_hashes_form_dict = document_hashes.from_dict(document_hashes_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DocumentMeta.md b/docs/apis/public_v2/docs/DocumentMeta.md new file mode 100644 index 00000000..3b184cb0 --- /dev/null +++ b/docs/apis/public_v2/docs/DocumentMeta.md @@ -0,0 +1,31 @@ +# DocumentMeta + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filename** | [**Filename**](Filename.md) | | [optional] +**description** | [**DocumentMetaDescription**](DocumentMetaDescription.md) | | [optional] +**identifiers** | [**Identifiers**](Identifiers.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.document_meta import DocumentMeta + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentMeta from a JSON string +document_meta_instance = DocumentMeta.from_json(json) +# print the JSON string representation of the object +print(DocumentMeta.to_json()) + +# convert the object into a dict +document_meta_dict = document_meta_instance.to_dict() +# create an instance of DocumentMeta from a dict +document_meta_form_dict = document_meta.from_dict(document_meta_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/DocumentMetaDescription.md b/docs/apis/public_v2/docs/DocumentMetaDescription.md new file mode 100644 index 00000000..ca1c57c9 --- /dev/null +++ b/docs/apis/public_v2/docs/DocumentMetaDescription.md @@ -0,0 +1,47 @@ +# DocumentMetaDescription + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | [**Title**](Title.md) | | [optional] +**abstract** | [**Abstract**](Abstract.md) | | [optional] +**authors** | [**Authors**](Authors.md) | | [optional] +**affiliations** | [**Affiliations**](Affiliations.md) | | [optional] +**subjects** | [**Subjects**](Subjects.md) | | [optional] +**keywords** | [**Keywords**](Keywords.md) | | [optional] +**publication_date** | [**PublicationDate**](PublicationDate.md) | | [optional] +**languages** | [**Languages**](Languages.md) | | [optional] +**license** | [**DocumentDescriptionLicense**](DocumentDescriptionLicense.md) | | [optional] +**publishers** | [**Publishers**](Publishers.md) | | [optional] +**url_refs** | [**UrlRefs**](UrlRefs.md) | | [optional] +**references** | [**References**](References.md) | | [optional] +**publication** | [**Publication1**](Publication1.md) | | [optional] +**reference_count** | [**ReferenceCount**](ReferenceCount.md) | | [optional] +**citation_count** | [**CitationCount**](CitationCount.md) | | [optional] +**citation_date** | [**CitationCountDate**](CitationCountDate.md) | | [optional] +**advanced** | [**DocumentDescriptionAdvanced**](DocumentDescriptionAdvanced.md) | | [optional] +**analytics** | [**DocumentDescriptionAdvanced**](DocumentDescriptionAdvanced.md) | | [optional] +**acquisition** | [**DocumentDescriptionAcquisition**](DocumentDescriptionAcquisition.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.document_meta_description import DocumentMetaDescription + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentMetaDescription from a JSON string +document_meta_description_instance = DocumentMetaDescription.from_json(json) +# print the JSON string representation of the object +print(DocumentMetaDescription.to_json()) + +# convert the object into a dict +document_meta_description_dict = document_meta_description_instance.to_dict() +# create an instance of DocumentMetaDescription from a dict +document_meta_description_form_dict = document_meta_description.from_dict(document_meta_description_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Domain.md b/docs/apis/public_v2/docs/Domain.md new file mode 100644 index 00000000..e7f9a3c8 --- /dev/null +++ b/docs/apis/public_v2/docs/Domain.md @@ -0,0 +1,28 @@ +# Domain + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.domain import Domain + +# TODO update the JSON string below +json = "{}" +# create an instance of Domain from a JSON string +domain_instance = Domain.from_json(json) +# print the JSON string representation of the object +print(Domain.to_json()) + +# convert the object into a dict +domain_dict = domain_instance.to_dict() +# create an instance of Domain from a dict +domain_form_dict = domain.from_dict(domain_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ElasticIndexPropertyObject.md b/docs/apis/public_v2/docs/ElasticIndexPropertyObject.md index 00d1d908..1ffd988f 100644 --- a/docs/apis/public_v2/docs/ElasticIndexPropertyObject.md +++ b/docs/apis/public_v2/docs/ElasticIndexPropertyObject.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | | -**enabled** | **bool** | | [optional] -**ignore_above** | **int** | | [optional] +**enabled** | [**Enabled**](Enabled.md) | | [optional] +**ignore_above** | [**IgnoreAbove**](IgnoreAbove.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/ElasticIndexSearchQueryOptions.md b/docs/apis/public_v2/docs/ElasticIndexSearchQueryOptions.md index 2ffa2c35..8443b3dc 100644 --- a/docs/apis/public_v2/docs/ElasticIndexSearchQueryOptions.md +++ b/docs/apis/public_v2/docs/ElasticIndexSearchQueryOptions.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**source** | **List[str]** | | [optional] -**from_** | **int** | | [optional] -**size** | **int** | | [optional] -**query** | **object** | | [optional] -**aggs** | **object** | | [optional] -**sort** | **List[object]** | | [optional] +**source** | [**Source2**](Source2.md) | | [optional] +**from_** | [**ModelFrom**](ModelFrom.md) | | [optional] +**size** | [**Size1**](Size1.md) | | [optional] +**query** | [**Query**](Query.md) | | [optional] +**aggs** | [**Aggs**](Aggs.md) | | [optional] +**sort** | [**Sort**](Sort.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/ElasticMetadata.md b/docs/apis/public_v2/docs/ElasticMetadata.md index 11987b66..618570ab 100644 --- a/docs/apis/public_v2/docs/ElasticMetadata.md +++ b/docs/apis/public_v2/docs/ElasticMetadata.md @@ -5,15 +5,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**aliases** | **List[str]** | | [optional] -**created** | **str** | | [optional] -**description** | **str** | | [optional] -**display_name** | **str** | | [optional] -**source** | **str** | | [optional] -**storage** | **str** | | [optional] -**version** | **str** | | [optional] -**type** | **str** | | [optional] -**domain** | **List[str]** | | [optional] +**aliases** | [**Aliases**](Aliases.md) | | [optional] +**created** | [**Created**](Created.md) | | [optional] +**description** | [**Description**](Description.md) | | [optional] +**display_name** | [**DisplayName**](DisplayName.md) | | [optional] +**source** | [**Source1**](Source1.md) | | [optional] +**storage** | [**Storage**](Storage.md) | | [optional] +**version** | [**Version1**](Version1.md) | | [optional] +**type** | [**Type**](Type.md) | | [optional] +**domain** | [**Domain**](Domain.md) | | [optional] **classification** | **List[str]** | | ## Example diff --git a/docs/apis/public_v2/docs/Enabled.md b/docs/apis/public_v2/docs/Enabled.md new file mode 100644 index 00000000..501e9c68 --- /dev/null +++ b/docs/apis/public_v2/docs/Enabled.md @@ -0,0 +1,28 @@ +# Enabled + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.enabled import Enabled + +# TODO update the JSON string below +json = "{}" +# create an instance of Enabled from a JSON string +enabled_instance = Enabled.from_json(json) +# print the JSON string representation of the object +print(Enabled.to_json()) + +# convert the object into a dict +enabled_dict = enabled_instance.to_dict() +# create an instance of Enabled from a dict +enabled_form_dict = enabled.from_dict(enabled_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/EndDate.md b/docs/apis/public_v2/docs/EndDate.md new file mode 100644 index 00000000..65ce1f79 --- /dev/null +++ b/docs/apis/public_v2/docs/EndDate.md @@ -0,0 +1,28 @@ +# EndDate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.end_date import EndDate + +# TODO update the JSON string below +json = "{}" +# create an instance of EndDate from a JSON string +end_date_instance = EndDate.from_json(json) +# print the JSON string representation of the object +print(EndDate.to_json()) + +# convert the object into a dict +end_date_dict = end_date_instance.to_dict() +# create an instance of EndDate from a dict +end_date_form_dict = end_date.from_dict(end_date_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ErrorReason.md b/docs/apis/public_v2/docs/ErrorReason.md new file mode 100644 index 00000000..dbf081ed --- /dev/null +++ b/docs/apis/public_v2/docs/ErrorReason.md @@ -0,0 +1,28 @@ +# ErrorReason + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.error_reason import ErrorReason + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorReason from a JSON string +error_reason_instance = ErrorReason.from_json(json) +# print the JSON string representation of the object +print(ErrorReason.to_json()) + +# convert the object into a dict +error_reason_dict = error_reason_instance.to_dict() +# create an instance of ErrorReason from a dict +error_reason_form_dict = error_reason.from_dict(error_reason_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/FileUri.md b/docs/apis/public_v2/docs/FileUri.md new file mode 100644 index 00000000..bd1bf0f9 --- /dev/null +++ b/docs/apis/public_v2/docs/FileUri.md @@ -0,0 +1,28 @@ +# FileUri + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.file_uri import FileUri + +# TODO update the JSON string below +json = "{}" +# create an instance of FileUri from a JSON string +file_uri_instance = FileUri.from_json(json) +# print the JSON string representation of the object +print(FileUri.to_json()) + +# convert the object into a dict +file_uri_dict = file_uri_instance.to_dict() +# create an instance of FileUri from a dict +file_uri_form_dict = file_uri.from_dict(file_uri_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/FileUrl.md b/docs/apis/public_v2/docs/FileUrl.md new file mode 100644 index 00000000..5dcbf77c --- /dev/null +++ b/docs/apis/public_v2/docs/FileUrl.md @@ -0,0 +1,29 @@ +# FileUrl + +List of File's URL to be converted and uploaded to the data index. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.file_url import FileUrl + +# TODO update the JSON string below +json = "{}" +# create an instance of FileUrl from a JSON string +file_url_instance = FileUrl.from_json(json) +# print the JSON string representation of the object +print(FileUrl.to_json()) + +# convert the object into a dict +file_url_dict = file_url_instance.to_dict() +# create an instance of FileUrl from a dict +file_url_form_dict = file_url.from_dict(file_url_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Filename.md b/docs/apis/public_v2/docs/Filename.md new file mode 100644 index 00000000..179ff8e8 --- /dev/null +++ b/docs/apis/public_v2/docs/Filename.md @@ -0,0 +1,28 @@ +# Filename + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.filename import Filename + +# TODO update the JSON string below +json = "{}" +# create an instance of Filename from a JSON string +filename_instance = Filename.from_json(json) +# print the JSON string representation of the object +print(Filename.to_json()) + +# convert the object into a dict +filename_dict = filename_instance.to_dict() +# create an instance of Filename from a dict +filename_form_dict = filename.from_dict(filename_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Flavour.md b/docs/apis/public_v2/docs/Flavour.md index 8dc5b2c2..f352678c 100644 --- a/docs/apis/public_v2/docs/Flavour.md +++ b/docs/apis/public_v2/docs/Flavour.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | -**display_name** | **str** | | [optional] +**display_name** | [**DisplayName**](DisplayName.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/GenAIAWSBedrock.md b/docs/apis/public_v2/docs/GenAIAWSBedrock.md index 4406f72f..357c15e4 100644 --- a/docs/apis/public_v2/docs/GenAIAWSBedrock.md +++ b/docs/apis/public_v2/docs/GenAIAWSBedrock.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **kind** | **str** | | [optional] [default to 'aws_bedrock'] **config** | [**GenAIAWSBedrockConfig**](GenAIAWSBedrockConfig.md) | | -**proj_params** | [**GenAIPartialParams**](GenAIPartialParams.md) | | [optional] +**proj_params** | [**GenAIAWSBedrockProjParams**](GenAIAWSBedrockProjParams.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/GenAIAWSBedrockProjParams.md b/docs/apis/public_v2/docs/GenAIAWSBedrockProjParams.md new file mode 100644 index 00000000..561b82b2 --- /dev/null +++ b/docs/apis/public_v2/docs/GenAIAWSBedrockProjParams.md @@ -0,0 +1,32 @@ +# GenAIAWSBedrockProjParams + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**model_id** | [**ModelId**](ModelId.md) | | [optional] +**prompt_template** | [**PromptTemplate**](PromptTemplate.md) | | [optional] +**params** | [**Params**](Params.md) | | [optional] +**timeout** | [**Timeout**](Timeout.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.gen_aiaws_bedrock_proj_params import GenAIAWSBedrockProjParams + +# TODO update the JSON string below +json = "{}" +# create an instance of GenAIAWSBedrockProjParams from a JSON string +gen_aiaws_bedrock_proj_params_instance = GenAIAWSBedrockProjParams.from_json(json) +# print the JSON string representation of the object +print(GenAIAWSBedrockProjParams.to_json()) + +# convert the object into a dict +gen_aiaws_bedrock_proj_params_dict = gen_aiaws_bedrock_proj_params_instance.to_dict() +# create an instance of GenAIAWSBedrockProjParams from a dict +gen_aiaws_bedrock_proj_params_form_dict = gen_aiaws_bedrock_proj_params.from_dict(gen_aiaws_bedrock_proj_params_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/GenAIBAM.md b/docs/apis/public_v2/docs/GenAIBAM.md index 7b12e31f..cddc7353 100644 --- a/docs/apis/public_v2/docs/GenAIBAM.md +++ b/docs/apis/public_v2/docs/GenAIBAM.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **kind** | **str** | | [optional] [default to 'bam'] **config** | [**GenAIBAMConfig**](GenAIBAMConfig.md) | | -**proj_params** | [**GenAIPartialParams**](GenAIPartialParams.md) | | [optional] +**proj_params** | [**GenAIAWSBedrockProjParams**](GenAIAWSBedrockProjParams.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/GenAICPD.md b/docs/apis/public_v2/docs/GenAICPD.md new file mode 100644 index 00000000..3faf6bfb --- /dev/null +++ b/docs/apis/public_v2/docs/GenAICPD.md @@ -0,0 +1,32 @@ +# GenAICPD + +GenAI integration for watsonx settings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | | [optional] [default to 'cpd'] +**config** | [**GenAICPDConfig**](GenAICPDConfig.md) | | +**proj_params** | [**GenAIAWSBedrockProjParams**](GenAIAWSBedrockProjParams.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.gen_aicpd import GenAICPD + +# TODO update the JSON string below +json = "{}" +# create an instance of GenAICPD from a JSON string +gen_aicpd_instance = GenAICPD.from_json(json) +# print the JSON string representation of the object +print(GenAICPD.to_json()) + +# convert the object into a dict +gen_aicpd_dict = gen_aicpd_instance.to_dict() +# create an instance of GenAICPD from a dict +gen_aicpd_form_dict = gen_aicpd.from_dict(gen_aicpd_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/GenAICPDConfig.md b/docs/apis/public_v2/docs/GenAICPDConfig.md new file mode 100644 index 00000000..fcd7cdd7 --- /dev/null +++ b/docs/apis/public_v2/docs/GenAICPDConfig.md @@ -0,0 +1,36 @@ +# GenAICPDConfig + +Config for CPD watsonx + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**genai_api** | **str** | | +**genai_project_id** | **str** | | +**genai_cpd_url** | **str** | | +**genai_cpd_verify_tls** | **bool** | | [optional] [default to True] +**genai_cpd_username** | **str** | | +**genai_cpd_password** | [**GenaiCpdPassword**](GenaiCpdPassword.md) | | [optional] +**genai_cpd_api_key** | [**GenaiCpdApiKey**](GenaiCpdApiKey.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.gen_aicpd_config import GenAICPDConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of GenAICPDConfig from a JSON string +gen_aicpd_config_instance = GenAICPDConfig.from_json(json) +# print the JSON string representation of the object +print(GenAICPDConfig.to_json()) + +# convert the object into a dict +gen_aicpd_config_dict = gen_aicpd_config_instance.to_dict() +# create an instance of GenAICPDConfig from a dict +gen_aicpd_config_form_dict = gen_aicpd_config.from_dict(gen_aicpd_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/GenAIHFInferenceApi.md b/docs/apis/public_v2/docs/GenAIHFInferenceApi.md index de3c2230..81083f21 100644 --- a/docs/apis/public_v2/docs/GenAIHFInferenceApi.md +++ b/docs/apis/public_v2/docs/GenAIHFInferenceApi.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **kind** | **str** | | [optional] [default to 'hf_api'] **config** | [**GenAIHFInferenceApiConfig**](GenAIHFInferenceApiConfig.md) | | -**proj_params** | [**GenAIPartialParams**](GenAIPartialParams.md) | | [optional] +**proj_params** | [**GenAIAWSBedrockProjParams**](GenAIAWSBedrockProjParams.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/GenAIOpenai.md b/docs/apis/public_v2/docs/GenAIOpenai.md new file mode 100644 index 00000000..4e1c156f --- /dev/null +++ b/docs/apis/public_v2/docs/GenAIOpenai.md @@ -0,0 +1,32 @@ +# GenAIOpenai + +GenAI integration for OpenAI API settings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | | [optional] [default to 'openai'] +**config** | [**GenAIOpenaiConfig**](GenAIOpenaiConfig.md) | | +**proj_params** | [**GenAIAWSBedrockProjParams**](GenAIAWSBedrockProjParams.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.gen_ai_openai import GenAIOpenai + +# TODO update the JSON string below +json = "{}" +# create an instance of GenAIOpenai from a JSON string +gen_ai_openai_instance = GenAIOpenai.from_json(json) +# print the JSON string representation of the object +print(GenAIOpenai.to_json()) + +# convert the object into a dict +gen_ai_openai_dict = gen_ai_openai_instance.to_dict() +# create an instance of GenAIOpenai from a dict +gen_ai_openai_form_dict = gen_ai_openai.from_dict(gen_ai_openai_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/GenAIOpenaiConfig.md b/docs/apis/public_v2/docs/GenAIOpenaiConfig.md new file mode 100644 index 00000000..03974041 --- /dev/null +++ b/docs/apis/public_v2/docs/GenAIOpenaiConfig.md @@ -0,0 +1,32 @@ +# GenAIOpenaiConfig + +Config for OpenAI API + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**genai_openai_api_key** | **str** | | +**genai_openai_base_url** | **str** | | +**genai_openai_verify_tls** | **bool** | | [optional] [default to True] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.gen_ai_openai_config import GenAIOpenaiConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of GenAIOpenaiConfig from a JSON string +gen_ai_openai_config_instance = GenAIOpenaiConfig.from_json(json) +# print the JSON string representation of the object +print(GenAIOpenaiConfig.to_json()) + +# convert the object into a dict +gen_ai_openai_config_dict = gen_ai_openai_config_instance.to_dict() +# create an instance of GenAIOpenaiConfig from a dict +gen_ai_openai_config_form_dict = gen_ai_openai_config.from_dict(gen_ai_openai_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/GenAIPartialParams.md b/docs/apis/public_v2/docs/GenAIPartialParams.md index d775b835..59f38352 100644 --- a/docs/apis/public_v2/docs/GenAIPartialParams.md +++ b/docs/apis/public_v2/docs/GenAIPartialParams.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**model_id** | **str** | | [optional] -**prompt_template** | **str** | | [optional] -**params** | **object** | | [optional] -**timeout** | **float** | | [optional] +**model_id** | [**ModelId**](ModelId.md) | | [optional] +**prompt_template** | [**PromptTemplate**](PromptTemplate.md) | | [optional] +**params** | [**Params**](Params.md) | | [optional] +**timeout** | [**Timeout**](Timeout.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/GenAIWatsonx.md b/docs/apis/public_v2/docs/GenAIWatsonx.md index 2bfd05f5..2e1920d2 100644 --- a/docs/apis/public_v2/docs/GenAIWatsonx.md +++ b/docs/apis/public_v2/docs/GenAIWatsonx.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **kind** | **str** | | [optional] [default to 'watsonx'] **config** | [**GenAIWatsonxConfig**](GenAIWatsonxConfig.md) | | -**proj_params** | [**GenAIPartialParams**](GenAIPartialParams.md) | | [optional] +**proj_params** | [**GenAIAWSBedrockProjParams**](GenAIAWSBedrockProjParams.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/GenaiCpdApiKey.md b/docs/apis/public_v2/docs/GenaiCpdApiKey.md new file mode 100644 index 00000000..ceb32328 --- /dev/null +++ b/docs/apis/public_v2/docs/GenaiCpdApiKey.md @@ -0,0 +1,28 @@ +# GenaiCpdApiKey + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.genai_cpd_api_key import GenaiCpdApiKey + +# TODO update the JSON string below +json = "{}" +# create an instance of GenaiCpdApiKey from a JSON string +genai_cpd_api_key_instance = GenaiCpdApiKey.from_json(json) +# print the JSON string representation of the object +print(GenaiCpdApiKey.to_json()) + +# convert the object into a dict +genai_cpd_api_key_dict = genai_cpd_api_key_instance.to_dict() +# create an instance of GenaiCpdApiKey from a dict +genai_cpd_api_key_form_dict = genai_cpd_api_key.from_dict(genai_cpd_api_key_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/GenaiCpdPassword.md b/docs/apis/public_v2/docs/GenaiCpdPassword.md new file mode 100644 index 00000000..1bd2ff29 --- /dev/null +++ b/docs/apis/public_v2/docs/GenaiCpdPassword.md @@ -0,0 +1,28 @@ +# GenaiCpdPassword + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.genai_cpd_password import GenaiCpdPassword + +# TODO update the JSON string below +json = "{}" +# create an instance of GenaiCpdPassword from a JSON string +genai_cpd_password_instance = GenaiCpdPassword.from_json(json) +# print the JSON string representation of the object +print(GenaiCpdPassword.to_json()) + +# convert the object into a dict +genai_cpd_password_dict = genai_cpd_password_instance.to_dict() +# create an instance of GenaiCpdPassword from a dict +genai_cpd_password_form_dict = genai_cpd_password.from_dict(genai_cpd_password_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/HeadUrl.md b/docs/apis/public_v2/docs/HeadUrl.md new file mode 100644 index 00000000..0eaf5374 --- /dev/null +++ b/docs/apis/public_v2/docs/HeadUrl.md @@ -0,0 +1,28 @@ +# HeadUrl + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.head_url import HeadUrl + +# TODO update the JSON string below +json = "{}" +# create an instance of HeadUrl from a JSON string +head_url_instance = HeadUrl.from_json(json) +# print the JSON string representation of the object +print(HeadUrl.to_json()) + +# convert the object into a dict +head_url_dict = head_url_instance.to_dict() +# create an instance of HeadUrl from a dict +head_url_form_dict = head_url.from_dict(head_url_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Headers.md b/docs/apis/public_v2/docs/Headers.md new file mode 100644 index 00000000..913f9b06 --- /dev/null +++ b/docs/apis/public_v2/docs/Headers.md @@ -0,0 +1,28 @@ +# Headers + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.headers import Headers + +# TODO update the JSON string below +json = "{}" +# create an instance of Headers from a JSON string +headers_instance = Headers.from_json(json) +# print the JSON string representation of the object +print(Headers.to_json()) + +# convert the object into a dict +headers_dict = headers_instance.to_dict() +# create an instance of Headers from a dict +headers_form_dict = headers.from_dict(headers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/HttpSource.md b/docs/apis/public_v2/docs/HttpSource.md index 24590c82..062a6c18 100644 --- a/docs/apis/public_v2/docs/HttpSource.md +++ b/docs/apis/public_v2/docs/HttpSource.md @@ -1,12 +1,11 @@ # HttpSource +List of Internal File's URLs to be converted and uploaded to the data index. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**url** | **str** | | -**headers** | **object** | | ## Example diff --git a/docs/apis/public_v2/docs/Id.md b/docs/apis/public_v2/docs/Id.md new file mode 100644 index 00000000..a38665c1 --- /dev/null +++ b/docs/apis/public_v2/docs/Id.md @@ -0,0 +1,28 @@ +# Id + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.id import Id + +# TODO update the JSON string below +json = "{}" +# create an instance of Id from a JSON string +id_instance = Id.from_json(json) +# print the JSON string representation of the object +print(Id.to_json()) + +# convert the object into a dict +id_dict = id_instance.to_dict() +# create an instance of Id from a dict +id_form_dict = id.from_dict(id_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Identifiers.md b/docs/apis/public_v2/docs/Identifiers.md new file mode 100644 index 00000000..5fcf3670 --- /dev/null +++ b/docs/apis/public_v2/docs/Identifiers.md @@ -0,0 +1,28 @@ +# Identifiers + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.identifiers import Identifiers + +# TODO update the JSON string below +json = "{}" +# create an instance of Identifiers from a JSON string +identifiers_instance = Identifiers.from_json(json) +# print the JSON string representation of the object +print(Identifiers.to_json()) + +# convert the object into a dict +identifiers_dict = identifiers_instance.to_dict() +# create an instance of Identifiers from a dict +identifiers_form_dict = identifiers.from_dict(identifiers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Identifiers1.md b/docs/apis/public_v2/docs/Identifiers1.md new file mode 100644 index 00000000..c5567f03 --- /dev/null +++ b/docs/apis/public_v2/docs/Identifiers1.md @@ -0,0 +1,29 @@ +# Identifiers1 + +Unique identifiers of a publication venue. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.identifiers1 import Identifiers1 + +# TODO update the JSON string below +json = "{}" +# create an instance of Identifiers1 from a JSON string +identifiers1_instance = Identifiers1.from_json(json) +# print the JSON string representation of the object +print(Identifiers1.to_json()) + +# convert the object into a dict +identifiers1_dict = identifiers1_instance.to_dict() +# create an instance of Identifiers1 from a dict +identifiers1_form_dict = identifiers1.from_dict(identifiers1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/IgnoreAbove.md b/docs/apis/public_v2/docs/IgnoreAbove.md new file mode 100644 index 00000000..fb2173c2 --- /dev/null +++ b/docs/apis/public_v2/docs/IgnoreAbove.md @@ -0,0 +1,28 @@ +# IgnoreAbove + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.ignore_above import IgnoreAbove + +# TODO update the JSON string below +json = "{}" +# create an instance of IgnoreAbove from a JSON string +ignore_above_instance = IgnoreAbove.from_json(json) +# print the JSON string representation of the object +print(IgnoreAbove.to_json()) + +# convert the object into a dict +ignore_above_dict = ignore_above_instance.to_dict() +# create an instance of IgnoreAbove from a dict +ignore_above_form_dict = ignore_above.from_dict(ignore_above_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ImageUrlsInfo.md b/docs/apis/public_v2/docs/ImageUrlsInfo.md new file mode 100644 index 00000000..6ae007ca --- /dev/null +++ b/docs/apis/public_v2/docs/ImageUrlsInfo.md @@ -0,0 +1,11 @@ +# ImageUrlsInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/InternalUrl.md b/docs/apis/public_v2/docs/InternalUrl.md deleted file mode 100644 index 46ecf375..00000000 --- a/docs/apis/public_v2/docs/InternalUrl.md +++ /dev/null @@ -1,30 +0,0 @@ -# InternalUrl - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**download_url** | **str** | | -**header_url** | **str** | | - -## Example - -```python -from deepsearch.cps.apis.public_v2.models.internal_url import InternalUrl - -# TODO update the JSON string below -json = "{}" -# create an instance of InternalUrl from a JSON string -internal_url_instance = InternalUrl.from_json(json) -# print the JSON string representation of the object -print(InternalUrl.to_json()) - -# convert the object into a dict -internal_url_dict = internal_url_instance.to_dict() -# create an instance of InternalUrl from a dict -internal_url_form_dict = internal_url.from_dict(internal_url_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/apis/public_v2/docs/Issue.md b/docs/apis/public_v2/docs/Issue.md new file mode 100644 index 00000000..07da61fb --- /dev/null +++ b/docs/apis/public_v2/docs/Issue.md @@ -0,0 +1,29 @@ +# Issue + +Publication issue (issue number). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.issue import Issue + +# TODO update the JSON string below +json = "{}" +# create an instance of Issue from a JSON string +issue_instance = Issue.from_json(json) +# print the JSON string representation of the object +print(Issue.to_json()) + +# convert the object into a dict +issue_dict = issue_instance.to_dict() +# create an instance of Issue from a dict +issue_form_dict = issue.from_dict(issue_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/KeyPrefix.md b/docs/apis/public_v2/docs/KeyPrefix.md new file mode 100644 index 00000000..3272a3c7 --- /dev/null +++ b/docs/apis/public_v2/docs/KeyPrefix.md @@ -0,0 +1,28 @@ +# KeyPrefix + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.key_prefix import KeyPrefix + +# TODO update the JSON string below +json = "{}" +# create an instance of KeyPrefix from a JSON string +key_prefix_instance = KeyPrefix.from_json(json) +# print the JSON string representation of the object +print(KeyPrefix.to_json()) + +# convert the object into a dict +key_prefix_dict = key_prefix_instance.to_dict() +# create an instance of KeyPrefix from a dict +key_prefix_form_dict = key_prefix.from_dict(key_prefix_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Keywords.md b/docs/apis/public_v2/docs/Keywords.md new file mode 100644 index 00000000..92a1a065 --- /dev/null +++ b/docs/apis/public_v2/docs/Keywords.md @@ -0,0 +1,28 @@ +# Keywords + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.keywords import Keywords + +# TODO update the JSON string below +json = "{}" +# create an instance of Keywords from a JSON string +keywords_instance = Keywords.from_json(json) +# print the JSON string representation of the object +print(Keywords.to_json()) + +# convert the object into a dict +keywords_dict = keywords_instance.to_dict() +# create an instance of Keywords from a dict +keywords_form_dict = keywords.from_dict(keywords_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/KgKey.md b/docs/apis/public_v2/docs/KgKey.md new file mode 100644 index 00000000..4295a40d --- /dev/null +++ b/docs/apis/public_v2/docs/KgKey.md @@ -0,0 +1,28 @@ +# KgKey + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.kg_key import KgKey + +# TODO update the JSON string below +json = "{}" +# create an instance of KgKey from a JSON string +kg_key_instance = KgKey.from_json(json) +# print the JSON string representation of the object +print(KgKey.to_json()) + +# convert the object into a dict +kg_key_dict = kg_key_instance.to_dict() +# create an instance of KgKey from a dict +kg_key_form_dict = kg_key.from_dict(kg_key_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Languages.md b/docs/apis/public_v2/docs/Languages.md new file mode 100644 index 00000000..e7883222 --- /dev/null +++ b/docs/apis/public_v2/docs/Languages.md @@ -0,0 +1,28 @@ +# Languages + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.languages import Languages + +# TODO update the JSON string below +json = "{}" +# create an instance of Languages from a JSON string +languages_instance = Languages.from_json(json) +# print the JSON string representation of the object +print(Languages.to_json()) + +# convert the object into a dict +languages_dict = languages_instance.to_dict() +# create an instance of Languages from a dict +languages_form_dict = languages.from_dict(languages_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/License.md b/docs/apis/public_v2/docs/License.md new file mode 100644 index 00000000..95d194a9 --- /dev/null +++ b/docs/apis/public_v2/docs/License.md @@ -0,0 +1,28 @@ +# License + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.license import License + +# TODO update the JSON string below +json = "{}" +# create an instance of License from a JSON string +license_instance = License.from_json(json) +# print the JSON string representation of the object +print(License.to_json()) + +# convert the object into a dict +license_dict = license_instance.to_dict() +# create an instance of License from a dict +license_form_dict = license.from_dict(license_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Link.md b/docs/apis/public_v2/docs/Link.md new file mode 100644 index 00000000..dfff2fb0 --- /dev/null +++ b/docs/apis/public_v2/docs/Link.md @@ -0,0 +1,29 @@ +# Link + +Link to the data source of this document. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print(Link.to_json()) + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Log.md b/docs/apis/public_v2/docs/Log.md new file mode 100644 index 00000000..7c195ba8 --- /dev/null +++ b/docs/apis/public_v2/docs/Log.md @@ -0,0 +1,34 @@ +# Log + +Log entry to describe an ETL task on a document. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task** | [**Task**](Task.md) | | [optional] +**agent** | **object** | The Docling agent that performed the task, e.g., CCS or CXS. | +**type** | **object** | A task category. | +**comment** | [**Comment**](Comment.md) | | [optional] +**var_date** | **object** | A string representation of the task execution datetime in ISO 8601 format. | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.log import Log + +# TODO update the JSON string below +json = "{}" +# create an instance of Log from a JSON string +log_instance = Log.from_json(json) +# print the JSON string representation of the object +print(Log.to_json()) + +# convert the object into a dict +log_dict = log_instance.to_dict() +# create an instance of Log from a dict +log_form_dict = log.from_dict(log_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/MergeMode.md b/docs/apis/public_v2/docs/MergeMode.md new file mode 100644 index 00000000..6d624c0b --- /dev/null +++ b/docs/apis/public_v2/docs/MergeMode.md @@ -0,0 +1,28 @@ +# MergeMode + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.merge_mode import MergeMode + +# TODO update the JSON string below +json = "{}" +# create an instance of MergeMode from a JSON string +merge_mode_instance = MergeMode.from_json(json) +# print the JSON string representation of the object +print(MergeMode.to_json()) + +# convert the object into a dict +merge_mode_dict = merge_mode_instance.to_dict() +# create an instance of MergeMode from a dict +merge_mode_form_dict = merge_mode.from_dict(merge_mode_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ModelDate.md b/docs/apis/public_v2/docs/ModelDate.md new file mode 100644 index 00000000..384651f4 --- /dev/null +++ b/docs/apis/public_v2/docs/ModelDate.md @@ -0,0 +1,29 @@ +# ModelDate + +A string representation of the acquisition datetime in ISO 8601 format. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.model_date import ModelDate + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelDate from a JSON string +model_date_instance = ModelDate.from_json(json) +# print the JSON string representation of the object +print(ModelDate.to_json()) + +# convert the object into a dict +model_date_dict = model_date_instance.to_dict() +# create an instance of ModelDate from a dict +model_date_form_dict = model_date.from_dict(model_date_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ModelFrom.md b/docs/apis/public_v2/docs/ModelFrom.md new file mode 100644 index 00000000..1f8d17bb --- /dev/null +++ b/docs/apis/public_v2/docs/ModelFrom.md @@ -0,0 +1,28 @@ +# ModelFrom + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.model_from import ModelFrom + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelFrom from a JSON string +model_from_instance = ModelFrom.from_json(json) +# print the JSON string representation of the object +print(ModelFrom.to_json()) + +# convert the object into a dict +model_from_dict = model_from_instance.to_dict() +# create an instance of ModelFrom from a dict +model_from_form_dict = model_from.from_dict(model_from_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ModelId.md b/docs/apis/public_v2/docs/ModelId.md new file mode 100644 index 00000000..0e844435 --- /dev/null +++ b/docs/apis/public_v2/docs/ModelId.md @@ -0,0 +1,28 @@ +# ModelId + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.model_id import ModelId + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelId from a JSON string +model_id_instance = ModelId.from_json(json) +# print the JSON string representation of the object +print(ModelId.to_json()) + +# convert the object into a dict +model_id_dict = model_id_instance.to_dict() +# create an instance of ModelId from a dict +model_id_form_dict = model_id.from_dict(model_id_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Name.md b/docs/apis/public_v2/docs/Name.md new file mode 100644 index 00000000..0a27c16d --- /dev/null +++ b/docs/apis/public_v2/docs/Name.md @@ -0,0 +1,29 @@ +# Name + +Name of the collection. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.name import Name + +# TODO update the JSON string below +json = "{}" +# create an instance of Name from a JSON string +name_instance = Name.from_json(json) +# print the JSON string representation of the object +print(Name.to_json()) + +# convert the object into a dict +name_dict = name_instance.to_dict() +# create an instance of Name from a dict +name_form_dict = name.from_dict(name_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/NumberPages.md b/docs/apis/public_v2/docs/NumberPages.md new file mode 100644 index 00000000..74986a83 --- /dev/null +++ b/docs/apis/public_v2/docs/NumberPages.md @@ -0,0 +1,28 @@ +# NumberPages + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.number_pages import NumberPages + +# TODO update the JSON string below +json = "{}" +# create an instance of NumberPages from a JSON string +number_pages_instance = NumberPages.from_json(json) +# print the JSON string representation of the object +print(NumberPages.to_json()) + +# convert the object into a dict +number_pages_dict = number_pages_instance.to_dict() +# create an instance of NumberPages from a dict +number_pages_form_dict = number_pages.from_dict(number_pages_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/OCROptions.md b/docs/apis/public_v2/docs/OCROptions.md new file mode 100644 index 00000000..01516269 --- /dev/null +++ b/docs/apis/public_v2/docs/OCROptions.md @@ -0,0 +1,30 @@ +# OCROptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**do_ocr** | **bool** | | [optional] [default to True] +**kind** | **str** | | [optional] [default to 'easyocr'] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.ocr_options import OCROptions + +# TODO update the JSON string below +json = "{}" +# create an instance of OCROptions from a JSON string +ocr_options_instance = OCROptions.from_json(json) +# print the JSON string representation of the object +print(OCROptions.to_json()) + +# convert the object into a dict +ocr_options_dict = ocr_options_instance.to_dict() +# create an instance of OCROptions from a dict +ocr_options_form_dict = ocr_options.from_dict(ocr_options_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ObjectKeys.md b/docs/apis/public_v2/docs/ObjectKeys.md new file mode 100644 index 00000000..fbf1b2b8 --- /dev/null +++ b/docs/apis/public_v2/docs/ObjectKeys.md @@ -0,0 +1,29 @@ +# ObjectKeys + +List of s3 object keys to retrieve from bucket to be converted and uploaded to the data index. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.object_keys import ObjectKeys + +# TODO update the JSON string below +json = "{}" +# create an instance of ObjectKeys from a JSON string +object_keys_instance = ObjectKeys.from_json(json) +# print the JSON string representation of the object +print(ObjectKeys.to_json()) + +# convert the object into a dict +object_keys_dict = object_keys_instance.to_dict() +# create an instance of ObjectKeys from a dict +object_keys_form_dict = object_keys.from_dict(object_keys_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/OcrSettings.md b/docs/apis/public_v2/docs/OcrSettings.md index 8cb652a4..3af8fe0f 100644 --- a/docs/apis/public_v2/docs/OcrSettings.md +++ b/docs/apis/public_v2/docs/OcrSettings.md @@ -6,9 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enabled** | **bool** | | [optional] [default to False] -**backend** | **str** | | [optional] -**backend_settings** | **object** | | [optional] -**merge_mode** | **str** | | [optional] +**backend** | [**Backend**](Backend.md) | | [optional] +**backend_settings** | [**BackendSettings**](BackendSettings.md) | | [optional] +**merge_mode** | [**MergeMode**](MergeMode.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/Page.md b/docs/apis/public_v2/docs/Page.md new file mode 100644 index 00000000..2829e6b3 --- /dev/null +++ b/docs/apis/public_v2/docs/Page.md @@ -0,0 +1,28 @@ +# Page + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.page import Page + +# TODO update the JSON string below +json = "{}" +# create an instance of Page from a JSON string +page_instance = Page.from_json(json) +# print the JSON string representation of the object +print(Page.to_json()) + +# convert the object into a dict +page_dict = page_instance.to_dict() +# create an instance of Page from a dict +page_form_dict = page.from_dict(page_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/PageLabels.md b/docs/apis/public_v2/docs/PageLabels.md new file mode 100644 index 00000000..8a29524d --- /dev/null +++ b/docs/apis/public_v2/docs/PageLabels.md @@ -0,0 +1,28 @@ +# PageLabels + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.page_labels import PageLabels + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLabels from a JSON string +page_labels_instance = PageLabels.from_json(json) +# print the JSON string representation of the object +print(PageLabels.to_json()) + +# convert the object into a dict +page_labels_dict = page_labels_instance.to_dict() +# create an instance of PageLabels from a dict +page_labels_form_dict = page_labels.from_dict(page_labels_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Pages.md b/docs/apis/public_v2/docs/Pages.md new file mode 100644 index 00000000..451aecf1 --- /dev/null +++ b/docs/apis/public_v2/docs/Pages.md @@ -0,0 +1,29 @@ +# Pages + +Page range in the publication. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.pages import Pages + +# TODO update the JSON string below +json = "{}" +# create an instance of Pages from a JSON string +pages_instance = Pages.from_json(json) +# print the JSON string representation of the object +print(Pages.to_json()) + +# convert the object into a dict +pages_dict = pages_instance.to_dict() +# create an instance of Pages from a dict +pages_form_dict = pages.from_dict(pages_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Params.md b/docs/apis/public_v2/docs/Params.md new file mode 100644 index 00000000..3d52ca80 --- /dev/null +++ b/docs/apis/public_v2/docs/Params.md @@ -0,0 +1,28 @@ +# Params + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.params import Params + +# TODO update the JSON string below +json = "{}" +# create an instance of Params from a JSON string +params_instance = Params.from_json(json) +# print the JSON string representation of the object +print(Params.to_json()) + +# convert the object into a dict +params_dict = params_instance.to_dict() +# create an instance of Params from a dict +params_form_dict = params.from_dict(params_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/PartialDirectConversionParameters.md b/docs/apis/public_v2/docs/PartialDirectConversionParameters.md index 0daec9b8..34a087a9 100644 --- a/docs/apis/public_v2/docs/PartialDirectConversionParameters.md +++ b/docs/apis/public_v2/docs/PartialDirectConversionParameters.md @@ -7,11 +7,11 @@ Specify conversion settings (OCR, Assemble, ML Models) directly. Fields left nu Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | | [optional] [default to 'direct'] -**ocr** | [**OcrSettings**](OcrSettings.md) | | [optional] -**assemble** | [**AssembleSettings**](AssembleSettings.md) | | [optional] -**metadata** | [**CollectionMetadataSettings**](CollectionMetadataSettings.md) | | [optional] -**page_labels** | **Dict[str, object]** | | [optional] -**model_pipeline** | [**ModelPipelineSettings**](ModelPipelineSettings.md) | | [optional] +**ocr** | [**PartialDirectConversionParametersOcr**](PartialDirectConversionParametersOcr.md) | | [optional] +**assemble** | [**PartialDirectConversionParametersAssemble**](PartialDirectConversionParametersAssemble.md) | | [optional] +**metadata** | [**PartialDirectConversionParametersMetadata**](PartialDirectConversionParametersMetadata.md) | | [optional] +**page_labels** | [**PageLabels**](PageLabels.md) | | [optional] +**model_pipeline** | [**PartialDirectConversionParametersModelPipeline**](PartialDirectConversionParametersModelPipeline.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/PartialDirectConversionParametersAssemble.md b/docs/apis/public_v2/docs/PartialDirectConversionParametersAssemble.md new file mode 100644 index 00000000..0e984bb6 --- /dev/null +++ b/docs/apis/public_v2/docs/PartialDirectConversionParametersAssemble.md @@ -0,0 +1,30 @@ +# PartialDirectConversionParametersAssemble + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | [**AssembleMode**](AssembleMode.md) | | +**include_incomplete_documents** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_assemble import PartialDirectConversionParametersAssemble + +# TODO update the JSON string below +json = "{}" +# create an instance of PartialDirectConversionParametersAssemble from a JSON string +partial_direct_conversion_parameters_assemble_instance = PartialDirectConversionParametersAssemble.from_json(json) +# print the JSON string representation of the object +print(PartialDirectConversionParametersAssemble.to_json()) + +# convert the object into a dict +partial_direct_conversion_parameters_assemble_dict = partial_direct_conversion_parameters_assemble_instance.to_dict() +# create an instance of PartialDirectConversionParametersAssemble from a dict +partial_direct_conversion_parameters_assemble_form_dict = partial_direct_conversion_parameters_assemble.from_dict(partial_direct_conversion_parameters_assemble_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/PartialDirectConversionParametersMetadata.md b/docs/apis/public_v2/docs/PartialDirectConversionParametersMetadata.md new file mode 100644 index 00000000..5fa0c612 --- /dev/null +++ b/docs/apis/public_v2/docs/PartialDirectConversionParametersMetadata.md @@ -0,0 +1,33 @@ +# PartialDirectConversionParametersMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | [**Description**](Description.md) | | [optional] +**display_name** | [**DisplayName**](DisplayName.md) | | [optional] +**license** | [**License**](License.md) | | [optional] +**source** | [**Source1**](Source1.md) | | [optional] +**version** | [**Version1**](Version1.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_metadata import PartialDirectConversionParametersMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of PartialDirectConversionParametersMetadata from a JSON string +partial_direct_conversion_parameters_metadata_instance = PartialDirectConversionParametersMetadata.from_json(json) +# print the JSON string representation of the object +print(PartialDirectConversionParametersMetadata.to_json()) + +# convert the object into a dict +partial_direct_conversion_parameters_metadata_dict = partial_direct_conversion_parameters_metadata_instance.to_dict() +# create an instance of PartialDirectConversionParametersMetadata from a dict +partial_direct_conversion_parameters_metadata_form_dict = partial_direct_conversion_parameters_metadata.from_dict(partial_direct_conversion_parameters_metadata_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/PartialDirectConversionParametersModelPipeline.md b/docs/apis/public_v2/docs/PartialDirectConversionParametersModelPipeline.md new file mode 100644 index 00000000..24c1eabd --- /dev/null +++ b/docs/apis/public_v2/docs/PartialDirectConversionParametersModelPipeline.md @@ -0,0 +1,32 @@ +# PartialDirectConversionParametersModelPipeline + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clusters** | **object** | | +**page** | **object** | | +**tables** | **object** | | +**normalization** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_model_pipeline import PartialDirectConversionParametersModelPipeline + +# TODO update the JSON string below +json = "{}" +# create an instance of PartialDirectConversionParametersModelPipeline from a JSON string +partial_direct_conversion_parameters_model_pipeline_instance = PartialDirectConversionParametersModelPipeline.from_json(json) +# print the JSON string representation of the object +print(PartialDirectConversionParametersModelPipeline.to_json()) + +# convert the object into a dict +partial_direct_conversion_parameters_model_pipeline_dict = partial_direct_conversion_parameters_model_pipeline_instance.to_dict() +# create an instance of PartialDirectConversionParametersModelPipeline from a dict +partial_direct_conversion_parameters_model_pipeline_form_dict = partial_direct_conversion_parameters_model_pipeline.from_dict(partial_direct_conversion_parameters_model_pipeline_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/PartialDirectConversionParametersOcr.md b/docs/apis/public_v2/docs/PartialDirectConversionParametersOcr.md new file mode 100644 index 00000000..6b0a8dbb --- /dev/null +++ b/docs/apis/public_v2/docs/PartialDirectConversionParametersOcr.md @@ -0,0 +1,32 @@ +# PartialDirectConversionParametersOcr + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **object** | | [optional] +**backend** | [**Backend**](Backend.md) | | [optional] +**backend_settings** | [**BackendSettings**](BackendSettings.md) | | [optional] +**merge_mode** | [**MergeMode**](MergeMode.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters_ocr import PartialDirectConversionParametersOcr + +# TODO update the JSON string below +json = "{}" +# create an instance of PartialDirectConversionParametersOcr from a JSON string +partial_direct_conversion_parameters_ocr_instance = PartialDirectConversionParametersOcr.from_json(json) +# print the JSON string representation of the object +print(PartialDirectConversionParametersOcr.to_json()) + +# convert the object into a dict +partial_direct_conversion_parameters_ocr_dict = partial_direct_conversion_parameters_ocr_instance.to_dict() +# create an instance of PartialDirectConversionParametersOcr from a dict +partial_direct_conversion_parameters_ocr_form_dict = partial_direct_conversion_parameters_ocr.from_dict(partial_direct_conversion_parameters_ocr_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ProjKey.md b/docs/apis/public_v2/docs/ProjKey.md new file mode 100644 index 00000000..3cf619d9 --- /dev/null +++ b/docs/apis/public_v2/docs/ProjKey.md @@ -0,0 +1,28 @@ +# ProjKey + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.proj_key import ProjKey + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjKey from a JSON string +proj_key_instance = ProjKey.from_json(json) +# print the JSON string representation of the object +print(ProjKey.to_json()) + +# convert the object into a dict +proj_key_dict = proj_key_instance.to_dict() +# create an instance of ProjKey from a dict +proj_key_form_dict = proj_key.from_dict(proj_key_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ProjectApi.md b/docs/apis/public_v2/docs/ProjectApi.md index 5a224d65..0a7aac28 100644 --- a/docs/apis/public_v2/docs/ProjectApi.md +++ b/docs/apis/public_v2/docs/ProjectApi.md @@ -4,9 +4,9 @@ All URIs are relative to */api/cps/public/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**check_wait_ccs_task_task**](ProjectApi.md#check_wait_ccs_task_task) | **GET** /project/{proj_key}/convert_tasks/{task_id} | Check Wait Ccs Task Task -[**convert_pdf_document**](ProjectApi.md#convert_pdf_document) | **POST** /project/{proj_key}/convert | Convert Pdf Document +[**convert_document**](ProjectApi.md#convert_document) | **POST** /project/{proj_key}/convert | Convert Document [**delete_project_integration_config_genai**](ProjectApi.md#delete_project_integration_config_genai) | **DELETE** /project/{proj_key}/integrations/genai | Delete Project Integration Config Genai +[**get_convert_task**](ProjectApi.md#get_convert_task) | **GET** /project/{proj_key}/convert_tasks/{task_id} | Get Convert Task [**get_project_default_values**](ProjectApi.md#get_project_default_values) | **GET** /project/{proj_key}/default_values | Get Project Default Values [**get_project_integration_config_genai**](ProjectApi.md#get_project_integration_config_genai) | **GET** /project/{proj_key}/integrations/genai | Get Project Integration Config Genai [**provision_project_packages**](ProjectApi.md#provision_project_packages) | **POST** /project/{proj_key}/packages | Provision Project Packages @@ -14,12 +14,12 @@ Method | HTTP request | Description [**update_project_integration_config_genai**](ProjectApi.md#update_project_integration_config_genai) | **POST** /project/{proj_key}/integrations/genai | Update Project Integration Config Genai -# **check_wait_ccs_task_task** -> TaskResult check_wait_ccs_task_task(task_id, proj_key, wait=wait) +# **convert_document** +> CpsTask convert_document(proj_key, convert_document_request) -Check Wait Ccs Task Task +Convert Document -Check status of a CCS conversion task. +Convert a document directly with Docling. ### Example @@ -27,7 +27,8 @@ Check status of a CCS conversion task. ```python import deepsearch.cps.apis.public_v2 -from deepsearch.cps.apis.public_v2.models.task_result import TaskResult +from deepsearch.cps.apis.public_v2.models.convert_document_request import ConvertDocumentRequest +from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask from deepsearch.cps.apis.public_v2.rest import ApiException from pprint import pprint @@ -52,17 +53,16 @@ configuration.api_key['Bearer'] = os.environ["API_KEY"] with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = deepsearch.cps.apis.public_v2.ProjectApi(api_client) - task_id = 'task_id_example' # str | proj_key = 'proj_key_example' # str | - wait = 3.4 # float | Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. (optional) + convert_document_request = deepsearch.cps.apis.public_v2.ConvertDocumentRequest() # ConvertDocumentRequest | try: - # Check Wait Ccs Task Task - api_response = api_instance.check_wait_ccs_task_task(task_id, proj_key, wait=wait) - print("The response of ProjectApi->check_wait_ccs_task_task:\n") + # Convert Document + api_response = api_instance.convert_document(proj_key, convert_document_request) + print("The response of ProjectApi->convert_document:\n") pprint(api_response) except Exception as e: - print("Exception when calling ProjectApi->check_wait_ccs_task_task: %s\n" % e) + print("Exception when calling ProjectApi->convert_document: %s\n" % e) ``` @@ -72,13 +72,12 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **task_id** | **str**| | **proj_key** | **str**| | - **wait** | **float**| Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. | [optional] + **convert_document_request** | [**ConvertDocumentRequest**](ConvertDocumentRequest.md)| | ### Return type -[**TaskResult**](TaskResult.md) +[**CpsTask**](CpsTask.md) ### Authorization @@ -86,7 +85,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -98,12 +97,12 @@ 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) -# **convert_pdf_document** -> CcsTask convert_pdf_document(proj_key, convert_document_request) +# **delete_project_integration_config_genai** +> delete_project_integration_config_genai(proj_key) -Convert Pdf Document +Delete Project Integration Config Genai -Convert a PDF document directly to CCS. +Delete the GenAI config for a given project integration. ### Example @@ -111,8 +110,6 @@ Convert a PDF document directly to CCS. ```python import deepsearch.cps.apis.public_v2 -from deepsearch.cps.apis.public_v2.models.ccs_task import CcsTask -from deepsearch.cps.apis.public_v2.models.convert_document_request import ConvertDocumentRequest from deepsearch.cps.apis.public_v2.rest import ApiException from pprint import pprint @@ -138,15 +135,12 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = deepsearch.cps.apis.public_v2.ProjectApi(api_client) proj_key = 'proj_key_example' # str | - convert_document_request = deepsearch.cps.apis.public_v2.ConvertDocumentRequest() # ConvertDocumentRequest | try: - # Convert Pdf Document - api_response = api_instance.convert_pdf_document(proj_key, convert_document_request) - print("The response of ProjectApi->convert_pdf_document:\n") - pprint(api_response) + # Delete Project Integration Config Genai + api_instance.delete_project_integration_config_genai(proj_key) except Exception as e: - print("Exception when calling ProjectApi->convert_pdf_document: %s\n" % e) + print("Exception when calling ProjectApi->delete_project_integration_config_genai: %s\n" % e) ``` @@ -157,11 +151,10 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **proj_key** | **str**| | - **convert_document_request** | [**ConvertDocumentRequest**](ConvertDocumentRequest.md)| | ### Return type -[**CcsTask**](CcsTask.md) +void (empty response body) ### Authorization @@ -169,24 +162,24 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successful Response | - | +**204** | 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_project_integration_config_genai** -> delete_project_integration_config_genai(proj_key) +# **get_convert_task** +> TaskResult get_convert_task(task_id, proj_key, wait=wait) -Delete Project Integration Config Genai +Get Convert Task -Delete the GenAI config for a given project integration. +Check status of a Docling conversion task; return presign urls for MD and JSON file if finished conversion successfully. ### Example @@ -194,6 +187,7 @@ Delete the GenAI config for a given project integration. ```python import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.task_result import TaskResult from deepsearch.cps.apis.public_v2.rest import ApiException from pprint import pprint @@ -218,13 +212,17 @@ configuration.api_key['Bearer'] = os.environ["API_KEY"] with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = deepsearch.cps.apis.public_v2.ProjectApi(api_client) + task_id = 'task_id_example' # str | proj_key = 'proj_key_example' # str | + wait = deepsearch.cps.apis.public_v2.Wait() # Wait | Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. (optional) try: - # Delete Project Integration Config Genai - api_instance.delete_project_integration_config_genai(proj_key) + # Get Convert Task + api_response = api_instance.get_convert_task(task_id, proj_key, wait=wait) + print("The response of ProjectApi->get_convert_task:\n") + pprint(api_response) except Exception as e: - print("Exception when calling ProjectApi->delete_project_integration_config_genai: %s\n" % e) + print("Exception when calling ProjectApi->get_convert_task: %s\n" % e) ``` @@ -234,11 +232,13 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **task_id** | **str**| | **proj_key** | **str**| | + **wait** | [**Wait**](.md)| Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. | [optional] ### Return type -void (empty response body) +[**TaskResult**](TaskResult.md) ### Authorization @@ -253,7 +253,7 @@ void (empty response body) | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Successful Response | - | +**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) @@ -377,7 +377,7 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = deepsearch.cps.apis.public_v2.ProjectApi(api_client) proj_key = 'proj_key_example' # str | - decode_secrets = True # bool | (optional) + decode_secrets = deepsearch.cps.apis.public_v2.DecodeSecrets() # DecodeSecrets | (optional) try: # Get Project Integration Config Genai @@ -396,7 +396,7 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **proj_key** | **str**| | - **decode_secrets** | **bool**| | [optional] + **decode_secrets** | [**DecodeSecrets**](.md)| | [optional] ### Return type diff --git a/docs/apis/public_v2/docs/ProjectDataIndexConversionSettingsInput.md b/docs/apis/public_v2/docs/ProjectDataIndexConversionSettingsInput.md new file mode 100644 index 00000000..88bd88e8 --- /dev/null +++ b/docs/apis/public_v2/docs/ProjectDataIndexConversionSettingsInput.md @@ -0,0 +1,31 @@ +# ProjectDataIndexConversionSettingsInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ocr** | [**OCROptions**](OCROptions.md) | | [optional] +**table_structure** | [**TableStructureOptions**](TableStructureOptions.md) | | [optional] +**generate_page_images** | **bool** | | [optional] [default to True] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_input import ProjectDataIndexConversionSettingsInput + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectDataIndexConversionSettingsInput from a JSON string +project_data_index_conversion_settings_input_instance = ProjectDataIndexConversionSettingsInput.from_json(json) +# print the JSON string representation of the object +print(ProjectDataIndexConversionSettingsInput.to_json()) + +# convert the object into a dict +project_data_index_conversion_settings_input_dict = project_data_index_conversion_settings_input_instance.to_dict() +# create an instance of ProjectDataIndexConversionSettingsInput from a dict +project_data_index_conversion_settings_input_form_dict = project_data_index_conversion_settings_input.from_dict(project_data_index_conversion_settings_input_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ProjectDataIndexConversionSettingsOutput.md b/docs/apis/public_v2/docs/ProjectDataIndexConversionSettingsOutput.md new file mode 100644 index 00000000..7e19c2df --- /dev/null +++ b/docs/apis/public_v2/docs/ProjectDataIndexConversionSettingsOutput.md @@ -0,0 +1,31 @@ +# ProjectDataIndexConversionSettingsOutput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ocr** | [**OCROptions**](OCROptions.md) | | [optional] +**table_structure** | [**TableStructureOptions**](TableStructureOptions.md) | | [optional] +**generate_page_images** | **bool** | | [optional] [default to True] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_data_index_conversion_settings_output import ProjectDataIndexConversionSettingsOutput + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectDataIndexConversionSettingsOutput from a JSON string +project_data_index_conversion_settings_output_instance = ProjectDataIndexConversionSettingsOutput.from_json(json) +# print the JSON string representation of the object +print(ProjectDataIndexConversionSettingsOutput.to_json()) + +# convert the object into a dict +project_data_index_conversion_settings_output_dict = project_data_index_conversion_settings_output_instance.to_dict() +# create an instance of ProjectDataIndexConversionSettingsOutput from a dict +project_data_index_conversion_settings_output_form_dict = project_data_index_conversion_settings_output.from_dict(project_data_index_conversion_settings_output_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ProjectDataIndexNonView.md b/docs/apis/public_v2/docs/ProjectDataIndexNonView.md index 28912138..802e6731 100644 --- a/docs/apis/public_v2/docs/ProjectDataIndexNonView.md +++ b/docs/apis/public_v2/docs/ProjectDataIndexNonView.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | -**description** | **str** | | [optional] +**description** | [**Description**](Description.md) | | [optional] **schema_key** | **str** | | [optional] [default to 'generic'] ## Example diff --git a/docs/apis/public_v2/docs/ProjectDataIndexView.md b/docs/apis/public_v2/docs/ProjectDataIndexView.md index 83b93f76..273de068 100644 --- a/docs/apis/public_v2/docs/ProjectDataIndexView.md +++ b/docs/apis/public_v2/docs/ProjectDataIndexView.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | -**description** | **str** | | [optional] +**description** | [**Description**](Description.md) | | [optional] **view_of** | [**ViewOf**](ViewOf.md) | | ## Example diff --git a/docs/apis/public_v2/docs/ProjectDataIndexWithStatus.md b/docs/apis/public_v2/docs/ProjectDataIndexWithStatus.md index 9b5c86ad..6c73602a 100644 --- a/docs/apis/public_v2/docs/ProjectDataIndexWithStatus.md +++ b/docs/apis/public_v2/docs/ProjectDataIndexWithStatus.md @@ -5,19 +5,19 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**source** | [**Source**](Source.md) | | +**source** | [**Source3**](Source3.md) | | **name** | **str** | | **documents** | **int** | | **health** | **str** | | **status** | **str** | | **creation_date** | **str** | | -**metadata** | [**ElasticMetadata**](ElasticMetadata.md) | | [optional] +**metadata** | [**ProjectDataIndexWithStatusMetadata**](ProjectDataIndexWithStatusMetadata.md) | | [optional] **description** | **str** | | -**schema_key** | **str** | | [optional] +**schema_key** | [**SchemaKey**](SchemaKey.md) | | [optional] **type** | **str** | | -**view_of** | [**ViewOf**](ViewOf.md) | | [optional] -**record_properties** | **object** | | [optional] -**provenance** | **str** | | [optional] +**view_of** | [**ViewOf1**](ViewOf1.md) | | [optional] +**record_properties** | [**RecordProperties**](RecordProperties.md) | | [optional] +**provenance** | [**Provenance**](Provenance.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/ProjectDataIndexWithStatusMetadata.md b/docs/apis/public_v2/docs/ProjectDataIndexWithStatusMetadata.md new file mode 100644 index 00000000..c55bd928 --- /dev/null +++ b/docs/apis/public_v2/docs/ProjectDataIndexWithStatusMetadata.md @@ -0,0 +1,38 @@ +# ProjectDataIndexWithStatusMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aliases** | [**Aliases**](Aliases.md) | | [optional] +**created** | [**Created**](Created.md) | | [optional] +**description** | [**Description**](Description.md) | | [optional] +**display_name** | [**DisplayName**](DisplayName.md) | | [optional] +**source** | [**Source1**](Source1.md) | | [optional] +**storage** | [**Storage**](Storage.md) | | [optional] +**version** | [**Version1**](Version1.md) | | [optional] +**type** | [**Type**](Type.md) | | [optional] +**domain** | [**Domain**](Domain.md) | | [optional] +**classification** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_data_index_with_status_metadata import ProjectDataIndexWithStatusMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectDataIndexWithStatusMetadata from a JSON string +project_data_index_with_status_metadata_instance = ProjectDataIndexWithStatusMetadata.from_json(json) +# print the JSON string representation of the object +print(ProjectDataIndexWithStatusMetadata.to_json()) + +# convert the object into a dict +project_data_index_with_status_metadata_dict = project_data_index_with_status_metadata_instance.to_dict() +# create an instance of ProjectDataIndexWithStatusMetadata from a dict +project_data_index_with_status_metadata_form_dict = project_data_index_with_status_metadata.from_dict(project_data_index_with_status_metadata_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ProjectDocument.md b/docs/apis/public_v2/docs/ProjectDocument.md index dfe145cc..136e4ef2 100644 --- a/docs/apis/public_v2/docs/ProjectDocument.md +++ b/docs/apis/public_v2/docs/ProjectDocument.md @@ -6,11 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **document_hash** | **str** | | -**filename** | **str** | | -**file_uri** | **str** | | [optional] -**ref_uri** | **str** | | [optional] -**number_pages** | **int** | | [optional] -**status** | **str** | | [optional] +**filename** | [**Filename**](Filename.md) | | [optional] +**file_uri** | [**FileUri**](FileUri.md) | | [optional] +**ref_uri** | [**RefUri**](RefUri.md) | | [optional] +**number_pages** | [**NumberPages**](NumberPages.md) | | [optional] +**status** | [**Status**](Status.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/PromptTemplate.md b/docs/apis/public_v2/docs/PromptTemplate.md new file mode 100644 index 00000000..3b07facd --- /dev/null +++ b/docs/apis/public_v2/docs/PromptTemplate.md @@ -0,0 +1,28 @@ +# PromptTemplate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.prompt_template import PromptTemplate + +# TODO update the JSON string below +json = "{}" +# create an instance of PromptTemplate from a JSON string +prompt_template_instance = PromptTemplate.from_json(json) +# print the JSON string representation of the object +print(PromptTemplate.to_json()) + +# convert the object into a dict +prompt_template_dict = prompt_template_instance.to_dict() +# create an instance of PromptTemplate from a dict +prompt_template_form_dict = prompt_template.from_dict(prompt_template_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Properties.md b/docs/apis/public_v2/docs/Properties.md index db8ca3da..da0b2b69 100644 --- a/docs/apis/public_v2/docs/Properties.md +++ b/docs/apis/public_v2/docs/Properties.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **properties** | [**Dict[str, Properties]**](Properties.md) | | **type** | **object** | | -**enabled** | **object** | | [optional] -**ignore_above** | **object** | | [optional] +**enabled** | [**Enabled**](Enabled.md) | | [optional] +**ignore_above** | [**IgnoreAbove**](IgnoreAbove.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/Provenance.md b/docs/apis/public_v2/docs/Provenance.md new file mode 100644 index 00000000..9dc16f18 --- /dev/null +++ b/docs/apis/public_v2/docs/Provenance.md @@ -0,0 +1,28 @@ +# Provenance + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.provenance import Provenance + +# TODO update the JSON string below +json = "{}" +# create an instance of Provenance from a JSON string +provenance_instance = Provenance.from_json(json) +# print the JSON string representation of the object +print(Provenance.to_json()) + +# convert the object into a dict +provenance_dict = provenance_instance.to_dict() +# create an instance of Provenance from a dict +provenance_form_dict = provenance.from_dict(provenance_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Publication.md b/docs/apis/public_v2/docs/Publication.md new file mode 100644 index 00000000..646582c0 --- /dev/null +++ b/docs/apis/public_v2/docs/Publication.md @@ -0,0 +1,37 @@ +# Publication + +Publication details of a journal or venue. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifiers** | [**Identifiers1**](Identifiers1.md) | | [optional] +**name** | **str** | Name of the publication. | +**alternate_names** | [**AlternateNames**](AlternateNames.md) | | [optional] +**type** | [**Type1**](Type1.md) | | [optional] +**pages** | [**Pages**](Pages.md) | | [optional] +**issue** | [**Issue**](Issue.md) | | [optional] +**volume** | [**Volume**](Volume.md) | | [optional] +**url** | [**Url**](Url.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.publication import Publication + +# TODO update the JSON string below +json = "{}" +# create an instance of Publication from a JSON string +publication_instance = Publication.from_json(json) +# print the JSON string representation of the object +print(Publication.to_json()) + +# convert the object into a dict +publication_dict = publication_instance.to_dict() +# create an instance of Publication from a dict +publication_form_dict = publication.from_dict(publication_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Publication1.md b/docs/apis/public_v2/docs/Publication1.md new file mode 100644 index 00000000..a1d0caae --- /dev/null +++ b/docs/apis/public_v2/docs/Publication1.md @@ -0,0 +1,29 @@ +# Publication1 + +List of publication journals or venues. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.publication1 import Publication1 + +# TODO update the JSON string below +json = "{}" +# create an instance of Publication1 from a JSON string +publication1_instance = Publication1.from_json(json) +# print the JSON string representation of the object +print(Publication1.to_json()) + +# convert the object into a dict +publication1_dict = publication1_instance.to_dict() +# create an instance of Publication1 from a dict +publication1_form_dict = publication1.from_dict(publication1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/PublicationDate.md b/docs/apis/public_v2/docs/PublicationDate.md new file mode 100644 index 00000000..4caeb50e --- /dev/null +++ b/docs/apis/public_v2/docs/PublicationDate.md @@ -0,0 +1,28 @@ +# PublicationDate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.publication_date import PublicationDate + +# TODO update the JSON string below +json = "{}" +# create an instance of PublicationDate from a JSON string +publication_date_instance = PublicationDate.from_json(json) +# print the JSON string representation of the object +print(PublicationDate.to_json()) + +# convert the object into a dict +publication_date_dict = publication_date_instance.to_dict() +# create an instance of PublicationDate from a dict +publication_date_form_dict = publication_date.from_dict(publication_date_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Publishers.md b/docs/apis/public_v2/docs/Publishers.md new file mode 100644 index 00000000..b4c73a21 --- /dev/null +++ b/docs/apis/public_v2/docs/Publishers.md @@ -0,0 +1,28 @@ +# Publishers + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.publishers import Publishers + +# TODO update the JSON string below +json = "{}" +# create an instance of Publishers from a JSON string +publishers_instance = Publishers.from_json(json) +# print the JSON string representation of the object +print(Publishers.to_json()) + +# convert the object into a dict +publishers_dict = publishers_instance.to_dict() +# create an instance of Publishers from a dict +publishers_form_dict = publishers.from_dict(publishers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Query.md b/docs/apis/public_v2/docs/Query.md new file mode 100644 index 00000000..6678068f --- /dev/null +++ b/docs/apis/public_v2/docs/Query.md @@ -0,0 +1,28 @@ +# Query + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.query import Query + +# TODO update the JSON string below +json = "{}" +# create an instance of Query from a JSON string +query_instance = Query.from_json(json) +# print the JSON string representation of the object +print(Query.to_json()) + +# convert the object into a dict +query_dict = query_instance.to_dict() +# create an instance of Query from a dict +query_form_dict = query.from_dict(query_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/RecordProperties.md b/docs/apis/public_v2/docs/RecordProperties.md new file mode 100644 index 00000000..6930e0c6 --- /dev/null +++ b/docs/apis/public_v2/docs/RecordProperties.md @@ -0,0 +1,28 @@ +# RecordProperties + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.record_properties import RecordProperties + +# TODO update the JSON string below +json = "{}" +# create an instance of RecordProperties from a JSON string +record_properties_instance = RecordProperties.from_json(json) +# print the JSON string representation of the object +print(RecordProperties.to_json()) + +# convert the object into a dict +record_properties_dict = record_properties_instance.to_dict() +# create an instance of RecordProperties from a dict +record_properties_form_dict = record_properties.from_dict(record_properties_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/RefUri.md b/docs/apis/public_v2/docs/RefUri.md new file mode 100644 index 00000000..d6469c7a --- /dev/null +++ b/docs/apis/public_v2/docs/RefUri.md @@ -0,0 +1,28 @@ +# RefUri + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.ref_uri import RefUri + +# TODO update the JSON string below +json = "{}" +# create an instance of RefUri from a JSON string +ref_uri_instance = RefUri.from_json(json) +# print the JSON string representation of the object +print(RefUri.to_json()) + +# convert the object into a dict +ref_uri_dict = ref_uri_instance.to_dict() +# create an instance of RefUri from a dict +ref_uri_form_dict = ref_uri.from_dict(ref_uri_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ReferenceCount.md b/docs/apis/public_v2/docs/ReferenceCount.md new file mode 100644 index 00000000..bf35e1fb --- /dev/null +++ b/docs/apis/public_v2/docs/ReferenceCount.md @@ -0,0 +1,29 @@ +# ReferenceCount + +Total number of documents referenced by this document. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.reference_count import ReferenceCount + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferenceCount from a JSON string +reference_count_instance = ReferenceCount.from_json(json) +# print the JSON string representation of the object +print(ReferenceCount.to_json()) + +# convert the object into a dict +reference_count_dict = reference_count_instance.to_dict() +# create an instance of ReferenceCount from a dict +reference_count_form_dict = reference_count.from_dict(reference_count_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/References.md b/docs/apis/public_v2/docs/References.md new file mode 100644 index 00000000..b7ec005e --- /dev/null +++ b/docs/apis/public_v2/docs/References.md @@ -0,0 +1,28 @@ +# References + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.references import References + +# TODO update the JSON string below +json = "{}" +# create an instance of References from a JSON string +references_instance = References.from_json(json) +# print the JSON string representation of the object +print(References.to_json()) + +# convert the object into a dict +references_dict = references_instance.to_dict() +# create an instance of References from a dict +references_form_dict = references.from_dict(references_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/RelatedTasks.md b/docs/apis/public_v2/docs/RelatedTasks.md new file mode 100644 index 00000000..c6775804 --- /dev/null +++ b/docs/apis/public_v2/docs/RelatedTasks.md @@ -0,0 +1,28 @@ +# RelatedTasks + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.related_tasks import RelatedTasks + +# TODO update the JSON string below +json = "{}" +# create an instance of RelatedTasks from a JSON string +related_tasks_instance = RelatedTasks.from_json(json) +# print the JSON string representation of the object +print(RelatedTasks.to_json()) + +# convert the object into a dict +related_tasks_dict = related_tasks_instance.to_dict() +# create an instance of RelatedTasks from a dict +related_tasks_form_dict = related_tasks.from_dict(related_tasks_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ResponseGetProjectDataIndexConversionSettings.md b/docs/apis/public_v2/docs/ResponseGetProjectDataIndexConversionSettings.md new file mode 100644 index 00000000..204231e3 --- /dev/null +++ b/docs/apis/public_v2/docs/ResponseGetProjectDataIndexConversionSettings.md @@ -0,0 +1,31 @@ +# ResponseGetProjectDataIndexConversionSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ocr** | [**OCROptions**](OCROptions.md) | | [optional] +**table_structure** | [**TableStructureOptions**](TableStructureOptions.md) | | [optional] +**generate_page_images** | **object** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.response_get_project_data_index_conversion_settings import ResponseGetProjectDataIndexConversionSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of ResponseGetProjectDataIndexConversionSettings from a JSON string +response_get_project_data_index_conversion_settings_instance = ResponseGetProjectDataIndexConversionSettings.from_json(json) +# print the JSON string representation of the object +print(ResponseGetProjectDataIndexConversionSettings.to_json()) + +# convert the object into a dict +response_get_project_data_index_conversion_settings_dict = response_get_project_data_index_conversion_settings_instance.to_dict() +# create an instance of ResponseGetProjectDataIndexConversionSettings from a dict +response_get_project_data_index_conversion_settings_form_dict = response_get_project_data_index_conversion_settings.from_dict(response_get_project_data_index_conversion_settings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ResponseGetProjectIntegrationConfigGenai.md b/docs/apis/public_v2/docs/ResponseGetProjectIntegrationConfigGenai.md index b9ee8bc0..17952281 100644 --- a/docs/apis/public_v2/docs/ResponseGetProjectIntegrationConfigGenai.md +++ b/docs/apis/public_v2/docs/ResponseGetProjectIntegrationConfigGenai.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **kind** | **object** | | [optional] **config** | [**GenAIAWSBedrockConfig**](GenAIAWSBedrockConfig.md) | | -**proj_params** | [**GenAIPartialParams**](GenAIPartialParams.md) | | [optional] +**proj_params** | [**GenAIAWSBedrockProjParams**](GenAIAWSBedrockProjParams.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/ResponseUpdateProjectDataIndexConversionSettings.md b/docs/apis/public_v2/docs/ResponseUpdateProjectDataIndexConversionSettings.md new file mode 100644 index 00000000..4c767281 --- /dev/null +++ b/docs/apis/public_v2/docs/ResponseUpdateProjectDataIndexConversionSettings.md @@ -0,0 +1,31 @@ +# ResponseUpdateProjectDataIndexConversionSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ocr** | [**OCROptions**](OCROptions.md) | | [optional] +**table_structure** | [**TableStructureOptions**](TableStructureOptions.md) | | [optional] +**generate_page_images** | **object** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.response_update_project_data_index_conversion_settings import ResponseUpdateProjectDataIndexConversionSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of ResponseUpdateProjectDataIndexConversionSettings from a JSON string +response_update_project_data_index_conversion_settings_instance = ResponseUpdateProjectDataIndexConversionSettings.from_json(json) +# print the JSON string representation of the object +print(ResponseUpdateProjectDataIndexConversionSettings.to_json()) + +# convert the object into a dict +response_update_project_data_index_conversion_settings_dict = response_update_project_data_index_conversion_settings_instance.to_dict() +# create an instance of ResponseUpdateProjectDataIndexConversionSettings from a dict +response_update_project_data_index_conversion_settings_form_dict = response_update_project_data_index_conversion_settings.from_dict(response_update_project_data_index_conversion_settings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/S3Coordinates.md b/docs/apis/public_v2/docs/S3Coordinates.md index 4cf1d984..7d04af28 100644 --- a/docs/apis/public_v2/docs/S3Coordinates.md +++ b/docs/apis/public_v2/docs/S3Coordinates.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **access_key** | **str** | | **secret_key** | **str** | | **bucket** | **str** | | -**key_prefix** | **str** | | [optional] +**key_prefix** | [**KeyPrefix**](KeyPrefix.md) | | [optional] **location** | **str** | | ## Example diff --git a/docs/apis/public_v2/docs/S3DocumentSource.md b/docs/apis/public_v2/docs/S3DocumentSource.md index ca01b694..23a4b871 100644 --- a/docs/apis/public_v2/docs/S3DocumentSource.md +++ b/docs/apis/public_v2/docs/S3DocumentSource.md @@ -7,7 +7,7 @@ Specifies documents to import from an S3 bucket Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **coordinates** | [**S3Coordinates**](S3Coordinates.md) | | -**object_keys** | **List[str]** | List of s3 object keys to retrieve from bucket to be converted and uploaded to the data index. | [optional] +**object_keys** | [**ObjectKeys**](ObjectKeys.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/SchemaKey.md b/docs/apis/public_v2/docs/SchemaKey.md new file mode 100644 index 00000000..2d1abc4b --- /dev/null +++ b/docs/apis/public_v2/docs/SchemaKey.md @@ -0,0 +1,28 @@ +# SchemaKey + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.schema_key import SchemaKey + +# TODO update the JSON string below +json = "{}" +# create an instance of SchemaKey from a JSON string +schema_key_instance = SchemaKey.from_json(json) +# print the JSON string representation of the object +print(SchemaKey.to_json()) + +# convert the object into a dict +schema_key_dict = schema_key_instance.to_dict() +# create an instance of SchemaKey from a dict +schema_key_form_dict = schema_key.from_dict(schema_key_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ScratchIds.md b/docs/apis/public_v2/docs/ScratchIds.md new file mode 100644 index 00000000..d348adb3 --- /dev/null +++ b/docs/apis/public_v2/docs/ScratchIds.md @@ -0,0 +1,28 @@ +# ScratchIds + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.scratch_ids import ScratchIds + +# TODO update the JSON string below +json = "{}" +# create an instance of ScratchIds from a JSON string +scratch_ids_instance = ScratchIds.from_json(json) +# print the JSON string representation of the object +print(ScratchIds.to_json()) + +# convert the object into a dict +scratch_ids_dict = scratch_ids_instance.to_dict() +# create an instance of ScratchIds from a dict +scratch_ids_form_dict = scratch_ids.from_dict(scratch_ids_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/SearchString.md b/docs/apis/public_v2/docs/SearchString.md new file mode 100644 index 00000000..f27e42b9 --- /dev/null +++ b/docs/apis/public_v2/docs/SearchString.md @@ -0,0 +1,28 @@ +# SearchString + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.search_string import SearchString + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchString from a JSON string +search_string_instance = SearchString.from_json(json) +# print the JSON string representation of the object +print(SearchString.to_json()) + +# convert the object into a dict +search_string_dict = search_string_instance.to_dict() +# create an instance of SearchString from a dict +search_string_form_dict = search_string.from_dict(search_string_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/SemanticIngestRequest.md b/docs/apis/public_v2/docs/SemanticIngestRequest.md index 111f436d..ec93c1bc 100644 --- a/docs/apis/public_v2/docs/SemanticIngestRequest.md +++ b/docs/apis/public_v2/docs/SemanticIngestRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**source** | [**Source1**](Source1.md) | | +**source** | [**Source4**](Source4.md) | | **parameters** | [**SemanticIngestReqParams**](SemanticIngestReqParams.md) | | ## Example diff --git a/docs/apis/public_v2/docs/Size.md b/docs/apis/public_v2/docs/Size.md new file mode 100644 index 00000000..b7c31e5a --- /dev/null +++ b/docs/apis/public_v2/docs/Size.md @@ -0,0 +1,29 @@ +# Size + +Size in bytes of the raw document from the data source. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.size import Size + +# TODO update the JSON string below +json = "{}" +# create an instance of Size from a JSON string +size_instance = Size.from_json(json) +# print the JSON string representation of the object +print(Size.to_json()) + +# convert the object into a dict +size_dict = size_instance.to_dict() +# create an instance of Size from a dict +size_form_dict = size.from_dict(size_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Size1.md b/docs/apis/public_v2/docs/Size1.md new file mode 100644 index 00000000..b87eb258 --- /dev/null +++ b/docs/apis/public_v2/docs/Size1.md @@ -0,0 +1,28 @@ +# Size1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.size1 import Size1 + +# TODO update the JSON string below +json = "{}" +# create an instance of Size1 from a JSON string +size1_instance = Size1.from_json(json) +# print the JSON string representation of the object +print(Size1.to_json()) + +# convert the object into a dict +size1_dict = size1_instance.to_dict() +# create an instance of Size1 from a dict +size1_form_dict = size1.from_dict(size1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Sort.md b/docs/apis/public_v2/docs/Sort.md new file mode 100644 index 00000000..986eb057 --- /dev/null +++ b/docs/apis/public_v2/docs/Sort.md @@ -0,0 +1,28 @@ +# Sort + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.sort import Sort + +# TODO update the JSON string below +json = "{}" +# create an instance of Sort from a JSON string +sort_instance = Sort.from_json(json) +# print the JSON string representation of the object +print(Sort.to_json()) + +# convert the object into a dict +sort_dict = sort_instance.to_dict() +# create an instance of Sort from a dict +sort_form_dict = sort.from_dict(sort_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Source.md b/docs/apis/public_v2/docs/Source.md index a52e72c3..66884c0a 100644 --- a/docs/apis/public_v2/docs/Source.md +++ b/docs/apis/public_v2/docs/Source.md @@ -5,9 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**index_key** | **object** | | -**elastic_id** | **object** | | -**proj_key** | **object** | | ## Example diff --git a/docs/apis/public_v2/docs/Source1.md b/docs/apis/public_v2/docs/Source1.md index f18efff5..d37c9017 100644 --- a/docs/apis/public_v2/docs/Source1.md +++ b/docs/apis/public_v2/docs/Source1.md @@ -5,12 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **object** | | -**url** | **object** | | -**elastic_id** | **object** | | -**index_key** | **object** | | -**document_hash** | **object** | | -**proj_key** | **object** | | ## Example diff --git a/docs/apis/public_v2/docs/Source2.md b/docs/apis/public_v2/docs/Source2.md new file mode 100644 index 00000000..305e966e --- /dev/null +++ b/docs/apis/public_v2/docs/Source2.md @@ -0,0 +1,28 @@ +# Source2 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.source2 import Source2 + +# TODO update the JSON string below +json = "{}" +# create an instance of Source2 from a JSON string +source2_instance = Source2.from_json(json) +# print the JSON string representation of the object +print(Source2.to_json()) + +# convert the object into a dict +source2_dict = source2_instance.to_dict() +# create an instance of Source2 from a dict +source2_form_dict = source2.from_dict(source2_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Source3.md b/docs/apis/public_v2/docs/Source3.md new file mode 100644 index 00000000..3912434c --- /dev/null +++ b/docs/apis/public_v2/docs/Source3.md @@ -0,0 +1,31 @@ +# Source3 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index_key** | **object** | | +**elastic_id** | **object** | | +**proj_key** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.source3 import Source3 + +# TODO update the JSON string below +json = "{}" +# create an instance of Source3 from a JSON string +source3_instance = Source3.from_json(json) +# print the JSON string representation of the object +print(Source3.to_json()) + +# convert the object into a dict +source3_dict = source3_instance.to_dict() +# create an instance of Source3 from a dict +source3_form_dict = source3.from_dict(source3_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Source4.md b/docs/apis/public_v2/docs/Source4.md new file mode 100644 index 00000000..d7f56cfd --- /dev/null +++ b/docs/apis/public_v2/docs/Source4.md @@ -0,0 +1,34 @@ +# Source4 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **object** | | +**url** | **object** | | +**elastic_id** | **object** | | +**index_key** | **object** | | +**document_hash** | **object** | | +**proj_key** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.source4 import Source4 + +# TODO update the JSON string below +json = "{}" +# create an instance of Source4 from a JSON string +source4_instance = Source4.from_json(json) +# print the JSON string representation of the object +print(Source4.to_json()) + +# convert the object into a dict +source4_dict = source4_instance.to_dict() +# create an instance of Source4 from a dict +source4_form_dict = source4.from_dict(source4_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/StartCount.md b/docs/apis/public_v2/docs/StartCount.md new file mode 100644 index 00000000..569d84c6 --- /dev/null +++ b/docs/apis/public_v2/docs/StartCount.md @@ -0,0 +1,28 @@ +# StartCount + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.start_count import StartCount + +# TODO update the JSON string below +json = "{}" +# create an instance of StartCount from a JSON string +start_count_instance = StartCount.from_json(json) +# print the JSON string representation of the object +print(StartCount.to_json()) + +# convert the object into a dict +start_count_dict = start_count_instance.to_dict() +# create an instance of StartCount from a dict +start_count_form_dict = start_count.from_dict(start_count_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/StartedAt.md b/docs/apis/public_v2/docs/StartedAt.md new file mode 100644 index 00000000..aa8ac1ab --- /dev/null +++ b/docs/apis/public_v2/docs/StartedAt.md @@ -0,0 +1,28 @@ +# StartedAt + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.started_at import StartedAt + +# TODO update the JSON string below +json = "{}" +# create an instance of StartedAt from a JSON string +started_at_instance = StartedAt.from_json(json) +# print the JSON string representation of the object +print(StartedAt.to_json()) + +# convert the object into a dict +started_at_dict = started_at_instance.to_dict() +# create an instance of StartedAt from a dict +started_at_form_dict = started_at.from_dict(started_at_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Status.md b/docs/apis/public_v2/docs/Status.md new file mode 100644 index 00000000..0c38d11f --- /dev/null +++ b/docs/apis/public_v2/docs/Status.md @@ -0,0 +1,28 @@ +# Status + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.status import Status + +# TODO update the JSON string below +json = "{}" +# create an instance of Status from a JSON string +status_instance = Status.from_json(json) +# print the JSON string representation of the object +print(Status.to_json()) + +# convert the object into a dict +status_dict = status_instance.to_dict() +# create an instance of Status from a dict +status_form_dict = status.from_dict(status_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/StatusFilter.md b/docs/apis/public_v2/docs/StatusFilter.md new file mode 100644 index 00000000..85149973 --- /dev/null +++ b/docs/apis/public_v2/docs/StatusFilter.md @@ -0,0 +1,11 @@ +# StatusFilter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Storage.md b/docs/apis/public_v2/docs/Storage.md new file mode 100644 index 00000000..da21ef40 --- /dev/null +++ b/docs/apis/public_v2/docs/Storage.md @@ -0,0 +1,28 @@ +# Storage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.storage import Storage + +# TODO update the JSON string below +json = "{}" +# create an instance of Storage from a JSON string +storage_instance = Storage.from_json(json) +# print the JSON string representation of the object +print(Storage.to_json()) + +# convert the object into a dict +storage_dict = storage_instance.to_dict() +# create an instance of Storage from a dict +storage_form_dict = storage.from_dict(storage_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/StorageSummaryTask.md b/docs/apis/public_v2/docs/StorageSummaryTask.md index 1f924558..6bf0f98b 100644 --- a/docs/apis/public_v2/docs/StorageSummaryTask.md +++ b/docs/apis/public_v2/docs/StorageSummaryTask.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**dc_key** | **str** | | [optional] -**kg_key** | **str** | | [optional] +**dc_key** | [**DcKey**](DcKey.md) | | [optional] +**kg_key** | [**KgKey**](KgKey.md) | | [optional] **kind** | **str** | | **proj_key** | **str** | | **task_id** | **str** | | diff --git a/docs/apis/public_v2/docs/Subjects.md b/docs/apis/public_v2/docs/Subjects.md new file mode 100644 index 00000000..1e45368f --- /dev/null +++ b/docs/apis/public_v2/docs/Subjects.md @@ -0,0 +1,28 @@ +# Subjects + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.subjects import Subjects + +# TODO update the JSON string below +json = "{}" +# create an instance of Subjects from a JSON string +subjects_instance = Subjects.from_json(json) +# print the JSON string representation of the object +print(Subjects.to_json()) + +# convert the object into a dict +subjects_dict = subjects_instance.to_dict() +# create an instance of Subjects from a dict +subjects_form_dict = subjects.from_dict(subjects_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/SystemApi.md b/docs/apis/public_v2/docs/SystemApi.md index d9c01822..0fb6fc2b 100644 --- a/docs/apis/public_v2/docs/SystemApi.md +++ b/docs/apis/public_v2/docs/SystemApi.md @@ -316,8 +316,8 @@ configuration.api_key['Bearer'] = os.environ["API_KEY"] with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = deepsearch.cps.apis.public_v2.SystemApi(api_client) - proj_key = 'proj_key_example' # str | (optional) - term = 'term_example' # str | (optional) + proj_key = deepsearch.cps.apis.public_v2.ProjKey() # ProjKey | (optional) + term = deepsearch.cps.apis.public_v2.Term() # Term | (optional) try: # List System Knowledge Graphs @@ -335,8 +335,8 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **proj_key** | **str**| | [optional] - **term** | **str**| | [optional] + **proj_key** | [**ProjKey**](.md)| | [optional] + **term** | [**Term**](.md)| | [optional] ### Return type diff --git a/docs/apis/public_v2/docs/SystemInfo.md b/docs/apis/public_v2/docs/SystemInfo.md index 230286ae..324eacf1 100644 --- a/docs/apis/public_v2/docs/SystemInfo.md +++ b/docs/apis/public_v2/docs/SystemInfo.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **allow_non_admins_to_make_resources_public** | **bool** | | **api** | **object** | | **genai_defaults** | [**Dict[str, GenAIParams]**](GenAIParams.md) | | +**conversion_settings_defaults** | [**ProjectDataIndexConversionSettingsOutput**](ProjectDataIndexConversionSettingsOutput.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/TableFormerMode.md b/docs/apis/public_v2/docs/TableFormerMode.md new file mode 100644 index 00000000..c3a1a28b --- /dev/null +++ b/docs/apis/public_v2/docs/TableFormerMode.md @@ -0,0 +1,11 @@ +# TableFormerMode + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/TableStructureOptions.md b/docs/apis/public_v2/docs/TableStructureOptions.md new file mode 100644 index 00000000..f04043f0 --- /dev/null +++ b/docs/apis/public_v2/docs/TableStructureOptions.md @@ -0,0 +1,30 @@ +# TableStructureOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**do_table_structure** | **bool** | | [optional] [default to True] +**table_structure_mode** | [**TableFormerMode**](TableFormerMode.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.table_structure_options import TableStructureOptions + +# TODO update the JSON string below +json = "{}" +# create an instance of TableStructureOptions from a JSON string +table_structure_options_instance = TableStructureOptions.from_json(json) +# print the JSON string representation of the object +print(TableStructureOptions.to_json()) + +# convert the object into a dict +table_structure_options_dict = table_structure_options_instance.to_dict() +# create an instance of TableStructureOptions from a dict +table_structure_options_form_dict = table_structure_options.from_dict(table_structure_options_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/TargetConversionParameters.md b/docs/apis/public_v2/docs/TargetConversionParameters.md index d5b62a52..c552761c 100644 --- a/docs/apis/public_v2/docs/TargetConversionParameters.md +++ b/docs/apis/public_v2/docs/TargetConversionParameters.md @@ -6,8 +6,8 @@ Specify target settings (add_raw_pages, add_annotations). Fields left null are Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**add_raw_pages** | **bool** | | [optional] -**add_annotations** | **bool** | | [optional] +**add_raw_pages** | [**AddRawPages**](AddRawPages.md) | | [optional] +**add_annotations** | [**AddAnnotations**](AddAnnotations.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/Task.md b/docs/apis/public_v2/docs/Task.md new file mode 100644 index 00000000..2e388410 --- /dev/null +++ b/docs/apis/public_v2/docs/Task.md @@ -0,0 +1,29 @@ +# Task + +An identifier of this task. It may be used to identify this task from other tasks of the same agent and type. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.task import Task + +# TODO update the JSON string below +json = "{}" +# create an instance of Task from a JSON string +task_instance = Task.from_json(json) +# print the JSON string representation of the object +print(Task.to_json()) + +# convert the object into a dict +task_dict = task_instance.to_dict() +# create an instance of Task from a dict +task_form_dict = task.from_dict(task_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/TaskContext.md b/docs/apis/public_v2/docs/TaskContext.md index 63da20dd..6aa40d17 100644 --- a/docs/apis/public_v2/docs/TaskContext.md +++ b/docs/apis/public_v2/docs/TaskContext.md @@ -14,11 +14,11 @@ Name | Type | Description | Notes **progress** | **float** | | **meta** | **object** | | **created_at** | **datetime** | | -**started_at** | **datetime** | | [optional] -**completed_at** | **datetime** | | [optional] -**start_count** | **int** | | [optional] -**error_reason** | **str** | | [optional] -**related_tasks** | **List[object]** | | [optional] +**started_at** | [**StartedAt**](StartedAt.md) | | [optional] +**completed_at** | [**CompletedAt**](CompletedAt.md) | | [optional] +**start_count** | [**StartCount**](StartCount.md) | | [optional] +**error_reason** | [**ErrorReason**](ErrorReason.md) | | [optional] +**related_tasks** | [**RelatedTasks**](RelatedTasks.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/TaskType.md b/docs/apis/public_v2/docs/TaskType.md new file mode 100644 index 00000000..0639d760 --- /dev/null +++ b/docs/apis/public_v2/docs/TaskType.md @@ -0,0 +1,28 @@ +# TaskType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.task_type import TaskType + +# TODO update the JSON string below +json = "{}" +# create an instance of TaskType from a JSON string +task_type_instance = TaskType.from_json(json) +# print the JSON string representation of the object +print(TaskType.to_json()) + +# convert the object into a dict +task_type_dict = task_type_instance.to_dict() +# create an instance of TaskType from a dict +task_type_form_dict = task_type.from_dict(task_type_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/TasksApi.md b/docs/apis/public_v2/docs/TasksApi.md index 7c48049c..c9b16b81 100644 --- a/docs/apis/public_v2/docs/TasksApi.md +++ b/docs/apis/public_v2/docs/TasksApi.md @@ -129,7 +129,7 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: api_instance = deepsearch.cps.apis.public_v2.TasksApi(api_client) task_id = 'task_id_example' # str | proj_key = 'proj_key_example' # str | - wait = 3.4 # float | Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. (optional) + wait = deepsearch.cps.apis.public_v2.Wait1() # Wait1 | Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. (optional) try: # Get Project Celery Task @@ -149,7 +149,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **task_id** | **str**| | **proj_key** | **str**| | - **wait** | **float**| Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. | [optional] + **wait** | [**Wait1**](.md)| Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. | [optional] ### Return type @@ -294,7 +294,7 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = deepsearch.cps.apis.public_v2.TasksApi(api_client) proj_key = 'proj_key_example' # str | - task_type = 'task_type_example' # str | (optional) + task_type = deepsearch.cps.apis.public_v2.TaskType() # TaskType | (optional) skip = 0 # int | (optional) (default to 0) limit = 50 # int | (optional) (default to 50) sort_by = '_id' # str | (optional) (default to '_id') @@ -317,7 +317,7 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **proj_key** | **str**| | - **task_type** | **str**| | [optional] + **task_type** | [**TaskType**](.md)| | [optional] **skip** | **int**| | [optional] [default to 0] **limit** | **int**| | [optional] [default to 50] **sort_by** | **str**| | [optional] [default to '_id'] diff --git a/docs/apis/public_v2/docs/Term.md b/docs/apis/public_v2/docs/Term.md new file mode 100644 index 00000000..3f8eeb4a --- /dev/null +++ b/docs/apis/public_v2/docs/Term.md @@ -0,0 +1,28 @@ +# Term + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.term import Term + +# TODO update the JSON string below +json = "{}" +# create an instance of Term from a JSON string +term_instance = Term.from_json(json) +# print the JSON string representation of the object +print(Term.to_json()) + +# convert the object into a dict +term_dict = term_instance.to_dict() +# create an instance of Term from a dict +term_form_dict = term.from_dict(term_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Text.md b/docs/apis/public_v2/docs/Text.md new file mode 100644 index 00000000..921e6677 --- /dev/null +++ b/docs/apis/public_v2/docs/Text.md @@ -0,0 +1,28 @@ +# Text + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.text import Text + +# TODO update the JSON string below +json = "{}" +# create an instance of Text from a JSON string +text_instance = Text.from_json(json) +# print the JSON string representation of the object +print(Text.to_json()) + +# convert the object into a dict +text_dict = text_instance.to_dict() +# create an instance of Text from a dict +text_form_dict = text.from_dict(text_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Timeout.md b/docs/apis/public_v2/docs/Timeout.md new file mode 100644 index 00000000..3ded7e02 --- /dev/null +++ b/docs/apis/public_v2/docs/Timeout.md @@ -0,0 +1,28 @@ +# Timeout + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.timeout import Timeout + +# TODO update the JSON string below +json = "{}" +# create an instance of Timeout from a JSON string +timeout_instance = Timeout.from_json(json) +# print the JSON string representation of the object +print(Timeout.to_json()) + +# convert the object into a dict +timeout_dict = timeout_instance.to_dict() +# create an instance of Timeout from a dict +timeout_form_dict = timeout.from_dict(timeout_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Title.md b/docs/apis/public_v2/docs/Title.md new file mode 100644 index 00000000..f8bf6cd1 --- /dev/null +++ b/docs/apis/public_v2/docs/Title.md @@ -0,0 +1,28 @@ +# Title + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.title import Title + +# TODO update the JSON string below +json = "{}" +# create an instance of Title from a JSON string +title_instance = Title.from_json(json) +# print the JSON string representation of the object +print(Title.to_json()) + +# convert the object into a dict +title_dict = title_instance.to_dict() +# create an instance of Title from a dict +title_form_dict = title.from_dict(title_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/TruncatePages.md b/docs/apis/public_v2/docs/TruncatePages.md new file mode 100644 index 00000000..65023f34 --- /dev/null +++ b/docs/apis/public_v2/docs/TruncatePages.md @@ -0,0 +1,28 @@ +# TruncatePages + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.truncate_pages import TruncatePages + +# TODO update the JSON string below +json = "{}" +# create an instance of TruncatePages from a JSON string +truncate_pages_instance = TruncatePages.from_json(json) +# print the JSON string representation of the object +print(TruncatePages.to_json()) + +# convert the object into a dict +truncate_pages_dict = truncate_pages_instance.to_dict() +# create an instance of TruncatePages from a dict +truncate_pages_form_dict = truncate_pages.from_dict(truncate_pages_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Type.md b/docs/apis/public_v2/docs/Type.md new file mode 100644 index 00000000..510281b3 --- /dev/null +++ b/docs/apis/public_v2/docs/Type.md @@ -0,0 +1,28 @@ +# Type + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.type import Type + +# TODO update the JSON string below +json = "{}" +# create an instance of Type from a JSON string +type_instance = Type.from_json(json) +# print the JSON string representation of the object +print(Type.to_json()) + +# convert the object into a dict +type_dict = type_instance.to_dict() +# create an instance of Type from a dict +type_form_dict = type.from_dict(type_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Type1.md b/docs/apis/public_v2/docs/Type1.md new file mode 100644 index 00000000..85fb7a75 --- /dev/null +++ b/docs/apis/public_v2/docs/Type1.md @@ -0,0 +1,29 @@ +# Type1 + +Type of publication (journal article, conference, review,...). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.type1 import Type1 + +# TODO update the JSON string below +json = "{}" +# create an instance of Type1 from a JSON string +type1_instance = Type1.from_json(json) +# print the JSON string representation of the object +print(Type1.to_json()) + +# convert the object into a dict +type1_dict = type1_instance.to_dict() +# create an instance of Type1 from a dict +type1_form_dict = type1.from_dict(type1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/UploadApi.md b/docs/apis/public_v2/docs/UploadApi.md index 43694d6d..ac86f9d8 100644 --- a/docs/apis/public_v2/docs/UploadApi.md +++ b/docs/apis/public_v2/docs/UploadApi.md @@ -130,7 +130,7 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = deepsearch.cps.apis.public_v2.UploadApi(api_client) proj_key = 'proj_key_example' # str | - scratch_ids = 'scratch_ids_example' # str | (optional) + scratch_ids = deepsearch.cps.apis.public_v2.ScratchIds() # ScratchIds | (optional) try: # List Project Scratch Files @@ -149,7 +149,7 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **proj_key** | **str**| | - **scratch_ids** | **str**| | [optional] + **scratch_ids** | [**ScratchIds**](.md)| | [optional] ### Return type @@ -212,11 +212,11 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = deepsearch.cps.apis.public_v2.UploadApi(api_client) proj_key = 'proj_key_example' # str | - page = 56 # int | (optional) + page = deepsearch.cps.apis.public_v2.Page() # Page | (optional) items_per_page = 20 # int | (optional) (default to 20) - search_string = 'search_string_example' # str | (optional) - begin_date = 56 # int | (optional) - end_date = 56 # int | (optional) + search_string = deepsearch.cps.apis.public_v2.SearchString() # SearchString | (optional) + begin_date = deepsearch.cps.apis.public_v2.BeginDate() # BeginDate | (optional) + end_date = deepsearch.cps.apis.public_v2.EndDate() # EndDate | (optional) try: # List Project Scratch Files Paginated @@ -235,11 +235,11 @@ with deepsearch.cps.apis.public_v2.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **proj_key** | **str**| | - **page** | **int**| | [optional] + **page** | [**Page**](.md)| | [optional] **items_per_page** | **int**| | [optional] [default to 20] - **search_string** | **str**| | [optional] - **begin_date** | **int**| | [optional] - **end_date** | **int**| | [optional] + **search_string** | [**SearchString**](.md)| | [optional] + **begin_date** | [**BeginDate**](.md)| | [optional] + **end_date** | [**EndDate**](.md)| | [optional] ### Return type diff --git a/docs/apis/public_v2/docs/UploadElasticRequestBody.md b/docs/apis/public_v2/docs/UploadElasticRequestBody.md index 912c9e1c..cb361f3b 100644 --- a/docs/apis/public_v2/docs/UploadElasticRequestBody.md +++ b/docs/apis/public_v2/docs/UploadElasticRequestBody.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**document_hashes** | **List[str]** | List of document hashes to be used as filter. | [optional] -**with_operations** | **List[str]** | List of Operation Status documents don't have to be used as filter. | [optional] +**document_hashes** | [**DocumentHashes**](DocumentHashes.md) | | [optional] +**with_operations** | [**WithOperations**](WithOperations.md) | | [optional] ## Example diff --git a/docs/apis/public_v2/docs/UploadToElastic.md b/docs/apis/public_v2/docs/UploadToElastic.md new file mode 100644 index 00000000..59aa2bbe --- /dev/null +++ b/docs/apis/public_v2/docs/UploadToElastic.md @@ -0,0 +1,28 @@ +# UploadToElastic + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.upload_to_elastic import UploadToElastic + +# TODO update the JSON string below +json = "{}" +# create an instance of UploadToElastic from a JSON string +upload_to_elastic_instance = UploadToElastic.from_json(json) +# print the JSON string representation of the object +print(UploadToElastic.to_json()) + +# convert the object into a dict +upload_to_elastic_dict = upload_to_elastic_instance.to_dict() +# create an instance of UploadToElastic from a dict +upload_to_elastic_form_dict = upload_to_elastic.from_dict(upload_to_elastic_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Url.md b/docs/apis/public_v2/docs/Url.md new file mode 100644 index 00000000..37205256 --- /dev/null +++ b/docs/apis/public_v2/docs/Url.md @@ -0,0 +1,29 @@ +# Url + +URL on the publication site. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.url import Url + +# TODO update the JSON string below +json = "{}" +# create an instance of Url from a JSON string +url_instance = Url.from_json(json) +# print the JSON string representation of the object +print(Url.to_json()) + +# convert the object into a dict +url_dict = url_instance.to_dict() +# create an instance of Url from a dict +url_form_dict = url.from_dict(url_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/UrlRefs.md b/docs/apis/public_v2/docs/UrlRefs.md new file mode 100644 index 00000000..ba5ee332 --- /dev/null +++ b/docs/apis/public_v2/docs/UrlRefs.md @@ -0,0 +1,28 @@ +# UrlRefs + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.url_refs import UrlRefs + +# TODO update the JSON string below +json = "{}" +# create an instance of UrlRefs from a JSON string +url_refs_instance = UrlRefs.from_json(json) +# print the JSON string representation of the object +print(UrlRefs.to_json()) + +# convert the object into a dict +url_refs_dict = url_refs_instance.to_dict() +# create an instance of UrlRefs from a dict +url_refs_form_dict = url_refs.from_dict(url_refs_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Version.md b/docs/apis/public_v2/docs/Version.md new file mode 100644 index 00000000..b629e795 --- /dev/null +++ b/docs/apis/public_v2/docs/Version.md @@ -0,0 +1,29 @@ +# Version + +The version of this collection model. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.version import Version + +# TODO update the JSON string below +json = "{}" +# create an instance of Version from a JSON string +version_instance = Version.from_json(json) +# print the JSON string representation of the object +print(Version.to_json()) + +# convert the object into a dict +version_dict = version_instance.to_dict() +# create an instance of Version from a dict +version_form_dict = version.from_dict(version_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Version1.md b/docs/apis/public_v2/docs/Version1.md new file mode 100644 index 00000000..00bad7dd --- /dev/null +++ b/docs/apis/public_v2/docs/Version1.md @@ -0,0 +1,28 @@ +# Version1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.version1 import Version1 + +# TODO update the JSON string below +json = "{}" +# create an instance of Version1 from a JSON string +version1_instance = Version1.from_json(json) +# print the JSON string representation of the object +print(Version1.to_json()) + +# convert the object into a dict +version1_dict = version1_instance.to_dict() +# create an instance of Version1 from a dict +version1_form_dict = version1.from_dict(version1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/ViewOf1.md b/docs/apis/public_v2/docs/ViewOf1.md new file mode 100644 index 00000000..6d789613 --- /dev/null +++ b/docs/apis/public_v2/docs/ViewOf1.md @@ -0,0 +1,32 @@ +# ViewOf1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index_key** | **object** | | +**query_options** | [**ElasticIndexSearchQueryOptions**](ElasticIndexSearchQueryOptions.md) | | +**proj_key** | **object** | | +**elastic_id** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.view_of1 import ViewOf1 + +# TODO update the JSON string below +json = "{}" +# create an instance of ViewOf1 from a JSON string +view_of1_instance = ViewOf1.from_json(json) +# print the JSON string representation of the object +print(ViewOf1.to_json()) + +# convert the object into a dict +view_of1_dict = view_of1_instance.to_dict() +# create an instance of ViewOf1 from a dict +view_of1_form_dict = view_of1.from_dict(view_of1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Volume.md b/docs/apis/public_v2/docs/Volume.md new file mode 100644 index 00000000..fe8519d7 --- /dev/null +++ b/docs/apis/public_v2/docs/Volume.md @@ -0,0 +1,29 @@ +# Volume + +Publication volume. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.volume import Volume + +# TODO update the JSON string below +json = "{}" +# create an instance of Volume from a JSON string +volume_instance = Volume.from_json(json) +# print the JSON string representation of the object +print(Volume.to_json()) + +# convert the object into a dict +volume_dict = volume_instance.to_dict() +# create an instance of Volume from a dict +volume_form_dict = volume.from_dict(volume_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Wait.md b/docs/apis/public_v2/docs/Wait.md new file mode 100644 index 00000000..f69d9de2 --- /dev/null +++ b/docs/apis/public_v2/docs/Wait.md @@ -0,0 +1,29 @@ +# Wait + +Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.wait import Wait + +# TODO update the JSON string below +json = "{}" +# create an instance of Wait from a JSON string +wait_instance = Wait.from_json(json) +# print the JSON string representation of the object +print(Wait.to_json()) + +# convert the object into a dict +wait_dict = wait_instance.to_dict() +# create an instance of Wait from a dict +wait_form_dict = wait.from_dict(wait_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/Wait1.md b/docs/apis/public_v2/docs/Wait1.md new file mode 100644 index 00000000..5dcb622d --- /dev/null +++ b/docs/apis/public_v2/docs/Wait1.md @@ -0,0 +1,29 @@ +# Wait1 + +Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.wait1 import Wait1 + +# TODO update the JSON string below +json = "{}" +# create an instance of Wait1 from a JSON string +wait1_instance = Wait1.from_json(json) +# print the JSON string representation of the object +print(Wait1.to_json()) + +# convert the object into a dict +wait1_dict = wait1_instance.to_dict() +# create an instance of Wait1 from a dict +wait1_form_dict = wait1.from_dict(wait1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/WithOperations.md b/docs/apis/public_v2/docs/WithOperations.md new file mode 100644 index 00000000..db0fdc38 --- /dev/null +++ b/docs/apis/public_v2/docs/WithOperations.md @@ -0,0 +1,29 @@ +# WithOperations + +List of Operation Status documents don't have to be used as filter. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.with_operations import WithOperations + +# TODO update the JSON string below +json = "{}" +# create an instance of WithOperations from a JSON string +with_operations_instance = WithOperations.from_json(json) +# print the JSON string representation of the object +print(WithOperations.to_json()) + +# convert the object into a dict +with_operations_dict = with_operations_instance.to_dict() +# create an instance of WithOperations from a dict +with_operations_form_dict = with_operations.from_dict(with_operations_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/docs/WithoutOperations.md b/docs/apis/public_v2/docs/WithoutOperations.md new file mode 100644 index 00000000..721d6f8e --- /dev/null +++ b/docs/apis/public_v2/docs/WithoutOperations.md @@ -0,0 +1,29 @@ +# WithoutOperations + +List of Operation Status documents don't have to be used as filter. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.without_operations import WithoutOperations + +# TODO update the JSON string below +json = "{}" +# create an instance of WithoutOperations from a JSON string +without_operations_instance = WithoutOperations.from_json(json) +# print the JSON string representation of the object +print(WithoutOperations.to_json()) + +# convert the object into a dict +without_operations_dict = without_operations_instance.to_dict() +# create an instance of WithoutOperations from a dict +without_operations_form_dict = without_operations.from_dict(without_operations_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/guide/apis.md b/docs/guide/apis.md index 7b2fdb63..5b52f8e6 100644 --- a/docs/guide/apis.md +++ b/docs/guide/apis.md @@ -32,11 +32,11 @@ sw_kg_api = sw_client.KnowledgeGraphsApi(api.client.swagger_client) ## Interacting with the API directly via `requests` Another option is interacting with the CPS API directly using the endpoints. CPS provides a Swagger UI for inspecting all API endpoints (documented with schemas). To access the API documentation please use the following URLs: -- User API: `https://{HOST}/api/cps/user/v1/ui/` +- User API: `https://{HOST}/api/cps/user/v1/docs/` - Public API: `https://{HOST}/api/cps/public/v1/ui/` For example: -- User API: https://deepsearch-experience.res.ibm.com/api/cps/user/v1/ui/ +- User API: https://deepsearch-experience.res.ibm.com/api/cps/user/v1/docs/ - Public API: https://deepsearch-experience.res.ibm.com/api/cps/public/v1/ui/ diff --git a/docs/guide/convert_doc.md b/docs/guide/convert_doc.md index 77bfeb82..be676440 100644 --- a/docs/guide/convert_doc.md +++ b/docs/guide/convert_doc.md @@ -8,17 +8,7 @@ For the tasks on this page, you are required to identify your project within Dee The toolkit provides an easy method to convert documents from your local machine. The [`deepsearch documents`](../cli-reference.md#documents) component processes your input, uploads local files, submits for conversion and downloads the results to your machine. -Following inputs are supported: - -1. Single document in PDF format. -2. Multiple documents in ZIP format. -3. Directory containing multiple documents in PDF and ZIP formats. - -??? warning - ZIP files containing additional ZIP files are not supported. - - -Let `PATH_DOCS` be the path to a PDF document or a ZIP file or a directory in your local machine. +Let `PATH_DOCS` be the path to a PDF document in your local machine. === "CLI"
@@ -73,47 +63,6 @@ Let `URL` be the web address for an online document. --- -### Multiple URLs - -Multiple online documents can also be conveniently converted. - -- For CLI: -Create a text file containing the web addresses for online documents, separated by empty lines. For example, the contents of `ONLINE-DOCS.txt` could be: - -```text -URL1 -URL2 -URL3 -``` -Let `PATH_ONLINE_DOCS` be the path to this text file. - -- For python: -Simply pass a python list object containing multiple urls. Let `URL` be a list containing several URLs. - -=== "CLI" -
- - ```console - deepsearch documents convert -p PROJ_KEY -u PATH_ONLINE_DOCS - ``` - -
- - -=== "Python" - ```python - import deepsearch as ds - URL = ["https:///URL1", "https://URL2", "https://URL3"] - documents = ds.convert_documents(api=api,proj_key=PROJ_KEY, urls=URL) - - # Let's download all the converted documents locally in RESULT_DIR - documents.download_all(result_dir = RESULT_DIR) - ``` - -As we saw [before](#converting-local-documents), converted documents are automatically downloaded when using the CLI. Using python, the user specifies the directory where converted documents are downloaded. - ---- - ## Generating reports It is possible to create reports which inform the user about the document conversion tasks and their statuses. Such a report is useful in analysis and debugging large tasks. @@ -149,14 +98,12 @@ The `DocumentConversionResult` object has a built-in method for generating repor You can exercise control over the conversion settings used in document conversion through the python SDK as follows. -To do so, initialise a `ConversionSettings` object, either using the system defaults, or the settings of a particular project. +To do so, initialise a `ConversionSettings` object. ```python from deepsearch.documents.core.models import ConversionSettings -conv_settings = ConversionSettings.from_defaults(api) -# or by using the project key: -conv_settings = ConversionSettings.from_project(api, proj_key=PROJ_KEY) +conv_settings = ConversionSettings() # Modify conv_settings, see sections below... @@ -171,89 +118,49 @@ documents = ds.convert_documents( ### Modify the conversion pipeline models -You can modify the behaviour of the conversion pipeline by setting custom models for a task, or disabling them altogether. Currently, you may modify which models to use for layout segmentation (`clusters`), and for table structure prediction (`tables`). +You can modify the behaviour of the conversion pipeline by setting custom models for a task, or disabling them altogether. Currently, you may modify which models to use for table structure prediction (`tables`). #### Example 1: Disable the table structure predictions -You can simply disable a model by setting it to `None` +You can simply disable a model by setting it to `False` ```python -conv_settings.pipeline.tables = None +conv_settings.table_structure.do_table_structure = False ``` #### Example 2: Pick an alternative system model for table structure -Deep Search may offer multiple alternative models for the same task, e.g. for table structure prediction. You can list all available models, and set a different model. - +Deep Search offer two alternative models for the same task, e.g. for table structure prediction. You can choose between `fast` and `accurate` where's default is `fast`. -```python -from deepsearch.documents.core.models import DefaultConversionModel - -# Find out which system models are available -available_models = DefaultConversionModel.get_models(api) - -for m in available_models: - print(f"Got model type={m.type}, name={m.name}") - - -# Modify the settings to use another model (assuming it is available) -conv_settings.pipeline.tables = \ - DefaultConversionModel(type="WalnutTableStructureModel") -``` -#### Example 3: Pick a custom project model for table structure - -If you previously set up a custom model in your project, you can choose it the same way as above. +You can simply change the table structure by setting it to `accurate` ```python -from deepsearch.documents.core.models import ProjectConversionModel - -project_models = ProjectConversionModel.get_models(api, proj_key) - -for pm in project_models: - if pm.name == "my-ts-model-test-1": # basic example: match by name - conv_settings.pipeline.tables = pm +conv_settings.table_structure.table_structure_mode = "accurate" ``` ### Modify OCR settings -If you want to use OCR, you can enable it and choose an OCR backend. +By default OCR is enable, you can disable it or choose an OCR backend. -#### Example 1: Enable default OCR +#### Example 1: Disable default OCR ```python -from deepsearch.documents.core.models import ConversionSettings, OCRSettings +from deepsearch.documents.core.models import ConversionSettings -conv_settings = ConversionSettings.from_defaults(api) -conv_settings.ocr.enabled = True +conv_settings = ConversionSettings() +conv_settings.ocr.do_ocr = False ``` #### Example 2: Choose alternative OCR engine -```python -from deepsearch.documents.core.models import ConversionSettings, OCRSettings - -conv_settings = ConversionSettings.from_defaults(api) -conv_settings.ocr.enabled = True - -# Find out which OCR backends are available -engines = OCRSettings.get_backends(api) - -for b in engines: - print(f"Got OCR backend id={b.id}") - -# We pick the first engine from the list above -conv_settings.ocr.engine = engines[0] -``` - -#### Example 3: Specify OCR engine and language +The default OCR engine is `easyocr`, you can change it to alternative `tesserocr`. ```python -from deepsearch.documents.core.models import ConversionSettings, OCRSettings, AlpineOcrEngine +from deepsearch.documents.core.models import ConversionSettings -conv_settings = ConversionSettings.from_defaults(api) -conv_settings.ocr.enabled = True -conv_settings.ocr.engine = AlpineOcrEngine(languages=[AlpineOcrLanguage.Japanese]) +conv_settings = ConversionSettings() +conv_settings.ocr.kind = "tesserocr" ``` diff --git a/tools/swagger-client-generator/generate-client.sh b/tools/swagger-client-generator/generate-client.sh index 1f9a228c..a378de37 100755 --- a/tools/swagger-client-generator/generate-client.sh +++ b/tools/swagger-client-generator/generate-client.sh @@ -29,7 +29,7 @@ function download_swagger { if [[ "${base_path}" == http* ]]; then download_swagger "${base_path}/public/v1/swagger.json" "${curdir}/swagger-cps.json" download_swagger "${base_path}/public/v2/openapi.json" "${curdir}/openapi-ds-v2.json" - download_swagger "${base_path}/user/v1/swagger.json" "${curdir}/swagger-user.json" + download_swagger "${base_path}/user/v1/openapi.json" "${curdir}/swagger-user.json" download_swagger "${base_path}/kg/v1/swagger.json" "${curdir}/swagger-cps-kg.json" fi diff --git a/tools/swagger-client-generator/openapi-ds-v2.json b/tools/swagger-client-generator/openapi-ds-v2.json index 873649dd..e78bd259 100644 --- a/tools/swagger-client-generator/openapi-ds-v2.json +++ b/tools/swagger-client-generator/openapi-ds-v2.json @@ -1 +1 @@ -{"openapi":"3.1.0","info":{"title":"Deep Search (DS) API","description":"API for Deep Search.\n\n**WARNING**: This API is subject to change without warning!","version":"3.0.0"},"servers":[{"url":"/api/cps/public/v2"}],"paths":{"/project/{proj_key}/data_indices/documents/agents":{"get":{"tags":["Content Manager"],"summary":"Get Project Agents","description":"Get project agents.","operationId":"get_project_agents","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAgents"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/transactions/{transaction_id}":{"get":{"tags":["Content Manager"],"summary":"Get Project Documents By Transaction","description":"Get project documents by transaction ID.","operationId":"get_project_documents_by_transaction","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","format":"uuid","title":"Transaction Id"},"name":"transaction_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocuments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/":{"get":{"tags":["Content Manager"],"summary":"Get All Project Data Index Documents","description":"Get all project documents","operationId":"get_all_project_data_index_documents","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"integer","title":"Page","default":1},"name":"page","in":"query"},{"required":false,"schema":{"type":"integer","title":"Page Size","default":25},"name":"page_size","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocuments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/statistics":{"get":{"tags":["Content Manager"],"summary":"Get Project Conversion Statistics","description":"Get project conversion statistics.","operationId":"get_project_conversion_statistics","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentStatistics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/agent/{agent_name}":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Documents","description":"Get project documents, can be filter by status.","operationId":"get_project_data_index_documents","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Agent Name"},"name":"agent_name","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"string","enum":["PENDING","FAILURE","SUCCESS"],"title":"Status"},"name":"status","in":"query"},{"required":false,"schema":{"type":"integer","title":"Page","default":1},"name":"page","in":"query"},{"required":false,"schema":{"type":"integer","title":"Page Size","default":25},"name":"page_size","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocuments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/agent/{agent_name}/grouped":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Grouped Documents","description":"Get project documents grouped by upload.","operationId":"get_project_data_index_grouped_documents","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Agent Name"},"name":"agent_name","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"string","enum":["PENDING","FAILURE","SUCCESS"],"title":"Status"},"name":"status","in":"query"},{"required":false,"schema":{"type":"integer","title":"Page","default":1},"name":"page","in":"query"},{"required":false,"schema":{"type":"integer","title":"Page Size","default":25},"name":"page_size","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseGroupedDocuments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/upload_jobs":{"get":{"tags":["Content Manager"],"summary":"Get Project Index Upload Jobs","description":"Get project upload jobs.","operationId":"get_project_index_upload_jobs","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseUploadJobs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/Markdown":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Document Markdown","description":"Get project document Markdown.","operationId":"get_project_data_index_document_markdown","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Document Hash"},"name":"document_hash","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocumentURL"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/PDF":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Pdf Document","description":"Get project PDF document.","operationId":"get_project_data_index_pdf_document","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Document Hash"},"name":"document_hash","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocumentURL"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/JSON":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Json Document","description":"Get project JSON document.","operationId":"get_project_data_index_json_document","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Document Hash"},"name":"document_hash","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Project Data Index Json Document"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/artifacts":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Document Artifacts","description":"Get project document artifacts.","operationId":"get_project_data_index_document_artifacts","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Document Hash"},"name":"document_hash","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseDocumentArtifacts"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/metadata":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Document Metadata","description":"Get project document metadata.","operationId":"get_project_data_index_document_metadata","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Document Hash"},"name":"document_hash","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocument"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/doc_events":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Document Events","description":"Get events of a project document.","operationId":"get_project_data_index_document_events","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Document Hash"},"name":"document_hash","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"string","title":"Agent Name"},"name":"agent_name","in":"query"},{"required":false,"schema":{"type":"string","enum":["PENDING","FAILURE","SUCCESS"],"title":"Status"},"name":"status","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Project Data Index Document Events"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices":{"get":{"tags":["Data Indices"],"summary":"Get Project Data Indices","description":"Get project data indices.","operationId":"get_project_data_indices","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"},"type":"array","title":"Response Get Project Data Indices"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"post":{"tags":["Data Indices"],"summary":"Create Project Data Index","description":"Create a project data index.","operationId":"create_project_data_index","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexView"},{"$ref":"#/components/schemas/ProjectDataIndexNonView"}],"title":"Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}":{"get":{"tags":["Data Indices"],"summary":"Get Project Data Index","description":"Get project data index.","operationId":"get_project_data_index","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"delete":{"tags":["Data Indices"],"summary":"Delete Project Data Index","description":"Delete a project index data.","operationId":"delete_project_data_index","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Confirmation Token"},"name":"confirmation_token","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"patch":{"tags":["Data Indices"],"summary":"Update Project Data Index","description":"Update a project data index.","operationId":"update_project_data_index","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexView"},{"$ref":"#/components/schemas/ProjectDataIndexNonView"}],"title":"Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/delete_token":{"post":{"tags":["Data Indices"],"summary":"Create Project Data Index Delete Token","description":"Get a token used to confirm the deletion of a project data index.","operationId":"create_project_data_index_delete_token","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/actions/upload":{"post":{"tags":["Data Indices Upload"],"summary":"Upload Project Data Index File","description":"Upload a file to a project data index.","operationId":"upload_project_data_index_file","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonUploadRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/actions/upload_register_documents":{"post":{"tags":["Data Indices Upload"],"summary":"Upload Register Project Documents","description":"Upload and register documents to be converted later.","operationId":"upload_register_project_documents","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertDocumentsSources"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/actions/load_elastic":{"post":{"tags":["Data Indices Upload"],"summary":"Load Project Data Index Files Elastic","description":"Load file(s) in a project data index to elastic.","operationId":"load_project_data_index_files_elastic","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadElasticRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/actions/ccs_convert":{"post":{"tags":["Data Indices Upload"],"summary":"Ccs Convert File Project Data Index","description":"Convert files via CCS previously registered and in a project data index.","operationId":"ccs_convert_file_project_data_index","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertDocumentsRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/actions/ccs_convert_upload":{"post":{"tags":["Data Indices Upload"],"summary":"Ccs Convert Upload File Project Data Index","description":"Convert files via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema).","operationId":"ccs_convert_upload_file_project_data_index","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertUploadDocumentsRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/actions/html_print_convert_upload":{"post":{"tags":["Data Indices Upload"],"summary":"Html Print Convert Upload","description":"Convert a list of HTML pages to PDF, convert them via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema).","operationId":"html_print_convert_upload","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataIndexUploadFileSource"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment_url/{filename}":{"get":{"tags":["Data Indices Upload"],"summary":"Get Attachment Upload Data","description":"Get url and path to upload an attachment to a project data index.","operationId":"get_attachment_upload_data","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Index Item Id"},"name":"index_item_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Filename"},"name":"filename","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadData"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment":{"post":{"tags":["Data Indices Upload"],"summary":"Register Attachment","description":"Notify upload completion of an attachment to a project data index.","operationId":"register_attachment","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Index Item Id"},"name":"index_item_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadRequestBody"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/public/bags":{"get":{"tags":["Knowledge Graphs"],"summary":"List Public Knowledge Graphs","description":"List all public BAGs","operationId":"list_public_knowledge_graphs","parameters":[{"required":false,"schema":{"title":"Term"},"name":"term","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"object"},"type":"array","title":"Response List Public Knowledge Graphs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/backend/project/{proj_key}/bags":{"get":{"tags":["Knowledge Graphs"],"summary":"Backend List Project Kgs","description":"List all bags in the project, backend-aware","operationId":"backend_list_project_kgs","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"title":"Term"},"name":"term","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"object"},"type":"array","title":"Response Backend List Project Kgs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"post":{"tags":["Knowledge Graphs"],"summary":"Create Project Knowledge Graph","description":"Create new BAG, backend-aware","operationId":"create_project_knowledge_graph","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Project Knowledge Graph"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/backend/project/{proj_key}/bags/{bag_key}":{"patch":{"tags":["Knowledge Graphs"],"summary":"Update Project Knowledge Graph Metadata","description":"Update the metadata of a Knowledge graph","operationId":"update_project_knowledge_graph_metadata","parameters":[{"required":true,"schema":{"title":"Bag Key"},"name":"bag_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Update Project Knowledge Graph Metadata"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/default_values":{"get":{"tags":["Project"],"summary":"Get Project Default Values","description":"List project's default values.","operationId":"get_project_default_values","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultValues"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"post":{"tags":["Project"],"summary":"Update Project Default Values","description":"Update project's default values.","operationId":"update_project_default_values","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultValues"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/integrations/genai":{"get":{"tags":["Project"],"summary":"Get Project Integration Config Genai","description":"Get the GenAI config for a given project.","operationId":"get_project_integration_config_genai","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Decode Secrets"},"name":"decode_secrets","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/GenAIBAM"},{"$ref":"#/components/schemas/GenAIWatsonx"},{"$ref":"#/components/schemas/GenAIHFInferenceApi"},{"$ref":"#/components/schemas/GenAIAWSBedrock"}],"title":"Response Get Project Integration Config Genai"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"post":{"tags":["Project"],"summary":"Update Project Integration Config Genai","description":"Update the GenAI config for a given project.","operationId":"update_project_integration_config_genai","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/GenAIBAM"},{"$ref":"#/components/schemas/GenAIWatsonx"},{"$ref":"#/components/schemas/GenAIHFInferenceApi"},{"$ref":"#/components/schemas/GenAIAWSBedrock"}],"title":"Config"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"delete":{"tags":["Project"],"summary":"Delete Project Integration Config Genai","description":"Delete the GenAI config for a given project integration.","operationId":"delete_project_integration_config_genai","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/packages":{"post":{"tags":["Project"],"summary":"Provision Project Packages","description":"Install packages on a project.","operationId":"provision_project_packages","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPackageInstalationManifest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskContext"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/convert":{"post":{"tags":["Project"],"summary":"Convert Pdf Document","description":"Convert a PDF document directly to CCS.","operationId":"convert_pdf_document","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertDocumentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CcsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/convert_tasks/{task_id}":{"get":{"tags":["Project"],"summary":"Check Wait Ccs Task Task","description":"Check status of a CCS conversion task.","operationId":"check_wait_ccs_task_task","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"},"name":"task_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"description":"Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.","required":false,"schema":{"type":"number","maximum":30.0,"exclusiveMinimum":0.0,"title":"Wait","description":"Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls."},"name":"wait","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/semantic/ingest":{"post":{"tags":["Semantic"],"summary":"Ingest","description":"Ingest documents and collections for RAG","operationId":"ingest","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SemanticIngestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/info":{"get":{"tags":["System"],"summary":"Get System Information","description":"Get system info.","operationId":"get_system_information","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemInfo"}}}}}}},"/system/modules/configuration":{"get":{"tags":["System"],"summary":"Get System Modules Configuration","description":"Get modules configuration.","operationId":"get_system_modules_configuration","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModulesConfig"}}}}}}},"/system/modules/tasks":{"get":{"tags":["System"],"summary":"Get System Modules Tasks","description":"Get modules configuration.","operationId":"get_system_modules_tasks","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get System Modules Tasks"}}}}}}},"/system/kgs":{"get":{"tags":["System"],"summary":"List System Knowledge Graphs","description":"List all Knowledge Graphs in the system.","operationId":"list_system_knowledge_graphs","parameters":[{"required":false,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"query"},{"required":false,"schema":{"type":"string","title":"Term"},"name":"term","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{},"type":"array","title":"Response List System Knowledge Graphs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_all_kgs":{"get":{"tags":["System"],"summary":"System Get All Kgs Admin","description":"Get all kgs (only bag_key) for admin use.","operationId":"system_get_all_kgs_admin","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{},"type":"array","title":"Response System Get All Kgs Admin"}}}}},"security":[{"Bearer":[]}]}},"/system/packages":{"get":{"tags":["System"],"summary":"List Packages","description":"Get packages available in this CPS installation for installing in a project.","operationId":"list_packages","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CPSPackage"},"type":"array","title":"Response List Packages"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_all_dcs":{"get":{"tags":["System"],"summary":"System Get All Dcs Admin","description":"Get all data catalogs (only dc_key) for admin use.","operationId":"system_get_all_dcs_admin","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response System Get All Dcs Admin"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/list_all_flavours":{"get":{"tags":["System Flavours"],"summary":"List All Flavours","description":"Get all KG flavours storage on db.","operationId":"list_all_flavours","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/BagFlavourFullData"},"type":"array","title":"Response List All Flavours"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_flavour/{flavour_name}":{"get":{"tags":["System Flavours"],"summary":"Get Flavour","description":"Get flavour from db.","operationId":"get_flavour","parameters":[{"required":true,"schema":{"type":"string","title":"Flavour Name"},"name":"flavour_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BagFlavourFullData"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/save_flavour":{"put":{"tags":["System Flavours"],"summary":"Save Flavour","description":"Save flavour on db.","operationId":"save_flavour","parameters":[{"required":true,"schema":{"type":"boolean","title":"New Flavour"},"name":"new_flavour","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BagFlavourFullData"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/delete_flavour/{flavour_name}":{"delete":{"tags":["System Flavours"],"summary":"Delete Flavour","description":"Delete flavour from db.","operationId":"delete_flavour","parameters":[{"required":true,"schema":{"type":"string","title":"Flavour Name"},"name":"flavour_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/list_projects_flavours":{"get":{"tags":["System Flavours"],"summary":"List Projects Flavours","description":"Get all projects and their flavours.","operationId":"list_projects_flavours","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectsFlavours"},"type":"array","title":"Response List Projects Flavours"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/save_project_flavours":{"put":{"tags":["System Flavours"],"summary":"Save Project Flavours","description":"Save project flavours assignment on db.","operationId":"save_project_flavours","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectsFlavours"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_project_flavours/{proj_key}":{"get":{"tags":["System Flavours"],"summary":"List Flavours By Project","description":"Get project assignment flavours.","operationId":"list_flavours_by_project","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProjectFlavours"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/kg_storage_summary/{kg_key}":{"get":{"tags":["System Summary"],"summary":"System Get Kg Storage Summary Async","description":"Get knowledge graph storage summary.","operationId":"system_get_kg_storage_summary_async","parameters":[{"required":true,"schema":{"type":"string","title":"Kg Key"},"name":"kg_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSummaryTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/dc_storage_summary/{dc_key}":{"get":{"tags":["System Summary"],"summary":"System Get Dc Storage Summary Async","description":"Get data catalog storage summary.","operationId":"system_get_dc_storage_summary_async","parameters":[{"required":true,"schema":{"type":"string","title":"Dc Key"},"name":"dc_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSummaryTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/summary":{"get":{"tags":["System Summary"],"summary":"System Get Cps Summary","description":"Get cps summary data.","operationId":"system_get_cps_summary","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CPSSummary"},"type":"array","title":"Response System Get Cps Summary"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_flavours_default_quota":{"get":{"tags":["System Quotas"],"summary":"Get Flavours Default Quotas","description":"Get flavours default values.","operationId":"get_flavours_default_quotas","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlavoursDefaultQuota"},"type":"array","title":"Response Get Flavours Default Quotas"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/save_flavours_default_quota":{"put":{"tags":["System Quotas"],"summary":"Save Flavours Default Quotas","description":"Save flavours default quota.","operationId":"save_flavours_default_quotas","requestBody":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlavoursDefaultQuota"},"type":"array","title":"Flavours"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlavoursDefaultQuota"},"type":"array","title":"Response Save Flavours Default Quotas"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_projects_flavours_quota":{"get":{"tags":["System Quotas"],"summary":"Get Projects Flavours Quota","description":"Get projects flavours quotas.","operationId":"get_projects_flavours_quota","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectFlavoursQuota"},"type":"array","title":"Response Get Projects Flavours Quota"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/save_project_flavours_quota":{"put":{"tags":["System Quotas"],"summary":"Save Project Flavours Quota","description":"Save project flavours quota.","operationId":"save_project_flavours_quota","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectFlavoursQuota"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_project_flavours_quota/{proj_key}":{"get":{"tags":["System Quotas"],"summary":"Get Project Flavours Quota","description":"Get project flavours quota.","operationId":"get_project_flavours_quota","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlavoursQuota"},"type":"array","title":"Response Get Project Flavours Quota"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_project_flavour_total_kgs/{proj_key}/{flavour_name}":{"get":{"tags":["System Quotas"],"summary":"Get Project Flavour Total Kgs","description":"Gets kg total number by proj_key and flavour_key.","operationId":"get_project_flavour_total_kgs","parameters":[{"required":true,"schema":{"type":"string","title":"Flavour Name"},"name":"flavour_name","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectFlavourTotalKgs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/celery_tasks/{task_id}":{"get":{"tags":["Tasks"],"summary":"Get Project Celery Task","description":"Get a celery task for a project.","operationId":"get_project_celery_task","parameters":[{"required":true,"schema":{"type":"string","title":"Task Id"},"name":"task_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"description":"Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.","required":false,"schema":{"type":"number","maximum":30.0,"exclusiveMinimum":0.0,"title":"Wait","description":"Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls."},"name":"wait","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/tasks":{"get":{"tags":["Tasks"],"summary":"List Project Tasks","description":"List tasks for a project.","operationId":"list_project_tasks","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"string","title":"Task Type"},"name":"task_type","in":"query"},{"required":false,"schema":{"type":"integer","title":"Skip","default":0},"name":"skip","in":"query"},{"required":false,"schema":{"type":"integer","title":"Limit","default":50},"name":"limit","in":"query"},{"required":false,"schema":{"type":"string","title":"Sort By","default":"_id"},"name":"sort_by","in":"query"},{"required":false,"schema":{"type":"string","enum":["asc","desc"],"title":"Sort Order","default":"desc"},"name":"sort_order","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TaskContext"},"type":"array","title":"Response List Project Tasks"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/tasks/{task_id}":{"get":{"tags":["Tasks"],"summary":"Get Project Task","description":"Get a task for a project.","operationId":"get_project_task","parameters":[{"required":true,"schema":{"type":"string","title":"Task Id"},"name":"task_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskContext"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/tasks/{task_id}/actions/abort":{"post":{"tags":["Tasks"],"summary":"Abort Project Task","description":"Abort a task.","operationId":"abort_project_task","parameters":[{"required":true,"schema":{"type":"string","title":"Task Id"},"name":"task_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/scratch/files":{"get":{"tags":["Upload"],"summary":"List Project Scratch Files","description":"Get temporary files uploaded to a project.","operationId":"list_project_scratch_files","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"string","title":"Scratch Ids"},"name":"scratch_ids","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectScratchFiles"},"type":"array","title":"Response List Project Scratch Files"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/scratch/files_paginated":{"get":{"tags":["Upload"],"summary":"List Project Scratch Files Paginated","description":"Get paginated list of temporary files uploaded to a project.","operationId":"list_project_scratch_files_paginated","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"integer","title":"Page"},"name":"page","in":"query"},{"required":false,"schema":{"type":"integer","title":"Items Per Page","default":20},"name":"items_per_page","in":"query"},{"required":false,"schema":{"type":"string","title":"Search String"},"name":"search_string","in":"query"},{"required":false,"schema":{"type":"integer","title":"Begin Date"},"name":"begin_date","in":"query"},{"required":false,"schema":{"type":"integer","title":"End Date"},"name":"end_date","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectScratchFilesPaginated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/scratch/files/upload/{filename}":{"post":{"tags":["Upload"],"summary":"Create Project Scratch File","description":"Create file pointers for temporary storage.","operationId":"create_project_scratch_file","parameters":[{"required":true,"schema":{"type":"string","title":"Filename"},"name":"filename","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemporaryUploadFileResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}}},"components":{"schemas":{"AssembleMode":{"properties":{"page_elements":{"items":{"type":"string","enum":["H","M","None"]},"type":"array","title":"Page Elements"},"tables":{"items":{"type":"string","enum":["H","M","None"]},"type":"array","title":"Tables"}},"type":"object","required":["page_elements","tables"],"title":"AssembleMode"},"AssembleSettings":{"properties":{"mode":{"$ref":"#/components/schemas/AssembleMode"},"include_incomplete_documents":{"type":"boolean","title":"Include Incomplete Documents"}},"type":"object","required":["mode","include_incomplete_documents"],"title":"AssembleSettings"},"AttachmentUploadData":{"properties":{"attachment_path":{"type":"string","title":"Attachment Path"},"upload_data":{"type":"string","title":"Upload Data"}},"type":"object","required":["attachment_path","upload_data"],"title":"AttachmentUploadData"},"AttachmentUploadRequestBody":{"properties":{"attachment_path":{"type":"string","title":"Attachment Path"},"attachment_key":{"type":"string","title":"Attachment Key","default":"usr_attachments"}},"type":"object","required":["attachment_path"],"title":"AttachmentUploadRequestBody"},"BagFlavourFullData":{"properties":{"backend":{"type":"string","title":"Backend"},"config":{"type":"object","title":"Config"},"default_quota":{"type":"integer","title":"Default Quota","default":0},"description":{"type":"string","title":"Description"},"display_name":{"type":"string","title":"Display Name"},"is_from_deployment":{"type":"boolean","title":"Is From Deployment","default":true},"name":{"type":"string","title":"Name"},"order":{"type":"integer","title":"Order","default":0},"project_specific":{"type":"boolean","title":"Project Specific"}},"type":"object","required":["backend","config","description","display_name","name","project_specific"],"title":"BagFlavourFullData"},"CCSProject":{"properties":{"name":{"type":"string","title":"Name"},"proj_key":{"type":"string","title":"Proj Key"},"collection_name":{"type":"string","title":"Collection Name"}},"type":"object","required":["name","proj_key","collection_name"],"title":"CCSProject"},"CPSPackage":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"package_id":{"type":"string","title":"Package Id"},"type":{"type":"string","enum":["model","dictionary","knowledge_graph","data_catalog","data_flow","bundle"],"title":"Type"}},"type":"object","required":["name","description","package_id","type"],"title":"CPSPackage"},"CPSSummary":{"properties":{"availCpuSlots":{"type":"integer","title":"Availcpuslots"},"availMemSlots":{"type":"integer","title":"Availmemslots"},"availSlots":{"type":"integer","title":"Availslots"},"name":{"type":"string","title":"Name"},"numNodes":{"type":"integer","title":"Numnodes"},"numberKgs":{"type":"integer","title":"Numberkgs"},"runningKgs":{"type":"integer","title":"Runningkgs"},"workersPool":{"type":"string","title":"Workerspool"}},"type":"object","required":["availCpuSlots","availMemSlots","availSlots","name","numNodes","numberKgs","runningKgs","workersPool"],"title":"CPSSummary"},"CcsTask":{"properties":{"task_id":{"type":"string","title":"Task Id"},"ccs_project_key":{"type":"string","title":"Ccs Project Key"},"ccs_collection_name":{"type":"string","title":"Ccs Collection Name"}},"type":"object","required":["task_id","ccs_project_key","ccs_collection_name"],"title":"CcsTask"},"CollectionMetadataSettings":{"properties":{"description":{"type":"string","title":"Description"},"display_name":{"type":"string","title":"Display Name"},"license":{"type":"string","title":"License"},"source":{"type":"string","title":"Source"},"version":{"type":"string","title":"Version"}},"type":"object","title":"CollectionMetadataSettings"},"ConvertDocumentRequest":{"properties":{"http_source":{"$ref":"#/components/schemas/HttpSource"},"file_source":{"$ref":"#/components/schemas/FileSource"}},"type":"object","title":"ConvertDocumentRequest"},"ConvertDocumentsRequestBody":{"properties":{"conversion_settings":{"allOf":[{"$ref":"#/components/schemas/PartialDirectConversionParameters"}],"title":"Conversion Settings","description":"Specify the conversion settings to use."},"target_settings":{"allOf":[{"$ref":"#/components/schemas/TargetConversionParameters"}],"title":"Target Settings","description":"Specify the target settings to use."},"document_hashes":{"items":{"type":"string"},"type":"array","title":"Document Hashes","description":"List of document hashes to be used as filter."},"without_operations":{"items":{"type":"string","enum":["PENDING","FAILURE","SUCCESS"]},"type":"array","title":"Without Operations","description":"List of Operation Status documents don't have to be used as filter."},"upload_to_elastic":{"type":"boolean","title":"Upload To Elastic"}},"type":"object","title":"ConvertDocumentsRequestBody"},"ConvertDocumentsSources":{"properties":{"file_url":{"items":{"type":"string"},"type":"array","title":"File Url","description":"List of File's URL to be converted and uploaded to the data index."},"internal_file_url":{"items":{"$ref":"#/components/schemas/InternalUrl"},"type":"array","title":"Internal File Url","description":"List of Internal File's URLs to be converted and uploaded to the data index."},"s3_source":{"allOf":[{"$ref":"#/components/schemas/S3DocumentSource"}],"title":"S3 Source","description":"Coordinates to object store to get files to convert. Can specify which files with object keys."}},"type":"object","title":"ConvertDocumentsSources"},"ConvertUploadDocumentsRequestBody":{"properties":{"file_url":{"items":{"type":"string"},"type":"array","title":"File Url","description":"List of File's URL to be converted and uploaded to the data index."},"internal_file_url":{"items":{"$ref":"#/components/schemas/InternalUrl"},"type":"array","title":"Internal File Url","description":"List of Internal File's URLs to be converted and uploaded to the data index."},"s3_source":{"allOf":[{"$ref":"#/components/schemas/S3DocumentSource"}],"title":"S3 Source","description":"Coordinates to object store to get files to convert. Can specify which files with object keys."},"upload_to_elastic":{"type":"boolean","title":"Upload To Elastic"},"conversion_settings":{"allOf":[{"$ref":"#/components/schemas/PartialDirectConversionParameters"}],"title":"Conversion Settings","description":"Specify the conversion settings to use."},"target_settings":{"allOf":[{"$ref":"#/components/schemas/TargetConversionParameters"}],"title":"Target Settings","description":"Specify the target settings to use."}},"type":"object","title":"ConvertUploadDocumentsRequestBody"},"CpsTask":{"properties":{"task_id":{"type":"string","title":"Task Id"},"task_type":{"type":"string","title":"Task Type"},"task_status":{"type":"string","title":"Task Status"}},"type":"object","required":["task_id","task_type","task_status"],"title":"CpsTask"},"DataFlow":{"properties":{"df_tpl_key":{"type":"string","title":"Df Tpl Key"},"name":{"type":"string","title":"Name"}},"type":"object","required":["df_tpl_key","name"],"title":"DataFlow"},"DataIndexUploadFileSource":{"properties":{"urls":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Urls","description":"List of URLs to be printed to PDF, converted and uploaded to the data index."},"conversion_settings":{"allOf":[{"$ref":"#/components/schemas/PartialDirectConversionParameters"}],"title":"Conversion Settings","description":"Specify the conversion settings to use."}},"type":"object","required":["urls"],"title":"DataIndexUploadFileSource"},"DefaultValues":{"properties":{"ccs_project":{"$ref":"#/components/schemas/CCSProject"},"dataflow":{"$ref":"#/components/schemas/DataFlow"}},"type":"object","required":["ccs_project"],"title":"DefaultValues"},"Deployment":{"properties":{"name":{"type":"string","title":"Name"},"disclaimer":{"type":"string","title":"Disclaimer"},"should_show_warning":{"type":"boolean","title":"Should Show Warning"},"disable_kg_actions":{"type":"boolean","title":"Disable Kg Actions"},"linked_ccs_api":{"type":"object","title":"Linked Ccs Api"}},"type":"object","required":["name","disclaimer","should_show_warning","disable_kg_actions","linked_ccs_api"],"title":"Deployment"},"DirectModelConfig":{"properties":{"type":{"type":"string","title":"Type"},"config":{"type":"object","title":"Config"}},"type":"object","required":["type","config"],"title":"DirectModelConfig","description":"Direct configuration of a model."},"DocumentArtifacts":{"properties":{"document_meta_json":{"$ref":"#/components/schemas/DocumentArtifactsItem"},"document_pdf":{"$ref":"#/components/schemas/DocumentArtifactsItem"},"document_json":{"$ref":"#/components/schemas/DocumentArtifactsItem"},"document_glm_json":{"$ref":"#/components/schemas/DocumentArtifactsItem"},"document_md":{"$ref":"#/components/schemas/DocumentArtifactsItem"},"page_pdfs":{"items":{"$ref":"#/components/schemas/DocumentArtifactsPageItem"},"type":"array","title":"Page Pdfs","default":[]},"page_images":{"items":{"$ref":"#/components/schemas/DocumentArtifactsPageItem"},"type":"array","title":"Page Images","default":[]}},"type":"object","title":"DocumentArtifacts"},"DocumentArtifactsItem":{"properties":{"mime":{"type":"string","title":"Mime"},"path":{"type":"string","title":"Path"},"url":{"type":"string","title":"Url"}},"type":"object","required":["mime","path","url"],"title":"DocumentArtifactsItem"},"DocumentArtifactsPageItem":{"properties":{"mime":{"type":"string","title":"Mime"},"path":{"type":"string","title":"Path"},"url":{"type":"string","title":"Url"},"page":{"type":"integer","title":"Page","description":"Page number starting at 1."}},"type":"object","required":["mime","path","url","page"],"title":"DocumentArtifactsPageItem"},"DocumentStatistics":{"properties":{"total_documents":{"type":"integer","title":"Total Documents"},"documents_pending":{"type":"integer","title":"Documents Pending"},"documents_failed":{"type":"integer","title":"Documents Failed"},"documents_converted":{"type":"integer","title":"Documents Converted"}},"type":"object","required":["total_documents","documents_pending","documents_failed","documents_converted"],"title":"DocumentStatistics"},"ElasticIndexPropertyObject":{"properties":{"type":{"type":"string","title":"Type"},"enabled":{"type":"boolean","title":"Enabled"},"ignore_above":{"type":"integer","title":"Ignore Above"}},"type":"object","required":["type"],"title":"ElasticIndexPropertyObject"},"ElasticIndexPropertyPrimitive":{"properties":{"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ElasticIndexPropertyPrimitive"},{"$ref":"#/components/schemas/ElasticIndexPropertyObject"}]},"type":"object","title":"Properties"}},"type":"object","required":["properties"],"title":"ElasticIndexPropertyPrimitive"},"ElasticIndexSearchQueryOptions":{"properties":{"_source":{"items":{"type":"string"},"type":"array","title":" Source"},"from_":{"type":"integer","title":"From "},"size":{"type":"integer","title":"Size"},"query":{"type":"object","title":"Query"},"aggs":{"type":"object","title":"Aggs"},"sort":{"items":{"type":"object"},"type":"array","title":"Sort"}},"type":"object","title":"ElasticIndexSearchQueryOptions"},"ElasticIndexSource":{"properties":{"index_key":{"type":"string","title":"Index Key"},"elastic_id":{"type":"string","title":"Elastic Id"}},"type":"object","required":["index_key","elastic_id"],"title":"ElasticIndexSource"},"ElasticInstanceDataIndex":{"properties":{"index_key":{"type":"string","title":"Index Key"},"query_options":{"$ref":"#/components/schemas/ElasticIndexSearchQueryOptions"},"elastic_id":{"type":"string","title":"Elastic Id"}},"type":"object","required":["index_key","query_options","elastic_id"],"title":"ElasticInstanceDataIndex"},"ElasticMetadata":{"properties":{"aliases":{"items":{"type":"string"},"type":"array","title":"Aliases"},"created":{"type":"string","title":"Created"},"description":{"type":"string","title":"Description"},"display_name":{"type":"string","title":"Display Name"},"source":{"type":"string","title":"Source"},"storage":{"type":"string","title":"Storage"},"version":{"type":"string","title":"Version"},"type":{"type":"string","title":"Type"},"domain":{"items":{"type":"string"},"type":"array","title":"Domain"},"classification":{"items":{"type":"string"},"type":"array","title":"Classification"}},"type":"object","required":["classification"],"title":"ElasticMetadata"},"FileSource":{"properties":{"base64_string":{"type":"string","title":"Base64 String"},"filename":{"type":"string","title":"Filename"}},"type":"object","required":["base64_string","filename"],"title":"FileSource"},"Flavour":{"properties":{"name":{"type":"string","title":"Name"},"display_name":{"type":"string","title":"Display Name"}},"type":"object","required":["name"],"title":"Flavour"},"FlavoursDefaultQuota":{"properties":{"display_name":{"type":"string","title":"Display Name"},"name":{"type":"string","title":"Name"},"default_quota":{"type":"integer","title":"Default Quota"}},"type":"object","required":["display_name","name","default_quota"],"title":"FlavoursDefaultQuota"},"FlavoursQuota":{"properties":{"display_name":{"type":"string","title":"Display Name"},"name":{"type":"string","title":"Name"},"quota":{"type":"integer","title":"Quota"}},"type":"object","required":["display_name","name","quota"],"title":"FlavoursQuota"},"GenAIAWSBedrock":{"properties":{"kind":{"type":"string","enum":["aws_bedrock"],"title":"Kind","default":"aws_bedrock"},"config":{"$ref":"#/components/schemas/GenAIAWSBedrockConfig"},"proj_params":{"$ref":"#/components/schemas/GenAIPartialParams"}},"type":"object","required":["config"],"title":"GenAIAWSBedrock","description":"GenAI integration for AWS Bedrock settings"},"GenAIAWSBedrockConfig":{"properties":{"GENAI_AWS_ACCESS_KEY":{"type":"string","format":"password","title":"Genai Aws Access Key","writeOnly":true},"GENAI_AWS_SECRET_KEY":{"type":"string","format":"password","title":"Genai Aws Secret Key","writeOnly":true},"GENAI_AWS_REGION_NAME":{"type":"string","title":"Genai Aws Region Name"}},"type":"object","required":["GENAI_AWS_ACCESS_KEY","GENAI_AWS_SECRET_KEY","GENAI_AWS_REGION_NAME"],"title":"GenAIAWSBedrockConfig","description":"Config for AWS Bedrock"},"GenAIBAM":{"properties":{"kind":{"type":"string","enum":["bam"],"title":"Kind","default":"bam"},"config":{"$ref":"#/components/schemas/GenAIBAMConfig"},"proj_params":{"$ref":"#/components/schemas/GenAIPartialParams"}},"type":"object","required":["config"],"title":"GenAIBAM","description":"GenAI integration for BAM settings"},"GenAIBAMConfig":{"properties":{"GENAI_API":{"type":"string","title":"Genai Api"},"GENAI_KEY":{"type":"string","format":"password","title":"Genai Key","writeOnly":true}},"type":"object","required":["GENAI_API","GENAI_KEY"],"title":"GenAIBAMConfig","description":"Config for BAM"},"GenAIHFInferenceApi":{"properties":{"kind":{"type":"string","enum":["hf_api"],"title":"Kind","default":"hf_api"},"config":{"$ref":"#/components/schemas/GenAIHFInferenceApiConfig"},"proj_params":{"$ref":"#/components/schemas/GenAIPartialParams"}},"type":"object","required":["config"],"title":"GenAIHFInferenceApi","description":"GenAI integration for Inference API settings"},"GenAIHFInferenceApiConfig":{"properties":{"GENAI_HF_API_KEY":{"type":"string","format":"password","title":"Genai Hf Api Key","writeOnly":true}},"type":"object","required":["GENAI_HF_API_KEY"],"title":"GenAIHFInferenceApiConfig","description":"Config for HF Inference API"},"GenAIParams":{"properties":{"model_id":{"type":"string","title":"Model Id"},"prompt_template":{"type":"string","title":"Prompt Template"},"params":{"type":"object","title":"Params"},"timeout":{"type":"number","title":"Timeout"}},"type":"object","required":["model_id","prompt_template","params","timeout"],"title":"GenAIParams"},"GenAIPartialParams":{"properties":{"model_id":{"type":"string","title":"Model Id"},"prompt_template":{"type":"string","title":"Prompt Template"},"params":{"type":"object","title":"Params"},"timeout":{"type":"number","title":"Timeout"}},"type":"object","title":"GenAIPartialParams"},"GenAIWatsonx":{"properties":{"kind":{"type":"string","enum":["watsonx"],"title":"Kind","default":"watsonx"},"config":{"$ref":"#/components/schemas/GenAIWatsonxConfig"},"proj_params":{"$ref":"#/components/schemas/GenAIPartialParams"}},"type":"object","required":["config"],"title":"GenAIWatsonx","description":"GenAI integration for watsonx settings"},"GenAIWatsonxConfig":{"properties":{"GENAI_API":{"type":"string","title":"Genai Api"},"GENAI_PROJECT_ID":{"type":"string","title":"Genai Project Id"},"GENAI_KEY":{"type":"string","format":"password","title":"Genai Key","writeOnly":true}},"type":"object","required":["GENAI_API","GENAI_PROJECT_ID","GENAI_KEY"],"title":"GenAIWatsonxConfig","description":"Config for watsonx"},"GroupedProjectDocuments":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/ProjectDocument"},"type":"array","title":"Documents"},"upload_date":{"anyOf":[{"type":"string"},{"type":"string","format":"date-time"}],"title":"Upload Date"}},"type":"object","required":["documents","upload_date"],"title":"GroupedProjectDocuments"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HttpSource":{"properties":{"url":{"type":"string","title":"Url"},"headers":{"type":"object","title":"Headers"}},"type":"object","required":["url","headers"],"title":"HttpSource"},"InternalUrl":{"properties":{"download_url":{"type":"string","title":"Download Url"},"header_url":{"type":"string","title":"Header Url"}},"type":"object","required":["download_url","header_url"],"title":"InternalUrl"},"JsonUploadRequestBody":{"properties":{"file_url":{"type":"string","title":"File Url"}},"type":"object","required":["file_url"],"title":"JsonUploadRequestBody"},"ListProjectFlavours":{"properties":{"flavours":{"items":{"$ref":"#/components/schemas/BagFlavourFullData"},"type":"array","title":"Flavours"},"proj_key":{"type":"string","title":"Proj Key"}},"type":"object","required":["flavours","proj_key"],"title":"ListProjectFlavours"},"ModelPipelineSettings":{"properties":{"clusters":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Clusters"},"page":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Page"},"tables":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Tables"},"normalization":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Normalization"}},"type":"object","required":["clusters","page","tables","normalization"],"title":"ModelPipelineSettings"},"ModulesConfig":{"properties":{"df_template_variables":{"items":{},"type":"array","title":"Df Template Variables"},"linked_ccs_instances":{"items":{},"type":"array","title":"Linked Ccs Instances"},"linked_elastic_instances":{"items":{},"type":"array","title":"Linked Elastic Instances"}},"type":"object","required":["df_template_variables","linked_ccs_instances","linked_elastic_instances"],"title":"ModulesConfig"},"OcrSettings":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"backend":{"type":"string","title":"Backend"},"backend_settings":{"type":"object","title":"Backend Settings"},"merge_mode":{"type":"string","title":"Merge Mode"}},"type":"object","title":"OcrSettings"},"Package":{"properties":{"overrides":{"type":"object","title":"Overrides"},"package_id":{"type":"string","title":"Package Id"}},"type":"object","required":["overrides","package_id"],"title":"Package"},"PartialDirectConversionParameters":{"properties":{"type":{"type":"string","enum":["direct"],"title":"Type","default":"direct"},"ocr":{"$ref":"#/components/schemas/OcrSettings"},"assemble":{"$ref":"#/components/schemas/AssembleSettings"},"metadata":{"$ref":"#/components/schemas/CollectionMetadataSettings"},"page_labels":{"additionalProperties":{"type":"object"},"type":"object","title":"Page Labels"},"model_pipeline":{"$ref":"#/components/schemas/ModelPipelineSettings"}},"type":"object","title":"PartialDirectConversionParameters","description":"Specify conversion settings (OCR, Assemble, ML Models) directly.\n\nFields left null are set to platform defaults."},"ProjectAgent":{"properties":{"agent_info":{"type":"object","title":"Agent Info"},"agent_name":{"type":"string","title":"Agent Name"},"version":{"type":"string","title":"Version"}},"type":"object","required":["agent_info","agent_name","version"],"title":"ProjectAgent"},"ProjectAgents":{"properties":{"agents":{"items":{"$ref":"#/components/schemas/ProjectAgent"},"type":"array","title":"Agents"}},"type":"object","required":["agents"],"title":"ProjectAgents"},"ProjectDataIndexNonView":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"schema_key":{"type":"string","enum":["deepsearch-doc","deepsearch-db","generic"],"title":"Schema Key","default":"generic"}},"type":"object","required":["name"],"title":"ProjectDataIndexNonView"},"ProjectDataIndexSource":{"properties":{"index_key":{"type":"string","title":"Index Key"},"proj_key":{"type":"string","title":"Proj Key"}},"type":"object","required":["index_key","proj_key"],"title":"ProjectDataIndexSource"},"ProjectDataIndexView":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"view_of":{"anyOf":[{"$ref":"#/components/schemas/ProjectSourceDataIndex"},{"$ref":"#/components/schemas/ElasticInstanceDataIndex"}],"title":"View Of"}},"type":"object","required":["name","view_of"],"title":"ProjectDataIndexView"},"ProjectDataIndexWithStatus":{"properties":{"source":{"anyOf":[{"$ref":"#/components/schemas/ElasticIndexSource"},{"$ref":"#/components/schemas/ProjectDataIndexSource"}],"title":"Source"},"name":{"type":"string","title":"Name"},"documents":{"type":"integer","title":"Documents"},"health":{"type":"string","title":"Health"},"status":{"type":"string","title":"Status"},"creation_date":{"type":"string","title":"Creation Date"},"metadata":{"$ref":"#/components/schemas/ElasticMetadata"},"description":{"type":"string","title":"Description"},"schema_key":{"type":"string","enum":["deepsearch-doc","deepsearch-db","generic"],"title":"Schema Key"},"type":{"type":"string","title":"Type"},"view_of":{"anyOf":[{"$ref":"#/components/schemas/ProjectSourceDataIndex"},{"$ref":"#/components/schemas/ElasticInstanceDataIndex"}],"title":"View Of"},"record_properties":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ElasticIndexPropertyPrimitive"},{"$ref":"#/components/schemas/ElasticIndexPropertyObject"}]},"type":"object","title":"Record Properties"},"provenance":{"type":"string","title":"Provenance"}},"type":"object","required":["source","name","documents","health","status","creation_date","description","type"],"title":"ProjectDataIndexWithStatus"},"ProjectDocument":{"properties":{"document_hash":{"type":"string","title":"Document Hash"},"filename":{"type":"string","title":"Filename"},"file_uri":{"type":"string","title":"File Uri"},"ref_uri":{"type":"string","title":"Ref Uri"},"number_pages":{"type":"integer","title":"Number Pages"},"status":{"type":"string","title":"Status"}},"type":"object","required":["document_hash","filename"],"title":"ProjectDocument"},"ProjectDocumentURL":{"properties":{"download_url":{"type":"string","title":"Download Url"}},"type":"object","required":["download_url"],"title":"ProjectDocumentURL"},"ProjectDocuments":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/ProjectDocument"},"type":"array","title":"Documents"}},"type":"object","required":["documents"],"title":"ProjectDocuments"},"ProjectFlavourTotalKgs":{"properties":{"proj_key":{"type":"string","title":"Proj Key"},"flavour_name":{"type":"string","title":"Flavour Name"},"total_kgs":{"type":"integer","title":"Total Kgs"}},"type":"object","required":["proj_key","flavour_name","total_kgs"],"title":"ProjectFlavourTotalKgs"},"ProjectFlavoursQuota":{"properties":{"name":{"type":"string","title":"Name"},"proj_key":{"type":"string","title":"Proj Key"},"quotas":{"items":{"$ref":"#/components/schemas/FlavoursQuota"},"type":"array","title":"Quotas"}},"type":"object","required":["name","proj_key","quotas"],"title":"ProjectFlavoursQuota"},"ProjectPackageInstalationManifest":{"properties":{"packages":{"items":{"$ref":"#/components/schemas/Package"},"type":"array","title":"Packages"}},"type":"object","required":["packages"],"title":"ProjectPackageInstalationManifest"},"ProjectScratchFiles":{"properties":{"id":{"type":"string","title":"Id"},"proj_key":{"type":"string","title":"Proj Key"},"user_key":{"type":"string","title":"User Key"},"filename":{"type":"string","title":"Filename"},"timestamp":{"type":"string","title":"Timestamp"},"url":{"type":"string","title":"Url"}},"type":"object","required":["id","proj_key","user_key","filename","timestamp","url"],"title":"ProjectScratchFiles"},"ProjectScratchFilesPaginated":{"properties":{"files":{"items":{"$ref":"#/components/schemas/ProjectScratchFiles"},"type":"array","title":"Files"},"count":{"type":"integer","title":"Count"},"page":{"type":"integer","title":"Page"},"items_per_page":{"type":"integer","title":"Items Per Page"}},"type":"object","required":["files","count","page","items_per_page"],"title":"ProjectScratchFilesPaginated"},"ProjectSourceDataIndex":{"properties":{"index_key":{"type":"string","title":"Index Key"},"query_options":{"$ref":"#/components/schemas/ElasticIndexSearchQueryOptions"},"proj_key":{"type":"string","title":"Proj Key"}},"type":"object","required":["index_key","query_options","proj_key"],"title":"ProjectSourceDataIndex"},"ProjectsFlavours":{"properties":{"proj_key":{"type":"string","title":"Proj Key"},"name":{"type":"string","title":"Name"},"flavours":{"items":{"$ref":"#/components/schemas/Flavour"},"type":"array","title":"Flavours"}},"type":"object","required":["proj_key","name","flavours"],"title":"ProjectsFlavours"},"ReferenceToModel":{"properties":{"model_config_key":{"type":"string","title":"Model Config Key"},"proj_key":{"type":"string","title":"Proj Key"},"name":{"type":"string","title":"Name","default":""},"description":{"type":"string","title":"Description","default":""}},"type":"object","required":["model_config_key","proj_key"],"title":"ReferenceToModel","description":"Reference to a model configuration."},"ResponseDocumentArtifacts":{"properties":{"artifacts":{"$ref":"#/components/schemas/DocumentArtifacts"}},"type":"object","required":["artifacts"],"title":"ResponseDocumentArtifacts"},"ResponseGroupedDocuments":{"properties":{"grouped_documents":{"items":{"$ref":"#/components/schemas/GroupedProjectDocuments"},"type":"array","title":"Grouped Documents"}},"type":"object","required":["grouped_documents"],"title":"ResponseGroupedDocuments"},"ResponseUploadJobs":{"properties":{"upload_jobs":{"items":{"$ref":"#/components/schemas/UploadJob"},"type":"array","title":"Upload Jobs"}},"type":"object","required":["upload_jobs"],"title":"ResponseUploadJobs"},"S3Coordinates":{"properties":{"host":{"type":"string","title":"Host"},"port":{"type":"integer","title":"Port"},"ssl":{"type":"boolean","title":"Ssl"},"verifySSL":{"type":"boolean","title":"Verifyssl"},"access-key":{"type":"string","title":"Access-Key"},"secret-key":{"type":"string","title":"Secret-Key"},"bucket":{"type":"string","title":"Bucket"},"key_prefix":{"type":"string","title":"Key Prefix"},"location":{"type":"string","title":"Location"}},"type":"object","required":["host","port","ssl","verifySSL","access-key","secret-key","bucket","location"],"title":"S3Coordinates"},"S3DocumentSource":{"properties":{"coordinates":{"$ref":"#/components/schemas/S3Coordinates"},"object_keys":{"items":{"type":"string"},"type":"array","title":"Object Keys","description":"List of s3 object keys to retrieve from bucket to be converted and uploaded to the data index."}},"type":"object","required":["coordinates"],"title":"S3DocumentSource","description":"Specifies documents to import from an S3 bucket"},"SemanticIngestReqParams":{"properties":{"skip_ingested_docs":{"type":"boolean","title":"Skip Ingested Docs"}},"type":"object","required":["skip_ingested_docs"],"title":"SemanticIngestReqParams"},"SemanticIngestRequest":{"properties":{"source":{"anyOf":[{"$ref":"#/components/schemas/SemanticIngestSourceUrl"},{"$ref":"#/components/schemas/SemanticIngestSourcePublicDataDocument"},{"$ref":"#/components/schemas/SemanticIngestSourcePrivateDataDocument"},{"$ref":"#/components/schemas/SemanticIngestSourcePrivateDataCollection"}],"title":"Source"},"parameters":{"$ref":"#/components/schemas/SemanticIngestReqParams"}},"type":"object","required":["source","parameters"],"title":"SemanticIngestRequest"},"SemanticIngestSourcePrivateDataCollection":{"properties":{"type":{"type":"string","enum":["private_data_collection"],"title":"Type"},"proj_key":{"type":"string","title":"Proj Key"},"index_key":{"type":"string","title":"Index Key"}},"type":"object","required":["type","proj_key","index_key"],"title":"SemanticIngestSourcePrivateDataCollection"},"SemanticIngestSourcePrivateDataDocument":{"properties":{"type":{"type":"string","enum":["private_data_document"],"title":"Type"},"proj_key":{"type":"string","title":"Proj Key"},"index_key":{"type":"string","title":"Index Key"},"document_hash":{"type":"string","title":"Document Hash"}},"type":"object","required":["type","proj_key","index_key","document_hash"],"title":"SemanticIngestSourcePrivateDataDocument"},"SemanticIngestSourcePublicDataDocument":{"properties":{"type":{"type":"string","enum":["public_data_document"],"title":"Type"},"elastic_id":{"type":"string","title":"Elastic Id"},"index_key":{"type":"string","title":"Index Key"},"document_hash":{"type":"string","title":"Document Hash"}},"type":"object","required":["type","elastic_id","index_key","document_hash"],"title":"SemanticIngestSourcePublicDataDocument"},"SemanticIngestSourceUrl":{"properties":{"type":{"type":"string","enum":["url"],"title":"Type"},"url":{"type":"string","title":"Url"}},"type":"object","required":["type","url"],"title":"SemanticIngestSourceUrl"},"StorageSummaryTask":{"properties":{"dc_key":{"type":"string","title":"Dc Key"},"kg_key":{"type":"string","title":"Kg Key"},"kind":{"type":"string","enum":["project_task","celery_task"],"title":"Kind"},"proj_key":{"type":"string","title":"Proj Key"},"task_id":{"type":"string","title":"Task Id"}},"type":"object","required":["kind","proj_key","task_id"],"title":"StorageSummaryTask"},"SystemInfo":{"properties":{"notifications":{"items":{},"type":"array","title":"Notifications"},"default_project":{"type":"object","title":"Default Project"},"deployment":{"$ref":"#/components/schemas/Deployment"},"toolkit":{"type":"object","title":"Toolkit"},"allow_non_admins_to_make_resources_public":{"type":"boolean","title":"Allow Non Admins To Make Resources Public"},"api":{"type":"object","title":"Api"},"genai_defaults":{"additionalProperties":{"$ref":"#/components/schemas/GenAIParams"},"type":"object","title":"Genai Defaults"}},"type":"object","required":["notifications","default_project","deployment","toolkit","allow_non_admins_to_make_resources_public","api","genai_defaults"],"title":"SystemInfo"},"TargetConversionParameters":{"properties":{"add_raw_pages":{"type":"boolean","title":"Add Raw Pages"},"add_annotations":{"type":"boolean","title":"Add Annotations"}},"type":"object","title":"TargetConversionParameters","description":"Specify target settings (add_raw_pages, add_annotations).\n\nFields left null are set to platform defaults."},"TaskContext":{"properties":{"proj_key":{"type":"string","title":"Proj Key"},"user_key":{"type":"string","title":"User Key"},"task_type":{"type":"string","title":"Task Type"},"task_id":{"type":"string","title":"Task Id"},"task_status":{"type":"string","title":"Task Status"},"execution_mode":{"type":"string","title":"Execution Mode"},"progress":{"type":"number","title":"Progress"},"meta":{"type":"object","title":"Meta"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"completed_at":{"type":"string","format":"date-time","title":"Completed At"},"start_count":{"type":"integer","title":"Start Count"},"error_reason":{"type":"string","title":"Error Reason"},"related_tasks":{"items":{},"type":"array","title":"Related Tasks"}},"type":"object","required":["proj_key","user_key","task_type","task_id","task_status","execution_mode","progress","meta","created_at"],"title":"TaskContext"},"TaskResult":{"properties":{"result":{"title":"Result"},"task_id":{"type":"string","title":"Task Id"},"task_status":{"type":"string","title":"Task Status"}},"type":"object","required":["task_id","task_status"],"title":"TaskResult"},"TemporaryUploadFileResult":{"properties":{"id":{"type":"string","title":"Id"},"upload":{"$ref":"#/components/schemas/TemporaryUrlFields"},"download":{"$ref":"#/components/schemas/TemporaryUrl"},"metadata":{"$ref":"#/components/schemas/TemporaryUrl"},"upload_private":{"$ref":"#/components/schemas/TemporaryUrlFields"},"download_private":{"$ref":"#/components/schemas/TemporaryUrl"},"metadata_private":{"$ref":"#/components/schemas/TemporaryUrl"}},"type":"object","required":["id","upload","download","metadata","upload_private","download_private","metadata_private"],"title":"TemporaryUploadFileResult"},"TemporaryUrl":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"TemporaryUrl"},"TemporaryUrlFields":{"properties":{"url":{"type":"string","title":"Url"},"fields":{"type":"object","title":"Fields"}},"type":"object","required":["url","fields"],"title":"TemporaryUrlFields"},"TokenResponse":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"TokenResponse"},"UploadElasticRequestBody":{"properties":{"document_hashes":{"items":{"type":"string"},"type":"array","title":"Document Hashes","description":"List of document hashes to be used as filter."},"with_operations":{"items":{"type":"string","enum":["PENDING","FAILURE","SUCCESS"]},"type":"array","title":"With Operations","description":"List of Operation Status documents don't have to be used as filter."}},"type":"object","title":"UploadElasticRequestBody"},"UploadJob":{"properties":{"date":{"type":"string","format":"date-time","title":"Date"},"num_docs":{"type":"integer","title":"Num Docs"}},"type":"object","required":["date","num_docs"],"title":"UploadJob"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"Bearer":{"type":"apiKey","description":"Provide a Bearer token in the `Authorization` header","in":"header","name":"Authorization"}}}} \ No newline at end of file +{"openapi":"3.1.0","info":{"title":"Deep Search (DS) API","description":"API for Deep Search.\n\n**WARNING**: This API is subject to change without warning!","version":"3.0.0"},"servers":[{"url":"/api/cps/public/v2"}],"paths":{"/project/{proj_key}/data_indices/documents/agents":{"get":{"tags":["Content Manager"],"summary":"Get Project Agents","description":"Get project agents.","operationId":"get_project_agents","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAgents"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/transactions/{transaction_id}":{"get":{"tags":["Content Manager"],"summary":"Get Project Documents By Transaction","description":"Get project documents by transaction ID.","operationId":"get_project_documents_by_transaction","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Transaction Id"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocuments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/":{"get":{"tags":["Content Manager"],"summary":"Get All Project Data Index Documents","description":"Get all project documents","operationId":"get_all_project_data_index_documents","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocuments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/statistics":{"get":{"tags":["Content Manager"],"summary":"Get Project Conversion Statistics","description":"Get project conversion statistics.","operationId":"get_project_conversion_statistics","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentStatistics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/agent/{agent_name}":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Documents","description":"Get project documents, can be filter by status.","operationId":"get_project_data_index_documents","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"agent_name","in":"path","required":true,"schema":{"type":"string","title":"Agent Name"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/StatusFilter","description":"Filter the documents by conversion status."}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocuments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/agent/{agent_name}/grouped":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Grouped Documents","description":"Get project documents grouped by upload.","operationId":"get_project_data_index_grouped_documents","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"agent_name","in":"path","required":true,"schema":{"type":"string","title":"Agent Name"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/StatusFilter","description":"Filter the documents by conversion status."}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseGroupedDocuments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/upload_jobs":{"get":{"tags":["Content Manager"],"summary":"Get Project Index Upload Jobs","description":"Get project upload jobs.","operationId":"get_project_index_upload_jobs","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseUploadJobs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/Markdown":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Document Markdown","description":"Get project document Markdown.","operationId":"get_project_data_index_document_markdown","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"document_hash","in":"path","required":true,"schema":{"type":"string","title":"Document Hash"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocumentURL"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/PDF":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Pdf Document","description":"Get project PDF document.","operationId":"get_project_data_index_pdf_document","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"document_hash","in":"path","required":true,"schema":{"type":"string","title":"Document Hash"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocumentURL"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/JSON":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Json Document","description":"Get project JSON document.","operationId":"get_project_data_index_json_document","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"document_hash","in":"path","required":true,"schema":{"type":"string","title":"Document Hash"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Project Data Index Json Document"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/artifacts":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Document Artifacts","description":"Get project document artifacts.","operationId":"get_project_data_index_document_artifacts","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"document_hash","in":"path","required":true,"schema":{"type":"string","title":"Document Hash"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseDocumentArtifacts"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/metadata":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Document Metadata","description":"Get project document metadata.","operationId":"get_project_data_index_document_metadata","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"document_hash","in":"path","required":true,"schema":{"type":"string","title":"Document Hash"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocument"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Content Manager"],"summary":"Add Project Data Index Document Metadata","description":"Insert project document metadata.","operationId":"add_project_data_index_document_metadata","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"document_hash","in":"path","required":true,"schema":{"type":"string","title":"Document Hash"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentMeta"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/{document_hash}/doc_events":{"get":{"tags":["Content Manager"],"summary":"Get Project Data Index Document Events","description":"Get events of a project document.","operationId":"get_project_data_index_document_events","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"document_hash","in":"path","required":true,"schema":{"type":"string","title":"Document Hash"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"agent_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/StatusFilter","description":"Filter the documents by conversion status."}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Project Data Index Document Events"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices":{"get":{"tags":["Data Indices"],"summary":"Get Project Data Indices","description":"Get project data indices.","operationId":"get_project_data_indices","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"},"title":"Response Get Project Data Indices"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Data Indices"],"summary":"Create Project Data Index","description":"Create a project data index.","operationId":"create_project_data_index","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexView"},{"$ref":"#/components/schemas/ProjectDataIndexNonView"}],"title":"Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}":{"get":{"tags":["Data Indices"],"summary":"Get Project Data Index","description":"Get project data index.","operationId":"get_project_data_index","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Data Indices"],"summary":"Update Project Data Index","description":"Update a project data index.","operationId":"update_project_data_index","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexView"},{"$ref":"#/components/schemas/ProjectDataIndexNonView"}],"title":"Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Data Indices"],"summary":"Delete Project Data Index","description":"Delete a project index data.","operationId":"delete_project_data_index","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"confirmation_token","in":"query","required":true,"schema":{"type":"string","title":"Confirmation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/delete_token":{"post":{"tags":["Data Indices"],"summary":"Create Project Data Index Delete Token","description":"Get a token used to confirm the deletion of a project data index.","operationId":"create_project_data_index_delete_token","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/conversion_settings":{"get":{"tags":["Data Indices"],"summary":"Get Project Data Index Conversion Settings","description":"Get project data index conversion settings.","operationId":"get_project_data_index_conversion_settings","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexConversionSettings-Output"},{"type":"null"}],"title":"Response Get Project Data Index Conversion Settings"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Data Indices"],"summary":"Update Project Data Index Conversion Settings","description":"Update a project data index conversion settings.","operationId":"update_project_data_index_conversion_settings","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDataIndexConversionSettings-Input"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexConversionSettings-Output"},{"type":"null"}],"title":"Response Update Project Data Index Conversion Settings"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/actions/upload":{"post":{"tags":["Data Indices Upload"],"summary":"Upload Project Data Index File","description":"Upload a file to a project data index.","operationId":"upload_project_data_index_file","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonUploadRequestBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/actions/upload_register_documents":{"post":{"tags":["Data Indices Upload"],"summary":"Upload Register Project Documents","description":"Upload and register documents to be converted later.","operationId":"upload_register_project_documents","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertDocumentsSources"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/actions/load_elastic":{"post":{"tags":["Data Indices Upload"],"summary":"Load Project Data Index Files Elastic","description":"Load file(s) in a project data index to elastic.","operationId":"load_project_data_index_files_elastic","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadElasticRequestBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/actions/ccs_convert":{"post":{"tags":["Data Indices Upload"],"summary":"Ccs Convert File Project Data Index","description":"Convert files via CCS previously registered and in a project data index.","operationId":"ccs_convert_file_project_data_index","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertDocumentsRequestBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/actions/ccs_convert_upload":{"post":{"tags":["Data Indices Upload"],"summary":"Ccs Convert Upload File Project Data Index","description":"Convert files via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema).","operationId":"ccs_convert_upload_file_project_data_index","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertUploadDocumentsRequestBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/actions/html_print_convert_upload":{"post":{"tags":["Data Indices Upload"],"summary":"Html Print Convert Upload","description":"Convert a list of HTML pages to PDF, convert them via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema).","operationId":"html_print_convert_upload","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataIndexUploadFileSource"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment_url/{filename}":{"get":{"tags":["Data Indices Upload"],"summary":"Get Attachment Upload Data","description":"Get url and path to upload an attachment to a project data index.","operationId":"get_attachment_upload_data","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"index_item_id","in":"path","required":true,"schema":{"type":"string","title":"Index Item Id"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadData"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment":{"post":{"tags":["Data Indices Upload"],"summary":"Register Attachment","description":"Notify upload completion of an attachment to a project data index.","operationId":"register_attachment","security":[{"Bearer":[]}],"parameters":[{"name":"index_key","in":"path","required":true,"schema":{"type":"string","title":"Index Key"}},{"name":"index_item_id","in":"path","required":true,"schema":{"type":"string","title":"Index Item Id"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadRequestBody"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/public/bags":{"get":{"tags":["Knowledge Graphs"],"summary":"List Public Knowledge Graphs","description":"List all public BAGs","operationId":"list_public_knowledge_graphs","security":[{"Bearer":[]}],"parameters":[{"name":"term","in":"query","required":false,"schema":{"anyOf":[{},{"type":"null"}],"title":"Term"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"},"title":"Response List Public Knowledge Graphs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/backend/project/{proj_key}/bags":{"get":{"tags":["Knowledge Graphs"],"summary":"Backend List Project Kgs","description":"List all bags in the project, backend-aware","operationId":"backend_list_project_kgs","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"term","in":"query","required":false,"schema":{"title":"Term"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"},"title":"Response Backend List Project Kgs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Knowledge Graphs"],"summary":"Create Project Knowledge Graph","description":"Create new BAG, backend-aware","operationId":"create_project_knowledge_graph","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Project Knowledge Graph"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/backend/project/{proj_key}/bags/{bag_key}":{"patch":{"tags":["Knowledge Graphs"],"summary":"Update Project Knowledge Graph Metadata","description":"Update the metadata of a Knowledge graph","operationId":"update_project_knowledge_graph_metadata","security":[{"Bearer":[]}],"parameters":[{"name":"bag_key","in":"path","required":true,"schema":{"title":"Bag Key"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Update Project Knowledge Graph Metadata"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/default_values":{"get":{"tags":["Project"],"summary":"Get Project Default Values","description":"List project's default values.","operationId":"get_project_default_values","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultValues"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Project"],"summary":"Update Project Default Values","description":"Update project's default values.","operationId":"update_project_default_values","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultValues"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/integrations/genai":{"get":{"tags":["Project"],"summary":"Get Project Integration Config Genai","description":"Get the GenAI config for a given project.","operationId":"get_project_integration_config_genai","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"decode_secrets","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Decode Secrets"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GenAIBAM"},{"$ref":"#/components/schemas/GenAIWatsonx"},{"$ref":"#/components/schemas/GenAICPD"},{"$ref":"#/components/schemas/GenAIHFInferenceApi"},{"$ref":"#/components/schemas/GenAIOpenai"},{"$ref":"#/components/schemas/GenAIAWSBedrock"}],"discriminator":{"propertyName":"kind","mapping":{"bam":"#/components/schemas/GenAIBAM","watsonx":"#/components/schemas/GenAIWatsonx","cpd":"#/components/schemas/GenAICPD","hf_api":"#/components/schemas/GenAIHFInferenceApi","openai":"#/components/schemas/GenAIOpenai","aws_bedrock":"#/components/schemas/GenAIAWSBedrock"}},"title":"Response Get Project Integration Config Genai"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Project"],"summary":"Update Project Integration Config Genai","description":"Update the GenAI config for a given project.","operationId":"update_project_integration_config_genai","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GenAIBAM"},{"$ref":"#/components/schemas/GenAIWatsonx"},{"$ref":"#/components/schemas/GenAICPD"},{"$ref":"#/components/schemas/GenAIHFInferenceApi"},{"$ref":"#/components/schemas/GenAIOpenai"},{"$ref":"#/components/schemas/GenAIAWSBedrock"}],"discriminator":{"propertyName":"kind","mapping":{"bam":"#/components/schemas/GenAIBAM","watsonx":"#/components/schemas/GenAIWatsonx","cpd":"#/components/schemas/GenAICPD","hf_api":"#/components/schemas/GenAIHFInferenceApi","openai":"#/components/schemas/GenAIOpenai","aws_bedrock":"#/components/schemas/GenAIAWSBedrock"}},"title":"Config"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Project"],"summary":"Delete Project Integration Config Genai","description":"Delete the GenAI config for a given project integration.","operationId":"delete_project_integration_config_genai","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/packages":{"post":{"tags":["Project"],"summary":"Provision Project Packages","description":"Install packages on a project.","operationId":"provision_project_packages","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPackageInstalationManifest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskContext"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/convert":{"post":{"tags":["Project"],"summary":"Convert Document","description":"Convert a document directly with Docling.","operationId":"convert_document","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertDocumentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/convert_tasks/{task_id}":{"get":{"tags":["Project"],"summary":"Get Convert Task","description":"Check status of a Docling conversion task; return presign urls for MD and JSON file if finished conversion successfully.","operationId":"get_convert_task","security":[{"Bearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":30,"exclusiveMinimum":0},{"type":"null"}],"description":"Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.","title":"Wait"},"description":"Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/semantic/ingest":{"post":{"tags":["Semantic"],"summary":"Ingest","description":"Ingest documents and collections for RAG","operationId":"ingest","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SemanticIngestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/system/info":{"get":{"tags":["System"],"summary":"Get System Information","description":"Get system info.","operationId":"get_system_information","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemInfo"}}}}}}},"/system/modules/configuration":{"get":{"tags":["System"],"summary":"Get System Modules Configuration","description":"Get modules configuration.","operationId":"get_system_modules_configuration","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModulesConfig"}}}}}}},"/system/modules/tasks":{"get":{"tags":["System"],"summary":"Get System Modules Tasks","description":"Get modules configuration.","operationId":"get_system_modules_tasks","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get System Modules Tasks"}}}}}}},"/system/kgs":{"get":{"tags":["System"],"summary":"List System Knowledge Graphs","description":"List all Knowledge Graphs in the system.","operationId":"list_system_knowledge_graphs","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proj Key"}},{"name":"term","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Term"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{},"title":"Response List System Knowledge Graphs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/system/admin/get_all_kgs":{"get":{"tags":["System"],"summary":"System Get All Kgs Admin","description":"Get all kgs (only bag_key) for admin use.","operationId":"system_get_all_kgs_admin","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{},"type":"array","title":"Response System Get All Kgs Admin"}}}}},"security":[{"Bearer":[]}]}},"/system/packages":{"get":{"tags":["System"],"summary":"List Packages","description":"Get packages available in this CPS installation for installing in a project.","operationId":"list_packages","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CPSPackage"},"type":"array","title":"Response List Packages"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_all_dcs":{"get":{"tags":["System"],"summary":"System Get All Dcs Admin","description":"Get all data catalogs (only dc_key) for admin use.","operationId":"system_get_all_dcs_admin","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response System Get All Dcs Admin"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/list_all_flavours":{"get":{"tags":["System Flavours"],"summary":"List All Flavours","description":"Get all KG flavours storage on db.","operationId":"list_all_flavours","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/BagFlavourFullData"},"type":"array","title":"Response List All Flavours"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_flavour/{flavour_name}":{"get":{"tags":["System Flavours"],"summary":"Get Flavour","description":"Get flavour from db.","operationId":"get_flavour","security":[{"Bearer":[]}],"parameters":[{"name":"flavour_name","in":"path","required":true,"schema":{"type":"string","title":"Flavour Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BagFlavourFullData"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/system/admin/save_flavour":{"put":{"tags":["System Flavours"],"summary":"Save Flavour","description":"Save flavour on db.","operationId":"save_flavour","security":[{"Bearer":[]}],"parameters":[{"name":"new_flavour","in":"query","required":true,"schema":{"type":"boolean","title":"New Flavour"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BagFlavourFullData"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/system/admin/delete_flavour/{flavour_name}":{"delete":{"tags":["System Flavours"],"summary":"Delete Flavour","description":"Delete flavour from db.","operationId":"delete_flavour","security":[{"Bearer":[]}],"parameters":[{"name":"flavour_name","in":"path","required":true,"schema":{"type":"string","title":"Flavour Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/system/admin/list_projects_flavours":{"get":{"tags":["System Flavours"],"summary":"List Projects Flavours","description":"Get all projects and their flavours.","operationId":"list_projects_flavours","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectsFlavours"},"type":"array","title":"Response List Projects Flavours"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/save_project_flavours":{"put":{"tags":["System Flavours"],"summary":"Save Project Flavours","description":"Save project flavours assignment on db.","operationId":"save_project_flavours","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectsFlavours"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_project_flavours/{proj_key}":{"get":{"tags":["System Flavours"],"summary":"List Flavours By Project","description":"Get project assignment flavours.","operationId":"list_flavours_by_project","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProjectFlavours"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/system/admin/kg_storage_summary/{kg_key}":{"get":{"tags":["System Summary"],"summary":"System Get Kg Storage Summary Async","description":"Get knowledge graph storage summary.","operationId":"system_get_kg_storage_summary_async","security":[{"Bearer":[]}],"parameters":[{"name":"kg_key","in":"path","required":true,"schema":{"type":"string","title":"Kg Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSummaryTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/system/admin/dc_storage_summary/{dc_key}":{"get":{"tags":["System Summary"],"summary":"System Get Dc Storage Summary Async","description":"Get data catalog storage summary.","operationId":"system_get_dc_storage_summary_async","security":[{"Bearer":[]}],"parameters":[{"name":"dc_key","in":"path","required":true,"schema":{"type":"string","title":"Dc Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSummaryTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/system/admin/summary":{"get":{"tags":["System Summary"],"summary":"System Get Cps Summary","description":"Get cps summary data.","operationId":"system_get_cps_summary","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CPSSummary"},"type":"array","title":"Response System Get Cps Summary"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_flavours_default_quota":{"get":{"tags":["System Quotas"],"summary":"Get Flavours Default Quotas","description":"Get flavours default values.","operationId":"get_flavours_default_quotas","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlavoursDefaultQuota"},"type":"array","title":"Response Get Flavours Default Quotas"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/save_flavours_default_quota":{"put":{"tags":["System Quotas"],"summary":"Save Flavours Default Quotas","description":"Save flavours default quota.","operationId":"save_flavours_default_quotas","requestBody":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlavoursDefaultQuota"},"type":"array","title":"Flavours"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlavoursDefaultQuota"},"type":"array","title":"Response Save Flavours Default Quotas"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_projects_flavours_quota":{"get":{"tags":["System Quotas"],"summary":"Get Projects Flavours Quota","description":"Get projects flavours quotas.","operationId":"get_projects_flavours_quota","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectFlavoursQuota"},"type":"array","title":"Response Get Projects Flavours Quota"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/save_project_flavours_quota":{"put":{"tags":["System Quotas"],"summary":"Save Project Flavours Quota","description":"Save project flavours quota.","operationId":"save_project_flavours_quota","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectFlavoursQuota"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_project_flavours_quota/{proj_key}":{"get":{"tags":["System Quotas"],"summary":"Get Project Flavours Quota","description":"Get project flavours quota.","operationId":"get_project_flavours_quota","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FlavoursQuota"},"title":"Response Get Project Flavours Quota"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/system/admin/get_project_flavour_total_kgs/{proj_key}/{flavour_name}":{"get":{"tags":["System Quotas"],"summary":"Get Project Flavour Total Kgs","description":"Gets kg total number by proj_key and flavour_key.","operationId":"get_project_flavour_total_kgs","security":[{"Bearer":[]}],"parameters":[{"name":"flavour_name","in":"path","required":true,"schema":{"type":"string","title":"Flavour Name"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectFlavourTotalKgs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/celery_tasks/{task_id}":{"get":{"tags":["Tasks"],"summary":"Get Project Celery Task","description":"Get a celery task for a project.","operationId":"get_project_celery_task","security":[{"Bearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":30.0,"exclusiveMinimum":0.0},{"type":"null"}],"description":"Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls.","title":"Wait"},"description":"Optionally block this method call for a few seconds to wait for the result instead of polling through multiple calls."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/tasks":{"get":{"tags":["Tasks"],"summary":"List Project Tasks","description":"List tasks for a project.","operationId":"list_project_tasks","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"task_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"_id","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc","title":"Sort Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TaskContext"},"title":"Response List Project Tasks"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/tasks/{task_id}":{"get":{"tags":["Tasks"],"summary":"Get Project Task","description":"Get a task for a project.","operationId":"get_project_task","security":[{"Bearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskContext"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/tasks/{task_id}/actions/abort":{"post":{"tags":["Tasks"],"summary":"Abort Project Task","description":"Abort a task.","operationId":"abort_project_task","security":[{"Bearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/scratch/files":{"get":{"tags":["Upload"],"summary":"List Project Scratch Files","description":"Get temporary files uploaded to a project.","operationId":"list_project_scratch_files","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"scratch_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scratch Ids"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectScratchFiles"},"title":"Response List Project Scratch Files"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/scratch/files_paginated":{"get":{"tags":["Upload"],"summary":"List Project Scratch Files Paginated","description":"Get paginated list of temporary files uploaded to a project.","operationId":"list_project_scratch_files_paginated","security":[{"Bearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"page","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page"}},{"name":"items_per_page","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Items Per Page"}},{"name":"search_string","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search String"}},{"name":"begin_date","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Begin Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectScratchFilesPaginated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project/{proj_key}/scratch/files/upload/{filename}":{"post":{"tags":["Upload"],"summary":"Create Project Scratch File","description":"Create file pointers for temporary storage.","operationId":"create_project_scratch_file","security":[{"Bearer":[]}],"parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}},{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemporaryUploadFileResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Acquisition":{"properties":{"type":{"type":"string","enum":["API","FTP","Download","Link","Web scraping/Crawling","Other"],"title":"Type","description":"The method to obtain the data.","x-es-ignore_above":8191,"x-es-type":"keyword"},"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date","description":"A string representation of the acquisition datetime in ISO 8601 format."},"link":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Link","description":"Link to the data source of this document.","x-es-ignore_above":8191,"x-es-type":"keyword"},"size":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Size","description":"Size in bytes of the raw document from the data source.","x-es-type":"long"}},"additionalProperties":false,"type":"object","required":["type"],"title":"Acquisition","description":"Information on how the data was obtained."},"Affiliation":{"properties":{"name":{"type":"string","title":"Name","x-es-fields":{"keyword":{"ignore_above":8191,"type":"keyword"},"lower":{"ignore_above":8191,"normalizer":"lowercase_asciifolding","type":"keyword"}}},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","x-es-ignore_above":8191,"x-es-type":"keyword"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","x-es-ignore_above":8191,"x-es-type":"keyword"}},"additionalProperties":false,"type":"object","required":["name"],"title":"Affiliation","description":"Affiliation."},"AssembleMode":{"properties":{"page_elements":{"items":{"type":"string","enum":["H","M","None"]},"type":"array","title":"Page Elements"},"tables":{"items":{"type":"string","enum":["H","M","None"]},"type":"array","title":"Tables"}},"type":"object","required":["page_elements","tables"],"title":"AssembleMode"},"AssembleSettings":{"properties":{"mode":{"$ref":"#/components/schemas/AssembleMode"},"include_incomplete_documents":{"type":"boolean","title":"Include Incomplete Documents"}},"type":"object","required":["mode","include_incomplete_documents"],"title":"AssembleSettings"},"AttachmentUploadData":{"properties":{"attachment_path":{"type":"string","title":"Attachment Path"},"upload_data":{"type":"string","title":"Upload Data"}},"type":"object","required":["attachment_path","upload_data"],"title":"AttachmentUploadData"},"AttachmentUploadRequestBody":{"properties":{"attachment_path":{"type":"string","title":"Attachment Path"},"attachment_key":{"type":"string","title":"Attachment Key","default":"usr_attachments"}},"type":"object","required":["attachment_path"],"title":"AttachmentUploadRequestBody"},"Author":{"properties":{"name":{"type":"string","title":"Name","x-es-fields":{"keyword":{"ignore_above":8191,"type":"keyword"},"lower":{"ignore_above":8191,"normalizer":"lowercase_asciifolding","type":"keyword"}},"x-es-type":"text"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","x-es-ignore_above":8191,"x-es-type":"keyword"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","x-es-ignore_above":8191,"x-es-type":"keyword"},"affiliations":{"anyOf":[{"items":{"$ref":"#/components/schemas/Affiliation"},"type":"array"},{"type":"null"}],"title":"Affiliations"}},"additionalProperties":false,"type":"object","required":["name"],"title":"Author","description":"Author."},"BagFlavourFullData":{"properties":{"backend":{"type":"string","title":"Backend"},"config":{"type":"object","title":"Config"},"default_quota":{"type":"integer","title":"Default Quota","default":0},"description":{"type":"string","title":"Description"},"display_name":{"type":"string","title":"Display Name"},"is_from_deployment":{"type":"boolean","title":"Is From Deployment","default":true},"name":{"type":"string","title":"Name"},"order":{"type":"integer","title":"Order","default":0},"project_specific":{"type":"boolean","title":"Project Specific"}},"type":"object","required":["backend","config","description","display_name","name","project_specific"],"title":"BagFlavourFullData"},"BaseModel":{"properties":{},"type":"object","title":"BaseModel"},"CCSProject":{"properties":{"name":{"type":"string","title":"Name"},"proj_key":{"type":"string","title":"Proj Key"},"collection_name":{"type":"string","title":"Collection Name"}},"type":"object","required":["name","proj_key","collection_name"],"title":"CCSProject"},"CPSPackage":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"package_id":{"type":"string","title":"Package Id"},"type":{"type":"string","enum":["model","dictionary","knowledge_graph","data_catalog","data_flow","bundle"],"title":"Type"}},"type":"object","required":["name","description","package_id","type"],"title":"CPSPackage"},"CPSSummary":{"properties":{"availCpuSlots":{"type":"integer","title":"Availcpuslots"},"availMemSlots":{"type":"integer","title":"Availmemslots"},"availSlots":{"type":"integer","title":"Availslots"},"name":{"type":"string","title":"Name"},"numNodes":{"type":"integer","title":"Numnodes"},"numberKgs":{"type":"integer","title":"Numberkgs"},"runningKgs":{"type":"integer","title":"Runningkgs"},"workersPool":{"type":"string","title":"Workerspool"}},"type":"object","required":["availCpuSlots","availMemSlots","availSlots","name","numNodes","numberKgs","runningKgs","workersPool"],"title":"CPSSummary"},"CollectionDocumentInfo_str_":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Name of the collection.","x-es-ignore_above":8191,"x-es-type":"keyword"},"type":{"type":"string","const":"Document","title":"Type","description":"The collection type.","x-es-ignore_above":8191,"x-es-type":"keyword"},"version":{"anyOf":[{"type":"string","pattern":"^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?:-(?P(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+(?P[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"},{"type":"null"}],"title":"Version","description":"The version of this collection model.","x-es-ignore_above":8191,"x-es-type":"keyword"},"alias":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Alias","description":"A list of tags (aliases) for the collection.","x-es-ignore_above":8191,"x-es-type":"keyword"}},"additionalProperties":false,"type":"object","required":["type"],"title":"CollectionDocumentInfo[str]"},"CollectionMetadataSettings":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"license":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}},"type":"object","title":"CollectionMetadataSettings"},"ConvertDocumentRequest":{"properties":{"http_source":{"anyOf":[{"$ref":"#/components/schemas/api_server__fastapi_server__public__models__project_models__HttpSource"},{"type":"null"}]},"file_source":{"anyOf":[{"$ref":"#/components/schemas/FileSource"},{"type":"null"}]},"settings":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexConversionSettings-Input"},{"type":"null"}]},"image_urls":{"anyOf":[{"$ref":"#/components/schemas/ImageUrlsInfo"},{"type":"null"}]},"truncate_pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Truncate Pages"}},"type":"object","title":"ConvertDocumentRequest"},"ConvertDocumentsRequestBody":{"properties":{"conversion_settings":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexConversionSettings-Input"},{"$ref":"#/components/schemas/PartialDirectConversionParameters"},{"type":"null"}],"title":"Conversion Settings","description":"Specify the conversion settings to use."},"target_settings":{"anyOf":[{"$ref":"#/components/schemas/TargetConversionParameters"},{"type":"null"}],"description":"Specify the target settings to use.","deprecated":true},"document_hashes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Document Hashes","description":"List of document hashes to be used as filter."},"without_operations":{"anyOf":[{"items":{"type":"string","enum":["PENDING","FAILURE","SUCCESS"]},"type":"array"},{"type":"null"}],"title":"Without Operations","description":"List of Operation Status documents don't have to be used as filter."},"upload_to_elastic":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Upload To Elastic"}},"type":"object","title":"ConvertDocumentsRequestBody"},"ConvertDocumentsSources":{"properties":{"file_url":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"File Url","description":"List of File's URL to be converted and uploaded to the data index."},"http_source":{"anyOf":[{"items":{"$ref":"#/components/schemas/api_server__fastapi_server__public__models__data_indices_upload_models__HttpSource"},"type":"array"},{"type":"null"}],"title":"Http Source","description":"List of Internal File's URLs to be converted and uploaded to the data index."},"s3_source":{"anyOf":[{"$ref":"#/components/schemas/S3DocumentSource"},{"type":"null"}],"description":"Coordinates to object store to get files to convert. Can specify which files with object keys."}},"type":"object","title":"ConvertDocumentsSources"},"ConvertUploadDocumentsRequestBody":{"properties":{"file_url":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"File Url","description":"List of File's URL to be converted and uploaded to the data index."},"http_source":{"anyOf":[{"items":{"$ref":"#/components/schemas/api_server__fastapi_server__public__models__data_indices_upload_models__HttpSource"},"type":"array"},{"type":"null"}],"title":"Http Source","description":"List of Internal File's URLs to be converted and uploaded to the data index."},"s3_source":{"anyOf":[{"$ref":"#/components/schemas/S3DocumentSource"},{"type":"null"}],"description":"Coordinates to object store to get files to convert. Can specify which files with object keys."},"upload_to_elastic":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Upload To Elastic"},"meta":{"anyOf":[{"$ref":"#/components/schemas/DocumentMeta"},{"type":"null"}]},"conversion_settings":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexConversionSettings-Input"},{"$ref":"#/components/schemas/PartialDirectConversionParameters"},{"type":"null"}],"title":"Conversion Settings","description":"Specify the conversion settings to use."},"target_settings":{"anyOf":[{"$ref":"#/components/schemas/TargetConversionParameters"},{"type":"null"}],"description":"Specify the target settings to use.","deprecated":true}},"type":"object","title":"ConvertUploadDocumentsRequestBody"},"CpsTask":{"properties":{"task_id":{"type":"string","title":"Task Id"},"task_type":{"type":"string","title":"Task Type"},"task_status":{"type":"string","title":"Task Status"}},"type":"object","required":["task_id","task_type","task_status"],"title":"CpsTask"},"DataFlow":{"properties":{"df_tpl_key":{"type":"string","title":"Df Tpl Key"},"name":{"type":"string","title":"Name"}},"type":"object","required":["df_tpl_key","name"],"title":"DataFlow"},"DataIndexUploadFileSource":{"properties":{"conversion_settings":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexConversionSettings-Input"},{"$ref":"#/components/schemas/PartialDirectConversionParameters"},{"type":"null"}],"title":"Conversion Settings","description":"Specify the conversion settings to use."},"target_settings":{"anyOf":[{"$ref":"#/components/schemas/TargetConversionParameters"},{"type":"null"}],"description":"Specify the target settings to use.","deprecated":true},"urls":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Urls","description":"List of URLs to be printed to PDF, converted and uploaded to the data index."},"headers":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Headers"}},"type":"object","required":["urls"],"title":"DataIndexUploadFileSource"},"DefaultValues":{"properties":{"ccs_project":{"$ref":"#/components/schemas/CCSProject"},"dataflow":{"anyOf":[{"$ref":"#/components/schemas/DataFlow"},{"type":"null"}]}},"type":"object","required":["ccs_project"],"title":"DefaultValues"},"Deployment":{"properties":{"name":{"type":"string","title":"Name"},"disclaimer":{"type":"string","title":"Disclaimer"},"should_show_warning":{"type":"boolean","title":"Should Show Warning"},"disable_kg_actions":{"type":"boolean","title":"Disable Kg Actions"},"linked_ccs_api":{"type":"object","title":"Linked Ccs Api"}},"type":"object","required":["name","disclaimer","should_show_warning","disable_kg_actions","linked_ccs_api"],"title":"Deployment"},"DescriptionLicense":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code","x-es-ignore_above":8191,"x-es-type":"keyword"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"}},"additionalProperties":false,"type":"object","title":"DescriptionLicense","description":"Licence in document description."},"DirectModelConfig":{"properties":{"type":{"type":"string","title":"Type"},"config":{"type":"object","title":"Config"}},"type":"object","required":["type","config"],"title":"DirectModelConfig","description":"Direct configuration of a model."},"DocumentArtifacts":{"properties":{"document_meta_json":{"anyOf":[{"$ref":"#/components/schemas/DocumentArtifactsItem"},{"type":"null"}]},"document_pdf":{"anyOf":[{"$ref":"#/components/schemas/DocumentArtifactsItem"},{"type":"null"}]},"document_json":{"anyOf":[{"$ref":"#/components/schemas/DocumentArtifactsItem"},{"type":"null"}]},"document_legacy_json":{"anyOf":[{"$ref":"#/components/schemas/DocumentArtifactsItem"},{"type":"null"}]},"document_md":{"anyOf":[{"$ref":"#/components/schemas/DocumentArtifactsItem"},{"type":"null"}]},"page_pdfs":{"items":{"$ref":"#/components/schemas/DocumentArtifactsPageItem"},"type":"array","title":"Page Pdfs","default":[]},"page_images":{"items":{"$ref":"#/components/schemas/DocumentArtifactsPageItem"},"type":"array","title":"Page Images","default":[]}},"type":"object","title":"DocumentArtifacts"},"DocumentArtifactsItem":{"properties":{"mime":{"type":"string","title":"Mime"},"path":{"type":"string","title":"Path"},"url":{"type":"string","title":"Url"}},"type":"object","required":["mime","path","url"],"title":"DocumentArtifactsItem"},"DocumentArtifactsPageItem":{"properties":{"mime":{"type":"string","title":"Mime"},"path":{"type":"string","title":"Path"},"url":{"type":"string","title":"Url"},"page":{"type":"integer","title":"Page","description":"Page number starting at 1."}},"type":"object","required":["mime","path","url","page"],"title":"DocumentArtifactsPageItem"},"DocumentDescription":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"abstract":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Abstract"},"authors":{"anyOf":[{"items":{"$ref":"#/components/schemas/Author"},"type":"array"},{"type":"null"}],"title":"Authors"},"affiliations":{"anyOf":[{"items":{"$ref":"#/components/schemas/Affiliation"},"type":"array"},{"type":"null"}],"title":"Affiliations"},"subjects":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Subjects","x-es-fields":{"keyword":{"ignore_above":8191,"type":"keyword"}}},"keywords":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Keywords","x-es-ignore_above":8191,"x-es-type":"keyword"},"publication_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Publication Date"},"languages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Languages","x-es-ignore_above":8191,"x-es-type":"keyword"},"license":{"anyOf":[{"$ref":"#/components/schemas/DescriptionLicense"},{"type":"null"}]},"publishers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Publishers","x-es-ignore_above":8191,"x-es-type":"keyword"},"url_refs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Url Refs","x-es-ignore_above":8191,"x-es-type":"keyword"},"references":{"anyOf":[{"items":{"$ref":"#/components/schemas/docling_core__types__base__Identifier"},"type":"array"},{"type":"null"}],"title":"References"},"publication":{"anyOf":[{"items":{"$ref":"#/components/schemas/Publication"},"type":"array"},{"type":"null"}],"title":"Publication","description":"List of publication journals or venues."},"reference_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Reference Count","description":"Total number of documents referenced by this document.","x-es-type":"integer"},"citation_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Citation Count","description":"Total number of citations that this document has received (number of documents in whose bibliography this document appears).","x-es-type":"integer"},"citation_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Citation Count Date","description":"Last update date of the citation count."},"advanced":{"anyOf":[{"$ref":"#/components/schemas/BaseModel"},{"type":"null"}]},"analytics":{"anyOf":[{"$ref":"#/components/schemas/BaseModel"},{"type":"null"}]},"acquisition":{"anyOf":[{"$ref":"#/components/schemas/Acquisition"},{"type":"null"}],"description":"Information on how the document was obtained, for data governance purposes."}},"type":"object","title":"DocumentDescription"},"DocumentMeta":{"properties":{"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"description":{"anyOf":[{"$ref":"#/components/schemas/DocumentDescription"},{"type":"null"}]},"identifiers":{"anyOf":[{"items":{"$ref":"#/components/schemas/api_server__fastapi_server__public__models__data_indices_upload_models__Identifier"},"type":"array"},{"type":"null"}],"title":"Identifiers"}},"type":"object","title":"DocumentMeta"},"DocumentStatistics":{"properties":{"total_documents":{"type":"integer","title":"Total Documents"},"documents_pending":{"type":"integer","title":"Documents Pending"},"documents_failed":{"type":"integer","title":"Documents Failed"},"documents_converted":{"type":"integer","title":"Documents Converted"}},"type":"object","required":["total_documents","documents_pending","documents_failed","documents_converted"],"title":"DocumentStatistics"},"ElasticIndexPropertyObject":{"properties":{"type":{"type":"string","title":"Type"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"ignore_above":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ignore Above"}},"type":"object","required":["type"],"title":"ElasticIndexPropertyObject"},"ElasticIndexPropertyPrimitive":{"properties":{"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ElasticIndexPropertyPrimitive"},{"$ref":"#/components/schemas/ElasticIndexPropertyObject"}]},"type":"object","title":"Properties"}},"type":"object","required":["properties"],"title":"ElasticIndexPropertyPrimitive"},"ElasticIndexSearchQueryOptions":{"properties":{"_source":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Source"},"from_":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"From"},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size"},"query":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Query"},"aggs":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Aggs"},"sort":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Sort"}},"type":"object","title":"ElasticIndexSearchQueryOptions"},"ElasticIndexSource":{"properties":{"index_key":{"type":"string","title":"Index Key"},"elastic_id":{"type":"string","title":"Elastic Id"}},"type":"object","required":["index_key","elastic_id"],"title":"ElasticIndexSource"},"ElasticInstanceDataIndex":{"properties":{"index_key":{"type":"string","title":"Index Key"},"query_options":{"$ref":"#/components/schemas/ElasticIndexSearchQueryOptions"},"elastic_id":{"type":"string","title":"Elastic Id"}},"type":"object","required":["index_key","query_options","elastic_id"],"title":"ElasticInstanceDataIndex"},"ElasticMetadata":{"properties":{"aliases":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Aliases"},"created":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"storage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storage"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"domain":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Domain"},"classification":{"items":{"type":"string"},"type":"array","title":"Classification"}},"type":"object","required":["classification"],"title":"ElasticMetadata"},"FileSource":{"properties":{"base64_string":{"type":"string","title":"Base64 String"},"filename":{"type":"string","title":"Filename"}},"type":"object","required":["base64_string","filename"],"title":"FileSource"},"Flavour":{"properties":{"name":{"type":"string","title":"Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["name"],"title":"Flavour"},"FlavoursDefaultQuota":{"properties":{"display_name":{"type":"string","title":"Display Name"},"name":{"type":"string","title":"Name"},"default_quota":{"type":"integer","title":"Default Quota"}},"type":"object","required":["display_name","name","default_quota"],"title":"FlavoursDefaultQuota"},"FlavoursQuota":{"properties":{"display_name":{"type":"string","title":"Display Name"},"name":{"type":"string","title":"Name"},"quota":{"type":"integer","title":"Quota"}},"type":"object","required":["display_name","name","quota"],"title":"FlavoursQuota"},"GenAIAWSBedrock":{"properties":{"kind":{"type":"string","const":"aws_bedrock","title":"Kind","default":"aws_bedrock"},"config":{"$ref":"#/components/schemas/GenAIAWSBedrockConfig"},"proj_params":{"anyOf":[{"$ref":"#/components/schemas/GenAIPartialParams"},{"type":"null"}]}},"type":"object","required":["config"],"title":"GenAIAWSBedrock","description":"GenAI integration for AWS Bedrock settings"},"GenAIAWSBedrockConfig":{"properties":{"GENAI_AWS_ACCESS_KEY":{"type":"string","format":"password","title":"Genai Aws Access Key","writeOnly":true},"GENAI_AWS_SECRET_KEY":{"type":"string","format":"password","title":"Genai Aws Secret Key","writeOnly":true},"GENAI_AWS_REGION_NAME":{"type":"string","title":"Genai Aws Region Name"}},"type":"object","required":["GENAI_AWS_ACCESS_KEY","GENAI_AWS_SECRET_KEY","GENAI_AWS_REGION_NAME"],"title":"GenAIAWSBedrockConfig","description":"Config for AWS Bedrock"},"GenAIBAM":{"properties":{"kind":{"type":"string","const":"bam","title":"Kind","default":"bam"},"config":{"$ref":"#/components/schemas/GenAIBAMConfig"},"proj_params":{"anyOf":[{"$ref":"#/components/schemas/GenAIPartialParams"},{"type":"null"}]}},"type":"object","required":["config"],"title":"GenAIBAM","description":"GenAI integration for BAM settings"},"GenAIBAMConfig":{"properties":{"GENAI_API":{"type":"string","title":"Genai Api"},"GENAI_KEY":{"type":"string","format":"password","title":"Genai Key","writeOnly":true}},"type":"object","required":["GENAI_API","GENAI_KEY"],"title":"GenAIBAMConfig","description":"Config for BAM"},"GenAICPD":{"properties":{"kind":{"type":"string","const":"cpd","title":"Kind","default":"cpd"},"config":{"$ref":"#/components/schemas/GenAICPDConfig"},"proj_params":{"anyOf":[{"$ref":"#/components/schemas/GenAIPartialParams"},{"type":"null"}]}},"type":"object","required":["config"],"title":"GenAICPD","description":"GenAI integration for watsonx settings"},"GenAICPDConfig":{"properties":{"GENAI_API":{"type":"string","title":"Genai Api"},"GENAI_PROJECT_ID":{"type":"string","title":"Genai Project Id"},"GENAI_CPD_URL":{"type":"string","title":"Genai Cpd Url"},"GENAI_CPD_VERIFY_TLS":{"type":"boolean","title":"Genai Cpd Verify Tls","default":true},"GENAI_CPD_USERNAME":{"type":"string","title":"Genai Cpd Username"},"GENAI_CPD_PASSWORD":{"anyOf":[{"type":"string","format":"password","writeOnly":true},{"type":"null"}],"title":"Genai Cpd Password"},"GENAI_CPD_API_KEY":{"anyOf":[{"type":"string","format":"password","writeOnly":true},{"type":"null"}],"title":"Genai Cpd Api Key"}},"type":"object","required":["GENAI_API","GENAI_PROJECT_ID","GENAI_CPD_URL","GENAI_CPD_USERNAME"],"title":"GenAICPDConfig","description":"Config for CPD watsonx"},"GenAIHFInferenceApi":{"properties":{"kind":{"type":"string","const":"hf_api","title":"Kind","default":"hf_api"},"config":{"$ref":"#/components/schemas/GenAIHFInferenceApiConfig"},"proj_params":{"anyOf":[{"$ref":"#/components/schemas/GenAIPartialParams"},{"type":"null"}]}},"type":"object","required":["config"],"title":"GenAIHFInferenceApi","description":"GenAI integration for Inference API settings"},"GenAIHFInferenceApiConfig":{"properties":{"GENAI_HF_API_KEY":{"type":"string","format":"password","title":"Genai Hf Api Key","writeOnly":true}},"type":"object","required":["GENAI_HF_API_KEY"],"title":"GenAIHFInferenceApiConfig","description":"Config for HF Inference API"},"GenAIOpenai":{"properties":{"kind":{"type":"string","const":"openai","title":"Kind","default":"openai"},"config":{"$ref":"#/components/schemas/GenAIOpenaiConfig"},"proj_params":{"anyOf":[{"$ref":"#/components/schemas/GenAIPartialParams"},{"type":"null"}]}},"type":"object","required":["config"],"title":"GenAIOpenai","description":"GenAI integration for OpenAI API settings"},"GenAIOpenaiConfig":{"properties":{"GENAI_OPENAI_API_KEY":{"type":"string","format":"password","title":"Genai Openai Api Key","writeOnly":true},"GENAI_OPENAI_BASE_URL":{"type":"string","title":"Genai Openai Base Url"},"GENAI_OPENAI_VERIFY_TLS":{"type":"boolean","title":"Genai Openai Verify Tls","default":true}},"type":"object","required":["GENAI_OPENAI_API_KEY","GENAI_OPENAI_BASE_URL"],"title":"GenAIOpenaiConfig","description":"Config for OpenAI API"},"GenAIParams":{"properties":{"model_id":{"type":"string","title":"Model Id"},"prompt_template":{"type":"string","title":"Prompt Template"},"params":{"type":"object","title":"Params"},"timeout":{"type":"number","title":"Timeout"}},"type":"object","required":["model_id","prompt_template","params","timeout"],"title":"GenAIParams"},"GenAIPartialParams":{"properties":{"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"prompt_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Template"},"params":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Params"},"timeout":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Timeout"}},"type":"object","title":"GenAIPartialParams"},"GenAIWatsonx":{"properties":{"kind":{"type":"string","const":"watsonx","title":"Kind","default":"watsonx"},"config":{"$ref":"#/components/schemas/GenAIWatsonxConfig"},"proj_params":{"anyOf":[{"$ref":"#/components/schemas/GenAIPartialParams"},{"type":"null"}]}},"type":"object","required":["config"],"title":"GenAIWatsonx","description":"GenAI integration for watsonx settings"},"GenAIWatsonxConfig":{"properties":{"GENAI_API":{"type":"string","title":"Genai Api"},"GENAI_PROJECT_ID":{"type":"string","title":"Genai Project Id"},"GENAI_KEY":{"type":"string","format":"password","title":"Genai Key","writeOnly":true}},"type":"object","required":["GENAI_API","GENAI_PROJECT_ID","GENAI_KEY"],"title":"GenAIWatsonxConfig","description":"Config for watsonx"},"GroupedProjectDocuments":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/ProjectDocument"},"type":"array","title":"Documents"},"upload_date":{"anyOf":[{"type":"string"},{"type":"string","format":"date-time"}],"title":"Upload Date"}},"type":"object","required":["documents","upload_date"],"title":"GroupedProjectDocuments"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImageUrlsInfo":{"type":"string","enum":["STORED"],"title":"ImageUrlsInfo"},"JsonUploadRequestBody":{"properties":{"file_url":{"type":"string","title":"File Url"}},"type":"object","required":["file_url"],"title":"JsonUploadRequestBody"},"ListProjectFlavours":{"properties":{"flavours":{"items":{"$ref":"#/components/schemas/BagFlavourFullData"},"type":"array","title":"Flavours"},"proj_key":{"type":"string","title":"Proj Key"}},"type":"object","required":["flavours","proj_key"],"title":"ListProjectFlavours"},"Log":{"properties":{"task":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task","description":"An identifier of this task. It may be used to identify this task from other tasks of the same agent and type.","x-es-ignore_above":8191,"x-es-type":"keyword"},"agent":{"type":"string","title":"Agent","description":"The Docling agent that performed the task, e.g., CCS or CXS.","x-es-ignore_above":8191,"x-es-type":"keyword"},"type":{"type":"string","title":"Type","description":"A task category.","x-es-ignore_above":8191,"x-es-type":"keyword"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment","description":"A description of the task or any comments in natural language."},"date":{"type":"string","format":"date-time","title":"Date","description":"A string representation of the task execution datetime in ISO 8601 format."}},"additionalProperties":false,"type":"object","required":["agent","type","date"],"title":"Log","description":"Log entry to describe an ETL task on a document."},"ModelPipelineSettings":{"properties":{"clusters":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Clusters"},"page":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Page"},"tables":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Tables"},"normalization":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Normalization"}},"type":"object","required":["clusters","page","tables","normalization"],"title":"ModelPipelineSettings"},"ModulesConfig":{"properties":{"df_template_variables":{"items":{},"type":"array","title":"Df Template Variables"},"linked_ccs_instances":{"items":{},"type":"array","title":"Linked Ccs Instances"},"linked_elastic_instances":{"items":{},"type":"array","title":"Linked Elastic Instances"}},"type":"object","required":["df_template_variables","linked_ccs_instances","linked_elastic_instances"],"title":"ModulesConfig"},"OCROptions":{"properties":{"do_ocr":{"type":"boolean","title":"Do Ocr","default":true},"kind":{"type":"string","enum":["easyocr","tesserocr"],"title":"Kind","default":"easyocr"}},"type":"object","title":"OCROptions"},"OcrSettings":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"backend":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Backend"},"backend_settings":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Backend Settings"},"merge_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merge Mode"}},"type":"object","title":"OcrSettings"},"Package":{"properties":{"overrides":{"type":"object","title":"Overrides"},"package_id":{"type":"string","title":"Package Id"}},"type":"object","required":["overrides","package_id"],"title":"Package"},"PartialDirectConversionParameters":{"properties":{"type":{"type":"string","const":"direct","title":"Type","default":"direct"},"ocr":{"anyOf":[{"$ref":"#/components/schemas/OcrSettings"},{"type":"null"}]},"assemble":{"anyOf":[{"$ref":"#/components/schemas/AssembleSettings"},{"type":"null"}]},"metadata":{"anyOf":[{"$ref":"#/components/schemas/CollectionMetadataSettings"},{"type":"null"}]},"page_labels":{"anyOf":[{"additionalProperties":{"type":"object"},"type":"object"},{"type":"null"}],"title":"Page Labels"},"model_pipeline":{"anyOf":[{"$ref":"#/components/schemas/ModelPipelineSettings"},{"type":"null"}]}},"type":"object","title":"PartialDirectConversionParameters","description":"Specify conversion settings (OCR, Assemble, ML Models) directly.\n\nFields left null are set to platform defaults."},"ProjectAgent":{"properties":{"agent_info":{"type":"object","title":"Agent Info"},"agent_name":{"type":"string","title":"Agent Name"},"version":{"type":"string","title":"Version"}},"type":"object","required":["agent_info","agent_name","version"],"title":"ProjectAgent"},"ProjectAgents":{"properties":{"agents":{"items":{"$ref":"#/components/schemas/ProjectAgent"},"type":"array","title":"Agents"}},"type":"object","required":["agents"],"title":"ProjectAgents"},"ProjectDataIndexConversionSettings-Input":{"properties":{"ocr":{"$ref":"#/components/schemas/OCROptions","default":{"do_ocr":true,"kind":"easyocr"}},"table_structure":{"$ref":"#/components/schemas/TableStructureOptions","default":{"do_table_structure":true,"table_structure_mode":"fast"}},"generate_page_images":{"type":"boolean","title":"Generate Page Images","default":true}},"type":"object","title":"ProjectDataIndexConversionSettings"},"ProjectDataIndexConversionSettings-Output":{"properties":{"ocr":{"$ref":"#/components/schemas/OCROptions","default":{"do_ocr":true,"kind":"easyocr"}},"table_structure":{"$ref":"#/components/schemas/TableStructureOptions","default":{"do_table_structure":true,"table_structure_mode":"fast"}},"generate_page_images":{"type":"boolean","title":"Generate Page Images","default":true}},"type":"object","title":"ProjectDataIndexConversionSettings"},"ProjectDataIndexNonView":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"schema_key":{"type":"string","enum":["deepsearch-doc","deepsearch-db","generic"],"title":"Schema Key","default":"generic"}},"type":"object","required":["name"],"title":"ProjectDataIndexNonView"},"ProjectDataIndexSource":{"properties":{"index_key":{"type":"string","title":"Index Key"},"proj_key":{"type":"string","title":"Proj Key"}},"type":"object","required":["index_key","proj_key"],"title":"ProjectDataIndexSource"},"ProjectDataIndexView":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"view_of":{"anyOf":[{"$ref":"#/components/schemas/ProjectSourceDataIndex"},{"$ref":"#/components/schemas/ElasticInstanceDataIndex"}],"title":"View Of"}},"type":"object","required":["name","view_of"],"title":"ProjectDataIndexView"},"ProjectDataIndexWithStatus":{"properties":{"source":{"anyOf":[{"$ref":"#/components/schemas/ElasticIndexSource"},{"$ref":"#/components/schemas/ProjectDataIndexSource"}],"title":"Source"},"name":{"type":"string","title":"Name"},"documents":{"type":"integer","title":"Documents"},"health":{"type":"string","title":"Health"},"status":{"type":"string","title":"Status"},"creation_date":{"type":"string","title":"Creation Date"},"metadata":{"anyOf":[{"$ref":"#/components/schemas/ElasticMetadata"},{"type":"null"}]},"description":{"type":"string","title":"Description"},"schema_key":{"anyOf":[{"type":"string","enum":["deepsearch-doc","deepsearch-db","generic"]},{"type":"null"}],"title":"Schema Key"},"type":{"type":"string","title":"Type"},"view_of":{"anyOf":[{"$ref":"#/components/schemas/ProjectSourceDataIndex"},{"$ref":"#/components/schemas/ElasticInstanceDataIndex"},{"type":"null"}],"title":"View Of"},"record_properties":{"anyOf":[{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ElasticIndexPropertyPrimitive"},{"$ref":"#/components/schemas/ElasticIndexPropertyObject"}]},"type":"object"},{"type":"null"}],"title":"Record Properties"},"provenance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provenance"}},"type":"object","required":["source","name","documents","health","status","creation_date","description","type"],"title":"ProjectDataIndexWithStatus"},"ProjectDocument":{"properties":{"document_hash":{"type":"string","title":"Document Hash"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"file_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Uri"},"ref_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref Uri"},"number_pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Number Pages"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","required":["document_hash"],"title":"ProjectDocument"},"ProjectDocumentURL":{"properties":{"download_url":{"type":"string","title":"Download Url"}},"type":"object","required":["download_url"],"title":"ProjectDocumentURL"},"ProjectDocuments":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/ProjectDocument"},"type":"array","title":"Documents"}},"type":"object","required":["documents"],"title":"ProjectDocuments"},"ProjectFlavourTotalKgs":{"properties":{"proj_key":{"type":"string","title":"Proj Key"},"flavour_name":{"type":"string","title":"Flavour Name"},"total_kgs":{"type":"integer","title":"Total Kgs"}},"type":"object","required":["proj_key","flavour_name","total_kgs"],"title":"ProjectFlavourTotalKgs"},"ProjectFlavoursQuota":{"properties":{"name":{"type":"string","title":"Name"},"proj_key":{"type":"string","title":"Proj Key"},"quotas":{"items":{"$ref":"#/components/schemas/FlavoursQuota"},"type":"array","title":"Quotas"}},"type":"object","required":["name","proj_key","quotas"],"title":"ProjectFlavoursQuota"},"ProjectPackageInstalationManifest":{"properties":{"packages":{"items":{"$ref":"#/components/schemas/Package"},"type":"array","title":"Packages"}},"type":"object","required":["packages"],"title":"ProjectPackageInstalationManifest"},"ProjectScratchFiles":{"properties":{"id":{"type":"string","title":"Id"},"proj_key":{"type":"string","title":"Proj Key"},"user_key":{"type":"string","title":"User Key"},"filename":{"type":"string","title":"Filename"},"timestamp":{"type":"string","title":"Timestamp"},"url":{"type":"string","title":"Url"}},"type":"object","required":["id","proj_key","user_key","filename","timestamp","url"],"title":"ProjectScratchFiles"},"ProjectScratchFilesPaginated":{"properties":{"files":{"items":{"$ref":"#/components/schemas/ProjectScratchFiles"},"type":"array","title":"Files"},"count":{"type":"integer","title":"Count"},"page":{"type":"integer","title":"Page"},"items_per_page":{"type":"integer","title":"Items Per Page"}},"type":"object","required":["files","count","page","items_per_page"],"title":"ProjectScratchFilesPaginated"},"ProjectSourceDataIndex":{"properties":{"index_key":{"type":"string","title":"Index Key"},"query_options":{"$ref":"#/components/schemas/ElasticIndexSearchQueryOptions"},"proj_key":{"type":"string","title":"Proj Key"}},"type":"object","required":["index_key","query_options","proj_key"],"title":"ProjectSourceDataIndex"},"ProjectsFlavours":{"properties":{"proj_key":{"type":"string","title":"Proj Key"},"name":{"type":"string","title":"Name"},"flavours":{"items":{"$ref":"#/components/schemas/Flavour"},"type":"array","title":"Flavours"}},"type":"object","required":["proj_key","name","flavours"],"title":"ProjectsFlavours"},"Publication":{"properties":{"identifiers":{"anyOf":[{"items":{"$ref":"#/components/schemas/docling_core__types__base__Identifier"},"type":"array"},{"type":"null"}],"title":"Identifiers","description":"Unique identifiers of a publication venue."},"name":{"type":"string","title":"Name","description":"Name of the publication.","x-es-ignore_above":8191,"x-es-type":"keyword"},"alternate_names":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Alternate Names","description":"Other names or abbreviations of this publication.","x-es-type":"text"},"type":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Type","description":"Type of publication (journal article, conference, review,...).","x-es-ignore_above":8191,"x-es-type":"keyword"},"pages":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pages","description":"Page range in the publication.","x-es-type":"text"},"issue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issue","description":"Publication issue (issue number).","x-es-ignore_above":8191,"x-es-type":"keyword"},"volume":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Volume","description":"Publication volume.","x-es-ignore_above":8191,"x-es-type":"keyword"},"url":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Url","description":"URL on the publication site.","x-es-ignore_above":8191,"x-es-type":"keyword"}},"additionalProperties":false,"type":"object","required":["name"],"title":"Publication","description":"Publication details of a journal or venue."},"ReferenceToModel":{"properties":{"model_config_key":{"type":"string","title":"Model Config Key"},"proj_key":{"type":"string","title":"Proj Key"},"name":{"type":"string","title":"Name","default":""},"description":{"type":"string","title":"Description","default":""}},"type":"object","required":["model_config_key","proj_key"],"title":"ReferenceToModel","description":"Reference to a model configuration."},"ResponseDocumentArtifacts":{"properties":{"artifacts":{"$ref":"#/components/schemas/DocumentArtifacts"}},"type":"object","required":["artifacts"],"title":"ResponseDocumentArtifacts"},"ResponseGroupedDocuments":{"properties":{"grouped_documents":{"items":{"$ref":"#/components/schemas/GroupedProjectDocuments"},"type":"array","title":"Grouped Documents"}},"type":"object","required":["grouped_documents"],"title":"ResponseGroupedDocuments"},"ResponseUploadJobs":{"properties":{"upload_jobs":{"items":{"$ref":"#/components/schemas/UploadJob"},"type":"array","title":"Upload Jobs"}},"type":"object","required":["upload_jobs"],"title":"ResponseUploadJobs"},"S3Coordinates":{"properties":{"host":{"type":"string","title":"Host"},"port":{"type":"integer","title":"Port"},"ssl":{"type":"boolean","title":"Ssl"},"verifySSL":{"type":"boolean","title":"Verifyssl"},"access-key":{"type":"string","title":"Access-Key"},"secret-key":{"type":"string","title":"Secret-Key"},"bucket":{"type":"string","title":"Bucket"},"key_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Prefix"},"location":{"type":"string","title":"Location"}},"type":"object","required":["host","port","ssl","verifySSL","access-key","secret-key","bucket","location"],"title":"S3Coordinates"},"S3DocumentSource":{"properties":{"coordinates":{"$ref":"#/components/schemas/S3Coordinates"},"object_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Object Keys","description":"List of s3 object keys to retrieve from bucket to be converted and uploaded to the data index."}},"type":"object","required":["coordinates"],"title":"S3DocumentSource","description":"Specifies documents to import from an S3 bucket"},"SemanticIngestReqParams":{"properties":{"skip_ingested_docs":{"type":"boolean","title":"Skip Ingested Docs"}},"type":"object","required":["skip_ingested_docs"],"title":"SemanticIngestReqParams"},"SemanticIngestRequest":{"properties":{"source":{"anyOf":[{"$ref":"#/components/schemas/SemanticIngestSourceUrl"},{"$ref":"#/components/schemas/SemanticIngestSourcePublicDataDocument"},{"$ref":"#/components/schemas/SemanticIngestSourcePrivateDataDocument"},{"$ref":"#/components/schemas/SemanticIngestSourcePrivateDataCollection"}],"title":"Source"},"parameters":{"$ref":"#/components/schemas/SemanticIngestReqParams"}},"type":"object","required":["source","parameters"],"title":"SemanticIngestRequest"},"SemanticIngestSourcePrivateDataCollection":{"properties":{"type":{"type":"string","const":"private_data_collection","title":"Type"},"proj_key":{"type":"string","title":"Proj Key"},"index_key":{"type":"string","title":"Index Key"}},"type":"object","required":["type","proj_key","index_key"],"title":"SemanticIngestSourcePrivateDataCollection"},"SemanticIngestSourcePrivateDataDocument":{"properties":{"type":{"type":"string","const":"private_data_document","title":"Type"},"proj_key":{"type":"string","title":"Proj Key"},"index_key":{"type":"string","title":"Index Key"},"document_hash":{"type":"string","title":"Document Hash"}},"type":"object","required":["type","proj_key","index_key","document_hash"],"title":"SemanticIngestSourcePrivateDataDocument"},"SemanticIngestSourcePublicDataDocument":{"properties":{"type":{"type":"string","const":"public_data_document","title":"Type"},"elastic_id":{"type":"string","title":"Elastic Id"},"index_key":{"type":"string","title":"Index Key"},"document_hash":{"type":"string","title":"Document Hash"}},"type":"object","required":["type","elastic_id","index_key","document_hash"],"title":"SemanticIngestSourcePublicDataDocument"},"SemanticIngestSourceUrl":{"properties":{"type":{"type":"string","const":"url","title":"Type"},"url":{"type":"string","title":"Url"}},"type":"object","required":["type","url"],"title":"SemanticIngestSourceUrl"},"StatusFilter":{"type":"string","enum":["PENDING","FAILURE","SUCCESS"],"title":"StatusFilter"},"StorageSummaryTask":{"properties":{"dc_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dc Key"},"kg_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kg Key"},"kind":{"type":"string","enum":["project_task","celery_task"],"title":"Kind"},"proj_key":{"type":"string","title":"Proj Key"},"task_id":{"type":"string","title":"Task Id"}},"type":"object","required":["kind","proj_key","task_id"],"title":"StorageSummaryTask"},"SystemInfo":{"properties":{"notifications":{"items":{},"type":"array","title":"Notifications"},"default_project":{"type":"object","title":"Default Project"},"deployment":{"$ref":"#/components/schemas/Deployment"},"toolkit":{"type":"object","title":"Toolkit"},"allow_non_admins_to_make_resources_public":{"type":"boolean","title":"Allow Non Admins To Make Resources Public"},"api":{"type":"object","title":"Api"},"genai_defaults":{"additionalProperties":{"$ref":"#/components/schemas/GenAIParams"},"type":"object","title":"Genai Defaults"},"conversion_settings_defaults":{"$ref":"#/components/schemas/ProjectDataIndexConversionSettings-Output","default":{"ocr":{"do_ocr":true,"kind":"easyocr"},"table_structure":{"do_table_structure":true,"table_structure_mode":"fast"},"generate_page_images":true}}},"type":"object","required":["notifications","default_project","deployment","toolkit","allow_non_admins_to_make_resources_public","api","genai_defaults"],"title":"SystemInfo"},"TableFormerMode":{"type":"string","enum":["fast","accurate"],"title":"TableFormerMode"},"TableStructureOptions":{"properties":{"do_table_structure":{"type":"boolean","title":"Do Table Structure","default":true},"table_structure_mode":{"$ref":"#/components/schemas/TableFormerMode","default":"fast"}},"type":"object","title":"TableStructureOptions"},"TargetConversionParameters":{"properties":{"add_raw_pages":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Add Raw Pages"},"add_annotations":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Add Annotations"}},"type":"object","title":"TargetConversionParameters","description":"Specify target settings (add_raw_pages, add_annotations).\n\nFields left null are set to platform defaults."},"TaskContext":{"properties":{"proj_key":{"type":"string","title":"Proj Key"},"user_key":{"type":"string","title":"User Key"},"task_type":{"type":"string","title":"Task Type"},"task_id":{"type":"string","title":"Task Id"},"task_status":{"type":"string","title":"Task Status"},"execution_mode":{"type":"string","title":"Execution Mode"},"progress":{"type":"number","title":"Progress"},"meta":{"type":"object","title":"Meta"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"start_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start Count"},"error_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Reason"},"related_tasks":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Related Tasks"}},"type":"object","required":["proj_key","user_key","task_type","task_id","task_status","execution_mode","progress","meta","created_at"],"title":"TaskContext"},"TaskResult":{"properties":{"result":{"anyOf":[{},{"type":"null"}],"title":"Result"},"task_id":{"type":"string","title":"Task Id"},"task_status":{"type":"string","title":"Task Status"}},"type":"object","required":["task_id","task_status"],"title":"TaskResult"},"TemporaryUploadFileResult":{"properties":{"id":{"type":"string","title":"Id"},"upload":{"$ref":"#/components/schemas/TemporaryUrlFields"},"download":{"$ref":"#/components/schemas/TemporaryUrl"},"metadata":{"$ref":"#/components/schemas/TemporaryUrl"},"upload_private":{"$ref":"#/components/schemas/TemporaryUrlFields"},"download_private":{"$ref":"#/components/schemas/TemporaryUrl"},"metadata_private":{"$ref":"#/components/schemas/TemporaryUrl"}},"type":"object","required":["id","upload","download","metadata","upload_private","download_private","metadata_private"],"title":"TemporaryUploadFileResult"},"TemporaryUrl":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"TemporaryUrl"},"TemporaryUrlFields":{"properties":{"url":{"type":"string","title":"Url"},"fields":{"type":"object","title":"Fields"}},"type":"object","required":["url","fields"],"title":"TemporaryUrlFields"},"TokenResponse":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"TokenResponse"},"UploadElasticRequestBody":{"properties":{"document_hashes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Document Hashes","description":"List of document hashes to be used as filter."},"with_operations":{"anyOf":[{"items":{"type":"string","enum":["PENDING","FAILURE","SUCCESS"]},"type":"array"},{"type":"null"}],"title":"With Operations","description":"List of Operation Status documents don't have to be used as filter."}},"type":"object","title":"UploadElasticRequestBody"},"UploadJob":{"properties":{"date":{"type":"string","format":"date-time","title":"Date"},"num_docs":{"type":"integer","title":"Num Docs"}},"type":"object","required":["date","num_docs"],"title":"UploadJob"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"api_server__fastapi_server__public__models__data_indices_upload_models__HttpSource":{"properties":{"download_url":{"type":"string","title":"Download Url"},"head_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Head Url"},"headers":{"type":"object","title":"Headers","default":{}}},"type":"object","required":["download_url"],"title":"HttpSource"},"api_server__fastapi_server__public__models__data_indices_upload_models__Identifier":{"properties":{"type":{"type":"string","title":"Type"},"_name":{"type":"string","title":"Name"},"value":{"type":"string","title":"Value"}},"type":"object","required":["type","_name","value"],"title":"Identifier"},"api_server__fastapi_server__public__models__project_models__HttpSource":{"properties":{"url":{"type":"string","title":"Url"},"headers":{"type":"object","title":"Headers"}},"type":"object","required":["url","headers"],"title":"HttpSource"},"docling_core__types__base__Identifier":{"properties":{"type":{"type":"string","title":"Type","description":"A string representing a collection or database that contains this data object.","x-es-ignore_above":8191,"x-es-type":"keyword"},"value":{"type":"string","title":"Value","description":"The identifier value of the data object within a collection or database.","x-es-ignore_above":8191,"x-es-type":"keyword"},"_name":{"type":"string","pattern":"^.+#.+$","title":"_Name","description":"A unique identifier of the data object across Docling, consisting of the concatenation of type and value in lower case, separated by hash (#).","x-es-ignore_above":8191,"x-es-type":"keyword"}},"additionalProperties":false,"type":"object","required":["type","value","_name"],"title":"Identifier","description":"Unique identifier of a Docling data object."}},"securitySchemes":{"Bearer":{"type":"apiKey","description":"Provide a Bearer token in the `Authorization` header","in":"header","name":"Authorization"}}}} \ No newline at end of file diff --git a/tools/swagger-client-generator/swagger-cps.json b/tools/swagger-client-generator/swagger-cps.json index 43601f7c..781e0c98 100644 --- a/tools/swagger-client-generator/swagger-cps.json +++ b/tools/swagger-client-generator/swagger-cps.json @@ -1 +1 @@ -{"swagger": "2.0", "info": {"version": "2.0.0", "title": "Corpus Processing Service (CPS) API"}, "schemes": ["http", "https"], "consumes": ["application/json"], "produces": ["application/json"], "securityDefinitions": {"Bearer": {"description": "For accessing the API a valid JWT token must be passed in all the queries in\nthe 'Authorization' header.\n\nA valid JWT token is generated by the API and returned.\n\nThe following syntax must be used in the 'Authorization' header :\n Bearer xxxxxx.yyyyyyy.zzzzzz\n", "type": "apiKey", "name": "Authorization", "in": "header", "x-apikeyInfoFunc": "oidc_user_mngt.utils.connexion_auth.api_key_info"}, "ManagementKey": {"description": "For accessing the API using a valid management token, it must be passed in all the queries in\nthe 'Authorization' header.\n", "type": "apiKey", "name": "Authorization", "in": "header", "x-apikeyInfoFunc": "api_server.utils.connexion_auth.api_mngt_token_info"}, "KGAuth": {"description": "API endpoints called by the KG application are authenticated by a valid JWT\ntoken which must contain the correct project resources which is needed.\nThe token must be passed in the 'X-CPS-KG-Authorization' header.\n\nA valid JWT token can be obtained by the CPS API or UI.\n\nThe following syntax must be used in the 'Authorization' header :\n KGToken xxxxxx.yyyyyyy.zzzzzz\n", "type": "apiKey", "name": "X-CPS-KG-Authorization", "in": "header", "x-apikeyInfoFunc": "api_server.utils.connexion_auth.kg_auth_info"}}, "paths": {"/project/{proj_key}/packages": {"post": {"tags": ["Project"], "description": "Install packages on a project", "operationId": "provision_project_packages", "x-swagger-router-controller": "api_server.controllers.system_controller", "security": [{"Bearer": []}], "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "schema": {"title": "ProjectPackageInstalationManifest", "type": "object", "required": ["packages"], "properties": {"packages": {"type": "array", "items": {"type": "object", "properties": {"package_id": {"type": "string"}, "overrides": {"type": "object"}}, "required": ["package_id"]}, "uniqueItems": true}}}}], "responses": {"200": {"description": "Task started. It can be found in the tasks endpoint for the project.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Package not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices": {"get": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Get project data indices", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "get_project_data_indices", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Project data indices.", "schema": {"type": "array", "items": {"$ref": "#/definitions/ProjectDataIndexWithStatus"}}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Create a project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "create_project_data_index", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"x-oneOf": [{"$ref": "#/definitions/ProjectDataIndexNonView"}, {"$ref": "#/definitions/ProjectDataIndexView"}]}}], "responses": {"200": {"description": "Project data index.", "schema": {"$ref": "#/definitions/ProjectDataIndexWithStatus"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}": {"get": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Get project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "get_project_data_index", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Project data index.", "schema": {"$ref": "#/definitions/ProjectDataIndexWithStatus"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "patch": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Update a project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "update_project_data_index", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"x-oneOf": [{"$ref": "#/definitions/ProjectDataIndexNonView"}, {"$ref": "#/definitions/ProjectDataIndexView"}]}}], "responses": {"200": {"description": "Updated project data index.", "schema": {"$ref": "#/definitions/ProjectDataIndexWithStatus"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "delete": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Delete a project index data", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "delete_project_data_index", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "confirmation_token", "in": "query", "required": true, "type": "string", "description": "The delete confirmation token"}], "responses": {"200": {"description": "Project data index deleted successfully."}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/delete_token": {"post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Get a token used to confirm the deletion of a project data index.", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "create_project_data_index_delete_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Project data index deletion token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "Data flow template not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/actions/upload": {"post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Upload a file to a project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "upload_project_data_index_file", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "params", "in": "body", "required": true, "schema": {"type": "object", "required": ["file_url"], "properties": {"file_url": {"type": "string"}}}}], "responses": {"200": {"description": "CPS task info", "schema": {"$ref": "#/definitions/CpsTask"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/actions/ccs_convert_upload": {"post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Convert files via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema)", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "ccs_convert_upload_file_project_data_index", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "DataIndexUploadFileSource", "type": "object", "properties": {"scratch_files_id": {"description": "List of CCS's scratch files id to be converted and uploaded to the data index", "type": "array", "items": {"type": "string"}}, "file_url": {"description": "List of File's URL to be converted and uploaded to the data index", "type": "array", "items": {"type": "string"}}, "s3_source": {"description": "Coordinates to object store to get files to convert. Can specify which files with object keys.", "type": "object", "properties": {"coordinates": {"description": "Coordinates to object store to get files to convert", "$ref": "#/definitions/ProjectDataIndexS3Coordinates"}, "object_keys": {"description": "List of s3 object keys to retrieve from bucket to be converted and uploaded to the data index", "type": "array", "items": {"type": "string"}}}}, "conversion_settings": {"description": "Specify conversion settings (OCR, Assemble, ML Models) directly", "$ref": "#/definitions/ProjectDataIndexConversionSettings"}, "target_settings": {"description": "Specify the conversion target settings to use.", "type": "object", "properties": {"add_raw_pages": {"title": "add_raw_pages", "type": "boolean"}, "add_annotations": {"type": "boolean", "title": "add_annotations"}}}}}}], "responses": {"200": {"description": "CPS task info", "schema": {"$ref": "#/definitions/CpsTask"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/actions/html_print_convert_upload": {"post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Convert a list of HTML pages to PDF, convert them via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema)", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "html_print_convert_upload", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "DataIndexUploadFileSource", "type": "object", "required": ["urls"], "properties": {"urls": {"description": "List of URLs to be printed to PDF, converted and uploaded to the data index", "type": "array", "items": {"x-oneOf": [{"type": "string"}, {"type": "object", "properties": {"url": {"type": "string"}, "filename": {"type": "string"}, "meta": {"type": "object"}}, "required": ["url"]}]}}, "conversion_settings": {"description": "Specify conversion settings (OCR, Assemble, ML Models) directly", "$ref": "#/definitions/ProjectDataIndexConversionSettings"}}}}], "responses": {"200": {"description": "CPS task info", "schema": {"$ref": "#/definitions/CpsTask"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment_url/{filename}": {"get": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Get url and path to upload an attachment to a project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "get_attachment_upload_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "index_item_id", "in": "path", "type": "string", "required": true}, {"name": "filename", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Attachment upload url and path", "schema": {"title": "AttachmentUploadData", "type": "object", "required": ["attachment_path", "upload_data"], "properties": {"attachment_path": {"type": "string", "description": "Attachment path."}, "upload_data": {"type": "object", "description": "Data to upload the temporary file. Example using requests 'requests(dot)post(url, data=fields, files=file)'. More information can be found on aws s3 documentation here https://docs.aws.amazon.com/AmazonS3/latest/userguide/PresignedUrlUploadObject.html", "properties": {"url": {"type": "string", "description": "url of the host."}, "fields": {"type": "object", "description": "fields to use in request body."}}}}}}, "404": {"description": "Project data index or document ID not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment": {"post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Notify upload completion of an attachment to a project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "register_attachment", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "index_item_id", "in": "path", "type": "string", "required": true}, {"name": "params", "in": "body", "required": true, "schema": {"type": "object", "required": ["attachment_path"], "properties": {"attachment_path": {"type": "string"}, "attachment_key": {"type": "string"}}}}], "responses": {"204": {"description": "Attachment notify successfull"}, "404": {"description": "Project data index or document ID not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/backend/project/{proj_key}/bags": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List all bags in the project, backend-aware", "produces": ["application/json"], "operationId": "backend_list_project_kgs", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "term", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"$ref": "#/definitions/BagBackendAware"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Create new BAG, backend-aware", "produces": ["application/json"], "operationId": "backend_create_project_kg", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"type": "object", "title": "CreateKnowledgeGraphOptions", "properties": {"name": {"type": "string", "pattern": "^(?:\\w| |-)+$", "description": "Name of the BAG", "maxLength": 32}, "flavours": {"type": "array", "description": "Flavours names of the bag. Determines its available resources", "items": {"type": "string"}}, "public": {"type": "boolean", "description": "If true, the BAG will be publicly available"}, "description": {"type": "string", "x-nullable": true, "description": "Description of the BAG"}}, "required": ["name", "flavours", "public"]}}], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/BagBackendAware"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "403": {"description": "Create knowledge graphs is disabled.", "schema": {"$ref": "#/definitions/Problem"}}, "409": {"description": "Cannot create BAG because one already exists with that name.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/backend/project/{proj_key}/bags/{bag_key}": {"patch": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Update the metadata of a Knowledge graph, backend-aware", "produces": ["application/json"], "operationId": "backend_update_project_kg_metadata", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"type": "object", "title": "PatchKnowledgeGraphOptions", "properties": {"name": {"type": "string"}, "public": {"type": "boolean"}, "description": {"type": "string", "x-nullable": true}}, "required": ["name", "description", "public"], "additionalProperties": false}}], "responses": {"200": {"description": "Knowledge graph metadata updated.", "schema": {"$ref": "#/definitions/BagBackendAware"}}, "404": {"description": "Knowledge graph not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/backend/project/{proj_key}/bags/{bag_key}/tasks/assemble_dataflow": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Assemble a data flow on a Knowledge Graph, backend-aware", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "backend_assemble_project_kg_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "AssembleDataFlowIntoKnowledgeGraphOptions", "type": "object", "properties": {"data_flow": {"type": "object", "properties": {"raw_data_flow": {"type": "object", "description": "If this is set, the raw data flow contents will be used.", "properties": {"template": {"description": "Must be valid JSON", "type": "string"}, "variables": {"type": "object"}}, "required": ["template", "variables"]}, "public": {"description": "Must be set if the data flow template is public", "type": "boolean"}, "df_tpl_key": {"description": "If set, the data flow with this key will be used.", "type": "string"}, "proj_key": {"description": "If set, allows for cross-project data flows to be used.", "type": "string"}}}, "snapshot": {"$ref": "#/definitions/TakeSnapshotSettingsBackendAware"}, "render": {"type": "object", "properties": {"variables": {"type": "object", "additionalProperties": {}}}, "required": ["variables"]}}, "required": ["render", "data_flow"]}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/backend/project/{proj_key}/bags/{bag_key}/tasks/assemble_dataflow/latest/snapshots": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Create a snapshot of a Knowledge Graph from the last data flow assembly task, backend-aware", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.controller", "operationId": "backend_create_project_kg_snapshot_from_data_flow_assembly", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"type": "object", "required": ["snapshot"], "properties": {"snapshot": {"$ref": "#/definitions/TakeSnapshotSettingsBackendAware"}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "404": {"description": "KG/BAG/Data Flow Assembly not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/backend/project/{proj_key}/bags/{bag_key}/status": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Get the status of a Knowledge Graph, backend-aware", "produces": ["application/json"], "operationId": "backend_get_project_kg_status", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "details", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Knowledge Graph status.", "schema": {"$ref": "#/definitions/BagStatusBackendAware"}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/public/bags": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List all public BAGs", "produces": ["application/json"], "operationId": "list_public_knowledge_graphs", "parameters": [{"name": "term", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"$ref": "#/definitions/Bag"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags": {"get": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List all bags in the project", "produces": ["application/json"], "operationId": "list_project_knowledge_graphs", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "term", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"$ref": "#/definitions/Bag"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Create new BAG", "produces": ["application/json"], "operationId": "create_project_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"type": "object", "title": "CreateKnowledgeGraphOptions", "properties": {"name": {"type": "string", "pattern": "^(?:\\w| |-)+$", "description": "Name of the BAG", "maxLength": 32}, "flavour": {"type": "string", "description": "\"Flavour\" of the BAG, determines its available resources."}, "public": {"type": "boolean", "description": "If true, the BAG will be publicly available"}, "description": {"type": "string", "x-nullable": true, "description": "Description of the BAG"}}, "required": ["name", "flavour", "public"]}}], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/Bag"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "403": {"description": "Create knowledge graphs is disabled.", "schema": {"$ref": "#/definitions/Problem"}}, "409": {"description": "Cannot create BAG because one already exists with that name.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}": {"delete": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Delete a BAG", "produces": ["application/json"], "operationId": "delete_project_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "confirmation_token", "in": "query", "type": "string", "required": true}], "responses": {"204": {"description": "BAG deleted."}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "patch": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Update the metadata of a Knowledge graph", "produces": ["application/json"], "operationId": "update_project_knowledge_graph_metadata", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"type": "object", "title": "PatchKnowledgeGraphOptions", "properties": {"name": {"type": "string"}, "public": {"type": "boolean"}, "description": {"type": "string", "x-nullable": true}}, "required": ["name", "description", "public"], "additionalProperties": false}}], "responses": {"200": {"description": "Knowledge graph metadata updated.", "schema": {"$ref": "#/definitions/Bag"}}, "404": {"description": "Knowledge graph not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/status": {"get": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Get the status of a Knowledge Graph", "produces": ["application/json"], "operationId": "get_project_knowledge_graph_status", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "details", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Knowledge Graph status.", "schema": {"$ref": "#/definitions/BagStatus"}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/usage_stats": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Get the usage stats of a Knowledge Graph", "produces": ["application/json"], "operationId": "get_project_knowledge_graph_usage_stats", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Knowledge Graph usage stats.", "schema": {"title": "UsageStats", "type": "object", "properties": {"proj_key": {"type": "string"}, "bag_key": {"type": "string"}, "last_command": {"type": "string"}}}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/delete_token": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Get a token used to confirm the deletion of a BAG.", "produces": ["application/json"], "operationId": "create_project_knowledge_graph_delete_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "BAG deletion token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/auth_token": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Get a token used to authenticate in the Erlenmeyer / KG APIs of a BAG.", "produces": ["application/json"], "operationId": "create_project_knowledge_graph_authentication_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "BAG auth token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/auth_callback": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Final step of redirection for authentication on a BAG.", "produces": ["application/json"], "operationId": "get_project_knowledge_graph_authentication_callback", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "bag_token", "in": "query", "type": "string", "required": true}], "responses": {"200": {"description": "BAG auth redirect URL.", "schema": {"title": "KnowledgeGraphAuthenticationCallback", "type": "object", "properties": {"callback_url": {"type": "string"}}}}, "401": {"description": "Unauthorized.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/backup": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Back up a Knowledge Graph", "produces": ["application/json"], "operationId": "create_project_knowledge_graph_backup", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "BackupKnowledgeGraphOptions", "type": "object", "properties": {"backup_s3": {"type": "boolean", "default": true}, "coordinates": {"$ref": "#/definitions/S3CoordinatesWithBackupKey"}}}}], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/restore": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Restore a back up of a Knowledge Graph", "produces": ["application/json"], "operationId": "restore_project_knowledge_graph_backup", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "RestoreKnowledgeGraphBackupOptions", "type": "object", "properties": {"coordinates": {"$ref": "#/definitions/S3CoordinatesWithBackupKey"}}}}], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/export": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Download a Knowledge Graph", "produces": ["application/json"], "operationId": "download_project_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/assemble_dataflow": {"get": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List assemble tasks for a Knowledge Graph.", "produces": ["application/json"], "operationId": "list_project_knowledge_graph_assemble_tasks", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "limit", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 50}, {"name": "skip", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 0}], "responses": {"200": {"description": "List of tasks.", "schema": {"type": "array", "items": {"title": "DataFlowAssembleIntoKnowledgeGraphTask", "type": "object", "properties": {"timestamp": {"type": "number", "format": "double"}, "data_flow": {"type": "object", "properties": {"render_options": {"type": "object", "properties": {"variables": {"type": "object"}, "target_bag": {"type": "object"}}}, "template": {"type": "string"}, "variables": {"type": "object"}}}}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Assemble a data flow on a Knowledge Graph", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "assemble_project_knowledge_graph_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "AssembleDataFlowIntoKnowledgeGraphOptions", "type": "object", "properties": {"data_flow": {"type": "object", "properties": {"raw_data_flow": {"type": "object", "description": "If this is set, the raw data flow contents will be used.", "properties": {"template": {"description": "Must be valid JSON", "type": "string"}, "variables": {"type": "object"}}, "required": ["template", "variables"]}, "public": {"description": "Must be set if the data flow template is public", "type": "boolean"}, "df_tpl_key": {"description": "If set, the data flow with this key will be used.", "type": "string"}, "proj_key": {"description": "If set, allows for cross-project data flows to be used.", "type": "string"}}}, "snapshot": {"$ref": "#/definitions/TakeSnapshotSettings"}, "render": {"type": "object", "properties": {"variables": {"type": "object", "additionalProperties": {}}}, "required": ["variables"]}}, "required": ["render", "data_flow"]}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/dataset_assembles/{task_id}/report": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Create a report for a data flow task assemble.", "produces": ["application/json"], "operationId": "create_project_knowledge_graph_assemble_report", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_id", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "DataFlowAssembleReportOptions", "type": "object", "properties": {"max_errors": {"type": "integer", "default": 50, "minimum": 0, "maximum": 100}, "event_log_level": {"type": "string", "default": "error", "enum": ["debug", "info", "warning", "error", "critical"]}}}}], "responses": {"200": {"description": "Report.", "schema": {"title": "DataFlowAssembleReport", "type": "object", "properties": {"task_id": {"type": "string"}, "dataflow_tasks": {"type": "object", "additionalProperties": {"title": "DataFlowAssembleReportSingleTask", "type": "object", "properties": {"status": {"type": "string"}, "progress": {"type": "number"}, "chunks": {"type": "object", "properties": {"total": {"type": "integer"}, "completed": {"type": "integer"}, "spawned": {"type": "integer"}, "success": {"type": "integer"}, "failure": {"type": "integer"}}}, "errors": {"type": "array", "items": {"type": "object", "properties": {"cause": {"type": "object", "properties": {"type": {"type": "string"}, "value": {}}}, "timestamp": {"type": "number"}}}}, "task_type": {"type": "string"}}}}}}}, "404": {"description": "Task not found, or is not a data flow assemble.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/assemble_dataflow/latest/snapshots": {"post": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Create a snapshot of a Knowledge Graph from the last data flow assembly task.", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.controller", "operationId": "create_project_knowledge_graph_snapshot_from_data_flow_assembly", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"type": "object", "required": ["snapshot"], "properties": {"snapshot": {"$ref": "#/definitions/TakeSnapshotSettings"}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "404": {"description": "KG/BAG/Data Flow Assembly not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/bags/{bag_key}/snapshots": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List snapshots for a knowledge graph from assembled data flows.", "produces": ["application/json"], "operationId": "list_project_knowledge_graph_snapshots", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Snapshots", "schema": {"type": "array", "items": {"$ref": "#/definitions/KgSnapshot"}}}, "404": {"description": "KG/BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Create a snapshot of a Knowledge Graph, with its current state.", "produces": ["application/json"], "operationId": "create_project_knowledge_graph_snapshot", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "KnowledgeGraphSnapshotOptions", "type": "object", "properties": {"name": {"type": "string", "pattern": "^(?:\\w| |-)+$"}}, "required": ["name"]}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "403": {"description": "Feature is disabled on this instance.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.kg_controller"}}, "/project/{proj_key}/bags/{bag_key}/snapshots/{execution_id}/actions/load": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Load a snapshot resulting from an assembled data flow", "produces": ["application/json"], "operationId": "load_project_knowledge_graph_snapshot", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "execution_id", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Snapshot is being loaded.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "403": {"description": "Feature is disabled on this instance.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG/Snapshot not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/snapshots/{execution_id}": {"delete": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Delete a snapshot resulting from an assembled data flow. The execution log itself is not deleted.", "produces": ["application/json"], "operationId": "delete_project_knowledge_graph_snapshot", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "execution_id", "in": "path", "type": "string", "required": true}], "responses": {"204": {"description": "OK"}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG/Snapshot not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/load_dataflow": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List load tasks for a Knowledge Graph", "produces": ["application/json"], "operationId": "list_project_knowledge_graph_load_tasks", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "limit", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 50}, {"name": "skip", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 0}], "responses": {"200": {"description": "List of tasks.", "schema": {"type": "array", "items": {"title": "DataFlowLoadIntoKnowledgeGraphTask", "type": "object", "properties": {"timestamp": {"type": "number", "format": "double"}, "data_flow": {"type": "object", "properties": {"render_options": {"type": "object", "properties": {"variables": {"type": "object"}, "target_bag": {"type": "object"}}}, "template": {"type": "string"}, "variables": {"type": "object"}}}, "save": {"type": "object"}}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Load a data flow onto a Knowledge Graph.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "load_project_knowledge_graph_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "LoadDataFlowIntoKnowledgeGraphOptions", "type": "object", "properties": {"data_flow": {"type": "object", "properties": {"raw_data_flow": {"type": "object", "description": "If this is set, the raw data flow contents will be used.", "properties": {"template": {"description": "Must be valid JSON", "type": "string"}, "variables": {"type": "object"}}, "required": ["template", "variables"]}, "public": {"description": "Must be set if the data flow template is public", "type": "boolean"}, "df_tpl_key": {"description": "If set, the data flow with this key will be used.", "type": "string"}, "proj_key": {"description": "If set, allows for cross-project data flows to be used.", "type": "string"}}}, "render": {"type": "object", "properties": {"variables": {"type": "object", "additionalProperties": {}}}, "required": ["variables"]}, "save": {"type": "object"}}, "required": ["save", "render", "data_flow"]}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/suspend": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Suspend a Knowledge Graph", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "suspend_project_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "SuspendKnowledgeGraphOptions", "type": "object", "properties": {"force": {"type": "boolean", "description": "If true, the KG will be suspended even if it's busy"}, "snapshot": {"type": "object", "properties": {"name": {"type": "string"}}}}, "required": ["force"]}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "404": {"description": "Knowledge Graph doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/resume": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Resume a Knowledge Graph", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "resume_project_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"title": "ResumeKnowledgeGraphOptions", "type": "object", "properties": {"snapshot_to_restore_id": {"type": "string"}, "reset": {"type": "boolean"}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "403": {"description": "Feature is disabled on this instance.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Knowledge Graph doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/upgrade": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Upgrade the deployment chart of a Knowledge Graph", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "upgrade_project_knowledge_graph_deployment", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"title": "KnowledgeGraphChartUpgradeOptions", "type": "object", "properties": {"chart": {"type": "string"}}}}], "responses": {"200": {"description": "Chart upgrading."}, "404": {"description": "Knowledge Graph doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/recreate_deployment": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "(Re)create the deployment for a Knowledge Graph", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "recreate_project_knowledge_graph_deployment", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"title": "KnowledgeGraphDeploymentRecreationOptions", "type": "object", "properties": {"force": {"type": "boolean"}}, "required": ["force"]}}], "responses": {"200": {"description": "Deployment upgrading."}, "404": {"description": "Knowledge Graph doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "409": {"description": "Refused to recreate the deployment since it already exists and the `force` flag is not `true`.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/export_dataset": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}, {"KGAuth": []}], "description": "Export dataset from a Knowledge Graph", "produces": ["application/json"], "operationId": "export_dataset", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "data", "in": "body", "required": true, "schema": {"type": "object", "required": ["info"], "properties": {"info": {"type": "object", "required": ["coords"], "properties": {"node_list": {"type": "array", "minLength": 1, "example": [{"_db": "db1-hash", "_id": "node-id"}, {"_db": "db2-hash", "_id": "node-id"}], "items": {"type": "object", "properties": {"_db": {"type": "string"}, "_id": {"type": "string"}}, "required": ["_db", "_id"]}}, "collection_key": {"type": "string"}, "include_s3_data": {"type": "boolean", "default": false}, "projection": {"type": "object", "example": {"projection": {}}, "description": "A dict specifying the fields to include or exclude. Use a dict to exclude fields from the result (e.g. projection={'main-text': false})."}, "coords": {"type": "object", "required": ["databases", "node_collection"], "properties": {"databases": {"type": "object", "additionalProperties": true}, "node_collection": {"type": "object", "properties": {"uri": {"type": "string"}, "database": {"type": "string"}, "collection_name_prefix": {"type": "string"}, "collection": {"type": "string"}}, "required": ["uri", "database", "collection_name_prefix", "collection"]}}}}}}}}], "responses": {"200": {"description": "Task", "schema": {"$ref": "#/definitions/ProjectTask"}}, "404": {"description": "Task not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.kg_controller"}}, "/elastic/indices/{index_type}/{index_domain}": {"get": {"tags": ["Elastic"], "security": [{"Bearer": []}], "description": "List of indices for elastic instance.", "produces": ["application/json"], "operationId": "list_indices_from_elastic_instance", "parameters": [{"name": "index_type", "in": "path", "type": "string", "default": "all", "required": true}, {"name": "index_domain", "in": "path", "type": "string", "required": true, "default": "all"}], "responses": {"200": {"description": "List of Elastic Instance Indices", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCollection"}}}, "404": {"description": "Instance indices not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.elastic_controller"}}, "/elastic/{elastic_instance}/{elastic_index}/properties": {"get": {"tags": ["Elastic"], "security": [{"Bearer": []}], "description": "Get the property schema of the given index.", "produces": ["application/json"], "operationId": "get_index_properties", "parameters": [{"name": "elastic_instance", "in": "path", "type": "string", "required": true}, {"name": "elastic_index", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Property schema", "schema": {"$ref": "#/definitions/ElasticIndexProperties"}}, "404": {"description": "Instance index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.elastic_controller"}}, "/elastic/{elastic_instance}/{elastic_index}/saved_queries": {"get": {"tags": ["Elastic"], "security": [{"Bearer": []}], "description": "List Kibana saved queries.", "produces": ["application/json"], "operationId": "get_kibana_saved_queries", "parameters": [{"name": "elastic_instance", "in": "path", "type": "string", "required": true}, {"name": "elastic_index", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "List of Kibana saved queries", "schema": {"type": "array", "title": "KibanaSavedQueriesResult", "items": {"$ref": "#/definitions/KibanaSavedQueriesResult"}}}, "404": {"description": "Instance indices not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.elastic_controller"}}, "/elastic/domains": {"get": {"tags": ["Elastic"], "security": [{"Bearer": []}], "description": "List system elastic domains.", "produces": ["application/json"], "operationId": "get_elastic_domains", "responses": {"200": {"description": "List of Elastic Domains.", "schema": {"type": "array", "items": {"type": "string"}}}, "404": {"description": "Domains not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.elastic_controller"}}, "/elastic/query_max_size": {"get": {"tags": ["Elastic"], "security": [{"Bearer": []}], "description": "Get the system maximum workable elastic query size.", "produces": ["application/json"], "operationId": "get_elastic_query_max_size", "responses": {"200": {"description": "Maximum elastic query size.", "schema": {"type": "object", "properties": {"elastic_query_max_size": {"type": "number"}}}}, "404": {"description": "No maximum workable elastic query size found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.elastic_controller"}}, "/deployment/info": {"get": {"tags": ["System"], "description": "Get deployment version report", "produces": ["application/json"], "operationId": "get_version_report", "security": [{"ManagementKey": []}], "parameters": [], "responses": {"200": {"description": "OK"}, "401": {"description": "Authentication failed, management api token is invalid or doesn't match", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/system/info": {"get": {"tags": ["System"], "description": "Get system info", "produces": ["application/json"], "operationId": "get_system_information", "parameters": [], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/SystemInfo"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/system/modules/configuration": {"get": {"tags": ["System"], "description": "Get modules configuration", "produces": ["application/json"], "operationId": "get_system_modules_configuration", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [], "responses": {"201": {"description": "Modules configuration", "schema": {"$ref": "#/definitions/SystemModulesConfiguration"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/modules/tasks": {"get": {"tags": ["System"], "description": "Get modules tasks", "produces": ["application/json"], "operationId": "get_system_modules_tasks", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [], "responses": {"201": {"description": "Modules tasks", "schema": {"$ref": "#/definitions/SystemModulesTasks"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/celery_tasks/status": {"get": {"tags": ["Tasks"], "security": [{"Bearer": []}], "description": "Get the status of Celery tasks.", "produces": ["application/json"], "operationId": "list_system_celery_tasks", "parameters": [{"name": "proj_key", "in": "query", "required": false, "type": "string"}, {"name": "project_task_id", "in": "query", "required": false, "type": "string"}, {"name": "started_since", "required": false, "type": "number", "in": "query", "description": "If set, return the tasks created at or after this timestamp. Otherwise, return the tasks created up to 60 minutes of the system's date, if `project_task_id` is not set."}, {"name": "task_status", "required": false, "type": "number", "format": "double", "in": "query"}, {"name": "limit", "required": false, "type": "integer", "in": "query", "default": 50}], "responses": {"200": {"description": "Celery tasks", "schema": {"type": "array", "items": {"title": "CeleryTask", "type": "object", "required": ["task_id", "project_task_id", "proj_key", "task_type", "created_at", "started_at", "completed_at", "task_status", "worker_name", "meta"], "properties": {"task_id": {"type": "string"}, "task_type": {"type": "string"}, "project_task_id": {"type": "string"}, "project_task_type": {"type": "string", "x-nullable": true}, "meta": {"type": "object", "additionalProperties": {}}, "proj_key": {"type": "string"}, "created_at": {"type": "number"}, "started_at": {"type": "number"}, "completed_at": {"type": "number"}, "task_status": {"type": "string"}, "worker_name": {"type": "string"}, "metrics": {"type": "object"}}}}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/system/celery_tasks/failure": {"get": {"tags": ["Tasks"], "security": [{"Bearer": []}], "description": "Get celery tasks that failed.", "produces": ["application/json"], "operationId": "list_failure_celery_tasks", "parameters": [{"name": "proj_key", "in": "query", "required": true, "type": "string"}, {"name": "task_id", "in": "query", "required": true, "type": "string"}], "responses": {"200": {"description": "Celery tasks", "schema": {"type": "array", "items": {"title": "CeleryTask", "type": "object", "required": ["proj_key", "task_id", "failures"], "properties": {"proj_key": {"type": "string"}, "task_id": {"type": "string"}, "failures": {"type": "array", "items": {"type": "object", "properties": {"worker_name": {"type": "string"}, "task_id": {"type": "string"}, "meta": {"type": "object", "additionalProperties": {}}, "logs": {"type": "object", "additionalProperties": {}}}}}}}}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/system/kgs": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "List all Knowledge Graphs in the system", "produces": ["application/json"], "operationId": "list_system_knowledge_graphs", "parameters": [{"name": "proj_key", "in": "query", "type": "string", "required": false}, {"name": "term", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"title": "KnowledgeGraphSystemInformation", "type": "object", "properties": {"proj_key": {"type": "string"}, "bag_key": {"type": "string"}, "name": {"type": "string"}, "slug": {"type": "string"}, "timestamp": {"type": "number", "format": "double"}, "bag_domain": {"type": "string"}, "bag_url": {"type": "string"}, "public": {"type": "boolean"}, "project_name": {"type": "string"}, "backend": {"type": "object", "additionalProperties": {"type": "object", "properties": {"flavour": {"type": "string"}, "deployment": {"type": "object", "properties": {"name": {"type": "string"}, "chart": {"type": "string"}, "flavour": {"type": "string"}, "resources": {"type": "object", "additionalProperties": {"type": "object", "properties": {"requests": {"type": "object"}, "limits": {"type": "object"}}}}}}}}}}}}}, "default": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.admin_kg_controller"}}, "/system/packages": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get packages available in this CPS installation for installing in a project.", "produces": ["application/json"], "operationId": "list_packages", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [], "responses": {"200": {"description": "Packages available to this CPS installation", "schema": {"type": "array", "items": {"$ref": "#/definitions/CpsPackage"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_all_kgs": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get all kgs (only bag_key) for admin use", "produces": ["application/json"], "operationId": "system_get_all_kgs_admin", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [], "responses": {"200": {"description": "Array with all kgs's key", "schema": {"type": "array", "items": {"type": "string"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_all_dcs": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get all data catalogs (only dc_key) for admin use", "produces": ["application/json"], "operationId": "system_get_all_dcs_admin", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [], "responses": {"200": {"description": "Array with all dcs's key", "schema": {"type": "array", "items": {"type": "string"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/kg_storage_summary/{kg_key}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get kg storage summary", "produces": ["application/json"], "operationId": "system_get_kg_storage_summary_async", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "kg_key", "in": "path", "type": "string", "required": true, "description": "Knowledge graph key"}], "responses": {"200": {"description": "Kg storage summary", "schema": {"$ref": "#/definitions/StorageSummaryTask"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/dc_storage_summary/{dc_key}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get dc storage summary", "produces": ["application/json"], "operationId": "system_get_dc_storage_summary_async", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "dc_key", "in": "path", "type": "string", "required": true, "description": "Data catalog key"}], "responses": {"200": {"description": "DC storage summary", "schema": {"$ref": "#/definitions/StorageSummaryTask"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/summary": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get cps summary data.", "produces": ["application/json"], "operationId": "system_get_cps_summary", "parameters": [], "responses": {"200": {"description": "Cps summary", "schema": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "workersPool": {"type": "string"}, "numNodes": {"type": "integer"}, "availSlots": {"type": "integer"}, "availMemSlots": {"type": "integer"}, "availCpuSlots": {"type": "integer"}, "numberKgs": {"type": "integer"}, "runningKgs": {"type": "integer"}}}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/system/admin/list_all_flavours": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get all KG flavours storage on db", "produces": ["application/json"], "operationId": "list_all_flavours", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [], "responses": {"200": {"description": "Flavours storage on db", "schema": {"type": "array", "items": {"$ref": "#/definitions/BagFlavourFullData"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_flavour/{flavour_name}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get flavour from db", "produces": ["application/json"], "operationId": "get_flavour", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "flavour_name", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Get flavour successful", "schema": {"$ref": "#/definitions/BagFlavourFullData"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/save_flavour": {"put": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Save flavour on db", "produces": ["application/json"], "operationId": "save_flavour", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "new_flavour", "in": "query", "required": true, "type": "boolean"}, {"name": "body", "in": "body", "required": true, "schema": {"$ref": "#/definitions/BagFlavourFullData"}}], "responses": {"200": {"description": "Save flavour successful"}, "409": {"description": "Flavour name already taken"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/delete_flavour/{flavour_name}": {"delete": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Delete flavour from db", "produces": ["application/json"], "operationId": "delete_flavour", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "flavour_name", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Deleted flavour successful"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/list_projects_flavours": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get all projects and their flavours", "produces": ["application/json"], "operationId": "list_projects_flavours", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [], "responses": {"200": {"description": "Flavours storage on db", "schema": {"type": "array", "items": {"$ref": "#/definitions/ProjectsFlavours"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/save_project_flavours": {"put": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Save project flavours assignment on db", "produces": ["application/json"], "operationId": "save_project_flavours", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "body", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ProjectsFlavours"}}], "responses": {"200": {"description": "Save project flavours successful"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_project_flavours/{proj_key}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get project assignment flavours", "produces": ["application/json"], "operationId": "list_flavours_by_project", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Ok", "schema": {"title": "ProjectFlavours", "type": "object", "properties": {"proj_key": {"type": "string"}, "flavours": {"type": "array", "items": {"$ref": "#/definitions/BagFlavourFullData"}}}, "required": ["proj_key", "flavours"]}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_flavours_default_quota": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get flavours default values", "produces": ["application/json"], "operationId": "get_flavours_default_quotas", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [], "responses": {"200": {"description": "Flavours default values", "schema": {"type": "array", "items": {"$ref": "#/definitions/BagFlavourDefaultQuota"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/save_flavours_default_quota": {"put": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Save flavours default quota", "produces": ["application/json"], "operationId": "save_flavours_default_quotas", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "flavours", "in": "body", "required": true, "schema": {"type": "array", "items": {"$ref": "#/definitions/BagFlavourDefaultQuota"}}}], "responses": {"200": {"description": "Save flavours default quotas successful", "schema": {"type": "array", "items": {"$ref": "#/definitions/BagFlavourDefaultQuota"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_projects_flavours_quota": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get projects flavours quotas", "produces": ["application/json"], "operationId": "get_projects_flavours_quota", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [], "responses": {"200": {"description": "Projects flavours quotas", "schema": {"type": "array", "items": {"$ref": "#/definitions/ProjectsFlavoursQuota"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/save_project_flavours_quota": {"put": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Save project flavours quota", "produces": ["application/json"], "operationId": "save_project_flavours_quota", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "projects_flavours_quotas", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ProjectsFlavoursQuota"}}], "responses": {"200": {"description": "Save project flavours quota successful"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_project_flavours_quota/{proj_key}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get project flavours quota", "produces": ["application/json"], "operationId": "get_project_flavours_quota", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Project flavours quota", "schema": {"type": "array", "items": {"$ref": "#/definitions/FlavoursQuota"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_project_flavour_total_kgs/{proj_key}/{flavour_name}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Gets kg total number by proj_key and flavour_key", "produces": ["application/json"], "operationId": "get_project_flavour_total_kgs", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "flavour_name", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Project flavours total kg number", "schema": {"title": "ProjectFlavourTotalKgs", "type": "object", "properties": {"proj_key": {"type": "string"}, "flavour_name": {"type": "string"}, "total_kgs": {"type": "integer"}}, "required": ["proj_key", "flavour_name", "total_kgs"]}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/kgc/dataflows/actions/validate": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Validate a dataflow", "produces": ["application/json"], "operationId": "validate_project_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dataflow", "x-body-name": "dataflow", "in": "body", "required": true, "schema": {"$ref": "#/definitions/KgcDataInput"}}], "responses": {"200": {"description": "Validation successful."}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflows/actions/run": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Run a dataflow", "produces": ["application/json"], "operationId": "assemble_project_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dataflow", "x-body-name": "dataflow", "in": "body", "required": true, "schema": {"$ref": "#/definitions/KgcDataInput"}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflows/actions/load": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Load a dataflow into a KG", "produces": ["application/json"], "operationId": "load_project_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"$ref": "#/definitions/LoadKgcDataInput"}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/public/kgc/dataflow_templates": {"get": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "List public data flow templates", "produces": ["application/json"], "operationId": "list_public_data_flow_templates", "parameters": [{"name": "query", "in": "query", "required": false, "type": "string"}], "responses": {"200": {"description": "List of data flow templates.", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataFlowTemplateListItem"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates": {"get": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "List a data flow templates", "produces": ["application/json"], "operationId": "list_project_data_flow_templates", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "query", "in": "query", "required": false, "type": "string"}], "responses": {"200": {"description": "List of data flow templates.", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataFlowTemplateListItem"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Create a data flow template", "produces": ["application/json"], "operationId": "create_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "CreateDataFlowTemplateOptions", "type": "object", "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "pattern": "^(?:\\w| |-)+$", "maxLength": 50, "minLength": 1}, "description": {"type": "string", "x-nullable": true}, "variables": {"type": "object", "additionalProperties": {"type": "object", "required": ["type"], "properties": {"type": {"$ref": "#/definitions/DataFlowTemplateVariable"}, "default_value": {}}}}, "template": {"$ref": "#/definitions/DataFlowTemplate"}}, "required": ["public", "name", "variables", "template", "description"]}}], "responses": {"200": {"description": "Dataflow created.", "schema": {"$ref": "#/definitions/DataFlow"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/from_json": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Create a data flow template from a JSON file.\n**DEPRECATED**: use `create_project_data_flow_template`\n", "deprecated": true, "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "name", "in": "formData", "required": false, "type": "string"}, {"name": "description", "in": "formData", "required": false, "type": "string"}, {"name": "public", "in": "formData", "type": "boolean", "required": false}, {"name": "contents", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "Dataflow created.", "schema": {"$ref": "#/definitions/DataFlow"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/public/kgc/dataflow_templates/{df_tpl_key}": {"get": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Get a single data flow template", "produces": ["application/json"], "operationId": "get_public_data_flow_template", "parameters": [{"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Data flow.", "schema": {"$ref": "#/definitions/DataFlow"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/public/kgc/dataflow_templates/{df_tpl_key}/export.json": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Export a single public data flow template", "produces": ["application/vnd.ibm.cps.df-template+json"], "operationId": "export_public_data_flow_template", "parameters": [{"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Data flow template.", "schema": {"type": "file"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}": {"get": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Get a single data flow template", "produces": ["application/json"], "operationId": "get_project_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Data flow template.", "schema": {"$ref": "#/definitions/DataFlow"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "put": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Update a data flow template", "produces": ["application/json"], "operationId": "update_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "UpdateDataFlowOptions", "type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string"}, "variables": {"type": "object", "additionalProperties": {"type": "object", "required": ["type"], "properties": {"type": {"$ref": "#/definitions/DataFlowTemplateVariable"}, "default_value": {}}}}, "template": {"$ref": "#/definitions/DataFlowTemplate"}, "public": {"type": "boolean"}}, "required": ["public", "name", "variables", "template"]}}], "responses": {"200": {"description": "Dataflow updated.", "schema": {"$ref": "#/definitions/DataFlow"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "delete": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Delete a single data flow template", "produces": ["application/json"], "operationId": "delete_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "confirmation_token", "in": "query", "type": "string", "required": true}], "responses": {"204": {"description": "Data flow deleted."}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/delete_token": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Get a token used to confirm the deletion of a data flow template.", "produces": ["application/json"], "operationId": "create_project_data_flow_template_delete_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data flow deletion token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "Data flow template not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/export.json": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Export a single data flow template", "produces": ["application/vnd.ibm.cps.df-template+json"], "operationId": "export_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Data flow template.", "schema": {"type": "file"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/topology": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Render a single data flow template, replacing the variable placeholders by their actual values and get the resulting Knowledge Graph topology from it.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "get_project_data_flow_template_topology", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "DataFlowTopologyOptions", "type": "object", "properties": {"variables": {"type": "object", "additionalProperties": {}}}}}], "responses": {"200": {"description": "Data flow topology.", "schema": {"$ref": "#/definitions/Topology"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/actions/render": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Render a single data flow template, replacing the variable placeholders by their actual values.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "render_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "RenderDataFlowTemplateOptions", "type": "object", "properties": {"target_bag": {"type": "object", "properties": {"bag_key": {"type": "string"}, "proj_key": {"type": "string", "description": "If set, this will override the 'proj_key' parameter in the path, allowing cross-project KGs to be used."}}, "required": ["bag_key"]}, "variables": {"type": "object", "additionalProperties": {}}}, "required": ["target_bag", "variables"]}}], "responses": {"200": {"description": "Rendered data flow", "schema": {"type": "object"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/actions/run": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Render a single data flow template, replacing the variable placeholders by their actual values and run it.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "assemble_project_data_flow_template_into_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "RunDataFlowTemplateOptions", "type": "object", "properties": {"target_bag_key": {"type": "string"}, "variables": {"type": "object", "additionalProperties": {}}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/raw_dataflow_templates/actions/run": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Render a single data flow template, replacing the variable placeholders by their actual values and run it.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "assemble_project_raw_data_flow_template_into_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "RunDataFlowTemplateOptions", "type": "object", "required": ["data_flow", "variable_values", "log_task"], "properties": {"log_task": {"type": "boolean", "default": true}, "data_flow": {"type": "object", "properties": {"template": {"type": "object", "properties": {"config": {"type": "object"}, "data-flow": {"type": "array", "items": {"type": "object"}}}, "required": ["config", "data-flow"]}, "variables": {"type": "object", "additionalProperties": {}}}, "required": ["template", "variables"]}, "variable_values": {"type": "object", "additionalProperties": {}}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/actions/load": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Render a single data flow template, replacing the variable placeholders by their actual values and load it into a Knowledge Graph.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "load_project_data_flow_template_into_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "LoadDataFlowIntoKnowledgeGraphOptions", "type": "object", "properties": {"render": {"type": "object", "properties": {"target_bag": {"type": "object", "properties": {"bag_key": {"type": "string"}, "proj_key": {"type": "string", "description": "If set, this will override the 'proj_key' parameter in the path, allowing cross-project KGs to be used."}}, "required": ["bag_key"]}, "variables": {"type": "object", "additionalProperties": {}}}, "required": ["target_bag", "variables"]}, "target": {"type": "object", "properties": {"save": {"type": "object"}}, "required": ["save"]}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc_dataflow_templates/debug/{df_tpl_key}": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "(Debug) get the fully rendered data flow, with all the coordinates set.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "debug_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "FullyRenderedDataFlow", "type": "object", "properties": {"target_bag": {"type": "object", "required": ["bag_key"], "properties": {"bag_key": {"type": "string"}, "proj_key": {"type": "string"}}}, "variables": {"type": "object", "additionalProperties": {}}}}}], "responses": {"200": {"description": "Rendered data flow.", "schema": {"type": "object"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/data_cataloges/known_schemas": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "List System Known Data Catalog Schemas.", "produces": ["application/json"], "operationId": "list_known_data_catalog_schemas", "parameters": [], "responses": {"200": {"description": "List of Known Data Catalog Schemas.", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogSchema"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/data_catalogues/with_schema": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "List data catalogues with specific schema", "produces": ["application/json"], "operationId": "list_data_catalogs_and_collections_from_schema", "parameters": [{"name": "proj_key", "in": "query", "type": "string", "required": false}, {"name": "schema", "x-body-name": "schema", "in": "body", "required": true, "schema": {"type": "object", "additionalProperties": {}}}], "responses": {"200": {"description": "List of data catalogues", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogue"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}/data": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get Data Catalog Collection data.", "produces": ["application/json"], "operationId": "get_data_catalog_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "after", "in": "query", "type": "string", "required": false}, {"name": "limit", "in": "query", "type": "integer", "minimum": 0, "default": 50, "required": false}], "responses": {"200": {"description": "Get Data Catalog Collection data."}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/from_mongo": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Create a data catalogue from a mongo database", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "import_project_data_catalog_from_mongo", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "DataCatalogImportOptions", "type": "object", "properties": {"target": {"type": "object", "required": ["name", "description", "public"], "properties": {"public": {"type": "boolean"}, "name": {"type": "string"}, "description": {"type": "string", "x-nullable": true}}}, "options": {"type": "object", "required": ["coordinates"], "properties": {"coordinates": {"$ref": "#/definitions/MongoS3CoordinatesWithCollectionList"}}}}, "required": ["target", "options"]}}], "responses": {"200": {"description": "Data catalogue created, and data is being imported.", "schema": {"$ref": "#/definitions/DataCatalogImportResult"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/from_url": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Create a data catalogue from a URL to a file", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "import_project_data_catalog_from_url", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "DataCatalogUrlImportOptions", "type": "object", "properties": {"target": {"type": "object", "required": ["name", "description", "public"], "properties": {"public": {"type": "boolean"}, "name": {"type": "string"}, "description": {"type": "string", "x-nullable": true}}}, "options": {"type": "object", "required": ["url"], "properties": {"url": {"type": "string"}}}}, "required": ["target", "options"]}}], "responses": {"200": {"description": "Data catalogue created, and data is being imported.", "schema": {"$ref": "#/definitions/DataCatalogImportResult"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/actions/clone": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Clone an existing data catalogue", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "clone_project_data_catalog", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "CloneDataCatalogOptions", "type": "object", "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "x-nullable": true, "pattern": "^(?:\\w| |-)+$"}, "description": {"type": "string", "x-nullable": true}, "copy_s3": {"type": "boolean", "description": "Should the catalog's S3 data also be copied?", "default": true}, "collections": {"type": "array", "items": {"type": "string"}}}, "required": ["name", "description", "public"]}}], "responses": {"200": {"description": "Data catalogue cloned, and data is being copied.", "schema": {"$ref": "#/definitions/CloneDataCatalogResult"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "List data catalogues for a project", "produces": ["application/json"], "operationId": "list_project_data_catalogs", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "query", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "List of data catalogues", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogue"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}, "post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Create an empty data catalog", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "create_project_data_catalog", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"type": "object", "title": "CreateDataCatalogOptions", "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "pattern": "^(?:\\w| |-)+$"}, "description": {"type": "string", "x-nullable": true}, "topology:data_flows": {"type": "array", "items": {"type": "object", "title": "DataCatalogDataFlow", "required": ["key", "data_flows"], "properties": {"key": {"type": "string"}, "data_flows": {"type": "object", "additionalProperties": {}}}, "$ref": "#/definitions/DataCatalogTopology"}}, "category_schemas": {"type": "array", "items": {"type": "object", "title": "DataCatalogCategorySchema", "required": ["key", "schema"], "properties": {"key": {"type": "string"}, "schema": {"type": "object", "additionalProperties": {}}}}}, "collections_data_flows": {"type": "array", "items": {"type": "object", "title": "DataCatalogDataFlow", "required": ["key", "data_flows"], "properties": {"key": {"type": "string"}, "data_flows": {"type": "array", "items": {"type": "object"}}}}}}, "required": ["name", "description", "public"]}}], "responses": {"200": {"description": "Data catalog created.", "schema": {"$ref": "#/definitions/DataCatalogue"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/public/data_catalogues/{dc_key}": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get a single data catalogue that was made public", "produces": ["application/json"], "operationId": "get_public_data_catalog", "parameters": [{"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Data catalogue", "schema": {"$ref": "#/definitions/DataCatalogue"}}, "404": {"description": "Data catalogue not found or is not public", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/public/data_catalogues/{dc_key}/collections": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get the collections of a data catalog.", "produces": ["application/json"], "operationId": "list_public_data_catalog_collections", "parameters": [{"name": "dc_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data catalog collections", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogCollection"}}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}": {"delete": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Delete a single data catalog's collection", "produces": ["application/json"], "operationId": "delete_project_data_catalog_collection", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}], "responses": {"204": {"description": "Collection deleted."}, "404": {"description": "Collection doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}/actions/infer_schema": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Infer the schema for a data catalog's collection.", "produces": ["application/json"], "operationId": "infer_project_data_catalog_category_schema", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "InferProjectDataCatalogCategorySchema", "type": "object", "properties": {"sample_size": {"type": "integer", "minimum": 1, "maximum": 1000}}}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}/actions/upload": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Upload data to a data catalog collection. The collection will be created if it doesn't exist.", "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_data_catalog_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "file", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}/actions/import": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Import data to a data catalog collection. The collection will be created if it doesn't exist.", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "import_project_data_catalog_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"type": "object", "title": "ImportToDataCatalogCollectionOptions", "minProperties": 1, "maxProperties": 1, "properties": {"ccs": {"type": "object", "properties": {"proj_key": {"type": "string"}, "auth_token": {"type": "string"}, "url": {"type": "string"}, "source_collection_name": {"type": "string"}, "export_package_mongo_options": {"type": "object", "required": ["assemble_options", "incremental", "package_options"], "properties": {"incremental": {"type": "boolean"}, "assemble_options": {"type": "object", "required": ["mode", "options"], "properties": {"mode": {"required": ["page_elements", "tables"], "properties": {"page_elements": {"description": "Which type of annotations to filter for the page elements: H (human annotations), M (model generated)", "items": {"enum": ["H", "M"], "type": "string"}, "type": "array", "minItems": 2, "maxItems": 2}, "tables": {"description": "Which type of annotations to filter for the tables: H (human annotations), M (model generated)", "items": {"enum": ["H", "M"], "type": "string"}, "type": "array", "minItems": 2, "maxItems": 2}}, "type": "object"}, "options": {"required": ["include_incomplete_documents"], "properties": {"include_incomplete_documents": {"type": "boolean", "description": "Include documents with missing pages? (e.g. no annotations for some pages)"}}, "type": "object"}}}, "inputs": {"type": "object", "required": ["document_hashes"], "properties": {"document_hashes": {"type": "array", "default": [], "items": {"type": "string"}}}}, "package_options": {"type": "object", "properties": {"match_mode": {"type": "string", "default": "document_hash", "enum": ["use_fuzzy_search", "document_hash"]}, "redirect_keys_to_s3": {"type": "array", "default": [], "items": {"type": "string"}}}}}}}, "required": ["proj_key"]}, "url": {"type": "string"}, "elastic": {"title": "ImportFromElasticToDataCatalogOptions", "type": "object", "required": ["parameters"], "properties": {"coordinates": {"$ref": "#/definitions/ElasticCoordinates"}, "elastic_id": {"type": "string"}, "parameters": {"type": "object", "required": ["index", "query_options"], "properties": {"index": {"type": "string"}, "query_options": {"type": "object", "properties": {"_source": {"type": "array", "items": {"type": "string"}}, "size": {"type": "number", "minimum": 0}, "query": {"type": "object", "additionalProperties": {}}}}, "import_s3_data": {"type": "boolean"}, "s3": {"title": "ImportFromElasticToDataCatalogS3Coords", "type": "object", "properties": {"host": {"type": "string"}, "port": {"type": "integer"}, "ssl": {"type": "boolean"}, "verifySSL": {"type": "boolean"}, "access-key": {"type": "string"}, "secret-key": {"type": "string"}, "bucket": {"type": "string"}, "key_prefix": {"type": "string"}, "location": {"type": "string"}}, "required": ["host", "port", "ssl", "verifySSL", "access-key", "secret-key", "bucket", "key_prefix", "location"]}, "page_size": {"type": "number", "default": 100}}}}}}}}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}/actions/export": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Export the contents of a data catalog's collection", "produces": ["application/zip", "application/json", "application/x-jsonlines"], "operationId": "export_project_data_catalog_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data catalog collection contents.", "schema": {"type": "file"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/actions/upload": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Upload data to a data catalog. The collection name(s) will be inferred from the file name(s).", "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_data_catalog_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "file", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/actions/import": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Import data to a data catalog. The collections will be created if they don't exist.", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "import_project_data_catalog_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"type": "object", "title": "ImportToDataCatalogOptions", "minProperties": 1, "maxProperties": 1, "properties": {"url": {"type": "string"}, "coordinates": {"$ref": "#/definitions/MongoS3CoordinatesWithCollectionList"}}}}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/actions/export": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Export the contents of a data catalog.", "produces": ["application/zip"], "operationId": "export_project_data_catalog_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data catalog contents.", "schema": {"type": "file"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/delete_token": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get a token used to confirm the deletion of a data catalog.", "produces": ["application/json"], "operationId": "create_project_data_catalog_delete_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data catalog deletion token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "Data flow template not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/public/data_catalogues": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "List public data catalogues", "produces": ["application/json"], "operationId": "list_public_data_catalogs", "parameters": [{"name": "query", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "List of public data catalogues", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogue"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/public/data_catalogues/{dc_key}/actions/clone": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Clone an existing public data catalogue", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "clone_public_data_catalog", "parameters": [{"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "ClonePublicDataCatalogOptions", "type": "object", "properties": {"proj_key": {"description": "The project key of the project to store the resulting data catalogue", "type": "string"}, "public": {"type": "boolean"}, "name": {"type": "string", "x-nullable": true, "pattern": "^(?:\\w| |-)+$"}, "description": {"type": "string", "x-nullable": true}, "collections": {"type": "array", "items": {"type": "string"}}, "copy_s3": {"type": "boolean", "description": "Should the catalog's S3 data also be copied?", "default": true}}, "required": ["name", "description", "public", "proj_key"]}}], "responses": {"200": {"description": "Data catalogue cloned, and data is being copied.", "schema": {"$ref": "#/definitions/CloneDataCatalogResult"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get a single data catalogue", "produces": ["application/json"], "operationId": "get_project_data_catalog", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Data catalogue", "schema": {"$ref": "#/definitions/DataCatalogue"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}, "delete": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Delete a single data catalog", "produces": ["application/json"], "operationId": "delete_project_data_catalog", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "required": true, "type": "string"}, {"name": "confirmation_token", "in": "query", "type": "string", "required": true}], "responses": {"204": {"description": "Data catalog deleted."}, "404": {"description": "Data catalog doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}, "patch": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Update the metadata of a data catalog.", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "patch_project_data_catalog", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"type": "object", "title": "PatchDataCatalogOptions", "properties": {"name": {"type": "string"}, "public": {"type": "boolean"}, "description": {"type": "string", "x-nullable": true}, "topology": {"$ref": "#/definitions/DataCatalogTopology"}, "category_schemas": {"type": "array", "items": {"type": "object", "title": "DataCatalogCategorySchema", "required": ["key", "schema"], "properties": {"key": {"type": "string"}, "schema": {"type": "object", "additionalProperties": {}}}}}, "collections_data_flows": {"type": "array", "items": {"type": "object", "title": "DataCatalogDataFlow", "required": ["key", "data_flows"], "properties": {"key": {"type": "string"}, "data_flows": {"type": "array", "items": {"type": "object"}}}}}}, "additionalProperties": false}}], "responses": {"200": {"description": "Data catalog updated.", "schema": {"$ref": "#/definitions/DataCatalogue"}}, "404": {"description": "Data catalog not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get the collections of a data catalog.", "produces": ["application/json"], "operationId": "list_project_data_catalog_collections", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data catalog collections", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogCollection"}}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}, "post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Create a collection in a data catalog", "produces": ["application/json"], "operationId": "create_project_data_catalog_collection", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"type": "object", "title": "CreateDataCatalogCollectionOptions", "properties": {"collection_name": {"type": "string", "pattern": "^(?:\\w|-)+$", "maxLength": 24, "minLength": 4}}, "required": ["collection_name"]}}], "responses": {"200": {"description": "Collection created."}, "404": {"description": "Dictionary doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/tasks": {"get": {"tags": ["Tasks"], "security": [{"Bearer": []}], "description": "List tasks for a project.", "produces": ["application/json"], "operationId": "list_project_tasks", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_type", "in": "query", "required": false, "type": "string"}, {"name": "limit", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 50}, {"name": "skip", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 0}, {"name": "sort_by", "in": "query", "required": false, "type": "string"}, {"name": "sort_order", "in": "query", "required": false, "type": "string", "default": "asc", "enum": ["asc", "desc"]}], "responses": {"200": {"description": "List of tasks.", "schema": {"type": "array", "items": {"$ref": "#/definitions/ProjectTask"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/tasks/{task_id}": {"get": {"tags": ["Tasks"], "security": [{"Bearer": []}, {"KGAuth": []}], "description": "Get a task for a project.", "produces": ["application/json"], "operationId": "get_project_task", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_id", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Task", "schema": {"$ref": "#/definitions/ProjectTask"}}, "404": {"description": "Task not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/tasks/{task_id}/actions/abort": {"post": {"tags": ["Tasks"], "security": [{"Bearer": []}], "description": "Abort a task.", "produces": ["application/json"], "operationId": "abort_project_task", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_id", "in": "path", "required": true, "type": "string"}], "responses": {"204": {"description": "Task aborted."}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/celery_tasks/{task_id}": {"get": {"tags": ["Tasks"], "security": [{"Bearer": []}], "description": "Get a celery task for a project.", "produces": ["application/json"], "operationId": "get_project_celery_task", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_id", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Task", "schema": {"type": "object", "title": "CeleryTaskPromise", "required": ["task_id", "task_status", "result"], "properties": {"task_id": {"type": "string"}, "task_status": {"type": "string"}, "result": {"x-nullable": true}}}}, "404": {"description": "Task not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/annotator/metadata": {"post": {"tags": ["Annotate"], "security": [{"Bearer": []}], "description": "Get annotator's metadata", "produces": ["application/json", "text/html"], "operationId": "get_cached_annotator_metadata", "x-swagger-router-controller": "api_server.controllers.annotate", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "in": "body", "schema": {"x-oneOf": [{"$ref": "#/definitions/AnnotatorSupportedAnnotationsParameters"}, {"$ref": "#/definitions/ModelSupportedAnnotationsParameters"}]}, "required": true}], "responses": {"200": {"description": "OK", "schema": {"title": "AnnotatorMetadata", "type": "object", "required": ["name", "version", "url", "author", "description"], "properties": {"name": {"type": "string"}, "version": {"type": "string"}, "url": {"type": "string"}, "author": {"type": "string"}, "description": {"type": "string"}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/annotate/supported_annotations": {"post": {"tags": ["Annotate"], "security": [{"Bearer": []}], "description": "Get supported annotations for an annotator", "produces": ["application/json", "text/html"], "operationId": "get_project_annotator_supported_annotations", "x-swagger-router-controller": "api_server.controllers.annotate", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "in": "body", "schema": {"x-oneOf": [{"$ref": "#/definitions/AnnotatorSupportedAnnotationsParameters"}, {"$ref": "#/definitions/ModelSupportedAnnotationsParameters"}]}, "required": true}], "responses": {"200": {"description": "OK", "schema": {"title": "SupportedAnnotatorAnnotations", "type": "object", "required": ["entities", "relationships"], "properties": {"entities": {"type": "array", "items": {"title": "EntityAnnotationDescriptor", "type": "object", "properties": {"key": {"type": "string"}, "description": {"type": "string"}, "data_fields": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}}, "required": ["key", "description"]}}, "relationships": {"type": "array", "items": {"title": "RelationshipAnnotationDescriptor", "type": "object", "properties": {"key": {"type": "string"}, "description": {"type": "string"}, "columns": {"type": "array", "items": {"type": "object", "title": "RelationshipAnnotationColumn", "properties": {"key": {"type": "string"}, "entities": {"type": "array", "items": {"type": "string"}}}, "required": ["key", "entities"]}}}, "required": ["key", "description", "columns"]}}, "supported_object_types": {"type": "array", "items": {"type": "string"}}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/object_annotations": {"post": {"tags": ["Annotate"], "security": [{"Bearer": []}], "description": "Run an annotator on an object, using resources from the project.\n*DEPRECATED*, please use generate_project_object_annotations_async instead.\n", "deprecated": true, "produces": ["application/json"], "operationId": "generate_project_object_annotations", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "AnnotateObjectOptions", "type": "object", "required": ["parameters", "input"], "properties": {"input": {"title": "AnnotatorInput", "type": "object", "minProperties": 1, "maxProperties": 1, "properties": {"text": {"type": "string", "maxLength": 4500}, "table": {"type": "array", "description": "A table, specified as an array of arrays. Each outer array represents a row, and each item in the inner array represents the column.", "items": {"type": "array", "items": {"title": "AnnotateTableCell", "type": "object", "required": ["bbox", "spans", "text", "type"], "properties": {"bbox": {"type": "array", "items": {"type": "number", "format": "double"}, "minItems": 4, "maxItems": 4}, "spans": {"type": "array", "description": "2-tuple representing the row:column where this cell spans to.", "items": {"type": "array", "items": {"type": "number", "format": "integer"}, "minItems": 2, "maxItems": 2}}, "text": {"type": "string"}, "type": {"title": "AnnotateTableCellType", "type": "string", "enum": ["col_header", "row_header", "body"]}}}}}, "image": {"title": "AnnotatorImageInput", "type": "object", "required": ["source"], "properties": {"source": {"title": "ImageSource", "type": "object", "minProperties": 1, "properties": {"scratch_id": {"type": "string"}, "proj_key": {"type": "string"}, "url": {"type": "string"}}}, "metadata": {"title": "ImageMetadata", "type": "object", "required": ["cells"], "properties": {"cells": {"title": "ImageCells", "type": "object", "required": ["data"], "properties": {"data": {"type": "array", "description": "A 6-tuple consisting of x1, y1, x2, y2, font, coordinates", "items": [{"type": "number"}, {"type": "number"}, {"type": "number"}, {"type": "number"}, {"type": "string"}, {"type": "string"}]}}}, "info": {"title": "ImageInfo", "type": "object", "required": ["width", "height"], "properties": {"width": {"type": "number"}, "height": {"type": "number"}}}}}}}}}, "parameters": {"title": "AnnotatorParameters", "type": "object", "properties": {"type": {"type": "string"}}, "additionalProperties": {}, "required": ["type"]}}}}], "responses": {"200": {"description": "OK", "schema": {"title": "AnnotatedObject", "type": "object", "minProperties": 1, "maxProperties": 1, "properties": {"text": {"title": "AnnotatedTextLines", "type": "object", "required": ["text", "entities", "relationships", "properties"], "properties": {"text": {"description": "Input text after clean up. The annotation indexes will be based on this text and not the input text.", "type": "string"}, "entities": {"type": "array", "description": "One item per line on the original text.", "items": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/EntityAnnotation"}}}}, "relationships": {"type": "array", "description": "One item per line on the original text.", "items": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/RelationshipAnnotation"}}}}, "properties": {"type": "array", "description": "One item per line on the original text.", "items": {"$ref": "#/definitions/ObjectPropertyMap"}}}}, "table": {"$ref": "#/definitions/AnnotatedTable"}, "image": {"$ref": "#/definitions/AnnotatedImage"}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.annotate"}}, "/project/{proj_key}/object_annotations_async": {"post": {"tags": ["Annotate"], "security": [{"Bearer": []}], "description": "Run an annotator on an object, using resources from the project.", "produces": ["application/json"], "operationId": "generate_project_object_annotations_async", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "AnnotateObjectOptions", "type": "object", "required": ["parameters", "input"], "properties": {"input": {"title": "AnnotatorInput", "type": "object", "minProperties": 1, "maxProperties": 1, "properties": {"text": {"type": "string", "maxLength": 4500}, "table": {"type": "array", "description": "A table, specified as an array of arrays. Each outer array represents a row, and each item in the inner array represents the column.", "items": {"type": "array", "items": {"title": "AnnotateTableCell", "type": "object", "required": ["bbox", "spans", "text", "type"], "properties": {"bbox": {"type": "array", "items": {"type": "number", "format": "double"}, "minItems": 4, "maxItems": 4}, "spans": {"type": "array", "description": "2-tuple representing the row:column where this cell spans to.", "items": {"type": "array", "items": {"type": "number", "format": "integer"}, "minItems": 2, "maxItems": 2}}, "text": {"type": "string"}, "type": {"title": "AnnotateTableCellType", "type": "string", "enum": ["col_header", "row_header", "body"]}}}}}, "image": {"title": "AnnotatorImageInput", "type": "object", "required": ["source"], "properties": {"source": {"title": "ImageSource", "type": "object", "minProperties": 1, "properties": {"scratch_id": {"type": "string"}, "proj_key": {"type": "string"}, "url": {"type": "string"}}}, "metadata": {"title": "ImageMetadata", "type": "object", "required": ["cells"], "properties": {"cells": {"title": "ImageCells", "type": "object", "required": ["data"], "properties": {"data": {"type": "array", "description": "A 6-tuple consisting of x1, y1, x2, y2, font, coordinates", "items": [{"type": "number"}, {"type": "number"}, {"type": "number"}, {"type": "number"}, {"type": "string"}, {"type": "string"}]}}}, "info": {"title": "ImageInfo", "type": "object", "required": ["width", "height"], "properties": {"width": {"type": "number"}, "height": {"type": "number"}}}}}}}}}, "parameters": {"title": "AnnotatorParameters", "type": "object", "properties": {"type": {"type": "string"}}, "additionalProperties": {}, "required": ["type"]}, "proj_key": {"type": "string"}, "model_config_key": {"type": "string"}, "public": {"type": "boolean"}}}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.annotate"}}, "/project/{proj_key}/scratch/files": {"get": {"tags": ["Uploads"], "security": [{"Bearer": []}], "description": "Get temporary files uploaded to a project", "produces": ["application/json"], "operationId": "list_project_scratch_files", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "scratch_ids", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "Files", "schema": {"type": "array", "items": {"title": "UploadedFile", "type": "object", "properties": {"id": {"type": "string", "description": "ID of the temporary file."}, "proj_key": {"type": "string"}, "user_key": {"type": "string"}, "filename": {"type": "string"}, "timestamp": {"type": "number"}}, "required": ["id", "proj_key", "user_key", "filename", "timestamp"]}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"deprecated": true, "tags": ["Uploads"], "security": [{"Bearer": []}], "description": "Upload a file to temporary storage", "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_scratch_file", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "file", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "File uploaded", "schema": {"title": "UploadedFileResult", "type": "object", "required": ["id", "url"], "properties": {"id": {"type": "string", "description": "ID of the temporary file."}, "url": {"type": "string", "description": "URL to get the temporary file form."}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/scratch/files_paginated": {"get": {"tags": ["Uploads"], "security": [{"Bearer": []}], "description": "Get paginated list of temporary files uploaded to a project", "produces": ["application/json"], "operationId": "list_project_scratch_files_paginated", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "page", "in": "query", "description": "page of the result list", "required": false, "type": "integer"}, {"name": "items_per_page", "in": "query", "description": "items on one page of the result list", "required": false, "default": 20, "type": "integer"}, {"name": "search_string", "in": "query", "description": "search keyword", "required": false, "type": "string"}, {"name": "begin_date", "in": "query", "description": "begin date of the search date interval", "required": false, "type": "integer"}, {"name": "end_date", "in": "query", "description": "end date of the search date interval", "required": false, "type": "integer"}], "responses": {"200": {"description": "Files", "schema": {"type": "array", "items": {"title": "UploadedFile", "type": "object", "properties": {"id": {"type": "string", "description": "ID of the temporary file."}, "proj_key": {"type": "string"}, "user_key": {"type": "string"}, "filename": {"type": "string"}, "timestamp": {"type": "number"}}, "required": ["id", "proj_key", "user_key", "filename", "timestamp"]}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/scratch/files/upload/{filename}": {"post": {"tags": ["Uploads"], "security": [{"Bearer": []}], "description": "Create file pointers for temporary storage", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "create_project_scratch_file", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "filename", "in": "path", "required": true, "type": "string"}], "responses": {"201": {"description": "Temporary file details", "schema": {"title": "TemporaryUploadFileResult", "type": "object", "required": ["id", "upload", "download", "metadata", "upload_private", "download_private", "metadata_private"], "properties": {"id": {"type": "string", "description": "ID of the temporary file."}, "upload": {"type": "object", "description": "URL to upload the temporary file.", "properties": {"url": {"type": "string"}, "fields": {"type": "object"}}}, "upload_private": {"type": "object", "description": "URL to upload the temporary file. (private URL, usable within the infrastracture)", "properties": {"url": {"type": "string"}, "fields": {"type": "object"}}}, "download": {"type": "object", "description": "URL to get the temporary file.", "properties": {"url": {"type": "string"}}}, "download_private": {"type": "object", "description": "URL to get the temporary file. (private URL, usable within the infrastracture)", "properties": {"url": {"type": "string"}}}, "metadata": {"type": "object", "description": "URL to metadata of the temporary file using the HEAD HTTP method.", "properties": {"url": {"type": "string"}}}, "metadata_private": {"type": "object", "description": "URL to metadata of the temporary file using the HEAD HTTP method. (private URL, usable within the infrastracture)", "properties": {"url": {"type": "string"}}}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/default_values": {"get": {"tags": ["Project"], "security": [{"Bearer": []}], "description": "List project's default values", "produces": ["application/json"], "operationId": "get_project_default_values", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/ProjectDefaultValues"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "post": {"tags": ["Project"], "security": [{"Bearer": []}], "description": "List project's default values", "produces": ["application/json"], "operationId": "update_project_default_values", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "default_values", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ProjectDefaultValues"}}], "responses": {"200": {"description": "OK"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/integrations/{integration_name}": {"get": {"tags": ["Project"], "security": [{"Bearer": []}], "description": "Get the config for a given project integration", "produces": ["application/json"], "operationId": "get_project_integration_config", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "integration_name", "in": "path", "type": "string", "required": true}, {"name": "decode_secrets", "in": "query", "type": "boolean", "description": "Project owners can retrieve decoded secrets", "default": false}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/ProjectIntegrations"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "post": {"tags": ["Project"], "security": [{"Bearer": []}], "description": "Update the config for a given project integration", "produces": ["application/json"], "operationId": "update_project_integration_config", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "integration_name", "in": "path", "type": "string", "required": true}, {"name": "config", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ProjectIntegrations"}}], "responses": {"200": {"description": "OK"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "delete": {"tags": ["Project"], "security": [{"Bearer": []}], "description": "Delete the config for a given project integration", "produces": ["application/json"], "operationId": "delete_project_integration_config", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "integration_name", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "OK"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/annotate/document": {"post": {"tags": ["Document Inspection"], "security": [{"Bearer": []}], "description": "Run an annotator on a document", "produces": ["application/json"], "operationId": "annotate_document", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "x-body-name": "body", "in": "body", "required": true, "schema": {"title": "AnnotateDocumentRequest", "type": "object", "required": ["document", "text_annotators", "image_annotators", "table_annotators"], "properties": {"document": {"type": "object"}, "text_annotators": {"type": "array", "items": {"$ref": "#/definitions/AnnotatorParametersOrRef"}}, "image_annotators": {"type": "array", "items": {"$ref": "#/definitions/AnnotatorParametersOrRef"}}, "table_annotators": {"type": "array", "items": {"$ref": "#/definitions/AnnotatorParametersOrRef"}}, "use_cache": {"type": "boolean", "default": true}}}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/annotate/document/report": {"post": {"tags": ["Document Inspection"], "security": [{"Bearer": []}], "description": "Submit a report on an inspected document", "produces": ["application/json"], "operationId": "report_inspected_document", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "x-body-name": "body", "in": "body", "required": true, "schema": {"title": "AnnotatedDocumentReport", "type": "object", "required": ["document", "report"], "properties": {"document": {"type": "object", "properties": {"input_scratch_id": {"type": "string"}, "output_scratch_id": {"type": "string"}}, "required": ["input_scratch_id", "output_scratch_id"]}, "document_conversion_parameters": {"type": "object"}, "document_annotation_parameters": {"type": "object"}, "report": {"type": "object", "properties": {"description": {"type": "string"}, "review_consent": {"type": "boolean"}}, "required": ["review_consent"]}}}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/annotate/document/results/{document_hash}": {"delete": {"tags": ["Document Inspection"], "security": [{"Bearer": []}], "description": "Delete annotation results for a document", "produces": ["application/json"], "operationId": "delete_document_annotation_result", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "document_hash", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "OK"}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/annotate/document/tasks/{task_id}": {"get": {"tags": ["Document Inspection"], "security": [{"Bearer": []}], "description": "Get the result of a previous document annotation", "produces": ["application/json"], "operationId": "get_annotate_document_result", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_id", "in": "path", "required": true, "type": "string"}, {"name": "wait", "in": "query", "required": false, "type": "number", "minimum": 0, "maximum": 10, "description": "Allow the response to be delayed for a few seconds to wait for the result, instead of doing client-side polling."}], "responses": {"200": {"description": "OK", "schema": {"type": "object", "required": ["task_id", "task_status", "result", "done"], "properties": {"task_id": {"type": "string"}, "task_status": {"type": "string"}, "result": {"type": "object", "x-nullable": true}, "done": {"type": "boolean"}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/annotate/inspection_report": {"get": {"tags": ["Document Inspection"], "security": [{"Bearer": []}], "description": "Get paginated list of inspection reports for a project", "produces": ["application/json"], "operationId": "list_project_inspection_report", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "page", "in": "query", "description": "page of the result list", "required": false, "type": "integer"}, {"name": "items_per_page", "in": "query", "description": "items on one page of the result list", "required": false, "default": 20, "type": "integer"}, {"name": "search_string", "in": "query", "description": "search keyword", "required": false, "type": "string"}, {"name": "begin_date", "in": "query", "description": "begin date of the search date interval", "required": false, "type": "integer"}, {"name": "end_date", "in": "query", "description": "end date of the search date interval", "required": false, "type": "integer"}], "responses": {"200": {"description": "Reports", "schema": {"type": "array", "items": {"title": "InspectionReport", "type": "object", "properties": {"id": {"type": "string", "description": "ID of the inpection report."}, "proj_key": {"type": "string"}, "user_key": {"type": "string"}, "timestamp": {"type": "number"}, "document": {"type": "string"}}, "required": ["id", "proj_key", "user_key", "timestamp", "document"]}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/ingest/documentqa": {"post": {"deprecated": true, "tags": ["Document Inspection", "Semantic"], "security": [{"Bearer": []}], "description": "Ingest a document for QA", "produces": ["application/json"], "operationId": "ingest_documentqa", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "x-body-name": "body", "in": "body", "required": true, "schema": {"title": "IngestDocumentQARequest", "type": "object", "properties": {"source": {"title": "Source", "x-anyOf": [{"title": "IngestDocumentQASourceUrl", "type": "object", "properties": {"type": {"title": "Type", "enum": ["url"], "type": "string"}, "url": {"title": "Url", "type": "string"}}, "required": ["type", "url"]}, {"title": "IngestDocumentQASourcePublicData", "type": "object", "properties": {"type": {"title": "Type", "enum": ["public_data"], "type": "string"}, "elastic_id": {"title": "Elastic Id", "type": "string"}, "index_key": {"title": "Index Key", "type": "string"}, "document_hash": {"title": "Document Hash", "type": "string"}}, "required": ["type", "elastic_id", "index_key", "document_hash"]}, {"title": "IngestDocumentQASourcePrivateData", "type": "object", "properties": {"type": {"title": "Type", "enum": ["private_data"], "type": "string"}, "proj_key": {"title": "Proj Key", "type": "string"}, "index_key": {"title": "Index Key", "type": "string"}, "document_hash": {"title": "Document Hash", "type": "string"}}, "required": ["type", "proj_key", "index_key", "document_hash"]}]}}, "required": ["source"]}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/semantic/ingest": {"post": {"tags": ["Semantic"], "security": [{"Bearer": []}], "description": "Ingest documents and collections for RAG", "produces": ["application/json"], "operationId": "ingest", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "x-body-name": "body", "in": "body", "required": true, "schema": {"title": "SemanticIngestRequest", "type": "object", "properties": {"source": {"title": "Source", "x-anyOf": [{"title": "IngestDocumentQASourceUrl", "type": "object", "properties": {"type": {"title": "Type", "enum": ["url"], "type": "string"}, "url": {"title": "Url", "type": "string"}}, "required": ["type", "url"]}, {"title": "SemanticIngestSourcePublicDataDocument", "type": "object", "properties": {"type": {"title": "Type", "enum": ["public_data_document"], "type": "string"}, "elastic_id": {"title": "Elastic Id", "type": "string"}, "index_key": {"title": "Index Key", "type": "string"}, "document_hash": {"title": "Document Hash", "type": "string"}}, "required": ["type", "elastic_id", "index_key", "document_hash"]}, {"title": "SemanticIngestSourcePrivateDataDocument", "type": "object", "properties": {"type": {"title": "Type", "enum": ["private_data_document"], "type": "string"}, "proj_key": {"title": "Proj Key", "type": "string"}, "index_key": {"title": "Index Key", "type": "string"}, "document_hash": {"title": "Document Hash", "type": "string"}}, "required": ["type", "proj_key", "index_key", "document_hash"]}, {"title": "SemanticIngestSourcePrivateDataCollection", "type": "object", "properties": {"type": {"title": "Type", "enum": ["private_data_collection"], "type": "string"}, "proj_key": {"title": "Proj Key", "type": "string"}, "index_key": {"title": "Index Key", "type": "string"}}, "required": ["type", "proj_key", "index_key"]}]}, "parameters": {"title": "SemanticIngestReqParams", "type": "object", "properties": {"skip_ingested_docs": {"title": "Skip Ingested Docs", "type": "boolean"}}, "required": ["skip_ingested_docs"]}}, "required": ["source", "parameters"]}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.semantic_controller"}}, "/project/{proj_key}/dictionaries/from_mongo": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Create a dictionary from a mongo database", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "import_project_dictionary_from_mongo", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "DictionaryImportOptions", "type": "object", "properties": {"target": {"type": "object", "required": ["name", "description", "public"], "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "pattern": "^(?:\\w| |-)+$"}, "description": {"type": "string", "x-nullable": true}}}, "options": {"type": "object", "required": ["coordinates"], "properties": {"coordinates": {"$ref": "#/definitions/MongoS3CoordinatesWithCollectionList"}}}}, "required": ["target", "options"]}}], "responses": {"200": {"description": "Dictionary created, and data is being imported.", "schema": {"title": "DictionaryImportResult", "type": "object", "properties": {"dictionary": {"$ref": "#/definitions/Dictionary"}, "import_task": {"$ref": "#/definitions/Task"}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/actions/clone": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Clone an existing dictionary", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "clone_project_dictionary", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "CloneDictionaryOptions", "type": "object", "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "pattern": "^(?:\\w| |-)+$", "x-nullable": true}, "description": {"type": "string", "x-nullable": true}, "copy_s3": {"type": "boolean", "description": "Should the dictionary's S3 data also be copied?", "default": true}, "collections": {"type": "array", "items": {"type": "string"}}}, "required": ["name", "description", "public"]}}], "responses": {"200": {"description": "Dictionary cloned, and data is being copied.", "schema": {"$ref": "#/definitions/DictionaryCloneResult"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "List dictionaries for a project", "produces": ["application/json"], "operationId": "list_project_dictionaries", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "query", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "List of dictionaries", "schema": {"type": "array", "items": {"$ref": "#/definitions/Dictionary"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}, "post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Create an empty dictionary", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "create_project_dictionary", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "CreateDictionaryOptions", "type": "object", "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "pattern": "^(?:\\w| |-)+$"}, "description": {"type": "string", "x-nullable": true}}, "required": ["name", "description", "public"]}}], "responses": {"200": {"description": "Dictionary created.", "schema": {"$ref": "#/definitions/Dictionary"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/public/dictionaries/{dict_key}": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get a single dictionary that was made public", "produces": ["application/json"], "operationId": "get_public_dictionary", "parameters": [{"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Dictionary", "schema": {"$ref": "#/definitions/Dictionary"}}, "404": {"description": "Dictionary not found or is not public", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/public/dictionaries/{dict_key}/collections": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get the collections of a dictionary.", "produces": ["application/json"], "operationId": "list_public_dictionary_collections", "parameters": [{"name": "dict_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Dictionary collections", "schema": {"type": "array", "items": {"$ref": "#/definitions/DictionaryCollection"}}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/collections/{collection_name}/actions/upload": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Upload data to a dictionary collection. The collection will be created if it doesn't exist.", "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_dictionary_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "file", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/collections/{collection_name}/actions/export": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Export the contents of a dictionary's collection", "produces": ["application/zip", "application/json"], "operationId": "export_project_dictionary_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "file_format", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "Dictionary collection contents.", "schema": {"type": "file"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/actions/upload": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Upload data to a dictionary. The collection name(s) will be inferred from the file name(s).", "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_dictionary_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "file", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/actions/export": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Export the contents of a dictionary.", "produces": ["application/zip"], "operationId": "export_project_dictionary_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Dictionary contents.", "schema": {"type": "file"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/delete_token": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get a token used to confirm the deletion of a dictionary.", "produces": ["application/json"], "operationId": "create_project_dictionary_delete_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Dictionary deletion token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "Data flow template not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/public/dictionaries": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "List public dictionaries", "produces": ["application/json"], "operationId": "list_public_dictionaries", "parameters": [{"name": "query", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "List of public dictionaries", "schema": {"type": "array", "items": {"$ref": "#/definitions/Dictionary"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/public/dictionaries/{dict_key}/actions/clone": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Clone an existing public dictionary", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "clone_public_dictionary", "parameters": [{"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "ClonePublicDictionaryOptions", "type": "object", "properties": {"proj_key": {"description": "The project key of the project to store the resulting dictionary", "type": "string"}, "public": {"type": "boolean"}, "name": {"type": "string", "x-nullable": true}, "description": {"type": "string", "x-nullable": true}, "collections": {"type": "array", "items": {"type": "string"}}, "copy_s3": {"type": "boolean", "description": "Should the dictionary's S3 data also be copied?", "default": true}}, "required": ["name", "description", "public", "proj_key"]}}], "responses": {"200": {"description": "Dictionary cloned, and data is being copied.", "schema": {"$ref": "#/definitions/DictionaryCloneResult"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get a single dictionary", "produces": ["application/json"], "operationId": "get_project_dictionary", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Dictionary", "schema": {"$ref": "#/definitions/Dictionary"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}, "delete": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Delete a single dictionary", "produces": ["application/json"], "operationId": "delete_project_dictionary", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "required": true, "type": "string"}, {"name": "confirmation_token", "in": "query", "type": "string", "required": true}], "responses": {"204": {"description": "Dictionary deleted."}, "404": {"description": "Dictionary doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}, "patch": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Update the metadata of a dictionary", "produces": ["application/json"], "operationId": "update_project_dictionary", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"type": "object", "title": "PatchDictionaryOptions", "properties": {"name": {"type": "string"}, "public": {"type": "boolean"}, "description": {"type": "string", "x-nullable": true}}, "additionalProperties": false}}], "responses": {"200": {"description": "Dictionary updated.", "schema": {"$ref": "#/definitions/Dictionary"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/collections": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get the collections of a dictionary.", "produces": ["application/json"], "operationId": "list_project_dictionary_collections", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Dictionary collections", "schema": {"type": "array", "items": {"$ref": "#/definitions/DictionaryCollection"}}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}, "post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Create a collection in a dictionary", "produces": ["application/json"], "operationId": "create_project_dictionary_collection", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"title": "CreateCollectionInDictionaryOptions", "type": "object", "properties": {"collection_name": {"type": "string", "pattern": "^(?:\\w|-)(?:\\w|\\s|-)*(?:\\w|-)$", "maxLength": 50, "minLength": 4}}, "required": ["collection_name"]}}], "responses": {"200": {"description": "Collection created."}, "404": {"description": "Dictionary doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/collections/{collection_name}": {"delete": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Delete a single dictionary's collection", "produces": ["application/json"], "operationId": "delete_project_dictionary_collection", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "required": true, "type": "string"}, {"name": "collection_name", "in": "path", "type": "string", "required": true}], "responses": {"204": {"description": "Collection deleted."}, "404": {"description": "Collection doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/collections/{collection_name}/data": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get a preview of the data in a dictionary", "produces": ["application/json"], "operationId": "get_project_dictionary_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "after", "in": "query", "type": "string", "pattern": "[a-zA-Z0-9]{24}", "required": false}, {"name": "limit", "in": "query", "type": "integer", "minimum": 0, "default": 1000, "required": false}, {"name": "response_format", "in": "query", "type": "string", "default": "object", "required": false}], "responses": {"200": {"description": "Dictionary collection contents.", "schema": {"x-oneOf": [{"$ref": "#/definitions/DictionaryCollectionObjectData"}, {"$ref": "#/definitions/DictionaryCollectionCsvData"}]}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}, "patch": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Update the data in a dictionary's collection", "produces": ["application/json"], "operationId": "update_project_dictionary_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "description": "A subset of JSON Patch operation list. Only `add`, `replace`, and `remove` is supported.\nSee http://jsonpatch.com/ for more details.\n", "schema": {"type": "array", "items": {"$ref": "#/definitions/DictionaryCollectionPatch"}}}], "responses": {"204": {"description": "Data updated."}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/model_configs": {"get": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "List Model Configurations for a project", "produces": ["application/json"], "operationId": "list_project_model_configs", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "List of Model Configurations", "schema": {"type": "array", "items": {"$ref": "#/definitions/ModelConfiguration"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}, "post": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "Create a Model Configuration", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "create_project_model_config", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "CreateProjectModelConfigOptions", "type": "object", "additionalProperties": false, "properties": {"public": {"type": "boolean"}, "name": {"pattern": "^(?:\\w| |-)+$", "type": "string"}, "description": {"type": "string", "x-nullable": true}, "configurations": {"type": "object", "properties": {"type": {"type": "string"}}, "required": ["type"]}, "model_config_key": {"type": "string"}}, "required": ["name", "description", "public", "configurations"]}}], "responses": {"200": {"description": "Model Configuration created.", "schema": {"$ref": "#/definitions/ModelConfiguration"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/model_configs/{model_config_key}": {"get": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "Get a single Model Configuration", "produces": ["application/json"], "operationId": "read_project_model_config", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "model_config_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Model Configuration", "schema": {"$ref": "#/definitions/ModelConfiguration"}}, "404": {"description": "Model Configuration not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}, "patch": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "Update a single Model Configuration", "produces": ["application/json"], "operationId": "update_project_model_config", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "model_config_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"title": "UpdateProjectModelConfigOptions", "type": "object", "additionalProperties": false, "properties": {"name": {"type": "string"}, "public": {"type": "boolean"}, "description": {"type": "string", "x-nullable": true}, "configurations": {"type": "object", "properties": {"type": {"type": "string"}}, "required": ["type"]}}, "required": ["name", "description", "public", "configurations"]}}], "responses": {"204": {"description": "Model Configuration updated."}, "404": {"description": "Model Configuration doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}, "delete": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "Delete a single Model Configuration", "produces": ["application/json"], "operationId": "delete_project_model_config", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "model_config_key", "in": "path", "required": true, "type": "string"}], "responses": {"204": {"description": "Model Configuration deleted."}, "404": {"description": "Model Configuration doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/public/model_configs": {"get": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "List public Model Configurations", "produces": ["application/json"], "operationId": "list_public_model_configs", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [], "responses": {"200": {"description": "List of public Model Configurations", "schema": {"type": "array", "items": {"$ref": "#/definitions/ModelConfiguration"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/public/model_configs/{model_config_key}": {"get": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "Get a single Model Configuration that was made public", "produces": ["application/json"], "operationId": "read_public_model_config", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "model_config_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Model configuration", "schema": {"$ref": "#/definitions/ModelConfiguration"}}, "404": {"description": "Model configuration not found or is not public", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/models": {"get": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "List models with the supported annotations for a project", "produces": ["application/json"], "operationId": "get_project_models_with_supported_annotations", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "List of Models with the supported annotations", "schema": {"type": "array", "items": {"$ref": "#/definitions/ModelConfiguration"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/processing_models/docs_graph_with_databases": {"post": {"tags": ["Processing Model"], "security": [{"Bearer": []}], "consumes": ["application/json"], "produces": ["application/json"], "description": "Create a Data Flow from a list of CCS Collections and CPS Models.", "operationId": "create_data_flow_from_df_wizard", "parameters": [{"name": "body", "in": "body", "required": true, "schema": {"type": "object", "required": ["ccs_document_collections", "catalog_document_collections", "models", "access_token"], "properties": {"access_token": {"type": "string"}, "ccs_document_collections": {"type": "array", "items": {"$ref": "#/definitions/CcsCollectionReference"}}, "models": {"type": "array", "items": {"$ref": "#/definitions/CpsModelReference"}}, "entity_mappings": {"$ref": "#/definitions/EntityMapping"}, "catalog_document_collections": {"type": "array", "items": {"$ref": "#/definitions/CatalogReference"}}, "data_catalogs": {"type": "array", "items": {"$ref": "#/definitions/CatalogReference"}}}}}], "responses": {"200": {"description": "Processing model generated successfully", "schema": {"$ref": "#/definitions/ProcessingModel"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.processing_model_controller"}}, "/processing_models": {"get": {"tags": ["Processing Model"], "security": [{"Bearer": []}], "produces": ["application/json"], "description": "List the available processing models.", "operationId": "get_processing_models", "x-swagger-router-controller": "api_server.controllers.processing_model_controller", "responses": {"200": {"description": "List of processing models and their description", "schema": {"type": "object", "required": ["processing_models"], "properties": {"processing_models": {"type": "array", "items": {"$ref": "#/definitions/ProcessingModelDescription"}}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}}, "definitions": {"TokenResponse": {"type": "object", "properties": {"token": {"type": "string"}}, "required": ["token"]}, "ProjectDataIndexWithStatus": {"title": "ProjectDataIndexWithStatus", "description": "Project data index with elastic status", "type": "object", "properties": {"source": {"title": "ProjectDataIndexSource", "type": "object", "properties": {"proj_key": {"type": "string"}, "index_key": {"type": "string"}}, "required": ["proj_key", "index_key"]}, "name": {"type": "string"}, "description": {"type": "string"}, "schema_key": {"type": "string", "description": "Index's schema key", "enum": ["deepsearch-doc", "deepsearch-db", "generic"]}, "type": {"type": "string", "description": "Index type, user friendly format", "enum": ["View", "Document", "DB Record", "Generic", "Experiment"]}, "view_of": {"type": "object", "properties": {"index_key": {"type": "string"}, "elastic_id": {"type": "string"}, "proj_key": {"type": "string"}, "query_options": {"$ref": "#/definitions/ElasticIndexSearchQueryOptions"}}, "required": ["index_key", "query_options"]}, "documents": {"type": "number"}, "health": {"type": "string"}, "status": {"type": "string"}, "creation_date": {"type": "string"}, "record_properties": {"$ref": "#/definitions/ElasticIndexProperties"}, "provenance": {"type": "string"}}, "required": ["source", "name", "description", "type", "documents", "health", "status", "creation_date"]}, "ProjectDataIndexNonView": {"title": "ProjectDataIndexNonView", "description": "Object to create a project data index", "type": "object", "properties": {"name": {"type": "string", "description": "Name of the data index", "minLength": 1, "maxLength": 64}, "description": {"type": "string", "description": "Description of the Index", "minLength": 1, "maxLength": 254}, "schema_key": {"type": "string", "description": "Schema key", "minLength": 1, "maxLength": 64, "default": "generic", "enum": ["deepsearch-doc", "deepsearch-db", "generic"]}}, "required": ["name"]}, "ProjectDataIndexView": {"title": "ProjectDataIndexView", "description": "Object to create a project data index view", "type": "object", "properties": {"name": {"type": "string", "description": "Name of the data index view", "minLength": 1, "maxLength": 64}, "description": {"type": "string", "description": "Description of the index view", "minLength": 1, "maxLength": 254}, "view_of": {"type": "object", "title": "ProjectDataIndexViewOf", "properties": {"instance_id": {"type": "string", "description": "Instance id key, if the source is a data asset", "minLength": 1, "maxLength": 64}, "proj_key": {"type": "string", "description": "Project id key, if the source is a project data index", "minLength": 1, "maxLength": 64}, "index_key": {"type": "string", "description": "Data index key", "minLength": 1, "maxLength": 64}, "query_options": {"$ref": "#/definitions/ElasticIndexSearchQueryOptions"}}, "required": ["index_key", "query_options"]}}, "required": ["name", "view_of"]}, "ProjectDataIndexConversionSettings": {"title": "ProjectDataIndexConversionSettings", "description": "Specify the conversion settings to use.", "type": "object", "properties": {"type": {"title": "Type", "type": "string", "default": "direct", "enum": ["direct"]}, "ocr": {"type": "object", "title": "OCR Settings", "properties": {"enabled": {"title": "Enabled", "type": "boolean", "default": false}, "backend": {"title": "Backend", "type": "string"}, "backend_settings": {"title": "Backend Settings", "type": "object"}, "merge_mode": {"title": "Merge Mode", "type": "string"}}}, "assemble": {"title": "Assemble Settings", "type": "object", "required": ["mode", "include_incomplete_documents"], "properties": {"mode": {"type": "object", "required": ["page_elements", "tables"], "properties": {"page_elements": {"title": "Page Elements", "type": "array", "items": {"type": "string", "enum": ["H", "M", "None"]}}, "tables": {"title": "Tables", "type": "array", "items": {"type": "string", "enum": ["H", "M", "None"]}}}}, "include_incomplete_documents": {"title": "Include Incomplete Documents", "type": "boolean"}}}, "metadata": {"title": "Collection Metadata Settings", "type": "object", "properties": {"description": {"title": "Description", "type": "string"}, "display_name": {"title": "Display Name", "type": "string"}, "licence": {"title": "Licence", "type": "string"}, "source": {"title": "Source", "type": "string"}, "version": {"title": "Version", "type": "string"}}}, "page_labels": {"title": "Page Labels", "type": "object"}, "model_pipeline": {"title": "Model Pipeline Settings", "type": "object", "required": ["clusters", "page", "tables", "normalization"], "properties": {"clusters": {"title": "Clusters", "x-oneOf": [{"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/0"}, {"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/1"}]}, "page": {"title": "Page", "x-oneOf": [{"type": "object", "description": "Reference to a model configuration", "required": ["model_config_key", "proj_key"], "properties": {"model_config_key": {"title": "Model Config Key", "type": "string"}, "proj_key": {"title": "Proj Key", "type": "string"}, "name": {"title": "Name", "type": "string"}, "description": {"title": "Description", "type": "string"}}}, {"type": "object", "description": "Direct configuration of a model", "required": ["type", "config"], "properties": {"type": {"title": "Type", "type": "string"}, "config": {"title": "Config", "type": "string"}}}]}, "tables": {"title": "Tables", "x-oneOf": [{"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/0"}, {"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/1"}]}, "normalization": {"title": "Normalization", "x-oneOf": [{"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/0"}, {"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/1"}]}}}}}, "ProjectDataIndexS3Coordinates": {"title": "ProjectDataIndexCOSCoordinates", "description": "Coordinates to COS", "type": "object", "properties": {"host": {"title": "host", "type": "string"}, "port": {"title": "port", "type": "number"}, "ssl": {"title": "ssl", "type": "boolean"}, "verify_ssl": {"title": "verify_ssl", "type": "boolean"}, "access_key": {"title": "access_key", "type": "string"}, "secret_key": {"title": "secret_key", "type": "string"}, "bucket": {"title": "bucket", "type": "string"}, "location": {"title": "location", "type": "string"}, "key_prefix": {"title": "key_prefix", "type": "string"}}, "required": ["host", "port", "ssl", "verify_ssl", "access_key", "secret_key", "bucket", "location"]}, "error_response": {"type": "object", "properties": {"error_message": {"type": "string"}, "error_code": {"type": "string", "x-nullable": true}}, "required": ["error_message"]}, "Problem": {"type": "object", "properties": {"type": {"type": "string"}, "title": {"type": "string"}, "detail": {"type": "string"}, "status": {"type": "integer"}}, "additionalProperties": {}, "example": {"type": "ExampleError", "title": "An example title", "detail": "A descriptive message.", "status": 500, "may_have_extra_fields": true}}, "Bag": {"type": "object", "required": ["proj_key", "bag_key", "name", "slug", "timestamp", "bag_domain", "flavour", "bag_url", "public", "_svc_endpoint", "token"], "properties": {"proj_key": {"type": "string"}, "bag_key": {"type": "string"}, "name": {"type": "string"}, "slug": {"type": "string"}, "timestamp": {"type": "number", "format": "double"}, "bag_domain": {"type": "string"}, "flavour": {"type": "string"}, "bag_url": {"type": "string"}, "public": {"type": "boolean"}, "_svc_endpoint": {"type": "string"}, "token": {"type": "string"}}}, "BagFlavour": {"type": "object", "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}, "description": {"type": "string"}}}, "BagFlavourDefaultQuota": {"title": "BagFlavourDefaultQuota", "type": "object", "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}, "default_quota": {"type": "number"}}, "required": ["name", "display_name"]}, "BagFlavourFullData": {"type": "object", "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}, "description": {"type": "string"}, "is_from_deployment": {"type": "boolean"}, "project_specific": {"type": "boolean"}, "default_quota": {"type": "integer"}, "order": {"type": "number"}, "backend": {"type": "string"}, "config": {"type": "object"}}, "required": ["display_name", "description", "project_specific", "backend", "config"]}, "ProjectsFlavours": {"type": "object", "properties": {"proj_key": {"type": "string"}, "name": {"type": "string"}, "flavours": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}}, "required": ["name"]}}}, "required": ["proj_key", "name", "flavours"]}, "ProjectsFlavoursQuota": {"title": "ProjectsFlavoursQuota", "type": "object", "properties": {"proj_key": {"type": "string"}, "name": {"type": "string"}, "quotas": {"type": "array", "items": {"$ref": "#/definitions/FlavoursQuota"}}}, "required": ["proj_key", "name", "quotas"]}, "FlavoursQuota": {"title": "FlavoursQuota", "type": "object", "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}, "quota": {"type": "integer"}}, "required": ["name", "display_name"]}, "SystemInfo": {"type": "object", "properties": {"allow_non_admins_to_make_resources_public": {"type": "boolean"}, "deployment": {"type": "object", "properties": {"name": {"type": "string"}, "disclaimer": {"type": "string"}, "should_show_warning": {"type": "boolean"}, "disable_kg_actions": {"type": "boolean"}, "linked_ccs_api": {"type": "object", "properties": {"uri": {"type": "string"}, "project_sync": {"type": "boolean"}}}}}, "toolkit": {"type": "object", "properties": {"name": {"type": "string"}, "host": {"type": "string"}, "verify_ssl": {"type": "boolean"}, "cli_command": {"type": "string"}, "required_version": {"type": "string", "x-nullable": true}}}, "api": {"type": "object", "properties": {"version": {"type": "string"}, "commit_hash": {"type": "string"}, "build_date": {"type": "integer"}}}}}, "SystemModulesConfiguration": {"type": "object", "required": ["df_template_variables", "linked_ccs_instances", "linked_elastic_instances"], "properties": {"df_template_variables": {"type": "array", "items": {"type": "object", "title": "WellKnownDfTemplateVariable", "required": ["description", "id", "type"], "properties": {"description": {"type": "string"}, "id": {"type": "string"}, "type": {"$ref": "#/definitions/DataFlowTemplateVariable"}}}}, "linked_ccs_instances": {"type": "array", "items": {"type": "object", "title": "LinkedCcsInstances", "required": ["description", "id"], "properties": {"description": {"type": "string"}, "id": {"type": "string"}}}}, "linked_elastic_instances": {"type": "array", "items": {"type": "object", "title": "LinkedElasticInstances", "required": ["description", "id"], "properties": {"description": {"type": "string"}, "id": {"type": "string"}}}}}}, "SystemModulesTasks": {"type": "object", "properties": {"tasks": {"type": "object", "additionalProperties": {"type": "object", "properties": {"schema": {"type": "object"}}}}}}, "BagCallback": {"type": "object", "properties": {"callback_url": {"type": "string"}}}, "KgcDataInput": {"type": "object", "properties": {"config": {"type": "object"}, "data-flow": {"type": "array", "items": {"type": "object", "additionalProperties": {}, "properties": {"config": {"type": "object", "additionalProperties": {}, "properties": {"coordinates": {"type": "object", "additionalProperties": {}, "properties": {"source": {"type": "object", "additionalProperties": {}, "properties": {"type": {"type": "string", "default": "bag", "enum": ["raw", "bag", "catalogue"]}, "bag_key": {"type": "string"}, "dc_key": {"type": "string"}, "proj_key": {"type": "string"}, "collection": {"type": "string"}, "public": {"type": "boolean"}}}, "target": {"type": "object", "additionalProperties": {}, "properties": {"type": {"type": "string", "default": "bag", "enum": ["raw", "bag", "catalogue"]}, "bag_key": {"type": "string"}, "dc_key": {"type": "string"}, "proj_key": {"type": "string"}, "collection": {"type": "string"}, "public": {"type": "boolean"}}}}}}, "required": ["coordinates"]}}, "required": ["config"]}}}, "required": ["config", "data-flow"]}, "LoadKgcDataInput": {"type": "object", "properties": {"dataflow": {"type": "object", "properties": {"config": {"type": "object"}, "data-flow": {"type": "array", "items": {"type": "object"}}}}, "target": {"type": "object", "properties": {"bag_key": {"type": "string"}, "save": {"type": "object"}}, "required": ["bag_key", "save"]}}, "required": ["dataflow", "target"]}, "Task": {"type": "object", "properties": {"task_id": {"type": "string"}, "task_type": {"type": "string"}, "task_status": {"type": "string"}, "proj_key": {"type": "string"}, "error_reason": {"type": "string", "x-nullable": true}, "kind": {"type": "string", "enum": ["project_task", "celery_task"]}, "related_tasks": {"type": "array", "items": {"title": "RelatedTask", "type": "object", "required": ["task_id", "task_type"], "properties": {"task_id": {"type": "string"}, "task_type": {"type": "string"}}}}}, "required": ["task_id", "task_type", "task_status", "proj_key", "error_reason", "kind"]}, "CcsTask": {"title": "CcsTask", "type": "object", "properties": {"task_id": {"type": "string"}, "ccs_project_key": {"type": "string"}, "ccs_collection_name": {"type": "string"}}, "required": ["task_id", "ccs_project_key", "ccs_collection_name"]}, "CpsTask": {"title": "CpsTask", "type": "object", "properties": {"task_id": {"type": "string"}, "task_status": {"type": "string"}, "task_type": {"type": "string"}}, "required": ["task_id", "task_status", "task_type"]}, "StorageSummaryTask": {"type": "object", "properties": {"task_id": {"type": "string"}, "proj_key": {"type": "string"}, "kg_key": {"type": "string"}, "dc_key": {"type": "string"}, "kind": {"type": "string", "enum": ["project_task", "celery_task"]}}, "required": ["task_id", "proj_key", "kind"]}, "StorageSummaryKG": {"type": "object", "properties": {"bag_key": {"type": "string"}, "name": {"type": "string"}, "size_bytes_db": {"type": "number"}, "size_converted_db": {"type": "string"}, "size_bytes_s3": {"type": "number"}, "size_converted_s3": {"type": "string"}, "categories_fraction": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "percentage": {"type": "number"}, "size_bytes_db": {"type": "number"}, "size_converted_db": {"type": "string"}, "color": {"type": "string"}}, "required": ["name", "percentage", "size_bytes_db", "size_converted_db"]}}}, "required": ["bag_key", "name", "size_bytes_db", "size_converted_db", "size_bytes_s3", "size_converted_s3", "categories_fraction"]}, "StorageSummaryDC": {"type": "object", "properties": {"dc_key": {"type": "string"}, "name": {"type": "string"}, "size_bytes_db": {"type": "number"}, "size_converted_db": {"type": "string"}, "size_bytes_s3": {"type": "number"}, "size_converted_s3": {"type": "string"}}, "required": ["dc_key", "name", "size_bytes_db", "size_converted_db", "size_bytes_s3", "size_converted_s3"]}, "DataCatalogue": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string", "x-nullable": true}, "dc_key": {"type": "string"}, "proj_key": {"type": "string"}, "created_by": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "copy_of": {"type": "string", "x-nullable": true}, "public": {"type": "boolean"}, "collections": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogCollection"}}, "topology": {"$ref": "#/definitions/DataCatalogTopology"}, "category_schemas": {"type": "array", "items": {"type": "object", "title": "DataCatalogCategorySchema", "required": ["key", "schema"], "properties": {"key": {"type": "string"}, "schema": {"type": "object", "additionalProperties": {}}}}}, "collections_data_flows": {"type": "array", "items": {"type": "object", "title": "DataCatalogDataFlow", "required": ["key", "data_flows"], "properties": {"key": {"type": "string"}, "data_flows": {"type": "array", "items": {"type": "object"}}}}}, "provenance_logs": {"type": "array", "items": {"type": "object", "title": "DataCatalogProvenanceLog", "required": ["user", "timestamp", "collection_name", "source"], "properties": {"user": {"type": "object", "title": "DataCatalogProvenanceLogUser", "properties": {"user_key": {"type": "string"}, "name": {"type": "string"}, "email": {"type": "string"}}, "required": ["user_key", "name", "email"]}, "timestamp": {"type": "number"}, "collection_name": {"type": "string", "x-nullable": true}, "source": {"type": "object", "title": "DataCatalogProvenanceLogSource", "x-nullable": true, "properties": {"elastic": {}, "mongo_s3": {}, "file": {}, "url": {}, "clone": {}, "ccs": {}}}}}}}, "required": ["name", "description", "dc_key", "proj_key", "created_by", "created_at", "copy_of", "public", "topology", "category_schemas", "collections_data_flows", "provenance_logs"]}, "DataCatalogSchema": {"type": "object", "properties": {"name": {"type": "string"}, "schema": {"type": "string"}}}, "DataCatalogCollection": {"type": "object", "required": ["name", "item_count"], "properties": {"name": {"type": "string"}, "item_count": {"type": "integer"}}}, "CloneDataCatalogResult": {"type": "object", "properties": {"data_catalogue": {"$ref": "#/definitions/DataCatalogue"}, "clone_task": {"$ref": "#/definitions/Task"}}, "required": ["data_catalogue", "clone_task"]}, "ProjectTask": {"type": "object", "properties": {"proj_key": {"type": "string"}, "user_key": {"type": "string"}, "task_type": {"type": "string"}, "task_id": {"type": "string"}, "task_status": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "started_at": {"type": "number", "format": "double", "x-nullable": true}, "completed_at": {"type": "number", "format": "double", "x-nullable": true}, "progress": {"type": "number", "format": "double"}, "meta": {"type": "object"}}}, "BagComponentStatus": {"type": "object", "properties": {"status": {"$ref": "#/definitions/BagComponentStatusEnum"}, "start_time": {"type": "number", "format": "double", "x-nullable": true}}, "required": ["status", "start_time"]}, "BagStatus": {"type": "object", "properties": {"status": {"$ref": "#/definitions/BagComponentStatusEnum"}, "components": {"type": "object", "properties": {"kg": {"description": "Status of the Knowledge Graph and its API", "allOf": [{"$ref": "#/definitions/BagComponentStatus"}]}, "erlenmeyer_api": {"description": "Status of the Erlenmeyer API for this Graph", "allOf": [{"$ref": "#/definitions/BagComponentStatus"}]}, "erlenmeyer_ui": {"description": "Status of the Erlenmeyer UI for this Graph", "allOf": [{"$ref": "#/definitions/BagComponentStatus"}]}}, "required": ["kg", "erlenmeyer_api", "erlenmeyer_ui"]}}, "required": ["status", "components"]}, "BagComponentStatusEnum": {"type": "string", "enum": ["LAUNCHING", "READY", "BUSY", "SUSPENDED", "SUSPENDING", "ERROR", "PROVISIONING", "PROVISIONING_FAILED", "UNKNOWN", "CHECKING", "PENDING_RESOURCES", "IDLE"]}, "DataFlowTemplate": {"type": "object", "properties": {"config": {"type": "object"}, "data-flow": {"type": "array", "items": {"type": "object"}}}, "required": ["config", "data-flow"]}, "DataFlowTemplateListItem": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string"}, "proj_key": {"type": "string"}, "df_tpl_key": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "updated_at": {"type": "number", "format": "double"}, "public": {"type": "boolean"}}}, "DataFlow": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string"}, "variables": {"type": "object", "additionalProperties": {"type": "object"}}, "template": {"type": "object"}, "proj_key": {"type": "string"}, "df_tpl_key": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "updated_at": {"type": "number", "format": "double"}, "public": {"type": "boolean"}}}, "DataFlowTemplateVariable": {"type": "string", "enum": ["string", "boolean", "number", "integer", "DataCatalogId", "DictionaryId", "KnowledgeGraphId", "ModelConfigurationId", "file", "SecretString", "ElasticId", "DataCatalogCollection", "DictionaryCollection", "KnowledgeGraphCollection", "CcsCollection", "DocumentSources"]}, "TakeSnapshotSettings": {"type": "object", "properties": {"flavour": {"type": "string"}, "name": {"type": "string"}, "load_into_kg_after_created": {"type": "boolean", "default": false}}, "required": ["flavour"]}, "KgSnapshot": {"type": "object", "properties": {"timestamp": {"type": "number", "format": "double"}, "data_flow": {"type": "object", "x-nullable": true}, "project_task_id": {"type": "string"}, "task_type": {"type": "string"}, "name": {"type": "string"}, "is_current": {"type": "boolean"}}}, "S3CoordinatesWithBackupKey": {"type": "object", "properties": {"host": {"type": "string"}, "port": {"type": "integer"}, "ssl": {"type": "boolean"}, "verifySSL": {"type": "boolean"}, "access-key": {"type": "string"}, "secret-key": {"type": "string"}, "bucket": {"type": "string"}, "location": {"type": "string"}, "backup_key": {"type": "string"}, "presigned": {"type": "object", "properties": {"url": {"type": "string"}, "fields": {"type": "object", "additionalProperties": {}}}, "required": ["url", "fields"]}}, "required": ["bucket", "backup_key"]}, "MongoCoordinates": {"type": "object", "properties": {"uri": {"type": "string"}, "database": {"type": "string"}}, "required": ["uri", "database"]}, "S3Coordinates": {"type": "object", "description": "If provided, the S3 data will be copied", "properties": {"host": {"type": "string"}, "port": {"type": "integer"}, "ssl": {"type": "boolean"}, "verifySSL": {"type": "boolean"}, "access-key": {"type": "string"}, "secret-key": {"type": "string"}, "bucket": {"type": "string"}, "location": {"type": "string"}, "key_prefix": {"type": "string"}}, "required": ["host", "port", "ssl", "verifySSL", "access-key", "secret-key", "bucket", "location", "key_prefix"]}, "MongoS3Coordinates": {"type": "object", "properties": {"mongo": {"$ref": "#/definitions/MongoCoordinates"}, "s3": {"$ref": "#/definitions/S3Coordinates"}}}, "CollectionListCoordinates": {"type": "object", "properties": {"collections": {"type": "array", "items": {"type": "string"}}}}, "MongoS3CoordinatesWithCollectionList": {"allOf": [{"$ref": "#/definitions/MongoS3Coordinates"}, {"$ref": "#/definitions/CollectionListCoordinates"}]}, "CpsPackage": {"type": "object", "properties": {"name": {"type": "string"}, "package_id": {"type": "string"}, "description": {"type": "string"}, "type": {"type": "string", "enum": ["model", "dictionary", "knowledge_graph", "data_catalog", "data_flow", "bundle"]}, "dependencies": {"type": "array", "items": {"type": "string"}}}, "required": ["name", "package_id", "description", "type", "dependencies"]}, "EntityAnnotation": {"type": "object", "properties": {"match": {"type": "string"}, "range": {"type": "array", "description": "2-Tuple representing the low and high indexes of the matching substring", "items": {"type": "integer"}, "minItems": 2, "maxItems": 2}, "subtype": {"type": "string"}, "type": {"type": "string"}}, "required": ["match", "range", "type"]}, "RelationshipAnnotation": {"type": "object"}, "ObjectPropertyMap": {"type": "object"}, "AnnotatedText": {"type": "object", "required": ["text", "entities", "relationships", "properties"], "properties": {"text": {"type": "string"}, "entities": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/EntityAnnotation"}}}, "relationships": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/RelationshipAnnotation"}}}, "properties": {"$ref": "#/definitions/ObjectPropertyMap"}}}, "AnnotatedTable": {"type": "object", "required": ["entities", "relationships", "properties"], "properties": {"text": {"type": "string"}, "entities": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/EntityAnnotation"}}}, "relationships": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/RelationshipAnnotation"}}}, "properties": {"$ref": "#/definitions/ObjectPropertyMap"}}}, "AnnotatedImage": {"type": "object", "required": ["entities", "relationships", "properties"], "properties": {"text": {"type": "string"}, "entities": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/EntityAnnotation"}}}, "relationships": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/RelationshipAnnotation"}}}, "properties": {"$ref": "#/definitions/ObjectPropertyMap"}}}, "AnnotatedObject": {"type": "object", "minProperties": 1, "maxProperties": 1, "properties": {"text": {"title": "AnnotatedTextLines", "type": "object", "required": ["text", "entities", "relationships", "properties"], "properties": {"text": {"description": "Input text after clean up. The annotation indexes will be based on this text and not the input text.", "type": "string"}, "entities": {"type": "array", "description": "One item per line on the original text.", "items": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/EntityAnnotation"}}}}, "relationships": {"type": "array", "description": "One item per line on the original text.", "items": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/RelationshipAnnotation"}}}}, "properties": {"type": "array", "description": "One item per line on the original text.", "items": {"$ref": "#/definitions/ObjectPropertyMap"}}}}, "table": {"$ref": "#/definitions/AnnotatedTable"}, "image": {"$ref": "#/definitions/AnnotatedImage"}}}, "TopologyNode": {"type": "object", "properties": {"name": {"type": "string"}}, "required": ["name"]}, "TopologyEdge": {"type": "object", "properties": {"name": {"type": "string"}, "source": {"type": "array", "items": {"type": "string"}}, "target": {"type": "array", "items": {"type": "string"}}}, "required": ["name", "source", "target"]}, "Topology": {"type": "object", "properties": {"categories": {"type": "array", "items": {"$ref": "#/definitions/TopologyNode"}}, "edges": {"type": "array", "items": {"$ref": "#/definitions/TopologyEdge"}}}, "required": ["categories", "edges"]}, "DataCatalogTopologyNode": {"properties": {"name": {"type": "string"}, "data-fields": {"type": "array", "items": {"type": "string"}}}, "required": ["name", "data-fields"]}, "DataCatalogTopologyEdge": {"type": "object", "properties": {"name": {"type": "string"}, "source": {"type": "array", "items": {"type": "string"}}, "target": {"type": "array", "items": {"type": "string"}}, "source_field": {"type": "string"}, "target_field": {"type": "string"}}, "required": ["name", "source", "target", "source_field", "target_field"]}, "DataCatalogTopology": {"properties": {"categories": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogTopologyNode"}}, "edges": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogTopologyEdge"}}}, "required": ["categories", "edges"]}, "DataCatalogImportResult": {"type": "object", "required": ["data_catalogue", "import_task"], "properties": {"data_catalogue": {"$ref": "#/definitions/DataCatalogue"}, "import_task": {"$ref": "#/definitions/Task"}}}, "ElasticCoordinates": {"type": "object", "required": ["hosts"], "properties": {"hosts": {"type": "array", "items": {"type": "string"}}, "ca_certificate_base64": {"type": "string"}, "dangerously_disable_ssl_validation": {"type": "boolean"}}}, "ModelConfiguration": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string", "x-nullable": true}, "model_config_key": {"type": "string"}, "proj_key": {"type": "string"}, "created_by": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "public": {"type": "boolean"}, "configurations": {"type": "object", "properties": {"type": {"type": "string"}}, "required": ["type"], "additionalProperties": {}}, "supported_annotations": {"type": "object"}}, "required": ["name", "description", "model_config_key", "proj_key", "created_by", "created_at", "public"]}, "DictionaryCollectionObjectData": {"title": "DictionaryCollectionObjectData", "type": "array", "items": {"title": "DictionaryEntryWithId", "properties": {"_id": {"type": "string"}}, "required": ["_id"], "allOf": [{"$ref": "#/definitions/DictionaryEntry"}]}}, "DictionaryCollectionCsvData": {"title": "DictionaryCollectionCsvData", "type": "object", "properties": {"header": {"type": "string"}, "body": {"type": "string"}}, "required": ["header", "body"]}, "ProjectDefaultValues": {"type": "object", "properties": {"ccs_project": {"type": "object", "required": ["proj_key", "name"], "properties": {"proj_key": {"type": "string"}, "name": {"type": "string"}, "collection_name": {"type": "string"}}}, "dataflow": {"type": "object", "required": ["df_tpl_key", "name"], "properties": {"df_tpl_key": {"type": "string"}, "name": {"type": "string"}}}}}, "ProjectIntegrations": {"x-anyOf": [{"title": "Genai", "x-anyOf": [{"title": "GenAIWatsonx", "description": "GenAI integration for watsonx settings", "type": "object", "properties": {"kind": {"title": "Kind", "default": "watsonx", "const": "watsonx", "type": "string"}, "config": {"title": "GenAIWatsonxConfig", "description": "Config for watsonx", "type": "object", "properties": {"GENAI_API": {"title": "Endpoint", "type": "string"}, "GENAI_PROJECT_ID": {"title": "Project Id", "type": "string"}, "GENAI_KEY": {"title": "Apikey", "type": "string", "writeOnly": true, "format": "password"}}, "required": ["endpoint", "project_id", "apikey"]}}, "required": ["config"]}, {"title": "GenAIBAM", "description": "GenAI integration for BAM settings", "type": "object", "properties": {"kind": {"title": "Kind", "default": "bam", "const": "bam", "type": "string"}, "config": {"title": "GenAIBAMConfig", "description": "Config for BAM", "type": "object", "properties": {"GENAI_API": {"title": "Endpoint", "type": "string"}, "GENAI_KEY": {"title": "Apikey", "type": "string", "writeOnly": true, "format": "password"}}, "required": ["endpoint", "apikey"]}}, "required": ["config"]}, {"title": "GenAIHFInferenceApi", "description": "GenAI integration for Inference API settings", "type": "object", "properties": {"kind": {"title": "Kind", "default": "hf_api", "const": "hf_api", "type": "string"}, "config": {"title": "GenAIHFInferenceApiConfig", "description": "Config for HF Inference API", "type": "object", "properties": {"GENAI_HF_API_KEY": {"title": "Genai Hf Api Key", "type": "string", "writeOnly": true, "format": "password"}}, "required": ["GENAI_HF_API_KEY"]}}, "required": ["config"]}, {"title": "GenAIAWSBedrock", "description": "GenAI integration for AWS Bedrock settings", "type": "object", "properties": {"kind": {"title": "Kind", "default": "aws_bedrock", "const": "aws_bedrock", "type": "string"}, "config": {"title": "GenAIAWSBedrockConfig", "description": "Config for AWS Bedrock", "type": "object", "properties": {"GENAI_AWS_ACCESS_KEY": {"title": "Genai Aws Access Key", "type": "string", "writeOnly": true, "format": "password"}, "GENAI_AWS_SECRET_KEY": {"title": "Genai Aws Secret Key", "type": "string", "writeOnly": true, "format": "password"}, "GENAI_AWS_REGION_NAME": {"title": "Genai Aws Region Name", "type": "string"}}, "required": ["GENAI_AWS_ACCESS_KEY", "GENAI_AWS_SECRET_KEY", "GENAI_AWS_REGION_NAME"]}}, "required": ["config"]}]}]}, "BagBackendAware": {"type": "object", "required": ["proj_key", "bag_key", "name", "description", "slug", "timestamp", "backend", "public"], "properties": {"proj_key": {"type": "string"}, "bag_key": {"type": "string"}, "name": {"type": "string"}, "description": {"type": "string"}, "slug": {"type": "string"}, "timestamp": {"type": "number", "format": "double"}, "backend": {"type": "object", "title": "BagBackends", "properties": {"kg_legacy_api": {"type": "object", "title": "BagKgLegacyApiBackend", "properties": {"bag_domain": {"type": "string"}, "flavour": {"type": "string"}, "bag_url": {"type": "string"}, "token": {"type": "string"}, "_svc_endpoint": {"type": "string"}}}, "kg_amqp": {"type": "object", "title": "BagAmqpBackend", "properties": {"flavour": {"type": "string"}}}}}, "public": {"type": "boolean"}, "last_coords_resolution": {"type": "number"}}}, "TakeSnapshotSettingsBackendAware": {"type": "object", "properties": {"backend_flavours": {"type": "object", "title": "BackendFlavour", "properties": {"kg_amqp": {"type": "string"}, "kg_legacy_api": {"type": "string"}}}, "name": {"type": "string"}, "load_into_kg_after_created": {"type": "boolean", "default": false}}, "required": ["backend_flavours"]}, "BagStatusBackendAware": {"type": "object", "properties": {"overall_status": {"$ref": "#/definitions/BagComponentStatusEnum"}, "kg_amqp": {"type": "object", "properties": {"status": {"$ref": "#/definitions/BagComponentStatusEnum"}}, "required": ["status"]}, "kg_legacy_api": {"$ref": "#/definitions/BagStatus"}}, "required": ["overall_status"]}, "AnnotatorSupportedAnnotationsParameters": {"type": "object", "properties": {"annotator": {"type": "string"}, "annotator_settings": {"type": "object"}}, "required": ["annotator"]}, "ModelSupportedAnnotationsParameters": {"type": "object", "properties": {"model_config_key": {"type": "string"}, "proj_key": {"type": "string"}, "public": {"type": "boolean"}}, "required": ["model_config_key", "proj_key", "public"]}, "ElasticIndexSearchQueryOptions": {"type": "object", "properties": {"_source": {"type": "array", "items": {"type": "string"}}, "from": {"type": "number", "minimum": 0}, "size": {"type": "number", "minimum": 0, "maximum": 10000}, "query": {"type": "object", "additionalProperties": {}}, "aggs": {"type": "object"}, "sort": {"type": "array", "items": {"type": "object"}}}}, "ElasticIndexProperties": {"type": "object"}, "KibanaSavedQueriesResult": {"type": "object", "properties": {"description": {"type": "string"}, "fields": {"type": "array", "items": {"type": "string"}}, "query": {"type": "string"}, "title": {"type": "string"}}}, "AnnotatorParametersOrRef": {"type": "object", "properties": {"type": {"type": "string"}, "model_config_key": {"type": "string"}, "proj_key": {"type": "string"}, "public": {"type": "boolean"}}}, "DataCollection": {"type": "object", "required": ["name", "documents", "health", "status", "metadata"], "properties": {"name": {"type": "string"}, "documents": {"type": "number"}, "health": {"type": "string"}, "status": {"type": "string"}, "metadata": {"type": "object", "required": ["aliases", "created", "description", "source", "version", "type", "domain"], "properties": {"aliases": {"type": "array", "items": {"type": "string"}}, "created": {"type": "string", "format": "datetime"}, "description": {"type": "string"}, "source": {"type": "string"}, "storage": {"type": "string"}, "version": {"type": "string"}, "type": {"type": "string"}, "domain": {"type": "array", "items": {"type": "string"}}}}, "source": {"type": "object", "required": ["index_key"], "properties": {"index_key": {"type": "string"}, "proj_key": {"type": "string"}, "elastic_id": {"type": "string"}}}}}, "Dictionary": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string", "x-nullable": true}, "dict_key": {"type": "string"}, "proj_key": {"type": "string"}, "created_by": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "copy_of": {"type": "string", "x-nullable": true}, "public": {"type": "boolean"}, "collections": {"type": "array", "items": {"$ref": "#/definitions/DictionaryCollection"}}}, "required": ["name", "description", "dict_key", "proj_key", "created_by", "created_at", "copy_of", "public"]}, "DictionaryEntry": {"type": "object", "additionalProperties": {}, "properties": {"_name": {"type": "string"}, "_synonyms": {"type": "array", "items": {"type": "string"}}}, "required": ["_name", "_synonyms"]}, "DictionaryCloneResult": {"type": "object", "properties": {"dictionary": {"$ref": "#/definitions/Dictionary"}, "clone_task": {"$ref": "#/definitions/Task"}}}, "DictionaryCollection": {"type": "object", "required": ["name", "item_count"], "properties": {"name": {"type": "string"}, "item_count": {"type": "integer"}}}, "DictionaryCollectionPatch": {"type": "object", "required": ["op", "path"], "properties": {"op": {"type": "string", "enum": ["add", "replace", "remove"]}, "path": {"type": "string", "description": "A path (see JSON patch specification) in the format `/{objectid}` for existing objects, or `/-` for new objects (`add` operations).", "pattern": "^/(?:-|[a-zA-Z0-9]{24})$"}, "value": {"$ref": "#/definitions/DictionaryEntry"}}}, "CpsModelReference": {"type": "object", "properties": {"model_config_key": {"type": "string"}, "proj_key": {"type": "string"}}, "required": ["model_config_key", "proj_key"]}, "CcsCollectionReference": {"type": "object", "properties": {"proj_key": {"type": "string"}, "collection_name": {"type": "string"}, "language": {"type": "string"}}, "required": ["proj_key", "collection_name"]}, "ProcessingModelDataFlow": {"type": "object", "properties": {"config": {"type": "object"}, "data-flow": {"type": "array", "items": {"type": "object"}}}, "required": ["config", "data-flow"]}, "WorkFlow": {"type": "object"}, "ProcessingModel": {"type": "object", "required": ["dataflow"], "properties": {"dataflow": {"$ref": "#/definitions/ProcessingModelDataFlow"}, "variables": {"type": "object", "additionalProperties": {"type": "object", "title": "DataFlowVariableDefinition", "properties": {"type": {"type": "string"}}, "required": ["type"]}}}}, "CatalogReference": {"type": "object", "properties": {"dc_key": {"type": "string"}, "proj_key": {"type": "string"}, "collection_name": {"type": "string"}}, "required": ["dc_key", "collection_name"]}, "EntityMapping": {"type": "object", "additionalProperties": {"type": "string"}}, "ProcessingModelDescription": {"type": "object", "required": ["name", "display_name", "description"], "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}, "description": {"type": "string"}}}}, "basePath": "/api/cps/public/v1"} +{"swagger": "2.0", "info": {"version": "2.0.0", "title": "Corpus Processing Service (CPS) API"}, "schemes": ["http", "https"], "consumes": ["application/json"], "produces": ["application/json"], "securityDefinitions": {"Bearer": {"description": "For accessing the API a valid JWT token must be passed in all the queries in\nthe 'Authorization' header.\n\nA valid JWT token is generated by the API and returned.\n\nThe following syntax must be used in the 'Authorization' header :\n Bearer xxxxxx.yyyyyyy.zzzzzz\n", "type": "apiKey", "name": "Authorization", "in": "header", "x-apikeyInfoFunc": "oidc_user_mngt.utils.connexion_auth.api_key_info"}, "ManagementKey": {"description": "For accessing the API using a valid management token, it must be passed in all the queries in\nthe 'Authorization' header.\n", "type": "apiKey", "name": "Authorization", "in": "header", "x-apikeyInfoFunc": "api_server.utils.connexion_auth.api_mngt_token_info"}, "KGAuth": {"description": "API endpoints called by the KG application are authenticated by a valid JWT\ntoken which must contain the correct project resources which is needed.\nThe token must be passed in the 'X-CPS-KG-Authorization' header.\n\nA valid JWT token can be obtained by the CPS API or UI.\n\nThe following syntax must be used in the 'Authorization' header :\n KGToken xxxxxx.yyyyyyy.zzzzzz\n", "type": "apiKey", "name": "X-CPS-KG-Authorization", "in": "header", "x-apikeyInfoFunc": "api_server.utils.connexion_auth.kg_auth_info"}}, "paths": {"/project/{proj_key}/packages": {"post": {"tags": ["Project"], "description": "Install packages on a project", "operationId": "provision_project_packages", "x-swagger-router-controller": "api_server.controllers.system_controller", "security": [{"Bearer": []}], "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "schema": {"title": "ProjectPackageInstalationManifest", "type": "object", "required": ["packages"], "properties": {"packages": {"type": "array", "items": {"type": "object", "properties": {"package_id": {"type": "string"}, "overrides": {"type": "object"}}, "required": ["package_id"]}, "uniqueItems": true}}}}], "responses": {"200": {"description": "Task started. It can be found in the tasks endpoint for the project.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Package not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices": {"get": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Get project data indices", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "get_project_data_indices", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Project data indices.", "schema": {"type": "array", "items": {"$ref": "#/definitions/ProjectDataIndexWithStatus"}}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Create a project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "create_project_data_index", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"x-oneOf": [{"$ref": "#/definitions/ProjectDataIndexNonView"}, {"$ref": "#/definitions/ProjectDataIndexView"}]}}], "responses": {"200": {"description": "Project data index.", "schema": {"$ref": "#/definitions/ProjectDataIndexWithStatus"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}": {"get": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Get project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "get_project_data_index", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Project data index.", "schema": {"$ref": "#/definitions/ProjectDataIndexWithStatus"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "patch": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Update a project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "update_project_data_index", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"x-oneOf": [{"$ref": "#/definitions/ProjectDataIndexNonView"}, {"$ref": "#/definitions/ProjectDataIndexView"}]}}], "responses": {"200": {"description": "Updated project data index.", "schema": {"$ref": "#/definitions/ProjectDataIndexWithStatus"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "delete": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Delete a project index data", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "delete_project_data_index", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "confirmation_token", "in": "query", "required": true, "type": "string", "description": "The delete confirmation token"}], "responses": {"200": {"description": "Project data index deleted successfully."}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/delete_token": {"post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Get a token used to confirm the deletion of a project data index.", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "create_project_data_index_delete_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Project data index deletion token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "Data flow template not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/actions/upload": {"post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Upload a file to a project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "upload_project_data_index_file", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "params", "in": "body", "required": true, "schema": {"type": "object", "required": ["file_url"], "properties": {"file_url": {"type": "string"}}}}], "responses": {"200": {"description": "CPS task info", "schema": {"$ref": "#/definitions/CpsTask"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/actions/ccs_convert_upload": {"post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Convert files via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema)", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "ccs_convert_upload_file_project_data_index", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "DataIndexUploadFileSource", "type": "object", "properties": {"file_url": {"description": "List of File's URL to be converted and uploaded to the data index", "type": "array", "items": {"type": "string"}}, "s3_source": {"description": "Coordinates to object store to get files to convert. Can specify which files with object keys.", "type": "object", "properties": {"coordinates": {"description": "Coordinates to object store to get files to convert", "$ref": "#/definitions/ProjectDataIndexS3Coordinates"}, "object_keys": {"description": "List of s3 object keys to retrieve from bucket to be converted and uploaded to the data index", "type": "array", "items": {"type": "string"}}}}, "conversion_settings": {"description": "Specify conversion settings (OCR, Assemble, ML Models) directly", "$ref": "#/definitions/ProjectDataIndexConversionSettings"}, "target_settings": {"description": "Specify the conversion target settings to use.", "type": "object", "properties": {"add_raw_pages": {"title": "add_raw_pages", "type": "boolean"}, "add_annotations": {"type": "boolean", "title": "add_annotations"}}}}}}], "responses": {"200": {"description": "CPS task info", "schema": {"$ref": "#/definitions/CpsTask"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/actions/html_print_convert_upload": {"post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Convert a list of HTML pages to PDF, convert them via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema)", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "html_print_convert_upload", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "DataIndexUploadFileSource", "type": "object", "required": ["urls"], "properties": {"urls": {"description": "List of URLs to be printed to PDF, converted and uploaded to the data index", "type": "array", "items": {"x-oneOf": [{"type": "string"}, {"type": "object", "properties": {"url": {"type": "string"}, "filename": {"type": "string"}, "meta": {"type": "object"}}, "required": ["url"]}]}}, "conversion_settings": {"description": "Specify conversion settings (OCR, Assemble, ML Models) directly", "$ref": "#/definitions/ProjectDataIndexConversionSettings"}}}}], "responses": {"200": {"description": "CPS task info", "schema": {"$ref": "#/definitions/CpsTask"}}, "404": {"description": "Project data index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment_url/{filename}": {"get": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Get url and path to upload an attachment to a project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "get_attachment_upload_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "index_item_id", "in": "path", "type": "string", "required": true}, {"name": "filename", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Attachment upload url and path", "schema": {"title": "AttachmentUploadData", "type": "object", "required": ["attachment_path", "upload_data"], "properties": {"attachment_path": {"type": "string", "description": "Attachment path."}, "upload_data": {"type": "object", "description": "Data to upload the temporary file. Example using requests 'requests(dot)post(url, data=fields, files=file)'. More information can be found on aws s3 documentation here https://docs.aws.amazon.com/AmazonS3/latest/userguide/PresignedUrlUploadObject.html", "properties": {"url": {"type": "string", "description": "url of the host."}, "fields": {"type": "object", "description": "fields to use in request body."}}}}}}, "404": {"description": "Project data index or document ID not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment": {"post": {"tags": ["Data Indices"], "security": [{"Bearer": []}], "description": "Notify upload completion of an attachment to a project data index", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.project_data_indices", "operationId": "register_attachment", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "index_key", "in": "path", "type": "string", "required": true}, {"name": "index_item_id", "in": "path", "type": "string", "required": true}, {"name": "params", "in": "body", "required": true, "schema": {"type": "object", "required": ["attachment_path"], "properties": {"attachment_path": {"type": "string"}, "attachment_key": {"type": "string"}}}}], "responses": {"204": {"description": "Attachment notify successfull"}, "404": {"description": "Project data index or document ID not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/backend/project/{proj_key}/bags": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List all bags in the project, backend-aware", "produces": ["application/json"], "operationId": "backend_list_project_kgs", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "term", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"$ref": "#/definitions/BagBackendAware"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Create new BAG, backend-aware", "produces": ["application/json"], "operationId": "backend_create_project_kg", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"type": "object", "title": "CreateKnowledgeGraphOptions", "properties": {"name": {"type": "string", "pattern": "^(?:\\w| |-)+$", "description": "Name of the BAG", "maxLength": 32}, "flavours": {"type": "array", "description": "Flavours names of the bag. Determines its available resources", "items": {"type": "string"}}, "public": {"type": "boolean", "description": "If true, the BAG will be publicly available"}, "description": {"type": "string", "x-nullable": true, "description": "Description of the BAG"}}, "required": ["name", "flavours", "public"]}}], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/BagBackendAware"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "403": {"description": "Create knowledge graphs is disabled.", "schema": {"$ref": "#/definitions/Problem"}}, "409": {"description": "Cannot create BAG because one already exists with that name.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/backend/project/{proj_key}/bags/{bag_key}": {"patch": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Update the metadata of a Knowledge graph, backend-aware", "produces": ["application/json"], "operationId": "backend_update_project_kg_metadata", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"type": "object", "title": "PatchKnowledgeGraphOptions", "properties": {"name": {"type": "string"}, "public": {"type": "boolean"}, "description": {"type": "string", "x-nullable": true}}, "required": ["name", "description", "public"], "additionalProperties": false}}], "responses": {"200": {"description": "Knowledge graph metadata updated.", "schema": {"$ref": "#/definitions/BagBackendAware"}}, "404": {"description": "Knowledge graph not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/backend/project/{proj_key}/bags/{bag_key}/tasks/assemble_dataflow": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Assemble a data flow on a Knowledge Graph, backend-aware", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "backend_assemble_project_kg_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "AssembleDataFlowIntoKnowledgeGraphOptions", "type": "object", "properties": {"data_flow": {"type": "object", "properties": {"raw_data_flow": {"type": "object", "description": "If this is set, the raw data flow contents will be used.", "properties": {"template": {"description": "Must be valid JSON", "type": "string"}, "variables": {"type": "object"}}, "required": ["template", "variables"]}, "public": {"description": "Must be set if the data flow template is public", "type": "boolean"}, "df_tpl_key": {"description": "If set, the data flow with this key will be used.", "type": "string"}, "proj_key": {"description": "If set, allows for cross-project data flows to be used.", "type": "string"}}}, "snapshot": {"$ref": "#/definitions/TakeSnapshotSettingsBackendAware"}, "render": {"type": "object", "properties": {"variables": {"type": "object", "additionalProperties": {}}}, "required": ["variables"]}}, "required": ["render", "data_flow"]}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/backend/project/{proj_key}/bags/{bag_key}/tasks/assemble_dataflow/latest/snapshots": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Create a snapshot of a Knowledge Graph from the last data flow assembly task, backend-aware", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.controller", "operationId": "backend_create_project_kg_snapshot_from_data_flow_assembly", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"type": "object", "required": ["snapshot"], "properties": {"snapshot": {"$ref": "#/definitions/TakeSnapshotSettingsBackendAware"}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "404": {"description": "KG/BAG/Data Flow Assembly not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/backend/project/{proj_key}/bags/{bag_key}/status": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Get the status of a Knowledge Graph, backend-aware", "produces": ["application/json"], "operationId": "backend_get_project_kg_status", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "details", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Knowledge Graph status.", "schema": {"$ref": "#/definitions/BagStatusBackendAware"}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/public/bags": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List all public BAGs", "produces": ["application/json"], "operationId": "list_public_knowledge_graphs", "parameters": [{"name": "term", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"$ref": "#/definitions/Bag"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags": {"get": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List all bags in the project", "produces": ["application/json"], "operationId": "list_project_knowledge_graphs", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "term", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"$ref": "#/definitions/Bag"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Create new BAG", "produces": ["application/json"], "operationId": "create_project_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"type": "object", "title": "CreateKnowledgeGraphOptions", "properties": {"name": {"type": "string", "pattern": "^(?:\\w| |-)+$", "description": "Name of the BAG", "maxLength": 32}, "flavour": {"type": "string", "description": "\"Flavour\" of the BAG, determines its available resources."}, "public": {"type": "boolean", "description": "If true, the BAG will be publicly available"}, "description": {"type": "string", "x-nullable": true, "description": "Description of the BAG"}}, "required": ["name", "flavour", "public"]}}], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/Bag"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "403": {"description": "Create knowledge graphs is disabled.", "schema": {"$ref": "#/definitions/Problem"}}, "409": {"description": "Cannot create BAG because one already exists with that name.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}": {"delete": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Delete a BAG", "produces": ["application/json"], "operationId": "delete_project_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "confirmation_token", "in": "query", "type": "string", "required": true}], "responses": {"204": {"description": "BAG deleted."}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "patch": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Update the metadata of a Knowledge graph", "produces": ["application/json"], "operationId": "update_project_knowledge_graph_metadata", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "data", "x-body-name": "data", "in": "body", "required": true, "schema": {"type": "object", "title": "PatchKnowledgeGraphOptions", "properties": {"name": {"type": "string"}, "public": {"type": "boolean"}, "description": {"type": "string", "x-nullable": true}}, "required": ["name", "description", "public"], "additionalProperties": false}}], "responses": {"200": {"description": "Knowledge graph metadata updated.", "schema": {"$ref": "#/definitions/Bag"}}, "404": {"description": "Knowledge graph not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/status": {"get": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Get the status of a Knowledge Graph", "produces": ["application/json"], "operationId": "get_project_knowledge_graph_status", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "details", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Knowledge Graph status.", "schema": {"$ref": "#/definitions/BagStatus"}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/usage_stats": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Get the usage stats of a Knowledge Graph", "produces": ["application/json"], "operationId": "get_project_knowledge_graph_usage_stats", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Knowledge Graph usage stats.", "schema": {"title": "UsageStats", "type": "object", "properties": {"proj_key": {"type": "string"}, "bag_key": {"type": "string"}, "last_command": {"type": "string"}}}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/delete_token": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Get a token used to confirm the deletion of a BAG.", "produces": ["application/json"], "operationId": "create_project_knowledge_graph_delete_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "BAG deletion token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/auth_token": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Get a token used to authenticate in the Erlenmeyer / KG APIs of a BAG.", "produces": ["application/json"], "operationId": "create_project_knowledge_graph_authentication_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "BAG auth token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/auth_callback": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Final step of redirection for authentication on a BAG.", "produces": ["application/json"], "operationId": "get_project_knowledge_graph_authentication_callback", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "bag_token", "in": "query", "type": "string", "required": true}], "responses": {"200": {"description": "BAG auth redirect URL.", "schema": {"title": "KnowledgeGraphAuthenticationCallback", "type": "object", "properties": {"callback_url": {"type": "string"}}}}, "401": {"description": "Unauthorized.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/backup": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Back up a Knowledge Graph", "produces": ["application/json"], "operationId": "create_project_knowledge_graph_backup", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "BackupKnowledgeGraphOptions", "type": "object", "properties": {"backup_s3": {"type": "boolean", "default": true}, "coordinates": {"$ref": "#/definitions/S3CoordinatesWithBackupKey"}}}}], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/restore": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Restore a back up of a Knowledge Graph", "produces": ["application/json"], "operationId": "restore_project_knowledge_graph_backup", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "RestoreKnowledgeGraphBackupOptions", "type": "object", "properties": {"coordinates": {"$ref": "#/definitions/S3CoordinatesWithBackupKey"}}}}], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/export": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Download a Knowledge Graph", "produces": ["application/json"], "operationId": "download_project_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/assemble_dataflow": {"get": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List assemble tasks for a Knowledge Graph.", "produces": ["application/json"], "operationId": "list_project_knowledge_graph_assemble_tasks", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "limit", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 50}, {"name": "skip", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 0}], "responses": {"200": {"description": "List of tasks.", "schema": {"type": "array", "items": {"title": "DataFlowAssembleIntoKnowledgeGraphTask", "type": "object", "properties": {"timestamp": {"type": "number", "format": "double"}, "data_flow": {"type": "object", "properties": {"render_options": {"type": "object", "properties": {"variables": {"type": "object"}, "target_bag": {"type": "object"}}}, "template": {"type": "string"}, "variables": {"type": "object"}}}}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Assemble a data flow on a Knowledge Graph", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "assemble_project_knowledge_graph_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "AssembleDataFlowIntoKnowledgeGraphOptions", "type": "object", "properties": {"data_flow": {"type": "object", "properties": {"raw_data_flow": {"type": "object", "description": "If this is set, the raw data flow contents will be used.", "properties": {"template": {"description": "Must be valid JSON", "type": "string"}, "variables": {"type": "object"}}, "required": ["template", "variables"]}, "public": {"description": "Must be set if the data flow template is public", "type": "boolean"}, "df_tpl_key": {"description": "If set, the data flow with this key will be used.", "type": "string"}, "proj_key": {"description": "If set, allows for cross-project data flows to be used.", "type": "string"}}}, "snapshot": {"$ref": "#/definitions/TakeSnapshotSettings"}, "render": {"type": "object", "properties": {"variables": {"type": "object", "additionalProperties": {}}}, "required": ["variables"]}}, "required": ["render", "data_flow"]}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/dataset_assembles/{task_id}/report": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Create a report for a data flow task assemble.", "produces": ["application/json"], "operationId": "create_project_knowledge_graph_assemble_report", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_id", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "DataFlowAssembleReportOptions", "type": "object", "properties": {"max_errors": {"type": "integer", "default": 50, "minimum": 0, "maximum": 100}, "event_log_level": {"type": "string", "default": "error", "enum": ["debug", "info", "warning", "error", "critical"]}}}}], "responses": {"200": {"description": "Report.", "schema": {"title": "DataFlowAssembleReport", "type": "object", "properties": {"task_id": {"type": "string"}, "dataflow_tasks": {"type": "object", "additionalProperties": {"title": "DataFlowAssembleReportSingleTask", "type": "object", "properties": {"status": {"type": "string"}, "progress": {"type": "number"}, "chunks": {"type": "object", "properties": {"total": {"type": "integer"}, "completed": {"type": "integer"}, "spawned": {"type": "integer"}, "success": {"type": "integer"}, "failure": {"type": "integer"}}}, "errors": {"type": "array", "items": {"type": "object", "properties": {"cause": {"type": "object", "properties": {"type": {"type": "string"}, "value": {}}}, "timestamp": {"type": "number"}}}}, "task_type": {"type": "string"}}}}}}}, "404": {"description": "Task not found, or is not a data flow assemble.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/assemble_dataflow/latest/snapshots": {"post": {"deprecated": true, "tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Create a snapshot of a Knowledge Graph from the last data flow assembly task.", "produces": ["application/json"], "x-swagger-router-controller": "api_server.controllers.controller", "operationId": "create_project_knowledge_graph_snapshot_from_data_flow_assembly", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"type": "object", "required": ["snapshot"], "properties": {"snapshot": {"$ref": "#/definitions/TakeSnapshotSettings"}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "404": {"description": "KG/BAG/Data Flow Assembly not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/bags/{bag_key}/snapshots": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List snapshots for a knowledge graph from assembled data flows.", "produces": ["application/json"], "operationId": "list_project_knowledge_graph_snapshots", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Snapshots", "schema": {"type": "array", "items": {"$ref": "#/definitions/KgSnapshot"}}}, "404": {"description": "KG/BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Create a snapshot of a Knowledge Graph, with its current state.", "produces": ["application/json"], "operationId": "create_project_knowledge_graph_snapshot", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "KnowledgeGraphSnapshotOptions", "type": "object", "properties": {"name": {"type": "string", "pattern": "^(?:\\w| |-)+$"}}, "required": ["name"]}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "403": {"description": "Feature is disabled on this instance.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.kg_controller"}}, "/project/{proj_key}/bags/{bag_key}/snapshots/{execution_id}/actions/load": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Load a snapshot resulting from an assembled data flow", "produces": ["application/json"], "operationId": "load_project_knowledge_graph_snapshot", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "execution_id", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Snapshot is being loaded.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "403": {"description": "Feature is disabled on this instance.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG/Snapshot not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/snapshots/{execution_id}": {"delete": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Delete a snapshot resulting from an assembled data flow. The execution log itself is not deleted.", "produces": ["application/json"], "operationId": "delete_project_knowledge_graph_snapshot", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "execution_id", "in": "path", "type": "string", "required": true}], "responses": {"204": {"description": "OK"}, "400": {"description": "Invalid parameters.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "KG/BAG/Snapshot not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/load_dataflow": {"get": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "List load tasks for a Knowledge Graph", "produces": ["application/json"], "operationId": "list_project_knowledge_graph_load_tasks", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "limit", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 50}, {"name": "skip", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 0}], "responses": {"200": {"description": "List of tasks.", "schema": {"type": "array", "items": {"title": "DataFlowLoadIntoKnowledgeGraphTask", "type": "object", "properties": {"timestamp": {"type": "number", "format": "double"}, "data_flow": {"type": "object", "properties": {"render_options": {"type": "object", "properties": {"variables": {"type": "object"}, "target_bag": {"type": "object"}}}, "template": {"type": "string"}, "variables": {"type": "object"}}}, "save": {"type": "object"}}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Load a data flow onto a Knowledge Graph.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "load_project_knowledge_graph_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "LoadDataFlowIntoKnowledgeGraphOptions", "type": "object", "properties": {"data_flow": {"type": "object", "properties": {"raw_data_flow": {"type": "object", "description": "If this is set, the raw data flow contents will be used.", "properties": {"template": {"description": "Must be valid JSON", "type": "string"}, "variables": {"type": "object"}}, "required": ["template", "variables"]}, "public": {"description": "Must be set if the data flow template is public", "type": "boolean"}, "df_tpl_key": {"description": "If set, the data flow with this key will be used.", "type": "string"}, "proj_key": {"description": "If set, allows for cross-project data flows to be used.", "type": "string"}}}, "render": {"type": "object", "properties": {"variables": {"type": "object", "additionalProperties": {}}}, "required": ["variables"]}, "save": {"type": "object"}}, "required": ["save", "render", "data_flow"]}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/suspend": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Suspend a Knowledge Graph", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "suspend_project_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "SuspendKnowledgeGraphOptions", "type": "object", "properties": {"force": {"type": "boolean", "description": "If true, the KG will be suspended even if it's busy"}, "snapshot": {"type": "object", "properties": {"name": {"type": "string"}}}}, "required": ["force"]}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "404": {"description": "Knowledge Graph doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/resume": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Resume a Knowledge Graph", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "resume_project_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"title": "ResumeKnowledgeGraphOptions", "type": "object", "properties": {"snapshot_to_restore_id": {"type": "string"}, "reset": {"type": "boolean"}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/ProjectTask"}}, "403": {"description": "Feature is disabled on this instance.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Knowledge Graph doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/upgrade": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "Upgrade the deployment chart of a Knowledge Graph", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "upgrade_project_knowledge_graph_deployment", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"title": "KnowledgeGraphChartUpgradeOptions", "type": "object", "properties": {"chart": {"type": "string"}}}}], "responses": {"200": {"description": "Chart upgrading."}, "404": {"description": "Knowledge Graph doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/recreate_deployment": {"post": {"tags": ["Knowledge Graphs"], "security": [{"Bearer": []}], "description": "(Re)create the deployment for a Knowledge Graph", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "recreate_project_knowledge_graph_deployment", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"title": "KnowledgeGraphDeploymentRecreationOptions", "type": "object", "properties": {"force": {"type": "boolean"}}, "required": ["force"]}}], "responses": {"200": {"description": "Deployment upgrading."}, "404": {"description": "Knowledge Graph doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "409": {"description": "Refused to recreate the deployment since it already exists and the `force` flag is not `true`.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/bags/{bag_key}/tasks/export_dataset": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}, {"KGAuth": []}], "description": "Export dataset from a Knowledge Graph", "produces": ["application/json"], "operationId": "export_dataset", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "bag_key", "in": "path", "type": "string", "required": true}, {"name": "data", "in": "body", "required": true, "schema": {"type": "object", "required": ["info"], "properties": {"info": {"type": "object", "required": ["coords"], "properties": {"node_list": {"type": "array", "minLength": 1, "example": [{"_db": "db1-hash", "_id": "node-id"}, {"_db": "db2-hash", "_id": "node-id"}], "items": {"type": "object", "properties": {"_db": {"type": "string"}, "_id": {"type": "string"}}, "required": ["_db", "_id"]}}, "collection_key": {"type": "string"}, "include_s3_data": {"type": "boolean", "default": false}, "projection": {"type": "object", "example": {"projection": {}}, "description": "A dict specifying the fields to include or exclude. Use a dict to exclude fields from the result (e.g. projection={'main-text': false})."}, "coords": {"type": "object", "required": ["databases", "node_collection"], "properties": {"databases": {"type": "object", "additionalProperties": true}, "node_collection": {"type": "object", "properties": {"uri": {"type": "string"}, "database": {"type": "string"}, "collection_name_prefix": {"type": "string"}, "collection": {"type": "string"}}, "required": ["uri", "database", "collection_name_prefix", "collection"]}}}}}}}}], "responses": {"200": {"description": "Task", "schema": {"$ref": "#/definitions/ProjectTask"}}, "404": {"description": "Task not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.kg_controller"}}, "/elastic/indices/{index_type}/{index_domain}": {"get": {"tags": ["Elastic"], "security": [{"Bearer": []}], "description": "List of indices for elastic instance.", "produces": ["application/json"], "operationId": "list_indices_from_elastic_instance", "parameters": [{"name": "index_type", "in": "path", "type": "string", "default": "all", "required": true}, {"name": "index_domain", "in": "path", "type": "string", "required": true, "default": "all"}], "responses": {"200": {"description": "List of Elastic Instance Indices", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCollection"}}}, "404": {"description": "Instance indices not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.elastic_controller"}}, "/elastic/{elastic_instance}/{elastic_index}/properties": {"get": {"tags": ["Elastic"], "security": [{"Bearer": []}], "description": "Get the property schema of the given index.", "produces": ["application/json"], "operationId": "get_index_properties", "parameters": [{"name": "elastic_instance", "in": "path", "type": "string", "required": true}, {"name": "elastic_index", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Property schema", "schema": {"$ref": "#/definitions/ElasticIndexProperties"}}, "404": {"description": "Instance index not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.elastic_controller"}}, "/elastic/{elastic_instance}/{elastic_index}/saved_queries": {"get": {"tags": ["Elastic"], "security": [{"Bearer": []}], "description": "List Kibana saved queries.", "produces": ["application/json"], "operationId": "get_kibana_saved_queries", "parameters": [{"name": "elastic_instance", "in": "path", "type": "string", "required": true}, {"name": "elastic_index", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "List of Kibana saved queries", "schema": {"type": "array", "title": "KibanaSavedQueriesResult", "items": {"$ref": "#/definitions/KibanaSavedQueriesResult"}}}, "404": {"description": "Instance indices not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.elastic_controller"}}, "/elastic/domains": {"get": {"tags": ["Elastic"], "security": [{"Bearer": []}], "description": "List system elastic domains.", "produces": ["application/json"], "operationId": "get_elastic_domains", "responses": {"200": {"description": "List of Elastic Domains.", "schema": {"type": "array", "items": {"type": "string"}}}, "404": {"description": "Domains not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.elastic_controller"}}, "/elastic/query_max_size": {"get": {"tags": ["Elastic"], "security": [{"Bearer": []}], "description": "Get the system maximum workable elastic query size.", "produces": ["application/json"], "operationId": "get_elastic_query_max_size", "responses": {"200": {"description": "Maximum elastic query size.", "schema": {"type": "object", "properties": {"elastic_query_max_size": {"type": "number"}}}}, "404": {"description": "No maximum workable elastic query size found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.elastic_controller"}}, "/deployment/info": {"get": {"tags": ["System"], "description": "Get deployment version report", "produces": ["application/json"], "operationId": "get_version_report", "security": [{"ManagementKey": []}], "parameters": [], "responses": {"200": {"description": "OK"}, "401": {"description": "Authentication failed, management api token is invalid or doesn't match", "schema": {"$ref": "#/definitions/Problem"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/system/info": {"get": {"tags": ["System"], "description": "Get system info", "produces": ["application/json"], "operationId": "get_system_information", "parameters": [], "responses": {"201": {"description": "OK", "schema": {"$ref": "#/definitions/SystemInfo"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/system/modules/configuration": {"get": {"tags": ["System"], "description": "Get modules configuration", "produces": ["application/json"], "operationId": "get_system_modules_configuration", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [], "responses": {"201": {"description": "Modules configuration", "schema": {"$ref": "#/definitions/SystemModulesConfiguration"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/modules/tasks": {"get": {"tags": ["System"], "description": "Get modules tasks", "produces": ["application/json"], "operationId": "get_system_modules_tasks", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [], "responses": {"201": {"description": "Modules tasks", "schema": {"$ref": "#/definitions/SystemModulesTasks"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/celery_tasks/status": {"get": {"tags": ["Tasks"], "security": [{"Bearer": []}], "description": "Get the status of Celery tasks.", "produces": ["application/json"], "operationId": "list_system_celery_tasks", "parameters": [{"name": "proj_key", "in": "query", "required": false, "type": "string"}, {"name": "project_task_id", "in": "query", "required": false, "type": "string"}, {"name": "started_since", "required": false, "type": "number", "in": "query", "description": "If set, return the tasks created at or after this timestamp. Otherwise, return the tasks created up to 60 minutes of the system's date, if `project_task_id` is not set."}, {"name": "task_status", "required": false, "type": "number", "format": "double", "in": "query"}, {"name": "limit", "required": false, "type": "integer", "in": "query", "default": 50}], "responses": {"200": {"description": "Celery tasks", "schema": {"type": "array", "items": {"title": "CeleryTask", "type": "object", "required": ["task_id", "project_task_id", "proj_key", "task_type", "created_at", "started_at", "completed_at", "task_status", "worker_name", "meta"], "properties": {"task_id": {"type": "string"}, "task_type": {"type": "string"}, "project_task_id": {"type": "string"}, "project_task_type": {"type": "string", "x-nullable": true}, "meta": {"type": "object", "additionalProperties": {}}, "proj_key": {"type": "string"}, "created_at": {"type": "number"}, "started_at": {"type": "number"}, "completed_at": {"type": "number"}, "task_status": {"type": "string"}, "worker_name": {"type": "string"}, "metrics": {"type": "object"}}}}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/system/celery_tasks/failure": {"get": {"tags": ["Tasks"], "security": [{"Bearer": []}], "description": "Get celery tasks that failed.", "produces": ["application/json"], "operationId": "list_failure_celery_tasks", "parameters": [{"name": "proj_key", "in": "query", "required": true, "type": "string"}, {"name": "task_id", "in": "query", "required": true, "type": "string"}], "responses": {"200": {"description": "Celery tasks", "schema": {"type": "array", "items": {"title": "CeleryTask", "type": "object", "required": ["proj_key", "task_id", "failures"], "properties": {"proj_key": {"type": "string"}, "task_id": {"type": "string"}, "failures": {"type": "array", "items": {"type": "object", "properties": {"worker_name": {"type": "string"}, "task_id": {"type": "string"}, "meta": {"type": "object", "additionalProperties": {}}, "logs": {"type": "object", "additionalProperties": {}}}}}}}}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/system/kgs": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "List all Knowledge Graphs in the system", "produces": ["application/json"], "operationId": "list_system_knowledge_graphs", "parameters": [{"name": "proj_key", "in": "query", "type": "string", "required": false}, {"name": "term", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"title": "KnowledgeGraphSystemInformation", "type": "object", "properties": {"proj_key": {"type": "string"}, "bag_key": {"type": "string"}, "name": {"type": "string"}, "slug": {"type": "string"}, "timestamp": {"type": "number", "format": "double"}, "bag_domain": {"type": "string"}, "bag_url": {"type": "string"}, "public": {"type": "boolean"}, "project_name": {"type": "string"}, "backend": {"type": "object", "additionalProperties": {"type": "object", "properties": {"flavour": {"type": "string"}, "deployment": {"type": "object", "properties": {"name": {"type": "string"}, "chart": {"type": "string"}, "flavour": {"type": "string"}, "resources": {"type": "object", "additionalProperties": {"type": "object", "properties": {"requests": {"type": "object"}, "limits": {"type": "object"}}}}}}}}}}}}}, "default": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.admin_kg_controller"}}, "/system/packages": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get packages available in this CPS installation for installing in a project.", "produces": ["application/json"], "operationId": "list_packages", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [], "responses": {"200": {"description": "Packages available to this CPS installation", "schema": {"type": "array", "items": {"$ref": "#/definitions/CpsPackage"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_all_kgs": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get all kgs (only bag_key) for admin use", "produces": ["application/json"], "operationId": "system_get_all_kgs_admin", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [], "responses": {"200": {"description": "Array with all kgs's key", "schema": {"type": "array", "items": {"type": "string"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_all_dcs": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get all data catalogs (only dc_key) for admin use", "produces": ["application/json"], "operationId": "system_get_all_dcs_admin", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [], "responses": {"200": {"description": "Array with all dcs's key", "schema": {"type": "array", "items": {"type": "string"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/kg_storage_summary/{kg_key}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get kg storage summary", "produces": ["application/json"], "operationId": "system_get_kg_storage_summary_async", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "kg_key", "in": "path", "type": "string", "required": true, "description": "Knowledge graph key"}], "responses": {"200": {"description": "Kg storage summary", "schema": {"$ref": "#/definitions/StorageSummaryTask"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/dc_storage_summary/{dc_key}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get dc storage summary", "produces": ["application/json"], "operationId": "system_get_dc_storage_summary_async", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "dc_key", "in": "path", "type": "string", "required": true, "description": "Data catalog key"}], "responses": {"200": {"description": "DC storage summary", "schema": {"$ref": "#/definitions/StorageSummaryTask"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/summary": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get cps summary data.", "produces": ["application/json"], "operationId": "system_get_cps_summary", "parameters": [], "responses": {"200": {"description": "Cps summary", "schema": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "workersPool": {"type": "string"}, "numNodes": {"type": "integer"}, "availSlots": {"type": "integer"}, "availMemSlots": {"type": "integer"}, "availCpuSlots": {"type": "integer"}, "numberKgs": {"type": "integer"}, "runningKgs": {"type": "integer"}}}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/system/admin/list_all_flavours": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get all KG flavours storage on db", "produces": ["application/json"], "operationId": "list_all_flavours", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [], "responses": {"200": {"description": "Flavours storage on db", "schema": {"type": "array", "items": {"$ref": "#/definitions/BagFlavourFullData"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_flavour/{flavour_name}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get flavour from db", "produces": ["application/json"], "operationId": "get_flavour", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "flavour_name", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Get flavour successful", "schema": {"$ref": "#/definitions/BagFlavourFullData"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/save_flavour": {"put": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Save flavour on db", "produces": ["application/json"], "operationId": "save_flavour", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "new_flavour", "in": "query", "required": true, "type": "boolean"}, {"name": "body", "in": "body", "required": true, "schema": {"$ref": "#/definitions/BagFlavourFullData"}}], "responses": {"200": {"description": "Save flavour successful"}, "409": {"description": "Flavour name already taken"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/delete_flavour/{flavour_name}": {"delete": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Delete flavour from db", "produces": ["application/json"], "operationId": "delete_flavour", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "flavour_name", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Deleted flavour successful"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/list_projects_flavours": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get all projects and their flavours", "produces": ["application/json"], "operationId": "list_projects_flavours", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [], "responses": {"200": {"description": "Flavours storage on db", "schema": {"type": "array", "items": {"$ref": "#/definitions/ProjectsFlavours"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/save_project_flavours": {"put": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Save project flavours assignment on db", "produces": ["application/json"], "operationId": "save_project_flavours", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "body", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ProjectsFlavours"}}], "responses": {"200": {"description": "Save project flavours successful"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_project_flavours/{proj_key}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get project assignment flavours", "produces": ["application/json"], "operationId": "list_flavours_by_project", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Ok", "schema": {"title": "ProjectFlavours", "type": "object", "properties": {"proj_key": {"type": "string"}, "flavours": {"type": "array", "items": {"$ref": "#/definitions/BagFlavourFullData"}}}, "required": ["proj_key", "flavours"]}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_flavours_default_quota": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get flavours default values", "produces": ["application/json"], "operationId": "get_flavours_default_quotas", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [], "responses": {"200": {"description": "Flavours default values", "schema": {"type": "array", "items": {"$ref": "#/definitions/BagFlavourDefaultQuota"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/save_flavours_default_quota": {"put": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Save flavours default quota", "produces": ["application/json"], "operationId": "save_flavours_default_quotas", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "flavours", "in": "body", "required": true, "schema": {"type": "array", "items": {"$ref": "#/definitions/BagFlavourDefaultQuota"}}}], "responses": {"200": {"description": "Save flavours default quotas successful", "schema": {"type": "array", "items": {"$ref": "#/definitions/BagFlavourDefaultQuota"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_projects_flavours_quota": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get projects flavours quotas", "produces": ["application/json"], "operationId": "get_projects_flavours_quota", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [], "responses": {"200": {"description": "Projects flavours quotas", "schema": {"type": "array", "items": {"$ref": "#/definitions/ProjectsFlavoursQuota"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/save_project_flavours_quota": {"put": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Save project flavours quota", "produces": ["application/json"], "operationId": "save_project_flavours_quota", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "projects_flavours_quotas", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ProjectsFlavoursQuota"}}], "responses": {"200": {"description": "Save project flavours quota successful"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_project_flavours_quota/{proj_key}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Get project flavours quota", "produces": ["application/json"], "operationId": "get_project_flavours_quota", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Project flavours quota", "schema": {"type": "array", "items": {"$ref": "#/definitions/FlavoursQuota"}}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/system/admin/get_project_flavour_total_kgs/{proj_key}/{flavour_name}": {"get": {"tags": ["System"], "security": [{"Bearer": []}], "description": "Gets kg total number by proj_key and flavour_key", "produces": ["application/json"], "operationId": "get_project_flavour_total_kgs", "x-swagger-router-controller": "api_server.controllers.system_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "flavour_name", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Project flavours total kg number", "schema": {"title": "ProjectFlavourTotalKgs", "type": "object", "properties": {"proj_key": {"type": "string"}, "flavour_name": {"type": "string"}, "total_kgs": {"type": "integer"}}, "required": ["proj_key", "flavour_name", "total_kgs"]}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/kgc/dataflows/actions/validate": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Validate a dataflow", "produces": ["application/json"], "operationId": "validate_project_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dataflow", "x-body-name": "dataflow", "in": "body", "required": true, "schema": {"$ref": "#/definitions/KgcDataInput"}}], "responses": {"200": {"description": "Validation successful."}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflows/actions/run": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Run a dataflow", "produces": ["application/json"], "operationId": "assemble_project_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dataflow", "x-body-name": "dataflow", "in": "body", "required": true, "schema": {"$ref": "#/definitions/KgcDataInput"}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflows/actions/load": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Load a dataflow into a KG", "produces": ["application/json"], "operationId": "load_project_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"$ref": "#/definitions/LoadKgcDataInput"}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/public/kgc/dataflow_templates": {"get": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "List public data flow templates", "produces": ["application/json"], "operationId": "list_public_data_flow_templates", "parameters": [{"name": "query", "in": "query", "required": false, "type": "string"}], "responses": {"200": {"description": "List of data flow templates.", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataFlowTemplateListItem"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates": {"get": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "List a data flow templates", "produces": ["application/json"], "operationId": "list_project_data_flow_templates", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "query", "in": "query", "required": false, "type": "string"}], "responses": {"200": {"description": "List of data flow templates.", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataFlowTemplateListItem"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Create a data flow template", "produces": ["application/json"], "operationId": "create_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "CreateDataFlowTemplateOptions", "type": "object", "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "pattern": "^(?:\\w| |-)+$", "maxLength": 50, "minLength": 1}, "description": {"type": "string", "x-nullable": true}, "variables": {"type": "object", "additionalProperties": {"type": "object", "required": ["type"], "properties": {"type": {"$ref": "#/definitions/DataFlowTemplateVariable"}, "default_value": {}}}}, "template": {"$ref": "#/definitions/DataFlowTemplate"}}, "required": ["public", "name", "variables", "template", "description"]}}], "responses": {"200": {"description": "Dataflow created.", "schema": {"$ref": "#/definitions/DataFlow"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/from_json": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Create a data flow template from a JSON file.\n**DEPRECATED**: use `create_project_data_flow_template`\n", "deprecated": true, "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "name", "in": "formData", "required": false, "type": "string"}, {"name": "description", "in": "formData", "required": false, "type": "string"}, {"name": "public", "in": "formData", "type": "boolean", "required": false}, {"name": "contents", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "Dataflow created.", "schema": {"$ref": "#/definitions/DataFlow"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/public/kgc/dataflow_templates/{df_tpl_key}": {"get": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Get a single data flow template", "produces": ["application/json"], "operationId": "get_public_data_flow_template", "parameters": [{"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Data flow.", "schema": {"$ref": "#/definitions/DataFlow"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/public/kgc/dataflow_templates/{df_tpl_key}/export.json": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Export a single public data flow template", "produces": ["application/vnd.ibm.cps.df-template+json"], "operationId": "export_public_data_flow_template", "parameters": [{"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Data flow template.", "schema": {"type": "file"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}": {"get": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Get a single data flow template", "produces": ["application/json"], "operationId": "get_project_data_flow", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Data flow template.", "schema": {"$ref": "#/definitions/DataFlow"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "put": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Update a data flow template", "produces": ["application/json"], "operationId": "update_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "UpdateDataFlowOptions", "type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string"}, "variables": {"type": "object", "additionalProperties": {"type": "object", "required": ["type"], "properties": {"type": {"$ref": "#/definitions/DataFlowTemplateVariable"}, "default_value": {}}}}, "template": {"$ref": "#/definitions/DataFlowTemplate"}, "public": {"type": "boolean"}}, "required": ["public", "name", "variables", "template"]}}], "responses": {"200": {"description": "Dataflow updated.", "schema": {"$ref": "#/definitions/DataFlow"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "delete": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Delete a single data flow template", "produces": ["application/json"], "operationId": "delete_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "confirmation_token", "in": "query", "type": "string", "required": true}], "responses": {"204": {"description": "Data flow deleted."}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/delete_token": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Get a token used to confirm the deletion of a data flow template.", "produces": ["application/json"], "operationId": "create_project_data_flow_template_delete_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data flow deletion token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "Data flow template not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/export.json": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Export a single data flow template", "produces": ["application/vnd.ibm.cps.df-template+json"], "operationId": "export_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Data flow template.", "schema": {"type": "file"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/topology": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Render a single data flow template, replacing the variable placeholders by their actual values and get the resulting Knowledge Graph topology from it.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "get_project_data_flow_template_topology", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "DataFlowTopologyOptions", "type": "object", "properties": {"variables": {"type": "object", "additionalProperties": {}}}}}], "responses": {"200": {"description": "Data flow topology.", "schema": {"$ref": "#/definitions/Topology"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/actions/render": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Render a single data flow template, replacing the variable placeholders by their actual values.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "render_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "RenderDataFlowTemplateOptions", "type": "object", "properties": {"target_bag": {"type": "object", "properties": {"bag_key": {"type": "string"}, "proj_key": {"type": "string", "description": "If set, this will override the 'proj_key' parameter in the path, allowing cross-project KGs to be used."}}, "required": ["bag_key"]}, "variables": {"type": "object", "additionalProperties": {}}}, "required": ["target_bag", "variables"]}}], "responses": {"200": {"description": "Rendered data flow", "schema": {"type": "object"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/actions/run": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Render a single data flow template, replacing the variable placeholders by their actual values and run it.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "assemble_project_data_flow_template_into_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "RunDataFlowTemplateOptions", "type": "object", "properties": {"target_bag_key": {"type": "string"}, "variables": {"type": "object", "additionalProperties": {}}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/raw_dataflow_templates/actions/run": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Render a single data flow template, replacing the variable placeholders by their actual values and run it.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "assemble_project_raw_data_flow_template_into_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "RunDataFlowTemplateOptions", "type": "object", "required": ["data_flow", "variable_values", "log_task"], "properties": {"log_task": {"type": "boolean", "default": true}, "data_flow": {"type": "object", "properties": {"template": {"type": "object", "properties": {"config": {"type": "object"}, "data-flow": {"type": "array", "items": {"type": "object"}}}, "required": ["config", "data-flow"]}, "variables": {"type": "object", "additionalProperties": {}}}, "required": ["template", "variables"]}, "variable_values": {"type": "object", "additionalProperties": {}}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc/dataflow_templates/{df_tpl_key}/actions/load": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "Render a single data flow template, replacing the variable placeholders by their actual values and load it into a Knowledge Graph.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "load_project_data_flow_template_into_knowledge_graph", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "LoadDataFlowIntoKnowledgeGraphOptions", "type": "object", "properties": {"render": {"type": "object", "properties": {"target_bag": {"type": "object", "properties": {"bag_key": {"type": "string"}, "proj_key": {"type": "string", "description": "If set, this will override the 'proj_key' parameter in the path, allowing cross-project KGs to be used."}}, "required": ["bag_key"]}, "variables": {"type": "object", "additionalProperties": {}}}, "required": ["target_bag", "variables"]}, "target": {"type": "object", "properties": {"save": {"type": "object"}}, "required": ["save"]}}}}], "responses": {"200": {"description": "Task started.", "schema": {"$ref": "#/definitions/Task"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/kgc_dataflow_templates/debug/{df_tpl_key}": {"post": {"tags": ["Data Flows"], "security": [{"Bearer": []}], "description": "(Debug) get the fully rendered data flow, with all the coordinates set.", "produces": ["application/json"], "consumes": ["application/json"], "operationId": "debug_project_data_flow_template", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "df_tpl_key", "in": "path", "required": true, "type": "string"}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "FullyRenderedDataFlow", "type": "object", "properties": {"target_bag": {"type": "object", "required": ["bag_key"], "properties": {"bag_key": {"type": "string"}, "proj_key": {"type": "string"}}}, "variables": {"type": "object", "additionalProperties": {}}}}}], "responses": {"200": {"description": "Rendered data flow.", "schema": {"type": "object"}}, "400": {"description": "Invalid dataflow.", "schema": {"$ref": "#/definitions/Problem"}}, "404": {"description": "Data flow template doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/data_cataloges/known_schemas": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "List System Known Data Catalog Schemas.", "produces": ["application/json"], "operationId": "list_known_data_catalog_schemas", "parameters": [], "responses": {"200": {"description": "List of Known Data Catalog Schemas.", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogSchema"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/data_catalogues/with_schema": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "List data catalogues with specific schema", "produces": ["application/json"], "operationId": "list_data_catalogs_and_collections_from_schema", "parameters": [{"name": "proj_key", "in": "query", "type": "string", "required": false}, {"name": "schema", "x-body-name": "schema", "in": "body", "required": true, "schema": {"type": "object", "additionalProperties": {}}}], "responses": {"200": {"description": "List of data catalogues", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogue"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}/data": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get Data Catalog Collection data.", "produces": ["application/json"], "operationId": "get_data_catalog_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "after", "in": "query", "type": "string", "required": false}, {"name": "limit", "in": "query", "type": "integer", "minimum": 0, "default": 50, "required": false}], "responses": {"200": {"description": "Get Data Catalog Collection data."}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/from_mongo": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Create a data catalogue from a mongo database", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "import_project_data_catalog_from_mongo", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "DataCatalogImportOptions", "type": "object", "properties": {"target": {"type": "object", "required": ["name", "description", "public"], "properties": {"public": {"type": "boolean"}, "name": {"type": "string"}, "description": {"type": "string", "x-nullable": true}}}, "options": {"type": "object", "required": ["coordinates"], "properties": {"coordinates": {"$ref": "#/definitions/MongoS3CoordinatesWithCollectionList"}}}}, "required": ["target", "options"]}}], "responses": {"200": {"description": "Data catalogue created, and data is being imported.", "schema": {"$ref": "#/definitions/DataCatalogImportResult"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/from_url": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Create a data catalogue from a URL to a file", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "import_project_data_catalog_from_url", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "DataCatalogUrlImportOptions", "type": "object", "properties": {"target": {"type": "object", "required": ["name", "description", "public"], "properties": {"public": {"type": "boolean"}, "name": {"type": "string"}, "description": {"type": "string", "x-nullable": true}}}, "options": {"type": "object", "required": ["url"], "properties": {"url": {"type": "string"}}}}, "required": ["target", "options"]}}], "responses": {"200": {"description": "Data catalogue created, and data is being imported.", "schema": {"$ref": "#/definitions/DataCatalogImportResult"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/actions/clone": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Clone an existing data catalogue", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "clone_project_data_catalog", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "CloneDataCatalogOptions", "type": "object", "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "x-nullable": true, "pattern": "^(?:\\w| |-)+$"}, "description": {"type": "string", "x-nullable": true}, "copy_s3": {"type": "boolean", "description": "Should the catalog's S3 data also be copied?", "default": true}, "collections": {"type": "array", "items": {"type": "string"}}}, "required": ["name", "description", "public"]}}], "responses": {"200": {"description": "Data catalogue cloned, and data is being copied.", "schema": {"$ref": "#/definitions/CloneDataCatalogResult"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "List data catalogues for a project", "produces": ["application/json"], "operationId": "list_project_data_catalogs", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "query", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "List of data catalogues", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogue"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}, "post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Create an empty data catalog", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "create_project_data_catalog", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"type": "object", "title": "CreateDataCatalogOptions", "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "pattern": "^(?:\\w| |-)+$"}, "description": {"type": "string", "x-nullable": true}, "topology:data_flows": {"type": "array", "items": {"type": "object", "title": "DataCatalogDataFlow", "required": ["key", "data_flows"], "properties": {"key": {"type": "string"}, "data_flows": {"type": "object", "additionalProperties": {}}}, "$ref": "#/definitions/DataCatalogTopology"}}, "category_schemas": {"type": "array", "items": {"type": "object", "title": "DataCatalogCategorySchema", "required": ["key", "schema"], "properties": {"key": {"type": "string"}, "schema": {"type": "object", "additionalProperties": {}}}}}, "collections_data_flows": {"type": "array", "items": {"type": "object", "title": "DataCatalogDataFlow", "required": ["key", "data_flows"], "properties": {"key": {"type": "string"}, "data_flows": {"type": "array", "items": {"type": "object"}}}}}}, "required": ["name", "description", "public"]}}], "responses": {"200": {"description": "Data catalog created.", "schema": {"$ref": "#/definitions/DataCatalogue"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/public/data_catalogues/{dc_key}": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get a single data catalogue that was made public", "produces": ["application/json"], "operationId": "get_public_data_catalog", "parameters": [{"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Data catalogue", "schema": {"$ref": "#/definitions/DataCatalogue"}}, "404": {"description": "Data catalogue not found or is not public", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/public/data_catalogues/{dc_key}/collections": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get the collections of a data catalog.", "produces": ["application/json"], "operationId": "list_public_data_catalog_collections", "parameters": [{"name": "dc_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data catalog collections", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogCollection"}}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}": {"delete": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Delete a single data catalog's collection", "produces": ["application/json"], "operationId": "delete_project_data_catalog_collection", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}], "responses": {"204": {"description": "Collection deleted."}, "404": {"description": "Collection doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}/actions/infer_schema": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Infer the schema for a data catalog's collection.", "produces": ["application/json"], "operationId": "infer_project_data_catalog_category_schema", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "InferProjectDataCatalogCategorySchema", "type": "object", "properties": {"sample_size": {"type": "integer", "minimum": 1, "maximum": 1000}}}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}/actions/upload": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Upload data to a data catalog collection. The collection will be created if it doesn't exist.", "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_data_catalog_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "file", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}/actions/import": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Import data to a data catalog collection. The collection will be created if it doesn't exist.", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "import_project_data_catalog_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"type": "object", "title": "ImportToDataCatalogCollectionOptions", "minProperties": 1, "maxProperties": 1, "properties": {"ccs": {"type": "object", "properties": {"proj_key": {"type": "string"}, "auth_token": {"type": "string"}, "url": {"type": "string"}, "source_collection_name": {"type": "string"}, "export_package_mongo_options": {"type": "object", "required": ["assemble_options", "incremental", "package_options"], "properties": {"incremental": {"type": "boolean"}, "assemble_options": {"type": "object", "required": ["mode", "options"], "properties": {"mode": {"required": ["page_elements", "tables"], "properties": {"page_elements": {"description": "Which type of annotations to filter for the page elements: H (human annotations), M (model generated)", "items": {"enum": ["H", "M"], "type": "string"}, "type": "array", "minItems": 2, "maxItems": 2}, "tables": {"description": "Which type of annotations to filter for the tables: H (human annotations), M (model generated)", "items": {"enum": ["H", "M"], "type": "string"}, "type": "array", "minItems": 2, "maxItems": 2}}, "type": "object"}, "options": {"required": ["include_incomplete_documents"], "properties": {"include_incomplete_documents": {"type": "boolean", "description": "Include documents with missing pages? (e.g. no annotations for some pages)"}}, "type": "object"}}}, "inputs": {"type": "object", "required": ["document_hashes"], "properties": {"document_hashes": {"type": "array", "default": [], "items": {"type": "string"}}}}, "package_options": {"type": "object", "properties": {"match_mode": {"type": "string", "default": "document_hash", "enum": ["use_fuzzy_search", "document_hash"]}, "redirect_keys_to_s3": {"type": "array", "default": [], "items": {"type": "string"}}}}}}}, "required": ["proj_key"]}, "url": {"type": "string"}, "elastic": {"title": "ImportFromElasticToDataCatalogOptions", "type": "object", "required": ["parameters"], "properties": {"coordinates": {"$ref": "#/definitions/ElasticCoordinates"}, "elastic_id": {"type": "string"}, "parameters": {"type": "object", "required": ["index", "query_options"], "properties": {"index": {"type": "string"}, "query_options": {"type": "object", "properties": {"_source": {"type": "array", "items": {"type": "string"}}, "size": {"type": "number", "minimum": 0}, "query": {"type": "object", "additionalProperties": {}}}}, "import_s3_data": {"type": "boolean"}, "s3": {"title": "ImportFromElasticToDataCatalogS3Coords", "type": "object", "properties": {"host": {"type": "string"}, "port": {"type": "integer"}, "ssl": {"type": "boolean"}, "verifySSL": {"type": "boolean"}, "access-key": {"type": "string"}, "secret-key": {"type": "string"}, "bucket": {"type": "string"}, "key_prefix": {"type": "string"}, "location": {"type": "string"}}, "required": ["host", "port", "ssl", "verifySSL", "access-key", "secret-key", "bucket", "key_prefix", "location"]}, "page_size": {"type": "number", "default": 100}}}}}}}}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections/{collection_name}/actions/export": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Export the contents of a data catalog's collection", "produces": ["application/zip", "application/json", "application/x-jsonlines"], "operationId": "export_project_data_catalog_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data catalog collection contents.", "schema": {"type": "file"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/actions/upload": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Upload data to a data catalog. The collection name(s) will be inferred from the file name(s).", "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_data_catalog_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "file", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/actions/import": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Import data to a data catalog. The collections will be created if they don't exist.", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "import_project_data_catalog_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"type": "object", "title": "ImportToDataCatalogOptions", "minProperties": 1, "maxProperties": 1, "properties": {"url": {"type": "string"}, "coordinates": {"$ref": "#/definitions/MongoS3CoordinatesWithCollectionList"}}}}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/actions/export": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Export the contents of a data catalog.", "produces": ["application/zip"], "operationId": "export_project_data_catalog_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data catalog contents.", "schema": {"type": "file"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/delete_token": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get a token used to confirm the deletion of a data catalog.", "produces": ["application/json"], "operationId": "create_project_data_catalog_delete_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data catalog deletion token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "Data flow template not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/public/data_catalogues": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "List public data catalogues", "produces": ["application/json"], "operationId": "list_public_data_catalogs", "parameters": [{"name": "query", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "List of public data catalogues", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogue"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/public/data_catalogues/{dc_key}/actions/clone": {"post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Clone an existing public data catalogue", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "clone_public_data_catalog", "parameters": [{"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "ClonePublicDataCatalogOptions", "type": "object", "properties": {"proj_key": {"description": "The project key of the project to store the resulting data catalogue", "type": "string"}, "public": {"type": "boolean"}, "name": {"type": "string", "x-nullable": true, "pattern": "^(?:\\w| |-)+$"}, "description": {"type": "string", "x-nullable": true}, "collections": {"type": "array", "items": {"type": "string"}}, "copy_s3": {"type": "boolean", "description": "Should the catalog's S3 data also be copied?", "default": true}}, "required": ["name", "description", "public", "proj_key"]}}], "responses": {"200": {"description": "Data catalogue cloned, and data is being copied.", "schema": {"$ref": "#/definitions/CloneDataCatalogResult"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get a single data catalogue", "produces": ["application/json"], "operationId": "get_project_data_catalog", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Data catalogue", "schema": {"$ref": "#/definitions/DataCatalogue"}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}, "delete": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Delete a single data catalog", "produces": ["application/json"], "operationId": "delete_project_data_catalog", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "required": true, "type": "string"}, {"name": "confirmation_token", "in": "query", "type": "string", "required": true}], "responses": {"204": {"description": "Data catalog deleted."}, "404": {"description": "Data catalog doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}, "patch": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Update the metadata of a data catalog.", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "patch_project_data_catalog", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"type": "object", "title": "PatchDataCatalogOptions", "properties": {"name": {"type": "string"}, "public": {"type": "boolean"}, "description": {"type": "string", "x-nullable": true}, "topology": {"$ref": "#/definitions/DataCatalogTopology"}, "category_schemas": {"type": "array", "items": {"type": "object", "title": "DataCatalogCategorySchema", "required": ["key", "schema"], "properties": {"key": {"type": "string"}, "schema": {"type": "object", "additionalProperties": {}}}}}, "collections_data_flows": {"type": "array", "items": {"type": "object", "title": "DataCatalogDataFlow", "required": ["key", "data_flows"], "properties": {"key": {"type": "string"}, "data_flows": {"type": "array", "items": {"type": "object"}}}}}}, "additionalProperties": false}}], "responses": {"200": {"description": "Data catalog updated.", "schema": {"$ref": "#/definitions/DataCatalogue"}}, "404": {"description": "Data catalog not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/data_catalogues/{dc_key}/collections": {"get": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Get the collections of a data catalog.", "produces": ["application/json"], "operationId": "list_project_data_catalog_collections", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Data catalog collections", "schema": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogCollection"}}}, "404": {"description": "Data catalogue not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}, "post": {"tags": ["Data Catalogs"], "security": [{"Bearer": []}], "description": "Create a collection in a data catalog", "produces": ["application/json"], "operationId": "create_project_data_catalog_collection", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dc_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"type": "object", "title": "CreateDataCatalogCollectionOptions", "properties": {"collection_name": {"type": "string", "pattern": "^(?:\\w|-)+$", "maxLength": 24, "minLength": 4}}, "required": ["collection_name"]}}], "responses": {"200": {"description": "Collection created."}, "404": {"description": "Dictionary doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.catalogs_controller"}}, "/project/{proj_key}/tasks": {"get": {"tags": ["Tasks"], "security": [{"Bearer": []}], "description": "List tasks for a project.", "produces": ["application/json"], "operationId": "list_project_tasks", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_type", "in": "query", "required": false, "type": "string"}, {"name": "limit", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 50}, {"name": "skip", "in": "query", "required": false, "type": "integer", "minimum": 0, "default": 0}, {"name": "sort_by", "in": "query", "required": false, "type": "string"}, {"name": "sort_order", "in": "query", "required": false, "type": "string", "default": "asc", "enum": ["asc", "desc"]}], "responses": {"200": {"description": "List of tasks.", "schema": {"type": "array", "items": {"$ref": "#/definitions/ProjectTask"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/tasks/{task_id}": {"get": {"tags": ["Tasks"], "security": [{"Bearer": []}, {"KGAuth": []}], "description": "Get a task for a project.", "produces": ["application/json"], "operationId": "get_project_task", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_id", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Task", "schema": {"$ref": "#/definitions/ProjectTask"}}, "404": {"description": "Task not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/tasks/{task_id}/actions/abort": {"post": {"tags": ["Tasks"], "security": [{"Bearer": []}], "description": "Abort a task.", "produces": ["application/json"], "operationId": "abort_project_task", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_id", "in": "path", "required": true, "type": "string"}], "responses": {"204": {"description": "Task aborted."}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/celery_tasks/{task_id}": {"get": {"tags": ["Tasks"], "security": [{"Bearer": []}], "description": "Get a celery task for a project.", "produces": ["application/json"], "operationId": "get_project_celery_task", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_id", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "Task", "schema": {"type": "object", "title": "CeleryTaskPromise", "required": ["task_id", "task_status", "result"], "properties": {"task_id": {"type": "string"}, "task_status": {"type": "string"}, "result": {"x-nullable": true}}}}, "404": {"description": "Task not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/annotator/metadata": {"post": {"tags": ["Annotate"], "security": [{"Bearer": []}], "description": "Get annotator's metadata", "produces": ["application/json", "text/html"], "operationId": "get_cached_annotator_metadata", "x-swagger-router-controller": "api_server.controllers.annotate", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "in": "body", "schema": {"x-oneOf": [{"$ref": "#/definitions/AnnotatorSupportedAnnotationsParameters"}, {"$ref": "#/definitions/ModelSupportedAnnotationsParameters"}]}, "required": true}], "responses": {"200": {"description": "OK", "schema": {"title": "AnnotatorMetadata", "type": "object", "required": ["name", "version", "url", "author", "description"], "properties": {"name": {"type": "string"}, "version": {"type": "string"}, "url": {"type": "string"}, "author": {"type": "string"}, "description": {"type": "string"}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/annotate/supported_annotations": {"post": {"tags": ["Annotate"], "security": [{"Bearer": []}], "description": "Get supported annotations for an annotator", "produces": ["application/json", "text/html"], "operationId": "get_project_annotator_supported_annotations", "x-swagger-router-controller": "api_server.controllers.annotate", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "in": "body", "schema": {"x-oneOf": [{"$ref": "#/definitions/AnnotatorSupportedAnnotationsParameters"}, {"$ref": "#/definitions/ModelSupportedAnnotationsParameters"}]}, "required": true}], "responses": {"200": {"description": "OK", "schema": {"title": "SupportedAnnotatorAnnotations", "type": "object", "required": ["entities", "relationships"], "properties": {"entities": {"type": "array", "items": {"title": "EntityAnnotationDescriptor", "type": "object", "properties": {"key": {"type": "string"}, "description": {"type": "string"}, "data_fields": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}}, "required": ["key", "description"]}}, "relationships": {"type": "array", "items": {"title": "RelationshipAnnotationDescriptor", "type": "object", "properties": {"key": {"type": "string"}, "description": {"type": "string"}, "columns": {"type": "array", "items": {"type": "object", "title": "RelationshipAnnotationColumn", "properties": {"key": {"type": "string"}, "entities": {"type": "array", "items": {"type": "string"}}}, "required": ["key", "entities"]}}}, "required": ["key", "description", "columns"]}}, "supported_object_types": {"type": "array", "items": {"type": "string"}}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/object_annotations": {"post": {"tags": ["Annotate"], "security": [{"Bearer": []}], "description": "Run an annotator on an object, using resources from the project.\n*DEPRECATED*, please use generate_project_object_annotations_async instead.\n", "deprecated": true, "produces": ["application/json"], "operationId": "generate_project_object_annotations", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "AnnotateObjectOptions", "type": "object", "required": ["parameters", "input"], "properties": {"input": {"title": "AnnotatorInput", "type": "object", "minProperties": 1, "maxProperties": 1, "properties": {"text": {"type": "string", "maxLength": 4500}, "table": {"type": "array", "description": "A table, specified as an array of arrays. Each outer array represents a row, and each item in the inner array represents the column.", "items": {"type": "array", "items": {"title": "AnnotateTableCell", "type": "object", "required": ["bbox", "spans", "text", "type"], "properties": {"bbox": {"type": "array", "items": {"type": "number", "format": "double"}, "minItems": 4, "maxItems": 4}, "spans": {"type": "array", "description": "2-tuple representing the row:column where this cell spans to.", "items": {"type": "array", "items": {"type": "number", "format": "integer"}, "minItems": 2, "maxItems": 2}}, "text": {"type": "string"}, "type": {"title": "AnnotateTableCellType", "type": "string", "enum": ["col_header", "row_header", "body"]}}}}}, "image": {"title": "AnnotatorImageInput", "type": "object", "required": ["source"], "properties": {"source": {"title": "ImageSource", "type": "object", "minProperties": 1, "properties": {"scratch_id": {"type": "string"}, "proj_key": {"type": "string"}, "url": {"type": "string"}}}, "metadata": {"title": "ImageMetadata", "type": "object", "required": ["cells"], "properties": {"cells": {"title": "ImageCells", "type": "object", "required": ["data"], "properties": {"data": {"type": "array", "description": "A 6-tuple consisting of x1, y1, x2, y2, font, coordinates", "items": [{"type": "number"}, {"type": "number"}, {"type": "number"}, {"type": "number"}, {"type": "string"}, {"type": "string"}]}}}, "info": {"title": "ImageInfo", "type": "object", "required": ["width", "height"], "properties": {"width": {"type": "number"}, "height": {"type": "number"}}}}}}}}}, "parameters": {"title": "AnnotatorParameters", "type": "object", "properties": {"type": {"type": "string"}}, "additionalProperties": {}, "required": ["type"]}}}}], "responses": {"200": {"description": "OK", "schema": {"title": "AnnotatedObject", "type": "object", "minProperties": 1, "maxProperties": 1, "properties": {"text": {"title": "AnnotatedTextLines", "type": "object", "required": ["text", "entities", "relationships", "properties"], "properties": {"text": {"description": "Input text after clean up. The annotation indexes will be based on this text and not the input text.", "type": "string"}, "entities": {"type": "array", "description": "One item per line on the original text.", "items": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/EntityAnnotation"}}}}, "relationships": {"type": "array", "description": "One item per line on the original text.", "items": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/RelationshipAnnotation"}}}}, "properties": {"type": "array", "description": "One item per line on the original text.", "items": {"$ref": "#/definitions/ObjectPropertyMap"}}}}, "table": {"$ref": "#/definitions/AnnotatedTable"}, "image": {"$ref": "#/definitions/AnnotatedImage"}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.annotate"}}, "/project/{proj_key}/object_annotations_async": {"post": {"tags": ["Annotate"], "security": [{"Bearer": []}], "description": "Run an annotator on an object, using resources from the project.", "produces": ["application/json"], "operationId": "generate_project_object_annotations_async", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"title": "AnnotateObjectOptions", "type": "object", "required": ["parameters", "input"], "properties": {"input": {"title": "AnnotatorInput", "type": "object", "minProperties": 1, "maxProperties": 1, "properties": {"text": {"type": "string", "maxLength": 4500}, "table": {"type": "array", "description": "A table, specified as an array of arrays. Each outer array represents a row, and each item in the inner array represents the column.", "items": {"type": "array", "items": {"title": "AnnotateTableCell", "type": "object", "required": ["bbox", "spans", "text", "type"], "properties": {"bbox": {"type": "array", "items": {"type": "number", "format": "double"}, "minItems": 4, "maxItems": 4}, "spans": {"type": "array", "description": "2-tuple representing the row:column where this cell spans to.", "items": {"type": "array", "items": {"type": "number", "format": "integer"}, "minItems": 2, "maxItems": 2}}, "text": {"type": "string"}, "type": {"title": "AnnotateTableCellType", "type": "string", "enum": ["col_header", "row_header", "body"]}}}}}, "image": {"title": "AnnotatorImageInput", "type": "object", "required": ["source"], "properties": {"source": {"title": "ImageSource", "type": "object", "minProperties": 1, "properties": {"scratch_id": {"type": "string"}, "proj_key": {"type": "string"}, "url": {"type": "string"}}}, "metadata": {"title": "ImageMetadata", "type": "object", "required": ["cells"], "properties": {"cells": {"title": "ImageCells", "type": "object", "required": ["data"], "properties": {"data": {"type": "array", "description": "A 6-tuple consisting of x1, y1, x2, y2, font, coordinates", "items": [{"type": "number"}, {"type": "number"}, {"type": "number"}, {"type": "number"}, {"type": "string"}, {"type": "string"}]}}}, "info": {"title": "ImageInfo", "type": "object", "required": ["width", "height"], "properties": {"width": {"type": "number"}, "height": {"type": "number"}}}}}}}}}, "parameters": {"title": "AnnotatorParameters", "type": "object", "properties": {"type": {"type": "string"}}, "additionalProperties": {}, "required": ["type"]}, "proj_key": {"type": "string"}, "model_config_key": {"type": "string"}, "public": {"type": "boolean"}}}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.annotate"}}, "/project/{proj_key}/scratch/files": {"get": {"tags": ["Uploads"], "security": [{"Bearer": []}], "description": "Get temporary files uploaded to a project", "produces": ["application/json"], "operationId": "list_project_scratch_files", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "scratch_ids", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "Files", "schema": {"type": "array", "items": {"title": "UploadedFile", "type": "object", "properties": {"id": {"type": "string", "description": "ID of the temporary file."}, "proj_key": {"type": "string"}, "user_key": {"type": "string"}, "filename": {"type": "string"}, "timestamp": {"type": "number"}}, "required": ["id", "proj_key", "user_key", "filename", "timestamp"]}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}, "post": {"deprecated": true, "tags": ["Uploads"], "security": [{"Bearer": []}], "description": "Upload a file to temporary storage", "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_scratch_file", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "file", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "File uploaded", "schema": {"title": "UploadedFileResult", "type": "object", "required": ["id", "url"], "properties": {"id": {"type": "string", "description": "ID of the temporary file."}, "url": {"type": "string", "description": "URL to get the temporary file form."}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/scratch/files_paginated": {"get": {"tags": ["Uploads"], "security": [{"Bearer": []}], "description": "Get paginated list of temporary files uploaded to a project", "produces": ["application/json"], "operationId": "list_project_scratch_files_paginated", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "page", "in": "query", "description": "page of the result list", "required": false, "type": "integer"}, {"name": "items_per_page", "in": "query", "description": "items on one page of the result list", "required": false, "default": 20, "type": "integer"}, {"name": "search_string", "in": "query", "description": "search keyword", "required": false, "type": "string"}, {"name": "begin_date", "in": "query", "description": "begin date of the search date interval", "required": false, "type": "integer"}, {"name": "end_date", "in": "query", "description": "end date of the search date interval", "required": false, "type": "integer"}], "responses": {"200": {"description": "Files", "schema": {"type": "array", "items": {"title": "UploadedFile", "type": "object", "properties": {"id": {"type": "string", "description": "ID of the temporary file."}, "proj_key": {"type": "string"}, "user_key": {"type": "string"}, "filename": {"type": "string"}, "timestamp": {"type": "number"}}, "required": ["id", "proj_key", "user_key", "filename", "timestamp"]}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/scratch/files/upload/{filename}": {"post": {"tags": ["Uploads"], "security": [{"Bearer": []}], "description": "Create file pointers for temporary storage", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "create_project_scratch_file", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "filename", "in": "path", "required": true, "type": "string"}], "responses": {"201": {"description": "Temporary file details", "schema": {"title": "TemporaryUploadFileResult", "type": "object", "required": ["id", "upload", "download", "metadata", "upload_private", "download_private", "metadata_private"], "properties": {"id": {"type": "string", "description": "ID of the temporary file."}, "upload": {"type": "object", "description": "URL to upload the temporary file.", "properties": {"url": {"type": "string"}, "fields": {"type": "object"}}}, "upload_private": {"type": "object", "description": "URL to upload the temporary file. (private URL, usable within the infrastracture)", "properties": {"url": {"type": "string"}, "fields": {"type": "object"}}}, "download": {"type": "object", "description": "URL to get the temporary file.", "properties": {"url": {"type": "string"}}}, "download_private": {"type": "object", "description": "URL to get the temporary file. (private URL, usable within the infrastracture)", "properties": {"url": {"type": "string"}}}, "metadata": {"type": "object", "description": "URL to metadata of the temporary file using the HEAD HTTP method.", "properties": {"url": {"type": "string"}}}, "metadata_private": {"type": "object", "description": "URL to metadata of the temporary file using the HEAD HTTP method. (private URL, usable within the infrastracture)", "properties": {"url": {"type": "string"}}}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.controller"}}, "/project/{proj_key}/default_values": {"get": {"tags": ["Project"], "security": [{"Bearer": []}], "description": "List project's default values", "produces": ["application/json"], "operationId": "get_project_default_values", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/ProjectDefaultValues"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "post": {"tags": ["Project"], "security": [{"Bearer": []}], "description": "List project's default values", "produces": ["application/json"], "operationId": "update_project_default_values", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "default_values", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ProjectDefaultValues"}}], "responses": {"200": {"description": "OK"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/integrations/{integration_name}": {"get": {"tags": ["Project"], "security": [{"Bearer": []}], "description": "Get the config for a given project integration", "produces": ["application/json"], "operationId": "get_project_integration_config", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "integration_name", "in": "path", "type": "string", "required": true}, {"name": "decode_secrets", "in": "query", "type": "boolean", "description": "Project owners can retrieve decoded secrets", "default": false}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/ProjectIntegrations"}}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "post": {"tags": ["Project"], "security": [{"Bearer": []}], "description": "Update the config for a given project integration", "produces": ["application/json"], "operationId": "update_project_integration_config", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "integration_name", "in": "path", "type": "string", "required": true}, {"name": "config", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ProjectIntegrations"}}], "responses": {"200": {"description": "OK"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}, "delete": {"tags": ["Project"], "security": [{"Bearer": []}], "description": "Delete the config for a given project integration", "produces": ["application/json"], "operationId": "delete_project_integration_config", "x-swagger-router-controller": "api_server.controllers.controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "integration_name", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "OK"}, "500": {"description": "Error occured on the server", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/annotate/document": {"post": {"tags": ["Document Inspection"], "security": [{"Bearer": []}], "description": "Run an annotator on a document", "produces": ["application/json"], "operationId": "annotate_document", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "x-body-name": "body", "in": "body", "required": true, "schema": {"title": "AnnotateDocumentRequest", "type": "object", "required": ["document", "text_annotators", "image_annotators", "table_annotators"], "properties": {"document": {"type": "object"}, "text_annotators": {"type": "array", "items": {"$ref": "#/definitions/AnnotatorParametersOrRef"}}, "image_annotators": {"type": "array", "items": {"$ref": "#/definitions/AnnotatorParametersOrRef"}}, "table_annotators": {"type": "array", "items": {"$ref": "#/definitions/AnnotatorParametersOrRef"}}, "use_cache": {"type": "boolean", "default": true}}}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/annotate/document/report": {"post": {"tags": ["Document Inspection"], "security": [{"Bearer": []}], "description": "Submit a report on an inspected document", "produces": ["application/json"], "operationId": "report_inspected_document", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "x-body-name": "body", "in": "body", "required": true, "schema": {"title": "AnnotatedDocumentReport", "type": "object", "required": ["document", "report"], "properties": {"document": {"type": "object", "properties": {"input_scratch_id": {"type": "string"}, "output_scratch_id": {"type": "string"}}, "required": ["input_scratch_id", "output_scratch_id"]}, "document_conversion_parameters": {"type": "object"}, "document_annotation_parameters": {"type": "object"}, "report": {"type": "object", "properties": {"description": {"type": "string"}, "review_consent": {"type": "boolean"}}, "required": ["review_consent"]}}}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/annotate/document/results/{document_hash}": {"delete": {"tags": ["Document Inspection"], "security": [{"Bearer": []}], "description": "Delete annotation results for a document", "produces": ["application/json"], "operationId": "delete_document_annotation_result", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "document_hash", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "OK"}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/annotate/document/tasks/{task_id}": {"get": {"tags": ["Document Inspection"], "security": [{"Bearer": []}], "description": "Get the result of a previous document annotation", "produces": ["application/json"], "operationId": "get_annotate_document_result", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "task_id", "in": "path", "required": true, "type": "string"}, {"name": "wait", "in": "query", "required": false, "type": "number", "minimum": 0, "maximum": 10, "description": "Allow the response to be delayed for a few seconds to wait for the result, instead of doing client-side polling."}], "responses": {"200": {"description": "OK", "schema": {"type": "object", "required": ["task_id", "task_status", "result", "done"], "properties": {"task_id": {"type": "string"}, "task_status": {"type": "string"}, "result": {"type": "object", "x-nullable": true}, "done": {"type": "boolean"}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/annotate/inspection_report": {"get": {"tags": ["Document Inspection"], "security": [{"Bearer": []}], "description": "Get paginated list of inspection reports for a project", "produces": ["application/json"], "operationId": "list_project_inspection_report", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "page", "in": "query", "description": "page of the result list", "required": false, "type": "integer"}, {"name": "items_per_page", "in": "query", "description": "items on one page of the result list", "required": false, "default": 20, "type": "integer"}, {"name": "search_string", "in": "query", "description": "search keyword", "required": false, "type": "string"}, {"name": "begin_date", "in": "query", "description": "begin date of the search date interval", "required": false, "type": "integer"}, {"name": "end_date", "in": "query", "description": "end date of the search date interval", "required": false, "type": "integer"}], "responses": {"200": {"description": "Reports", "schema": {"type": "array", "items": {"title": "InspectionReport", "type": "object", "properties": {"id": {"type": "string", "description": "ID of the inpection report."}, "proj_key": {"type": "string"}, "user_key": {"type": "string"}, "timestamp": {"type": "number"}, "document": {"type": "string"}}, "required": ["id", "proj_key", "user_key", "timestamp", "document"]}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/ingest/documentqa": {"post": {"deprecated": true, "tags": ["Document Inspection", "Semantic"], "security": [{"Bearer": []}], "description": "Ingest a document for QA", "produces": ["application/json"], "operationId": "ingest_documentqa", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "x-body-name": "body", "in": "body", "required": true, "schema": {"title": "IngestDocumentQARequest", "type": "object", "properties": {"source": {"title": "Source", "x-anyOf": [{"title": "IngestDocumentQASourceUrl", "type": "object", "properties": {"type": {"title": "Type", "enum": ["url"], "type": "string"}, "url": {"title": "Url", "type": "string"}}, "required": ["type", "url"]}, {"title": "IngestDocumentQASourcePublicData", "type": "object", "properties": {"type": {"title": "Type", "enum": ["public_data"], "type": "string"}, "elastic_id": {"title": "Elastic Id", "type": "string"}, "index_key": {"title": "Index Key", "type": "string"}, "document_hash": {"title": "Document Hash", "type": "string"}}, "required": ["type", "elastic_id", "index_key", "document_hash"]}, {"title": "IngestDocumentQASourcePrivateData", "type": "object", "properties": {"type": {"title": "Type", "enum": ["private_data"], "type": "string"}, "proj_key": {"title": "Proj Key", "type": "string"}, "index_key": {"title": "Index Key", "type": "string"}, "document_hash": {"title": "Document Hash", "type": "string"}}, "required": ["type", "proj_key", "index_key", "document_hash"]}]}}, "required": ["source"]}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.document_inspect_controller"}}, "/project/{proj_key}/semantic/ingest": {"post": {"tags": ["Semantic"], "security": [{"Bearer": []}], "description": "Ingest documents and collections for RAG", "produces": ["application/json"], "operationId": "ingest", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "x-body-name": "body", "in": "body", "required": true, "schema": {"title": "SemanticIngestRequest", "type": "object", "properties": {"source": {"title": "Source", "x-anyOf": [{"title": "IngestDocumentQASourceUrl", "type": "object", "properties": {"type": {"title": "Type", "enum": ["url"], "type": "string"}, "url": {"title": "Url", "type": "string"}}, "required": ["type", "url"]}, {"title": "SemanticIngestSourcePublicDataDocument", "type": "object", "properties": {"type": {"title": "Type", "enum": ["public_data_document"], "type": "string"}, "elastic_id": {"title": "Elastic Id", "type": "string"}, "index_key": {"title": "Index Key", "type": "string"}, "document_hash": {"title": "Document Hash", "type": "string"}}, "required": ["type", "elastic_id", "index_key", "document_hash"]}, {"title": "SemanticIngestSourcePrivateDataDocument", "type": "object", "properties": {"type": {"title": "Type", "enum": ["private_data_document"], "type": "string"}, "proj_key": {"title": "Proj Key", "type": "string"}, "index_key": {"title": "Index Key", "type": "string"}, "document_hash": {"title": "Document Hash", "type": "string"}}, "required": ["type", "proj_key", "index_key", "document_hash"]}, {"title": "SemanticIngestSourcePrivateDataCollection", "type": "object", "properties": {"type": {"title": "Type", "enum": ["private_data_collection"], "type": "string"}, "proj_key": {"title": "Proj Key", "type": "string"}, "index_key": {"title": "Index Key", "type": "string"}}, "required": ["type", "proj_key", "index_key"]}]}, "parameters": {"title": "SemanticIngestReqParams", "type": "object", "properties": {"skip_ingested_docs": {"title": "Skip Ingested Docs", "type": "boolean"}}, "required": ["skip_ingested_docs"]}}, "required": ["source", "parameters"]}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Task"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.semantic_controller"}}, "/project/{proj_key}/dictionaries/from_mongo": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Create a dictionary from a mongo database", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "import_project_dictionary_from_mongo", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "DictionaryImportOptions", "type": "object", "properties": {"target": {"type": "object", "required": ["name", "description", "public"], "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "pattern": "^(?:\\w| |-)+$"}, "description": {"type": "string", "x-nullable": true}}}, "options": {"type": "object", "required": ["coordinates"], "properties": {"coordinates": {"$ref": "#/definitions/MongoS3CoordinatesWithCollectionList"}}}}, "required": ["target", "options"]}}], "responses": {"200": {"description": "Dictionary created, and data is being imported.", "schema": {"title": "DictionaryImportResult", "type": "object", "properties": {"dictionary": {"$ref": "#/definitions/Dictionary"}, "import_task": {"$ref": "#/definitions/Task"}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/actions/clone": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Clone an existing dictionary", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "clone_project_dictionary", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "CloneDictionaryOptions", "type": "object", "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "pattern": "^(?:\\w| |-)+$", "x-nullable": true}, "description": {"type": "string", "x-nullable": true}, "copy_s3": {"type": "boolean", "description": "Should the dictionary's S3 data also be copied?", "default": true}, "collections": {"type": "array", "items": {"type": "string"}}}, "required": ["name", "description", "public"]}}], "responses": {"200": {"description": "Dictionary cloned, and data is being copied.", "schema": {"$ref": "#/definitions/DictionaryCloneResult"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "List dictionaries for a project", "produces": ["application/json"], "operationId": "list_project_dictionaries", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "query", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "List of dictionaries", "schema": {"type": "array", "items": {"$ref": "#/definitions/Dictionary"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}, "post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Create an empty dictionary", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "create_project_dictionary", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "CreateDictionaryOptions", "type": "object", "properties": {"public": {"type": "boolean"}, "name": {"type": "string", "pattern": "^(?:\\w| |-)+$"}, "description": {"type": "string", "x-nullable": true}}, "required": ["name", "description", "public"]}}], "responses": {"200": {"description": "Dictionary created.", "schema": {"$ref": "#/definitions/Dictionary"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/public/dictionaries/{dict_key}": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get a single dictionary that was made public", "produces": ["application/json"], "operationId": "get_public_dictionary", "parameters": [{"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Dictionary", "schema": {"$ref": "#/definitions/Dictionary"}}, "404": {"description": "Dictionary not found or is not public", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/public/dictionaries/{dict_key}/collections": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get the collections of a dictionary.", "produces": ["application/json"], "operationId": "list_public_dictionary_collections", "parameters": [{"name": "dict_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Dictionary collections", "schema": {"type": "array", "items": {"$ref": "#/definitions/DictionaryCollection"}}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/collections/{collection_name}/actions/upload": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Upload data to a dictionary collection. The collection will be created if it doesn't exist.", "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_dictionary_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "file", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/collections/{collection_name}/actions/export": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Export the contents of a dictionary's collection", "produces": ["application/zip", "application/json"], "operationId": "export_project_dictionary_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "file_format", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "Dictionary collection contents.", "schema": {"type": "file"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/actions/upload": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Upload data to a dictionary. The collection name(s) will be inferred from the file name(s).", "consumes": ["multipart/form-data"], "produces": ["application/json"], "operationId": "upload_project_dictionary_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "file", "in": "formData", "required": true, "type": "file"}], "responses": {"200": {"description": "Data is being processed.", "schema": {"$ref": "#/definitions/Task"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/actions/export": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Export the contents of a dictionary.", "produces": ["application/zip"], "operationId": "export_project_dictionary_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Dictionary contents.", "schema": {"type": "file"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/delete_token": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get a token used to confirm the deletion of a dictionary.", "produces": ["application/json"], "operationId": "create_project_dictionary_delete_token", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Dictionary deletion token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "404": {"description": "Data flow template not found.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/public/dictionaries": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "List public dictionaries", "produces": ["application/json"], "operationId": "list_public_dictionaries", "parameters": [{"name": "query", "in": "query", "type": "string", "required": false}], "responses": {"200": {"description": "List of public dictionaries", "schema": {"type": "array", "items": {"$ref": "#/definitions/Dictionary"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/public/dictionaries/{dict_key}/actions/clone": {"post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Clone an existing public dictionary", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "clone_public_dictionary", "parameters": [{"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "ClonePublicDictionaryOptions", "type": "object", "properties": {"proj_key": {"description": "The project key of the project to store the resulting dictionary", "type": "string"}, "public": {"type": "boolean"}, "name": {"type": "string", "x-nullable": true}, "description": {"type": "string", "x-nullable": true}, "collections": {"type": "array", "items": {"type": "string"}}, "copy_s3": {"type": "boolean", "description": "Should the dictionary's S3 data also be copied?", "default": true}}, "required": ["name", "description", "public", "proj_key"]}}], "responses": {"200": {"description": "Dictionary cloned, and data is being copied.", "schema": {"$ref": "#/definitions/DictionaryCloneResult"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get a single dictionary", "produces": ["application/json"], "operationId": "get_project_dictionary", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Dictionary", "schema": {"$ref": "#/definitions/Dictionary"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}, "delete": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Delete a single dictionary", "produces": ["application/json"], "operationId": "delete_project_dictionary", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "required": true, "type": "string"}, {"name": "confirmation_token", "in": "query", "type": "string", "required": true}], "responses": {"204": {"description": "Dictionary deleted."}, "404": {"description": "Dictionary doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}, "patch": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Update the metadata of a dictionary", "produces": ["application/json"], "operationId": "update_project_dictionary", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "options", "x-body-name": "options", "in": "body", "required": true, "schema": {"type": "object", "title": "PatchDictionaryOptions", "properties": {"name": {"type": "string"}, "public": {"type": "boolean"}, "description": {"type": "string", "x-nullable": true}}, "additionalProperties": false}}], "responses": {"200": {"description": "Dictionary updated.", "schema": {"$ref": "#/definitions/Dictionary"}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/collections": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get the collections of a dictionary.", "produces": ["application/json"], "operationId": "list_project_dictionary_collections", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "Dictionary collections", "schema": {"type": "array", "items": {"$ref": "#/definitions/DictionaryCollection"}}}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}, "post": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Create a collection in a dictionary", "produces": ["application/json"], "operationId": "create_project_dictionary_collection", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"title": "CreateCollectionInDictionaryOptions", "type": "object", "properties": {"collection_name": {"type": "string", "pattern": "^(?:\\w|-)(?:\\w|\\s|-)*(?:\\w|-)$", "maxLength": 50, "minLength": 4}}, "required": ["collection_name"]}}], "responses": {"200": {"description": "Collection created."}, "404": {"description": "Dictionary doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/collections/{collection_name}": {"delete": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Delete a single dictionary's collection", "produces": ["application/json"], "operationId": "delete_project_dictionary_collection", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "required": true, "type": "string"}, {"name": "collection_name", "in": "path", "type": "string", "required": true}], "responses": {"204": {"description": "Collection deleted."}, "404": {"description": "Collection doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/dictionaries/{dict_key}/collections/{collection_name}/data": {"get": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Get a preview of the data in a dictionary", "produces": ["application/json"], "operationId": "get_project_dictionary_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "after", "in": "query", "type": "string", "pattern": "[a-zA-Z0-9]{24}", "required": false}, {"name": "limit", "in": "query", "type": "integer", "minimum": 0, "default": 1000, "required": false}, {"name": "response_format", "in": "query", "type": "string", "default": "object", "required": false}], "responses": {"200": {"description": "Dictionary collection contents.", "schema": {"x-oneOf": [{"$ref": "#/definitions/DictionaryCollectionObjectData"}, {"$ref": "#/definitions/DictionaryCollectionCsvData"}]}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}, "patch": {"tags": ["Dictionaries"], "security": [{"Bearer": []}], "description": "Update the data in a dictionary's collection", "produces": ["application/json"], "operationId": "update_project_dictionary_collection_data", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "dict_key", "in": "path", "type": "string", "required": true}, {"name": "collection_name", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "description": "A subset of JSON Patch operation list. Only `add`, `replace`, and `remove` is supported.\nSee http://jsonpatch.com/ for more details.\n", "schema": {"type": "array", "items": {"$ref": "#/definitions/DictionaryCollectionPatch"}}}], "responses": {"204": {"description": "Data updated."}, "404": {"description": "Dictionary not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.dicts_controller"}}, "/project/{proj_key}/model_configs": {"get": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "List Model Configurations for a project", "produces": ["application/json"], "operationId": "list_project_model_configs", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "List of Model Configurations", "schema": {"type": "array", "items": {"$ref": "#/definitions/ModelConfiguration"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}, "post": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "Create a Model Configuration", "consumes": ["application/json"], "produces": ["application/json"], "operationId": "create_project_model_config", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "body", "in": "body", "required": true, "schema": {"title": "CreateProjectModelConfigOptions", "type": "object", "additionalProperties": false, "properties": {"public": {"type": "boolean"}, "name": {"pattern": "^(?:\\w| |-)+$", "type": "string"}, "description": {"type": "string", "x-nullable": true}, "configurations": {"type": "object", "properties": {"type": {"type": "string"}}, "required": ["type"]}, "model_config_key": {"type": "string"}}, "required": ["name", "description", "public", "configurations"]}}], "responses": {"200": {"description": "Model Configuration created.", "schema": {"$ref": "#/definitions/ModelConfiguration"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/model_configs/{model_config_key}": {"get": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "Get a single Model Configuration", "produces": ["application/json"], "operationId": "read_project_model_config", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "model_config_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Model Configuration", "schema": {"$ref": "#/definitions/ModelConfiguration"}}, "404": {"description": "Model Configuration not found", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}, "patch": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "Update a single Model Configuration", "produces": ["application/json"], "operationId": "update_project_model_config", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "model_config_key", "in": "path", "required": true, "type": "string"}, {"name": "body", "in": "body", "required": true, "schema": {"title": "UpdateProjectModelConfigOptions", "type": "object", "additionalProperties": false, "properties": {"name": {"type": "string"}, "public": {"type": "boolean"}, "description": {"type": "string", "x-nullable": true}, "configurations": {"type": "object", "properties": {"type": {"type": "string"}}, "required": ["type"]}}, "required": ["name", "description", "public", "configurations"]}}], "responses": {"204": {"description": "Model Configuration updated."}, "404": {"description": "Model Configuration doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}, "delete": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "Delete a single Model Configuration", "produces": ["application/json"], "operationId": "delete_project_model_config", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}, {"name": "model_config_key", "in": "path", "required": true, "type": "string"}], "responses": {"204": {"description": "Model Configuration deleted."}, "404": {"description": "Model Configuration doesn't exist.", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/public/model_configs": {"get": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "List public Model Configurations", "produces": ["application/json"], "operationId": "list_public_model_configs", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [], "responses": {"200": {"description": "List of public Model Configurations", "schema": {"type": "array", "items": {"$ref": "#/definitions/ModelConfiguration"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/public/model_configs/{model_config_key}": {"get": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "Get a single Model Configuration that was made public", "produces": ["application/json"], "operationId": "read_public_model_config", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "model_config_key", "in": "path", "type": "string", "required": true}, {"name": "include_collections", "in": "query", "type": "boolean", "required": false, "default": false}], "responses": {"200": {"description": "Model configuration", "schema": {"$ref": "#/definitions/ModelConfiguration"}}, "404": {"description": "Model configuration not found or is not public", "schema": {"$ref": "#/definitions/Problem"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/project/{proj_key}/models": {"get": {"tags": ["Model Configurations"], "security": [{"Bearer": []}], "description": "List models with the supported annotations for a project", "produces": ["application/json"], "operationId": "get_project_models_with_supported_annotations", "x-swagger-router-controller": "api_server.controllers.model_configs_controller", "parameters": [{"name": "proj_key", "in": "path", "type": "string", "required": true}], "responses": {"200": {"description": "List of Models with the supported annotations", "schema": {"type": "array", "items": {"$ref": "#/definitions/ModelConfiguration"}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}, "/processing_models/docs_graph_with_databases": {"post": {"tags": ["Processing Model"], "security": [{"Bearer": []}], "consumes": ["application/json"], "produces": ["application/json"], "description": "Create a Data Flow from a list of CCS Collections and CPS Models.", "operationId": "create_data_flow_from_df_wizard", "parameters": [{"name": "body", "in": "body", "required": true, "schema": {"type": "object", "required": ["ccs_document_collections", "catalog_document_collections", "models", "access_token"], "properties": {"access_token": {"type": "string"}, "ccs_document_collections": {"type": "array", "items": {"$ref": "#/definitions/CcsCollectionReference"}}, "models": {"type": "array", "items": {"$ref": "#/definitions/CpsModelReference"}}, "entity_mappings": {"$ref": "#/definitions/EntityMapping"}, "catalog_document_collections": {"type": "array", "items": {"$ref": "#/definitions/CatalogReference"}}, "data_catalogs": {"type": "array", "items": {"$ref": "#/definitions/CatalogReference"}}}}}], "responses": {"200": {"description": "Processing model generated successfully", "schema": {"$ref": "#/definitions/ProcessingModel"}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}, "x-swagger-router-controller": "api_server.controllers.processing_model_controller"}}, "/processing_models": {"get": {"tags": ["Processing Model"], "security": [{"Bearer": []}], "produces": ["application/json"], "description": "List the available processing models.", "operationId": "get_processing_models", "x-swagger-router-controller": "api_server.controllers.processing_model_controller", "responses": {"200": {"description": "List of processing models and their description", "schema": {"type": "object", "required": ["processing_models"], "properties": {"processing_models": {"type": "array", "items": {"$ref": "#/definitions/ProcessingModelDescription"}}}}}, "default": {"description": "Unexpected error.", "schema": {"$ref": "#/definitions/Problem"}}}}}}, "definitions": {"TokenResponse": {"type": "object", "properties": {"token": {"type": "string"}}, "required": ["token"]}, "ProjectDataIndexWithStatus": {"title": "ProjectDataIndexWithStatus", "description": "Project data index with elastic status", "type": "object", "properties": {"source": {"title": "ProjectDataIndexSource", "type": "object", "properties": {"proj_key": {"type": "string"}, "index_key": {"type": "string"}}, "required": ["proj_key", "index_key"]}, "name": {"type": "string"}, "description": {"type": "string"}, "schema_key": {"type": "string", "description": "Index's schema key", "enum": ["deepsearch-doc", "deepsearch-db", "generic"]}, "type": {"type": "string", "description": "Index type, user friendly format", "enum": ["View", "Document", "DB Record", "Generic", "Experiment"]}, "view_of": {"type": "object", "properties": {"index_key": {"type": "string"}, "elastic_id": {"type": "string"}, "proj_key": {"type": "string"}, "query_options": {"$ref": "#/definitions/ElasticIndexSearchQueryOptions"}}, "required": ["index_key", "query_options"]}, "documents": {"type": "number"}, "health": {"type": "string"}, "status": {"type": "string"}, "creation_date": {"type": "string"}, "record_properties": {"$ref": "#/definitions/ElasticIndexProperties"}, "provenance": {"type": "string"}}, "required": ["source", "name", "description", "type", "documents", "health", "status", "creation_date"]}, "ProjectDataIndexNonView": {"title": "ProjectDataIndexNonView", "description": "Object to create a project data index", "type": "object", "properties": {"name": {"type": "string", "description": "Name of the data index", "minLength": 1, "maxLength": 64}, "description": {"type": "string", "description": "Description of the Index", "minLength": 1, "maxLength": 254}, "schema_key": {"type": "string", "description": "Schema key", "minLength": 1, "maxLength": 64, "default": "generic", "enum": ["deepsearch-doc", "deepsearch-db", "generic"]}}, "required": ["name"]}, "ProjectDataIndexView": {"title": "ProjectDataIndexView", "description": "Object to create a project data index view", "type": "object", "properties": {"name": {"type": "string", "description": "Name of the data index view", "minLength": 1, "maxLength": 64}, "description": {"type": "string", "description": "Description of the index view", "minLength": 1, "maxLength": 254}, "view_of": {"type": "object", "title": "ProjectDataIndexViewOf", "properties": {"instance_id": {"type": "string", "description": "Instance id key, if the source is a data asset", "minLength": 1, "maxLength": 64}, "proj_key": {"type": "string", "description": "Project id key, if the source is a project data index", "minLength": 1, "maxLength": 64}, "index_key": {"type": "string", "description": "Data index key", "minLength": 1, "maxLength": 64}, "query_options": {"$ref": "#/definitions/ElasticIndexSearchQueryOptions"}}, "required": ["index_key", "query_options"]}}, "required": ["name", "view_of"]}, "ProjectDataIndexConversionSettings": {"title": "ProjectDataIndexConversionSettings", "description": "Specify the conversion settings to use.", "type": "object", "properties": {"type": {"title": "Type", "type": "string", "default": "direct", "enum": ["direct"]}, "ocr": {"type": "object", "title": "OCR Settings", "properties": {"enabled": {"title": "Enabled", "type": "boolean", "default": false}, "backend": {"title": "Backend", "type": "string"}, "backend_settings": {"title": "Backend Settings", "type": "object"}, "merge_mode": {"title": "Merge Mode", "type": "string"}}}, "assemble": {"title": "Assemble Settings", "type": "object", "required": ["mode", "include_incomplete_documents"], "properties": {"mode": {"type": "object", "required": ["page_elements", "tables"], "properties": {"page_elements": {"title": "Page Elements", "type": "array", "items": {"type": "string", "enum": ["H", "M", "None"]}}, "tables": {"title": "Tables", "type": "array", "items": {"type": "string", "enum": ["H", "M", "None"]}}}}, "include_incomplete_documents": {"title": "Include Incomplete Documents", "type": "boolean"}}}, "metadata": {"title": "Collection Metadata Settings", "type": "object", "properties": {"description": {"title": "Description", "type": "string"}, "display_name": {"title": "Display Name", "type": "string"}, "licence": {"title": "Licence", "type": "string"}, "source": {"title": "Source", "type": "string"}, "version": {"title": "Version", "type": "string"}}}, "page_labels": {"title": "Page Labels", "type": "object"}, "model_pipeline": {"title": "Model Pipeline Settings", "type": "object", "required": ["clusters", "page", "tables", "normalization"], "properties": {"clusters": {"title": "Clusters", "x-oneOf": [{"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/0"}, {"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/1"}]}, "page": {"title": "Page", "x-oneOf": [{"type": "object", "description": "Reference to a model configuration", "required": ["model_config_key", "proj_key"], "properties": {"model_config_key": {"title": "Model Config Key", "type": "string"}, "proj_key": {"title": "Proj Key", "type": "string"}, "name": {"title": "Name", "type": "string"}, "description": {"title": "Description", "type": "string"}}}, {"type": "object", "description": "Direct configuration of a model", "required": ["type", "config"], "properties": {"type": {"title": "Type", "type": "string"}, "config": {"title": "Config", "type": "string"}}}]}, "tables": {"title": "Tables", "x-oneOf": [{"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/0"}, {"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/1"}]}, "normalization": {"title": "Normalization", "x-oneOf": [{"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/0"}, {"$ref": "#/definitions/ProjectDataIndexConversionSettings/properties/model_pipeline/properties/page/x-oneOf/1"}]}}}}}, "ProjectDataIndexS3Coordinates": {"title": "ProjectDataIndexCOSCoordinates", "description": "Coordinates to COS", "type": "object", "properties": {"host": {"title": "host", "type": "string"}, "port": {"title": "port", "type": "number"}, "ssl": {"title": "ssl", "type": "boolean"}, "verify_ssl": {"title": "verify_ssl", "type": "boolean"}, "access_key": {"title": "access_key", "type": "string"}, "secret_key": {"title": "secret_key", "type": "string"}, "bucket": {"title": "bucket", "type": "string"}, "location": {"title": "location", "type": "string"}, "key_prefix": {"title": "key_prefix", "type": "string"}}, "required": ["host", "port", "ssl", "verify_ssl", "access_key", "secret_key", "bucket", "location"]}, "error_response": {"type": "object", "properties": {"error_message": {"type": "string"}, "error_code": {"type": "string", "x-nullable": true}}, "required": ["error_message"]}, "Problem": {"type": "object", "properties": {"type": {"type": "string"}, "title": {"type": "string"}, "detail": {"type": "string"}, "status": {"type": "integer"}}, "additionalProperties": {}, "example": {"type": "ExampleError", "title": "An example title", "detail": "A descriptive message.", "status": 500, "may_have_extra_fields": true}}, "Bag": {"type": "object", "required": ["proj_key", "bag_key", "name", "slug", "timestamp", "bag_domain", "flavour", "bag_url", "public", "_svc_endpoint", "token"], "properties": {"proj_key": {"type": "string"}, "bag_key": {"type": "string"}, "name": {"type": "string"}, "slug": {"type": "string"}, "timestamp": {"type": "number", "format": "double"}, "bag_domain": {"type": "string"}, "flavour": {"type": "string"}, "bag_url": {"type": "string"}, "public": {"type": "boolean"}, "_svc_endpoint": {"type": "string"}, "token": {"type": "string"}}}, "BagFlavour": {"type": "object", "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}, "description": {"type": "string"}}}, "BagFlavourDefaultQuota": {"title": "BagFlavourDefaultQuota", "type": "object", "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}, "default_quota": {"type": "number"}}, "required": ["name", "display_name"]}, "BagFlavourFullData": {"type": "object", "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}, "description": {"type": "string"}, "is_from_deployment": {"type": "boolean"}, "project_specific": {"type": "boolean"}, "default_quota": {"type": "integer"}, "order": {"type": "number"}, "backend": {"type": "string"}, "config": {"type": "object"}}, "required": ["display_name", "description", "project_specific", "backend", "config"]}, "ProjectsFlavours": {"type": "object", "properties": {"proj_key": {"type": "string"}, "name": {"type": "string"}, "flavours": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}}, "required": ["name"]}}}, "required": ["proj_key", "name", "flavours"]}, "ProjectsFlavoursQuota": {"title": "ProjectsFlavoursQuota", "type": "object", "properties": {"proj_key": {"type": "string"}, "name": {"type": "string"}, "quotas": {"type": "array", "items": {"$ref": "#/definitions/FlavoursQuota"}}}, "required": ["proj_key", "name", "quotas"]}, "FlavoursQuota": {"title": "FlavoursQuota", "type": "object", "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}, "quota": {"type": "integer"}}, "required": ["name", "display_name"]}, "SystemInfo": {"type": "object", "properties": {"allow_non_admins_to_make_resources_public": {"type": "boolean"}, "deployment": {"type": "object", "properties": {"name": {"type": "string"}, "disclaimer": {"type": "string"}, "should_show_warning": {"type": "boolean"}, "disable_kg_actions": {"type": "boolean"}, "linked_ccs_api": {"type": "object", "properties": {"uri": {"type": "string"}, "project_sync": {"type": "boolean"}}}}}, "toolkit": {"type": "object", "properties": {"name": {"type": "string"}, "host": {"type": "string"}, "verify_ssl": {"type": "boolean"}, "cli_command": {"type": "string"}, "required_version": {"type": "string", "x-nullable": true}}}, "api": {"type": "object", "properties": {"version": {"type": "string"}, "commit_hash": {"type": "string"}, "build_date": {"type": "integer"}}}}}, "SystemModulesConfiguration": {"type": "object", "required": ["df_template_variables", "linked_ccs_instances", "linked_elastic_instances"], "properties": {"df_template_variables": {"type": "array", "items": {"type": "object", "title": "WellKnownDfTemplateVariable", "required": ["description", "id", "type"], "properties": {"description": {"type": "string"}, "id": {"type": "string"}, "type": {"$ref": "#/definitions/DataFlowTemplateVariable"}}}}, "linked_ccs_instances": {"type": "array", "items": {"type": "object", "title": "LinkedCcsInstances", "required": ["description", "id"], "properties": {"description": {"type": "string"}, "id": {"type": "string"}}}}, "linked_elastic_instances": {"type": "array", "items": {"type": "object", "title": "LinkedElasticInstances", "required": ["description", "id"], "properties": {"description": {"type": "string"}, "id": {"type": "string"}}}}}}, "SystemModulesTasks": {"type": "object", "properties": {"tasks": {"type": "object", "additionalProperties": {"type": "object", "properties": {"schema": {"type": "object"}}}}}}, "BagCallback": {"type": "object", "properties": {"callback_url": {"type": "string"}}}, "KgcDataInput": {"type": "object", "properties": {"config": {"type": "object"}, "data-flow": {"type": "array", "items": {"type": "object", "additionalProperties": {}, "properties": {"config": {"type": "object", "additionalProperties": {}, "properties": {"coordinates": {"type": "object", "additionalProperties": {}, "properties": {"source": {"type": "object", "additionalProperties": {}, "properties": {"type": {"type": "string", "default": "bag", "enum": ["raw", "bag", "catalogue"]}, "bag_key": {"type": "string"}, "dc_key": {"type": "string"}, "proj_key": {"type": "string"}, "collection": {"type": "string"}, "public": {"type": "boolean"}}}, "target": {"type": "object", "additionalProperties": {}, "properties": {"type": {"type": "string", "default": "bag", "enum": ["raw", "bag", "catalogue"]}, "bag_key": {"type": "string"}, "dc_key": {"type": "string"}, "proj_key": {"type": "string"}, "collection": {"type": "string"}, "public": {"type": "boolean"}}}}}}, "required": ["coordinates"]}}, "required": ["config"]}}}, "required": ["config", "data-flow"]}, "LoadKgcDataInput": {"type": "object", "properties": {"dataflow": {"type": "object", "properties": {"config": {"type": "object"}, "data-flow": {"type": "array", "items": {"type": "object"}}}}, "target": {"type": "object", "properties": {"bag_key": {"type": "string"}, "save": {"type": "object"}}, "required": ["bag_key", "save"]}}, "required": ["dataflow", "target"]}, "Task": {"type": "object", "properties": {"task_id": {"type": "string"}, "task_type": {"type": "string"}, "task_status": {"type": "string"}, "proj_key": {"type": "string"}, "error_reason": {"type": "string", "x-nullable": true}, "kind": {"type": "string", "enum": ["project_task", "celery_task"]}, "related_tasks": {"type": "array", "items": {"title": "RelatedTask", "type": "object", "required": ["task_id", "task_type"], "properties": {"task_id": {"type": "string"}, "task_type": {"type": "string"}}}}}, "required": ["task_id", "task_type", "task_status", "proj_key", "error_reason", "kind"]}, "CcsTask": {"title": "CcsTask", "type": "object", "properties": {"task_id": {"type": "string"}, "ccs_project_key": {"type": "string"}, "ccs_collection_name": {"type": "string"}}, "required": ["task_id", "ccs_project_key", "ccs_collection_name"]}, "CpsTask": {"title": "CpsTask", "type": "object", "properties": {"task_id": {"type": "string"}, "task_status": {"type": "string"}, "task_type": {"type": "string"}}, "required": ["task_id", "task_status", "task_type"]}, "StorageSummaryTask": {"type": "object", "properties": {"task_id": {"type": "string"}, "proj_key": {"type": "string"}, "kg_key": {"type": "string"}, "dc_key": {"type": "string"}, "kind": {"type": "string", "enum": ["project_task", "celery_task"]}}, "required": ["task_id", "proj_key", "kind"]}, "StorageSummaryKG": {"type": "object", "properties": {"bag_key": {"type": "string"}, "name": {"type": "string"}, "size_bytes_db": {"type": "number"}, "size_converted_db": {"type": "string"}, "size_bytes_s3": {"type": "number"}, "size_converted_s3": {"type": "string"}, "categories_fraction": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "percentage": {"type": "number"}, "size_bytes_db": {"type": "number"}, "size_converted_db": {"type": "string"}, "color": {"type": "string"}}, "required": ["name", "percentage", "size_bytes_db", "size_converted_db"]}}}, "required": ["bag_key", "name", "size_bytes_db", "size_converted_db", "size_bytes_s3", "size_converted_s3", "categories_fraction"]}, "StorageSummaryDC": {"type": "object", "properties": {"dc_key": {"type": "string"}, "name": {"type": "string"}, "size_bytes_db": {"type": "number"}, "size_converted_db": {"type": "string"}, "size_bytes_s3": {"type": "number"}, "size_converted_s3": {"type": "string"}}, "required": ["dc_key", "name", "size_bytes_db", "size_converted_db", "size_bytes_s3", "size_converted_s3"]}, "DataCatalogue": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string", "x-nullable": true}, "dc_key": {"type": "string"}, "proj_key": {"type": "string"}, "created_by": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "copy_of": {"type": "string", "x-nullable": true}, "public": {"type": "boolean"}, "collections": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogCollection"}}, "topology": {"$ref": "#/definitions/DataCatalogTopology"}, "category_schemas": {"type": "array", "items": {"type": "object", "title": "DataCatalogCategorySchema", "required": ["key", "schema"], "properties": {"key": {"type": "string"}, "schema": {"type": "object", "additionalProperties": {}}}}}, "collections_data_flows": {"type": "array", "items": {"type": "object", "title": "DataCatalogDataFlow", "required": ["key", "data_flows"], "properties": {"key": {"type": "string"}, "data_flows": {"type": "array", "items": {"type": "object"}}}}}, "provenance_logs": {"type": "array", "items": {"type": "object", "title": "DataCatalogProvenanceLog", "required": ["user", "timestamp", "collection_name", "source"], "properties": {"user": {"type": "object", "title": "DataCatalogProvenanceLogUser", "properties": {"user_key": {"type": "string"}, "name": {"type": "string"}, "email": {"type": "string"}}, "required": ["user_key", "name", "email"]}, "timestamp": {"type": "number"}, "collection_name": {"type": "string", "x-nullable": true}, "source": {"type": "object", "title": "DataCatalogProvenanceLogSource", "x-nullable": true, "properties": {"elastic": {}, "mongo_s3": {}, "file": {}, "url": {}, "clone": {}, "ccs": {}}}}}}}, "required": ["name", "description", "dc_key", "proj_key", "created_by", "created_at", "copy_of", "public", "topology", "category_schemas", "collections_data_flows", "provenance_logs"]}, "DataCatalogSchema": {"type": "object", "properties": {"name": {"type": "string"}, "schema": {"type": "string"}}}, "DataCatalogCollection": {"type": "object", "required": ["name", "item_count"], "properties": {"name": {"type": "string"}, "item_count": {"type": "integer"}}}, "CloneDataCatalogResult": {"type": "object", "properties": {"data_catalogue": {"$ref": "#/definitions/DataCatalogue"}, "clone_task": {"$ref": "#/definitions/Task"}}, "required": ["data_catalogue", "clone_task"]}, "ProjectTask": {"type": "object", "properties": {"proj_key": {"type": "string"}, "user_key": {"type": "string"}, "task_type": {"type": "string"}, "task_id": {"type": "string"}, "task_status": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "started_at": {"type": "number", "format": "double", "x-nullable": true}, "completed_at": {"type": "number", "format": "double", "x-nullable": true}, "progress": {"type": "number", "format": "double"}, "meta": {"type": "object"}}}, "BagComponentStatus": {"type": "object", "properties": {"status": {"$ref": "#/definitions/BagComponentStatusEnum"}, "start_time": {"type": "number", "format": "double", "x-nullable": true}}, "required": ["status", "start_time"]}, "BagStatus": {"type": "object", "properties": {"status": {"$ref": "#/definitions/BagComponentStatusEnum"}, "components": {"type": "object", "properties": {"kg": {"description": "Status of the Knowledge Graph and its API", "allOf": [{"$ref": "#/definitions/BagComponentStatus"}]}, "erlenmeyer_api": {"description": "Status of the Erlenmeyer API for this Graph", "allOf": [{"$ref": "#/definitions/BagComponentStatus"}]}, "erlenmeyer_ui": {"description": "Status of the Erlenmeyer UI for this Graph", "allOf": [{"$ref": "#/definitions/BagComponentStatus"}]}}, "required": ["kg", "erlenmeyer_api", "erlenmeyer_ui"]}}, "required": ["status", "components"]}, "BagComponentStatusEnum": {"type": "string", "enum": ["LAUNCHING", "READY", "BUSY", "SUSPENDED", "SUSPENDING", "ERROR", "PROVISIONING", "PROVISIONING_FAILED", "UNKNOWN", "CHECKING", "PENDING_RESOURCES", "IDLE"]}, "DataFlowTemplate": {"type": "object", "properties": {"config": {"type": "object"}, "data-flow": {"type": "array", "items": {"type": "object"}}}, "required": ["config", "data-flow"]}, "DataFlowTemplateListItem": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string"}, "proj_key": {"type": "string"}, "df_tpl_key": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "updated_at": {"type": "number", "format": "double"}, "public": {"type": "boolean"}}}, "DataFlow": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string"}, "variables": {"type": "object", "additionalProperties": {"type": "object"}}, "template": {"type": "object"}, "proj_key": {"type": "string"}, "df_tpl_key": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "updated_at": {"type": "number", "format": "double"}, "public": {"type": "boolean"}}}, "DataFlowTemplateVariable": {"type": "string", "enum": ["string", "boolean", "number", "integer", "DataCatalogId", "DictionaryId", "KnowledgeGraphId", "ModelConfigurationId", "file", "SecretString", "ElasticId", "DataCatalogCollection", "DictionaryCollection", "KnowledgeGraphCollection", "CcsCollection", "DocumentSources"]}, "TakeSnapshotSettings": {"type": "object", "properties": {"flavour": {"type": "string"}, "name": {"type": "string"}, "load_into_kg_after_created": {"type": "boolean", "default": false}}, "required": ["flavour"]}, "KgSnapshot": {"type": "object", "properties": {"timestamp": {"type": "number", "format": "double"}, "data_flow": {"type": "object", "x-nullable": true}, "project_task_id": {"type": "string"}, "task_type": {"type": "string"}, "name": {"type": "string"}, "is_current": {"type": "boolean"}}}, "S3CoordinatesWithBackupKey": {"type": "object", "properties": {"host": {"type": "string"}, "port": {"type": "integer"}, "ssl": {"type": "boolean"}, "verifySSL": {"type": "boolean"}, "access-key": {"type": "string"}, "secret-key": {"type": "string"}, "bucket": {"type": "string"}, "location": {"type": "string"}, "backup_key": {"type": "string"}, "presigned": {"type": "object", "properties": {"url": {"type": "string"}, "fields": {"type": "object", "additionalProperties": {}}}, "required": ["url", "fields"]}}, "required": ["bucket", "backup_key"]}, "MongoCoordinates": {"type": "object", "properties": {"uri": {"type": "string"}, "database": {"type": "string"}}, "required": ["uri", "database"]}, "S3Coordinates": {"type": "object", "description": "If provided, the S3 data will be copied", "properties": {"host": {"type": "string"}, "port": {"type": "integer"}, "ssl": {"type": "boolean"}, "verifySSL": {"type": "boolean"}, "access-key": {"type": "string"}, "secret-key": {"type": "string"}, "bucket": {"type": "string"}, "location": {"type": "string"}, "key_prefix": {"type": "string"}}, "required": ["host", "port", "ssl", "verifySSL", "access-key", "secret-key", "bucket", "location", "key_prefix"]}, "MongoS3Coordinates": {"type": "object", "properties": {"mongo": {"$ref": "#/definitions/MongoCoordinates"}, "s3": {"$ref": "#/definitions/S3Coordinates"}}}, "CollectionListCoordinates": {"type": "object", "properties": {"collections": {"type": "array", "items": {"type": "string"}}}}, "MongoS3CoordinatesWithCollectionList": {"allOf": [{"$ref": "#/definitions/MongoS3Coordinates"}, {"$ref": "#/definitions/CollectionListCoordinates"}]}, "CpsPackage": {"type": "object", "properties": {"name": {"type": "string"}, "package_id": {"type": "string"}, "description": {"type": "string"}, "type": {"type": "string", "enum": ["model", "dictionary", "knowledge_graph", "data_catalog", "data_flow", "bundle"]}, "dependencies": {"type": "array", "items": {"type": "string"}}}, "required": ["name", "package_id", "description", "type", "dependencies"]}, "EntityAnnotation": {"type": "object", "properties": {"match": {"type": "string"}, "range": {"type": "array", "description": "2-Tuple representing the low and high indexes of the matching substring", "items": {"type": "integer"}, "minItems": 2, "maxItems": 2}, "subtype": {"type": "string"}, "type": {"type": "string"}}, "required": ["match", "range", "type"]}, "RelationshipAnnotation": {"type": "object"}, "ObjectPropertyMap": {"type": "object"}, "AnnotatedText": {"type": "object", "required": ["text", "entities", "relationships", "properties"], "properties": {"text": {"type": "string"}, "entities": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/EntityAnnotation"}}}, "relationships": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/RelationshipAnnotation"}}}, "properties": {"$ref": "#/definitions/ObjectPropertyMap"}}}, "AnnotatedTable": {"type": "object", "required": ["entities", "relationships", "properties"], "properties": {"text": {"type": "string"}, "entities": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/EntityAnnotation"}}}, "relationships": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/RelationshipAnnotation"}}}, "properties": {"$ref": "#/definitions/ObjectPropertyMap"}}}, "AnnotatedImage": {"type": "object", "required": ["entities", "relationships", "properties"], "properties": {"text": {"type": "string"}, "entities": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/EntityAnnotation"}}}, "relationships": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/RelationshipAnnotation"}}}, "properties": {"$ref": "#/definitions/ObjectPropertyMap"}}}, "AnnotatedObject": {"type": "object", "minProperties": 1, "maxProperties": 1, "properties": {"text": {"title": "AnnotatedTextLines", "type": "object", "required": ["text", "entities", "relationships", "properties"], "properties": {"text": {"description": "Input text after clean up. The annotation indexes will be based on this text and not the input text.", "type": "string"}, "entities": {"type": "array", "description": "One item per line on the original text.", "items": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/EntityAnnotation"}}}}, "relationships": {"type": "array", "description": "One item per line on the original text.", "items": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/RelationshipAnnotation"}}}}, "properties": {"type": "array", "description": "One item per line on the original text.", "items": {"$ref": "#/definitions/ObjectPropertyMap"}}}}, "table": {"$ref": "#/definitions/AnnotatedTable"}, "image": {"$ref": "#/definitions/AnnotatedImage"}}}, "TopologyNode": {"type": "object", "properties": {"name": {"type": "string"}}, "required": ["name"]}, "TopologyEdge": {"type": "object", "properties": {"name": {"type": "string"}, "source": {"type": "array", "items": {"type": "string"}}, "target": {"type": "array", "items": {"type": "string"}}}, "required": ["name", "source", "target"]}, "Topology": {"type": "object", "properties": {"categories": {"type": "array", "items": {"$ref": "#/definitions/TopologyNode"}}, "edges": {"type": "array", "items": {"$ref": "#/definitions/TopologyEdge"}}}, "required": ["categories", "edges"]}, "DataCatalogTopologyNode": {"properties": {"name": {"type": "string"}, "data-fields": {"type": "array", "items": {"type": "string"}}}, "required": ["name", "data-fields"]}, "DataCatalogTopologyEdge": {"type": "object", "properties": {"name": {"type": "string"}, "source": {"type": "array", "items": {"type": "string"}}, "target": {"type": "array", "items": {"type": "string"}}, "source_field": {"type": "string"}, "target_field": {"type": "string"}}, "required": ["name", "source", "target", "source_field", "target_field"]}, "DataCatalogTopology": {"properties": {"categories": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogTopologyNode"}}, "edges": {"type": "array", "items": {"$ref": "#/definitions/DataCatalogTopologyEdge"}}}, "required": ["categories", "edges"]}, "DataCatalogImportResult": {"type": "object", "required": ["data_catalogue", "import_task"], "properties": {"data_catalogue": {"$ref": "#/definitions/DataCatalogue"}, "import_task": {"$ref": "#/definitions/Task"}}}, "ElasticCoordinates": {"type": "object", "required": ["hosts"], "properties": {"hosts": {"type": "array", "items": {"type": "string"}}, "ca_certificate_base64": {"type": "string"}, "dangerously_disable_ssl_validation": {"type": "boolean"}}}, "ModelConfiguration": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string", "x-nullable": true}, "model_config_key": {"type": "string"}, "proj_key": {"type": "string"}, "created_by": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "public": {"type": "boolean"}, "configurations": {"type": "object", "properties": {"type": {"type": "string"}}, "required": ["type"], "additionalProperties": {}}, "supported_annotations": {"type": "object"}}, "required": ["name", "description", "model_config_key", "proj_key", "created_by", "created_at", "public"]}, "DictionaryCollectionObjectData": {"title": "DictionaryCollectionObjectData", "type": "array", "items": {"title": "DictionaryEntryWithId", "properties": {"_id": {"type": "string"}}, "required": ["_id"], "allOf": [{"$ref": "#/definitions/DictionaryEntry"}]}}, "DictionaryCollectionCsvData": {"title": "DictionaryCollectionCsvData", "type": "object", "properties": {"header": {"type": "string"}, "body": {"type": "string"}}, "required": ["header", "body"]}, "ProjectDefaultValues": {"type": "object", "properties": {"ccs_project": {"type": "object", "required": ["proj_key", "name"], "properties": {"proj_key": {"type": "string"}, "name": {"type": "string"}, "collection_name": {"type": "string"}}}, "dataflow": {"type": "object", "required": ["df_tpl_key", "name"], "properties": {"df_tpl_key": {"type": "string"}, "name": {"type": "string"}}}}}, "ProjectIntegrations": {"x-anyOf": [{"title": "Genai", "x-anyOf": [{"title": "GenAIWatsonx", "description": "GenAI integration for watsonx settings", "type": "object", "properties": {"kind": {"title": "Kind", "default": "watsonx", "const": "watsonx", "type": "string"}, "config": {"title": "GenAIWatsonxConfig", "description": "Config for watsonx", "type": "object", "properties": {"GENAI_API": {"title": "Endpoint", "type": "string"}, "GENAI_PROJECT_ID": {"title": "Project Id", "type": "string"}, "GENAI_KEY": {"title": "Apikey", "type": "string", "writeOnly": true, "format": "password"}}, "required": ["endpoint", "project_id", "apikey"]}}, "required": ["config"]}, {"title": "GenAIBAM", "description": "GenAI integration for BAM settings", "type": "object", "properties": {"kind": {"title": "Kind", "default": "bam", "const": "bam", "type": "string"}, "config": {"title": "GenAIBAMConfig", "description": "Config for BAM", "type": "object", "properties": {"GENAI_API": {"title": "Endpoint", "type": "string"}, "GENAI_KEY": {"title": "Apikey", "type": "string", "writeOnly": true, "format": "password"}}, "required": ["endpoint", "apikey"]}}, "required": ["config"]}, {"title": "GenAIHFInferenceApi", "description": "GenAI integration for Inference API settings", "type": "object", "properties": {"kind": {"title": "Kind", "default": "hf_api", "const": "hf_api", "type": "string"}, "config": {"title": "GenAIHFInferenceApiConfig", "description": "Config for HF Inference API", "type": "object", "properties": {"GENAI_HF_API_KEY": {"title": "Genai Hf Api Key", "type": "string", "writeOnly": true, "format": "password"}}, "required": ["GENAI_HF_API_KEY"]}}, "required": ["config"]}, {"title": "GenAIAWSBedrock", "description": "GenAI integration for AWS Bedrock settings", "type": "object", "properties": {"kind": {"title": "Kind", "default": "aws_bedrock", "const": "aws_bedrock", "type": "string"}, "config": {"title": "GenAIAWSBedrockConfig", "description": "Config for AWS Bedrock", "type": "object", "properties": {"GENAI_AWS_ACCESS_KEY": {"title": "Genai Aws Access Key", "type": "string", "writeOnly": true, "format": "password"}, "GENAI_AWS_SECRET_KEY": {"title": "Genai Aws Secret Key", "type": "string", "writeOnly": true, "format": "password"}, "GENAI_AWS_REGION_NAME": {"title": "Genai Aws Region Name", "type": "string"}}, "required": ["GENAI_AWS_ACCESS_KEY", "GENAI_AWS_SECRET_KEY", "GENAI_AWS_REGION_NAME"]}}, "required": ["config"]}]}]}, "BagBackendAware": {"type": "object", "required": ["proj_key", "bag_key", "name", "description", "slug", "timestamp", "backend", "public"], "properties": {"proj_key": {"type": "string"}, "bag_key": {"type": "string"}, "name": {"type": "string"}, "description": {"type": "string"}, "slug": {"type": "string"}, "timestamp": {"type": "number", "format": "double"}, "backend": {"type": "object", "title": "BagBackends", "properties": {"kg_legacy_api": {"type": "object", "title": "BagKgLegacyApiBackend", "properties": {"bag_domain": {"type": "string"}, "flavour": {"type": "string"}, "bag_url": {"type": "string"}, "token": {"type": "string"}, "_svc_endpoint": {"type": "string"}}}, "kg_amqp": {"type": "object", "title": "BagAmqpBackend", "properties": {"flavour": {"type": "string"}}}}}, "public": {"type": "boolean"}, "last_coords_resolution": {"type": "number"}}}, "TakeSnapshotSettingsBackendAware": {"type": "object", "properties": {"backend_flavours": {"type": "object", "title": "BackendFlavour", "properties": {"kg_amqp": {"type": "string"}, "kg_legacy_api": {"type": "string"}}}, "name": {"type": "string"}, "load_into_kg_after_created": {"type": "boolean", "default": false}}, "required": ["backend_flavours"]}, "BagStatusBackendAware": {"type": "object", "properties": {"overall_status": {"$ref": "#/definitions/BagComponentStatusEnum"}, "kg_amqp": {"type": "object", "properties": {"status": {"$ref": "#/definitions/BagComponentStatusEnum"}}, "required": ["status"]}, "kg_legacy_api": {"$ref": "#/definitions/BagStatus"}}, "required": ["overall_status"]}, "AnnotatorSupportedAnnotationsParameters": {"type": "object", "properties": {"annotator": {"type": "string"}, "annotator_settings": {"type": "object"}}, "required": ["annotator"]}, "ModelSupportedAnnotationsParameters": {"type": "object", "properties": {"model_config_key": {"type": "string"}, "proj_key": {"type": "string"}, "public": {"type": "boolean"}}, "required": ["model_config_key", "proj_key", "public"]}, "ElasticIndexSearchQueryOptions": {"type": "object", "properties": {"_source": {"type": "array", "items": {"type": "string"}}, "from": {"type": "number", "minimum": 0}, "size": {"type": "number", "minimum": 0, "maximum": 10000}, "query": {"type": "object", "additionalProperties": {}}, "aggs": {"type": "object"}, "sort": {"type": "array", "items": {"type": "object"}}}}, "ElasticIndexProperties": {"type": "object"}, "KibanaSavedQueriesResult": {"type": "object", "properties": {"description": {"type": "string"}, "fields": {"type": "array", "items": {"type": "string"}}, "query": {"type": "string"}, "title": {"type": "string"}}}, "AnnotatorParametersOrRef": {"type": "object", "properties": {"type": {"type": "string"}, "model_config_key": {"type": "string"}, "proj_key": {"type": "string"}, "public": {"type": "boolean"}}}, "DataCollection": {"type": "object", "required": ["name", "documents", "health", "status", "metadata"], "properties": {"name": {"type": "string"}, "documents": {"type": "number"}, "health": {"type": "string"}, "status": {"type": "string"}, "metadata": {"type": "object", "required": ["aliases", "created", "description", "source", "version", "type", "domain"], "properties": {"aliases": {"type": "array", "items": {"type": "string"}}, "created": {"type": "string", "format": "datetime"}, "description": {"type": "string"}, "source": {"type": "string"}, "storage": {"type": "string"}, "version": {"type": "string"}, "type": {"type": "string"}, "domain": {"type": "array", "items": {"type": "string"}}}}, "source": {"type": "object", "required": ["index_key"], "properties": {"index_key": {"type": "string"}, "proj_key": {"type": "string"}, "elastic_id": {"type": "string"}}}}}, "Dictionary": {"type": "object", "properties": {"name": {"type": "string"}, "description": {"type": "string", "x-nullable": true}, "dict_key": {"type": "string"}, "proj_key": {"type": "string"}, "created_by": {"type": "string"}, "created_at": {"type": "number", "format": "double"}, "copy_of": {"type": "string", "x-nullable": true}, "public": {"type": "boolean"}, "collections": {"type": "array", "items": {"$ref": "#/definitions/DictionaryCollection"}}}, "required": ["name", "description", "dict_key", "proj_key", "created_by", "created_at", "copy_of", "public"]}, "DictionaryEntry": {"type": "object", "additionalProperties": {}, "properties": {"_name": {"type": "string"}, "_synonyms": {"type": "array", "items": {"type": "string"}}}, "required": ["_name", "_synonyms"]}, "DictionaryCloneResult": {"type": "object", "properties": {"dictionary": {"$ref": "#/definitions/Dictionary"}, "clone_task": {"$ref": "#/definitions/Task"}}}, "DictionaryCollection": {"type": "object", "required": ["name", "item_count"], "properties": {"name": {"type": "string"}, "item_count": {"type": "integer"}}}, "DictionaryCollectionPatch": {"type": "object", "required": ["op", "path"], "properties": {"op": {"type": "string", "enum": ["add", "replace", "remove"]}, "path": {"type": "string", "description": "A path (see JSON patch specification) in the format `/{objectid}` for existing objects, or `/-` for new objects (`add` operations).", "pattern": "^/(?:-|[a-zA-Z0-9]{24})$"}, "value": {"$ref": "#/definitions/DictionaryEntry"}}}, "CpsModelReference": {"type": "object", "properties": {"model_config_key": {"type": "string"}, "proj_key": {"type": "string"}}, "required": ["model_config_key", "proj_key"]}, "CcsCollectionReference": {"type": "object", "properties": {"proj_key": {"type": "string"}, "collection_name": {"type": "string"}, "language": {"type": "string"}}, "required": ["proj_key", "collection_name"]}, "ProcessingModelDataFlow": {"type": "object", "properties": {"config": {"type": "object"}, "data-flow": {"type": "array", "items": {"type": "object"}}}, "required": ["config", "data-flow"]}, "WorkFlow": {"type": "object"}, "ProcessingModel": {"type": "object", "required": ["dataflow"], "properties": {"dataflow": {"$ref": "#/definitions/ProcessingModelDataFlow"}, "variables": {"type": "object", "additionalProperties": {"type": "object", "title": "DataFlowVariableDefinition", "properties": {"type": {"type": "string"}}, "required": ["type"]}}}}, "CatalogReference": {"type": "object", "properties": {"dc_key": {"type": "string"}, "proj_key": {"type": "string"}, "collection_name": {"type": "string"}}, "required": ["dc_key", "collection_name"]}, "EntityMapping": {"type": "object", "additionalProperties": {"type": "string"}}, "ProcessingModelDescription": {"type": "object", "required": ["name", "display_name", "description"], "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}, "description": {"type": "string"}}}}, "basePath": "/api/cps/public/v1"} diff --git a/tools/swagger-client-generator/swagger-user.json b/tools/swagger-client-generator/swagger-user.json index 3f2c5ea1..da2eec5a 100644 --- a/tools/swagger-client-generator/swagger-user.json +++ b/tools/swagger-client-generator/swagger-user.json @@ -1 +1 @@ -{"swagger": "2.0", "info": {"version": "1.2.0", "title": "User Management API"}, "schemes": ["http", "https"], "consumes": ["application/json"], "produces": ["application/json"], "securityDefinitions": {"Bearer": {"description": "For accessing the API a valid JWT token must be passed in all the queries in\nthe 'Authorization' header.\n\nA valid JWT token is generated by the API and returned.\n\nThe following syntax must be used in the 'Authorization' header :\n Bearer: xxxxxx.yyyyyyy.zzzzzz\n", "type": "apiKey", "name": "Authorization", "in": "header", "x-apikeyInfoFunc": "oidc_user_mngt.utils.connexion_auth.api_key_info"}, "UserAPIKey": {"description": "Login using the user credentials. Username is the email address. Password is\nthe API Key.\n", "type": "basic", "x-basicInfoFunc": "oidc_user_mngt.utils.connexion_auth.basic_auth_info"}}, "paths": {"/oidc/authenticate": {"get": {"tags": ["Oidc"], "description": "Redirect to the OIDC authenticate endpoint.", "produces": ["text/plain"], "x-swagger-router-controller": "oidc_user_mngt.controllers.oidc", "operationId": "authenticate", "responses": {"302": {"description": "Redirect to the OIDC authenticate endpoint"}}}}, "/oidc/token": {"get": {"tags": ["Oidc"], "description": "Retrieve the user access and identity tokens using either the code or the refresh_token.", "deprecated": true, "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.oidc", "operationId": "token", "parameters": [{"name": "code", "in": "query", "required": false, "type": "string", "description": "The oidc code response"}, {"name": "refresh_token", "in": "query", "required": false, "type": "string", "description": "The oidc code response"}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/OidcTokenResponse"}}}}, "post": {"tags": ["Oidc"], "description": "Retrieve the user access and identity tokens using either the code or the refresh_token.", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.oidc", "operationId": "create_tokens", "parameters": [{"name": "body", "in": "body", "schema": {"title": "CreateTokensRequestBody", "type": "object", "properties": {"code": {"type": "string", "description": "The oidc code response"}, "refresh_token": {"type": "string", "description": "The refresh token"}}}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/OidcTokenResponse"}}}}}, "/oidc/register_user": {"post": {"tags": ["Oidc"], "description": "Register a new user, provided a valid access_token and id_token from the oidc provider.", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.oidc", "operationId": "register_user", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"type": "object", "title": "RegisterUserRequestBody", "properties": {"access_token": {"type": "string", "description": "OIDC access_token signed by the provider"}, "id_token": {"type": "string", "description": "OIDC id_token signed by the provider"}}, "required": ["access_token", "id_token"]}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/UserDetails"}}}}}, "/user/impersonate": {"post": {"tags": ["Users"], "security": [{"Bearer": []}, {"UserAPIKey": []}], "description": "Request an impersonate user token.", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.user", "operationId": "impersonate_user_token", "parameters": [{"name": "body", "in": "body", "required": true, "schema": {"type": "object", "title": "ImpersonateUserTokenRequestBody", "required": ["target_user_key", "impersonate_secret"], "properties": {"target_user_key": {"type": "string"}, "impersonate_secret": {"type": "string"}}}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/TokenResponse"}}, "401": {"description": "Unauthorized.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "403": {"description": "The user that's performing this operation does not have permission or the impersonate secret isn't valid.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/user/service_accounts": {"get": {"deprecated": true, "tags": ["Users"], "security": [{"Bearer": []}], "description": "List all service accounts of your user", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.user", "operationId": "service_accounts_list", "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"$ref": "#/definitions/ServiceAccount"}}}}}, "post": {"deprecated": true, "tags": ["Users"], "security": [{"Bearer": []}], "description": "Create a new service accounts for your user", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.user", "operationId": "service_accounts_create", "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/ServiceAccount"}}}}}, "/user/api_key": {"get": {"tags": ["Users"], "security": [{"Bearer": []}], "description": "Show the API Key for your user", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.user", "operationId": "api_key_get", "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/ApiKey"}}}}, "post": {"tags": ["User"], "security": [{"Bearer": []}], "description": "Create an API Key for your user", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.user", "operationId": "api_key_create", "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/ApiKey"}}}}}, "/user/token": {"post": {"tags": ["Users"], "security": [{"Bearer": []}, {"UserAPIKey": []}], "description": "Request a user API token", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.user", "operationId": "get_access_token", "parameters": [{"name": "options", "in": "body", "required": false, "schema": {"type": "object", "title": "GetAccessTokenRequestBody", "properties": {"admin": {"type": "boolean", "default": false}}}}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/AccessToken"}}, "401": {"description": "Unauthorized.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/user/search": {"get": {"tags": ["Users"], "security": [{"Bearer": []}], "description": "Search for users matching the email or name. Depending on the user's permissions, only owners and assignees from their projects may be shown.", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.user", "operationId": "search", "parameters": [{"name": "term", "in": "query", "required": true, "type": "string", "description": "Search term"}], "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"$ref": "#/definitions/UserDetails"}}}}}}, "/user/current": {"get": {"tags": ["Users"], "security": [{"Bearer": []}], "description": "Gets the current user's details.", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.user", "operationId": "get_current_user_details", "parameters": [], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/UserDetails"}}}}}, "/projects": {"get": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "List all projects assigned to a user", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "list_projects", "parameters": [{"name": "role", "in": "query", "required": false, "type": "string", "description": "filter for the user role"}, {"name": "include_collaborators", "in": "query", "required": false, "type": "boolean", "default": true}], "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"$ref": "#/definitions/Project"}}}, "404": {"description": "Project does not exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}, "post": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "Create a new project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "create", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"type": "object", "title": "CreateProjectRequestBody", "properties": {"name": {"type": "string", "description": "Name of the project"}, "proj_key": {"type": "string", "description": "Internal project key to use. (use only if you really know what you are doing)"}}, "required": ["name"]}}], "responses": {"200": {"description": "New project details", "schema": {"$ref": "#/definitions/Project"}}}}}, "/projects/{proj_key}/is_authorized": {"get": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "Provide user-key and project-key to coordinates a project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "is_authorized", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}, {"name": "role", "in": "query", "required": false, "type": "string", "description": "The specific role to probe"}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/SuccessMessage"}}, "401": {"description": "Unauthorized", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "Project does not exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/projects/{proj_key}/delete": {"get": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "Get a delete confirmation token for the provided project.", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "get_delete_confirmation_token", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}], "responses": {"200": {"description": "Confirmation token.", "schema": {"$ref": "#/definitions/TokenResponse"}}, "403": {"description": "The user that is executing this operation is not an owner of the project.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "Project not found.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "409": {"description": "User not assigned to project.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/projects/{proj_key}": {"get": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "Returns the details of the project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "details", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/Project"}}, "401": {"description": "Unauthorized.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "Project does not exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}, "delete": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "Delete a project.", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "delete", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}, {"name": "confirmation_token", "in": "query", "required": true, "type": "string", "description": "The delete confirmation token"}], "responses": {"204": {"description": "Project deleted successfully."}, "403": {"description": "The user that is executing this operation is not an owner of the project.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "Project not found.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "409": {"description": "User not assigned to project.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/projects/{proj_key}/users": {"get": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "List all users belonging to a project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "list_users", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}], "responses": {"200": {"description": "OK", "schema": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/UserDetails"}}}}, "401": {"description": "Unauthorized.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "User does not exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}, "post": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "Assign a new user to a project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "add_user", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}, {"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ProjectUserAssignment"}}], "responses": {"200": {"description": "User assigned to project.", "schema": {"$ref": "#/definitions/SuccessMessage"}}, "400": {"description": "Invalid new_user_type.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "403": {"description": "The user that's performing this operation does not have permission to assign the user.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "User that's going to be assigned doesn't exist, or the project doesn't exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "409": {"description": "Reassigning the user would leave the project in an invalid state.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}, "put": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "Assign a new user to a project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "edit_user", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}, {"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ProjectUserAssignment"}}], "responses": {"200": {"description": "User assigned to project.", "schema": {"$ref": "#/definitions/SuccessMessage"}}, "400": {"description": "Invalid new_user_type.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "403": {"description": "The user that's performing this operation does not have permission to assign the user.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "User that's going to be assigned doesn't exist, or the project doesn't exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "409": {"description": "Reassigning the user would leave the project in an invalid state.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/projects/{proj_key}/users_paginated": {"get": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "List all users belonging to a cps project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "list_users_paginated", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}, {"name": "page", "in": "query", "description": "page of the result list", "required": false, "type": "integer"}, {"name": "items_per_page", "in": "query", "description": "items on one page of the result list", "required": false, "default": 2, "type": "integer"}], "responses": {"200": {"description": "OK", "schema": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/UserDetails"}}}}, "401": {"description": "Unauthorized.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "User does not exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/projects/{proj_key}/users/{username}": {"delete": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "Delete an user from a project.", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "remove_user", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}, {"name": "username", "in": "path", "required": true, "type": "string", "description": "The username for the user"}], "responses": {"204": {"description": "User deleted from project successfully."}, "403": {"description": "The user that is executing this operation is not an owner of the project.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "Project or user not found.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "409": {"description": "User not assigned to project, or the project only has one owner left.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/projects/{proj_key}/token": {"get": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "Request a token granting access to the current project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "get_project_token", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}], "responses": {"200": {"description": "OK", "schema": {"$ref": "#/definitions/AccessToken"}}, "401": {"description": "Unauthorized.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "Project does not exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/projects/{proj_key}/audits": {"get": {"tags": ["Projects"], "security": [{"Bearer": []}], "description": "List audits related to the project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.project", "operationId": "list_audits_in_project", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}, {"name": "user_key", "in": "query", "required": false, "type": "string"}, {"name": "type_", "in": "query", "type": "string", "required": false}, {"name": "search_term", "in": "query", "type": "string", "required": false}, {"name": "before", "in": "query", "type": "string", "format": "datetime", "required": false}, {"name": "after", "in": "query", "type": "string", "format": "datetime", "required": false}, {"name": "limit", "in": "query", "type": "integer", "default": 50}], "responses": {"200": {"description": "OK", "schema": {"type": "object", "required": ["audits"], "properties": {"audits": {"type": "array", "items": {"$ref": "#/definitions/AuditRecord"}}}}}, "401": {"description": "Unauthorized.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "Project does not exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/permissions": {"get": {"tags": ["Settings"], "security": [{"Bearer": []}], "description": "Get the global permissions for users.", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.global", "operationId": "global_permissions", "responses": {"200": {"description": "OK", "schema": {"type": "object", "additionalProperties": {"type": "boolean"}}}, "401": {"description": "Unauthorized", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/admin/users/pending": {"get": {"tags": ["Admin"], "security": [{"Bearer": []}], "description": "List pending user requests.", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.admin", "operationId": "list_pending_users", "parameters": [{"name": "term", "type": "string", "in": "query", "required": false}], "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"$ref": "#/definitions/UserDetails"}}}, "401": {"description": "Unauthorized", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/admin/users/{user_key}/confirmation": {"post": {"tags": ["Admin"], "security": [{"Bearer": []}], "description": "Confirm a pending user.", "consumes": ["application/json"], "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.admin", "operationId": "confirm_user", "parameters": [{"name": "user_key", "in": "path", "required": true, "type": "string"}], "responses": {"200": {"description": "OK"}, "401": {"description": "Unauthorized", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/admin/projects/all": {"get": {"tags": ["Admin"], "security": [{"Bearer": []}], "description": "List all projects", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.admin", "operationId": "list_all_projects", "responses": {"200": {"description": "OK", "schema": {"type": "array", "items": {"$ref": "#/definitions/Project"}}}, "404": {"description": "Project does not exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/admin/audits": {"get": {"tags": ["Admin"], "security": [{"Bearer": []}], "description": "List audits globally", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.admin", "operationId": "list_audits", "parameters": [{"name": "user_key", "in": "query", "required": false, "type": "string"}, {"name": "type_", "in": "query", "type": "string", "required": false}, {"name": "search_term", "in": "query", "type": "string", "required": false}, {"name": "before", "in": "query", "type": "string", "format": "datetime", "required": false}, {"name": "after", "in": "query", "type": "string", "format": "datetime", "required": false}, {"name": "limit", "in": "query", "type": "integer", "default": 50}], "responses": {"200": {"description": "OK", "schema": {"type": "object", "required": ["audits"], "properties": {"audits": {"type": "array", "items": {"$ref": "#/definitions/AuditRecord"}}}}}, "401": {"description": "Unauthorized.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "Project does not exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/admin/projects/{proj_key}/users": {"get": {"tags": ["Admin"], "security": [{"Bearer": []}], "description": "List all users belonging to a cps project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.admin", "operationId": "admin_list_users", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}, {"name": "page", "in": "query", "description": "page of the result list", "required": false, "type": "integer"}, {"name": "items_per_page", "in": "query", "description": "items on one page of the result list", "required": false, "default": 2, "type": "integer"}], "responses": {"200": {"description": "OK", "schema": {"type": "object", "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/UserDetails"}}}}, "401": {"description": "Unauthorized.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "User does not exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}, "post": {"tags": ["Admin"], "security": [{"Bearer": []}], "description": "Assign a new user to a project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.admin", "operationId": "admin_add_user", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}, {"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ProjectUserAssignment"}}], "responses": {"200": {"description": "User assigned to project.", "schema": {"$ref": "#/definitions/SuccessMessage"}}, "400": {"description": "Invalid new_user_type.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "403": {"description": "The user that's performing this operation does not have permission to assign the user.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "User that's going to be assigned doesn't exist, or the project doesn't exist.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "409": {"description": "Reassigning the user would leave the project in an invalid state.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/admin/projects/{proj_key}/users/{username}": {"delete": {"tags": ["Admin"], "security": [{"Bearer": []}], "description": "Delete an user from a project.", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.admin", "operationId": "admin_remove_user", "parameters": [{"name": "proj_key", "in": "path", "required": true, "type": "string", "description": "The project key"}, {"name": "username", "in": "path", "required": true, "type": "string", "description": "The username for the user"}], "responses": {"204": {"description": "User deleted from project successfully."}, "403": {"description": "The user that is executing this operation is not an owner of the project.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "404": {"description": "Project or user not found.", "schema": {"$ref": "#/definitions/ErrorResponse"}}, "409": {"description": "User not assigned to project, or the project only has one owner left.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/admin/projects": {"post": {"tags": ["Admin"], "security": [{"Bearer": []}], "description": "Create a new project", "produces": ["application/json"], "x-swagger-router-controller": "oidc_user_mngt.controllers.admin", "operationId": "create_project", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"type": "object", "title": "CreateProjectRequestBody", "properties": {"name": {"type": "string", "description": "Name of the project"}, "proj_key": {"type": "string", "description": "Internal project key to use. (use only if you really know what you are doing)"}}, "required": ["name"]}}], "responses": {"200": {"description": "New project details", "schema": {"$ref": "#/definitions/Project"}}}}}}, "definitions": {"ErrorResponse": {"type": "object", "properties": {"error": {"type": "string", "description": "Description of the error."}}, "required": ["error"]}, "UserDetails": {"type": "object", "properties": {"username": {"type": "string"}, "email": {"type": "string"}, "role": {"type": "string"}}}, "UserType": {"type": "string", "enum": ["assignee", "owner"]}, "ServiceAccount": {"type": "object", "required": ["user_key"], "properties": {"user_key": {"type": "string"}, "name": {"type": "string"}, "credentials": {"type": "object", "required": ["username", "password"], "properties": {"username": {"type": "string"}, "password": {"type": "string"}}}}}, "TokenResponse": {"type": "object", "properties": {"token": {"type": "string", "description": "The delete confirmation token."}}, "required": ["token"]}, "Project": {"type": "object", "properties": {"name": {"type": "string"}, "date": {"type": "string", "format": "datetime"}, "proj_key": {"type": "string"}, "role": {"$ref": "#/definitions/UserType"}}, "additionalProperties": {"type": "array", "items": {"$ref": "#/definitions/UserDetails"}}}, "SuccessMessage": {"type": "object", "properties": {"success": {"type": "string", "description": "Human readable message."}}, "required": ["success"]}, "ApiKey": {"type": "object", "required": ["api_key"], "properties": {"api_key": {"type": "string"}, "email": {"type": "string"}}}, "AccessToken": {"type": "object", "properties": {"access_token": {"type": "string"}}}, "ProjectUserAssignment": {"type": "object", "properties": {"username": {"type": "string", "description": "The username"}, "role": {"type": "string", "description": "The role to assign to the user"}, "force_role": {"type": "boolean", "default": true, "description": "If true, the role will be assigned also for existing users"}}, "required": ["username", "role"]}, "OidcTokenResponse": {"type": "object", "properties": {"access_token": {"type": "string"}, "id_token": {"type": "string"}, "refresh_token": {"type": "string"}}, "required": ["id_token", "refresh_token"]}, "AuditRecord": {"title": "AuditRecord", "type": "object", "properties": {"id": {"title": "Id", "type": "string"}, "timestamp": {"title": "Timestamp", "type": "string", "format": "datetime"}, "user_key": {"title": "User Key", "type": "string"}, "type": {"title": "Type", "type": "string"}, "message": {"title": "Message", "type": "string"}, "details": {"title": "Details", "type": "object"}, "proj_key": {"title": "Proj Key", "type": "string", "x-nullable": true}}, "required": ["id", "timestamp", "user_key", "type", "message", "details", "proj_key"]}}, "basePath": "/api/cps/user/v1"} +{"openapi":"3.1.0","info":{"title":"Deep Search (DS) User API","description":"API for Deep Search.","version":"2.0.0"},"servers":[{"url":"/api/cps/user/v1"}],"paths":{"/admin/users/pending":{"get":{"tags":["Admin"],"summary":"List Pending Users","operationId":"list_pending_users","security":[{"HTTPBearer":[]}],"parameters":[{"name":"term","in":"query","required":false,"schema":{"title":"Term"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{},"title":"Response List Pending Users"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_key}/confirmation":{"post":{"tags":["Admin"],"summary":"Confirm User","operationId":"confirm_user","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_key","in":"path","required":true,"schema":{"title":"User Key"}},{"name":"admin_user","in":"query","required":true,"schema":{"title":"Admin User"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/projects/all":{"post":{"tags":["Admin"],"summary":"List All Projects","operationId":"list_all_projects","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{},"type":"array","title":"Response List All Projects"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/audits":{"post":{"tags":["Admin"],"summary":"List Audits","operationId":"list_audits","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Key"}},{"name":"type_","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type "}},{"name":"search_term","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Term"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Before"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"After"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAuditsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/projects":{"post":{"tags":["Admin"],"summary":"Create Project","operationId":"create_project","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Project"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/projects/{proj_key}/users":{"get":{"tags":["Admin"],"summary":"Admin List Users","operationId":"admin_list_users","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"role","in":"query","required":false,"schema":{"title":"Role"}},{"name":"page","in":"query","required":false,"schema":{"title":"Page"}},{"name":"items_per_page","in":"query","required":false,"schema":{"title":"Items Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListUsersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Admin"],"summary":"Admin Add User","operationId":"admin_add_user","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"title":"Proj Key"}},{"name":"data","in":"query","required":true,"schema":{"title":"Data"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAddUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/projects/{proj_key}/users/{username}":{"delete":{"tags":["Admin"],"summary":"Admin Remove User","operationId":"admin_remove_user","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"title":"Proj Key"}},{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/permissions":{"get":{"tags":["Global"],"summary":"Global Permissions","operationId":"global_permissions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalPermissionsResponse"}}}}}}},"/oidc/authenticate":{"get":{"tags":["OIDC"],"summary":"Authenticate","operationId":"authenticate","responses":{"302":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oidc/token":{"get":{"tags":["OIDC"],"summary":"Token","operationId":"token","parameters":[{"name":"code","in":"query","required":false,"schema":{"title":"Code"}},{"name":"refresh_token","in":"query","required":false,"schema":{"title":"Refresh Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["OIDC"],"summary":"Create Tokens","operationId":"create_tokens","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oidc/register_user":{"post":{"tags":["OIDC"],"summary":"Register User","operationId":"register_user","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects":{"get":{"tags":["Project"],"summary":"List Projects","operationId":"list_projects","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}},{"name":"include_collaborators","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Collaborators"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectDetailsResponse"},"title":"Response List Projects"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Project"],"summary":"Create","operationId":"create","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDetailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{proj_key}/is_authorized":{"get":{"tags":["Project"],"summary":"Is Authorized","operationId":"is_authorized","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"title":"Proj Key"}},{"name":"role","in":"query","required":false,"schema":{"title":"Role"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsAuthorizedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{proj_key}/delete":{"get":{"tags":["Project"],"summary":"Get Delete Confirmation Token","operationId":"get_delete_confirmation_token","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteConfirmationTokenReponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{proj_key}":{"get":{"tags":["Project"],"summary":"Details","operationId":"details","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDetailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Project"],"summary":"Delete","operationId":"delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"confirmation_token","in":"query","required":true,"schema":{"type":"string","title":"Confirmation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDeleteReponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{proj_key}/users":{"get":{"tags":["Project"],"summary":"List Users","operationId":"list_users","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"role","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCollaboratorsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Project"],"summary":"Add User","operationId":"add_user","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAddEditUserReponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Project"],"summary":"Edit User","operationId":"edit_user","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAddEditUserReponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{proj_key}/users_paginated":{"get":{"tags":["Project"],"summary":"List Users Paginated","operationId":"list_users_paginated","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"page","in":"query","required":true,"schema":{"type":"integer","title":"Page"}},{"name":"items_per_page","in":"query","required":true,"schema":{"type":"integer","title":"Items Per Page"}},{"name":"role","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListUsersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{proj_key}/users/{username}":{"delete":{"tags":["Project"],"summary":"Remove User","operationId":"remove_user","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{proj_key}/token":{"get":{"tags":["Project"],"summary":"Get Project Token","operationId":"get_project_token","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccessTokenReponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{proj_key}/audits":{"get":{"tags":["Project"],"summary":"List Audits In Project","operationId":"list_audits_in_project","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proj_key","in":"path","required":true,"schema":{"type":"string","title":"Proj Key"}},{"name":"user_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Key"}},{"name":"type_","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type "}},{"name":"search_term","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Term"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Before"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"After"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAuditsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/impersonate":{"post":{"tags":["Service Accounts"],"summary":"Impersonate User Token","operationId":"impersonate_user_token","security":[{"HTTPBearer":[]}],"parameters":[{"name":"body","in":"query","required":true,"schema":{"title":"Body"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImpersonateUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/service_accounts":{"get":{"tags":["Service Accounts"],"summary":"Service Accounts List","operationId":"service_accounts_list","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ServiceAccountsResponse"},"type":"array","title":"Response Service Accounts List"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Service Accounts"],"summary":"Service Accounts Create","operationId":"service_accounts_create","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceAccountsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/user/api_key":{"get":{"tags":["Service Accounts"],"summary":"Api Key Get","operationId":"api_key_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserApiKeyResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Service Accounts"],"summary":"Api Key Create","operationId":"api_key_create","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserApiKeyResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/user/token":{"post":{"tags":["Service Accounts"],"summary":"Get Access Token","operationId":"get_access_token","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Options"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccessTokenReponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"HTTPBasic":[]}]}},"/user/current":{"get":{"tags":["Service Accounts"],"summary":"Get Current User Details","operationId":"get_current_user_details","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCurrentUserDetailsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/user/search":{"get":{"tags":["Service Accounts"],"summary":"Search","operationId":"search","security":[{"HTTPBearer":[]}],"parameters":[{"name":"term","in":"query","required":true,"schema":{"title":"Term"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/UserDetailsResponse"},{"type":"null"}]},"title":"Response Search"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AdminAddUserResponse":{"properties":{"success":{"type":"string","title":"Success"}},"type":"object","required":["success"],"title":"AdminAddUserResponse"},"DeleteConfirmationTokenReponse":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"DeleteConfirmationTokenReponse"},"GetAccessTokenReponse":{"properties":{"access_token":{"type":"string","title":"Access Token"}},"type":"object","required":["access_token"],"title":"GetAccessTokenReponse"},"GetCurrentUserDetailsResponse":{"properties":{"user_key":{"type":"string","title":"User Key"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"can_be_admin":{"type":"boolean","title":"Can Be Admin"},"is_admin":{"type":"boolean","title":"Is Admin"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}},"type":"object","required":["user_key","email","name","can_be_admin","is_admin","role"],"title":"GetCurrentUserDetailsResponse"},"GlobalPermissionsResponse":{"properties":{"search_any_user":{"type":"boolean","title":"Search Any User"},"disable_project_creation":{"type":"boolean","title":"Disable Project Creation","default":false},"match_users_by_email":{"type":"boolean","title":"Match Users By Email","default":false},"signup":{"type":"boolean","title":"Signup"},"strict_user_search_by_email":{"type":"boolean","title":"Strict User Search By Email","default":false}},"type":"object","required":["search_any_user","signup"],"title":"GlobalPermissionsResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImpersonateUserResponse":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"ImpersonateUserResponse"},"IsAuthorizedResponse":{"properties":{"authorized":{"type":"boolean","title":"Authorized"}},"type":"object","required":["authorized"],"title":"IsAuthorizedResponse"},"ListAuditsResponse":{"properties":{"audits":{"items":{"type":"object"},"type":"array","title":"Audits"}},"type":"object","required":["audits"],"title":"ListAuditsResponse"},"ListUsersResponse":{"properties":{"count":{"type":"integer","title":"Count"},"items_per_page":{"type":"integer","title":"Items Per Page"},"page":{"type":"integer","title":"Page"},"users":{"items":{"$ref":"#/components/schemas/UserResponseModel"},"type":"array","title":"Users"}},"type":"object","required":["count","items_per_page","page","users"],"title":"ListUsersResponse"},"ProjectAddEditUserReponse":{"properties":{"success":{"type":"string","title":"Success"}},"type":"object","required":["success"],"title":"ProjectAddEditUserReponse"},"ProjectCollaboratorsResponse":{"properties":{"owners":{"items":{},"type":"array","title":"Owners"},"editors":{"items":{},"type":"array","title":"Editors"},"viewers":{"items":{},"type":"array","title":"Viewers"}},"type":"object","required":["owners","editors","viewers"],"title":"ProjectCollaboratorsResponse"},"ProjectDeleteReponse":{"properties":{"success":{"type":"string","title":"Success"}},"type":"object","required":["success"],"title":"ProjectDeleteReponse"},"ProjectDetailsResponse":{"properties":{"owners":{"items":{},"type":"array","title":"Owners"},"editors":{"items":{},"type":"array","title":"Editors"},"viewers":{"items":{},"type":"array","title":"Viewers"},"name":{"type":"string","title":"Name"},"date":{"type":"string","title":"Date"},"proj_key":{"type":"string","title":"Proj Key"},"role":{"type":"string","title":"Role"}},"type":"object","required":["owners","editors","viewers","name","date","proj_key","role"],"title":"ProjectDetailsResponse"},"ServiceAccountsResponse":{"properties":{"user_key":{"type":"string","title":"User Key"},"name":{"type":"string","title":"Name"},"credentials":{"type":"object","title":"Credentials"}},"type":"object","required":["user_key","name","credentials"],"title":"ServiceAccountsResponse"},"UserApiKeyResponse":{"properties":{"email":{"type":"string","title":"Email"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["email","api_key"],"title":"UserApiKeyResponse"},"UserDetailsResponse":{"properties":{"user_key":{"type":"string","title":"User Key"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"}},"type":"object","required":["user_key","email","name"],"title":"UserDetailsResponse"},"UserResponseModel":{"properties":{"_id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"user_key":{"type":"string","title":"User Key"}},"type":"object","required":["email","name","role","user_key"],"title":"UserResponseModel"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"},"HTTPBasic":{"type":"http","scheme":"basic"}}}} \ No newline at end of file