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"