diff --git a/deepsearch/cps/apis/public_v2/__init__.py b/deepsearch/cps/apis/public_v2/__init__.py new file mode 100644 index 00000000..a8426b62 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/__init__.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "2.0.0" + +# import apis into sdk package +from deepsearch.cps.apis.public_v2.api.data_indices_api import DataIndicesApi +from deepsearch.cps.apis.public_v2.api.data_indices_upload_api import DataIndicesUploadApi +from deepsearch.cps.apis.public_v2.api.knowledge_graphs_api import KnowledgeGraphsApi +from deepsearch.cps.apis.public_v2.api.project_api import ProjectApi +from deepsearch.cps.apis.public_v2.api.semantic_api import SemanticApi +from deepsearch.cps.apis.public_v2.api.system_api import SystemApi +from deepsearch.cps.apis.public_v2.api.system_flavours_api import SystemFlavoursApi +from deepsearch.cps.apis.public_v2.api.system_quotas_api import SystemQuotasApi +from deepsearch.cps.apis.public_v2.api.system_summary_api import SystemSummaryApi +from deepsearch.cps.apis.public_v2.api.tasks_api import TasksApi +from deepsearch.cps.apis.public_v2.api.upload_api import UploadApi + +# import ApiClient +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.api_client import ApiClient +from deepsearch.cps.apis.public_v2.configuration import Configuration +from deepsearch.cps.apis.public_v2.exceptions import OpenApiException +from deepsearch.cps.apis.public_v2.exceptions import ApiTypeError +from deepsearch.cps.apis.public_v2.exceptions import ApiValueError +from deepsearch.cps.apis.public_v2.exceptions import ApiKeyError +from deepsearch.cps.apis.public_v2.exceptions import ApiAttributeError +from deepsearch.cps.apis.public_v2.exceptions import ApiException + +# import models into sdk package +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.bag_flavour_full_data import BagFlavourFullData +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.collection_metadata_settings import CollectionMetadataSettings +from deepsearch.cps.apis.public_v2.models.convert_documents_request_body import ConvertDocumentsRequestBody +from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask +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.default_values import DefaultValues +from deepsearch.cps.apis.public_v2.models.deployment import Deployment +from deepsearch.cps.apis.public_v2.models.direct_model_config import DirectModelConfig +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.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.http_validation_error import HTTPValidationError +from deepsearch.cps.apis.public_v2.models.json_upload_request_body import JsonUploadRequestBody +from deepsearch.cps.apis.public_v2.models.list_project_flavours import ListProjectFlavours +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.ocr_settings import OcrSettings +from deepsearch.cps.apis.public_v2.models.package import Package +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters import PartialDirectConversionParameters +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_flavour_total_kgs import ProjectFlavourTotalKgs +from deepsearch.cps.apis.public_v2.models.project_flavours_quota import ProjectFlavoursQuota +from deepsearch.cps.apis.public_v2.models.project_package_instalation_manifest import ProjectPackageInstalationManifest +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.project_source_data_index import ProjectSourceDataIndex +from deepsearch.cps.apis.public_v2.models.projects_flavours import ProjectsFlavours +from deepsearch.cps.apis.public_v2.models.properties import Properties +from deepsearch.cps.apis.public_v2.models.reference_to_model import ReferenceToModel +from deepsearch.cps.apis.public_v2.models.response_get_project_integration_config import ResponseGetProjectIntegrationConfig +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.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.source import Source +from deepsearch.cps.apis.public_v2.models.source1 import Source1 +from deepsearch.cps.apis.public_v2.models.storage_summary_task import StorageSummaryTask +from deepsearch.cps.apis.public_v2.models.system_info import SystemInfo +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.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.token_response import TokenResponse +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.view_of import ViewOf diff --git a/deepsearch/cps/apis/public_v2/api/__init__.py b/deepsearch/cps/apis/public_v2/api/__init__.py new file mode 100644 index 00000000..e302a2ec --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/__init__.py @@ -0,0 +1,15 @@ +# flake8: noqa + +# import apis into api package +from deepsearch.cps.apis.public_v2.api.data_indices_api import DataIndicesApi +from deepsearch.cps.apis.public_v2.api.data_indices_upload_api import DataIndicesUploadApi +from deepsearch.cps.apis.public_v2.api.knowledge_graphs_api import KnowledgeGraphsApi +from deepsearch.cps.apis.public_v2.api.project_api import ProjectApi +from deepsearch.cps.apis.public_v2.api.semantic_api import SemanticApi +from deepsearch.cps.apis.public_v2.api.system_api import SystemApi +from deepsearch.cps.apis.public_v2.api.system_flavours_api import SystemFlavoursApi +from deepsearch.cps.apis.public_v2.api.system_quotas_api import SystemQuotasApi +from deepsearch.cps.apis.public_v2.api.system_summary_api import SystemSummaryApi +from deepsearch.cps.apis.public_v2.api.tasks_api import TasksApi +from deepsearch.cps.apis.public_v2.api.upload_api import UploadApi + diff --git a/deepsearch/cps/apis/public_v2/api/data_indices_api.py b/deepsearch/cps/apis/public_v2/api/data_indices_api.py new file mode 100644 index 00000000..f6824042 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/data_indices_api.py @@ -0,0 +1,1738 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from deepsearch.cps.apis.public_v2.models.data import Data +from deepsearch.cps.apis.public_v2.models.project_data_index_with_status import ProjectDataIndexWithStatus +from deepsearch.cps.apis.public_v2.models.token_response import TokenResponse + +from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.rest import RESTResponseType + + +class DataIndicesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_project_data_index( + self, + 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: + """Create Project Data Index + + Create a project data index. + + :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._create_project_data_index_serialize( + 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, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_project_data_index_with_http_info( + self, + 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, + ) -> ApiResponse[ProjectDataIndexWithStatus]: + """Create Project Data Index + + Create a project data index. + + :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._create_project_data_index_serialize( + 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, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_project_data_index_without_preload_content( + self, + 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, + ) -> RESTResponseType: + """Create Project Data Index + + Create a project data index. + + :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._create_project_data_index_serialize( + 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 + ) + return response_data.response + + + def _create_project_data_index_serialize( + self, + proj_key, + data, + _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 + if data is not None: + _body_params = data + + + # 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', + 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 create_project_data_index_delete_token( + 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, + ) -> TokenResponse: + """Create Project Data Index Delete Token + + Get a token used to confirm the deletion of a project data index. + + :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._create_project_data_index_delete_token_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': "TokenResponse", + '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 create_project_data_index_delete_token_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[TokenResponse]: + """Create Project Data Index Delete Token + + Get a token used to confirm the deletion of a project data index. + + :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._create_project_data_index_delete_token_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': "TokenResponse", + '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 create_project_data_index_delete_token_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: + """Create Project Data Index Delete Token + + Get a token used to confirm the deletion of a project data index. + + :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._create_project_data_index_delete_token_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': "TokenResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_project_data_index_delete_token_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='POST', + resource_path='/project/{proj_key}/data_indices/{index_key}/delete_token', + 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 delete_project_data_index( + self, + index_key: StrictStr, + proj_key: StrictStr, + confirmation_token: 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, + ) -> object: + """Delete Project Data Index + + Delete a project index data. + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param confirmation_token: (required) + :type confirmation_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._delete_project_data_index_serialize( + index_key=index_key, + proj_key=proj_key, + confirmation_token=confirmation_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 delete_project_data_index_with_http_info( + self, + index_key: StrictStr, + proj_key: StrictStr, + confirmation_token: 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[object]: + """Delete Project Data Index + + Delete a project index data. + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param confirmation_token: (required) + :type confirmation_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._delete_project_data_index_serialize( + index_key=index_key, + proj_key=proj_key, + confirmation_token=confirmation_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 delete_project_data_index_without_preload_content( + self, + index_key: StrictStr, + proj_key: StrictStr, + confirmation_token: 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: + """Delete Project Data Index + + Delete a project index data. + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param confirmation_token: (required) + :type confirmation_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._delete_project_data_index_serialize( + index_key=index_key, + proj_key=proj_key, + confirmation_token=confirmation_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_project_data_index_serialize( + self, + index_key, + proj_key, + confirmation_token, + _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 + if confirmation_token is not None: + + _query_params.append(('confirmation_token', confirmation_token)) + + # 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='DELETE', + resource_path='/project/{proj_key}/data_indices/{index_key}', + 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_index( + 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, + ) -> ProjectDataIndexWithStatus: + """Get Project Data Index + + Get project data index. + + :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_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': "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_index_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[ProjectDataIndexWithStatus]: + """Get Project Data Index + + Get project data index. + + :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_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': "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_index_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 + + Get project data index. + + :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_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': "ProjectDataIndexWithStatus", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_project_data_index_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}', + 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, + 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, + ) -> 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. + + :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 + ) + 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, + response_types_map=_response_types_map, + ).data + + + @validate_call + 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)], + 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[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, + response_types_map=_response_types_map, + ) + + + @validate_call + 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)], + 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: + """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 + ) + return response_data.response + + + def _update_project_data_index_serialize( + self, + index_key, + proj_key, + data, + _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 + if data is not None: + _body_params = data + + + # 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='PATCH', + resource_path='/project/{proj_key}/data_indices/{index_key}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/deepsearch/cps/apis/public_v2/api/data_indices_upload_api.py b/deepsearch/cps/apis/public_v2/api/data_indices_upload_api.py new file mode 100644 index 00000000..1f9157dc --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/data_indices_upload_api.py @@ -0,0 +1,1579 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from 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.convert_documents_request_body import ConvertDocumentsRequestBody +from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask +from deepsearch.cps.apis.public_v2.models.data_index_upload_file_source import DataIndexUploadFileSource +from deepsearch.cps.apis.public_v2.models.json_upload_request_body import JsonUploadRequestBody + +from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.rest import RESTResponseType + + +class DataIndicesUploadApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def ccs_convert_upload_file_project_data_index( + self, + index_key: StrictStr, + proj_key: StrictStr, + convert_documents_request_body: ConvertDocumentsRequestBody, + _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, + ) -> CpsTask: + """Ccs Convert Upload File Project Data Index + + Convert files via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema). + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param convert_documents_request_body: (required) + :type convert_documents_request_body: ConvertDocumentsRequestBody + :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._ccs_convert_upload_file_project_data_index_serialize( + index_key=index_key, + proj_key=proj_key, + convert_documents_request_body=convert_documents_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '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 ccs_convert_upload_file_project_data_index_with_http_info( + self, + index_key: StrictStr, + proj_key: StrictStr, + convert_documents_request_body: ConvertDocumentsRequestBody, + _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[CpsTask]: + """Ccs Convert Upload File Project Data Index + + Convert files via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema). + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param convert_documents_request_body: (required) + :type convert_documents_request_body: ConvertDocumentsRequestBody + :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._ccs_convert_upload_file_project_data_index_serialize( + index_key=index_key, + proj_key=proj_key, + convert_documents_request_body=convert_documents_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '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 ccs_convert_upload_file_project_data_index_without_preload_content( + self, + index_key: StrictStr, + proj_key: StrictStr, + convert_documents_request_body: ConvertDocumentsRequestBody, + _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: + """Ccs Convert Upload File Project Data Index + + Convert files via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema). + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param convert_documents_request_body: (required) + :type convert_documents_request_body: ConvertDocumentsRequestBody + :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._ccs_convert_upload_file_project_data_index_serialize( + index_key=index_key, + proj_key=proj_key, + convert_documents_request_body=convert_documents_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _ccs_convert_upload_file_project_data_index_serialize( + self, + index_key, + proj_key, + convert_documents_request_body, + _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 + if convert_documents_request_body is not None: + _body_params = convert_documents_request_body + + + # 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}/actions/ccs_convert_upload', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_attachment_upload_data( + self, + index_key: StrictStr, + index_item_id: StrictStr, + filename: 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, + ) -> AttachmentUploadData: + """Get Attachment Upload Data + + Get url and path to upload an attachment to a project data index. + + :param index_key: (required) + :type index_key: str + :param index_item_id: (required) + :type index_item_id: str + :param filename: (required) + :type filename: 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_attachment_upload_data_serialize( + index_key=index_key, + index_item_id=index_item_id, + filename=filename, + 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': "AttachmentUploadData", + '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_attachment_upload_data_with_http_info( + self, + index_key: StrictStr, + index_item_id: StrictStr, + filename: 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[AttachmentUploadData]: + """Get Attachment Upload Data + + Get url and path to upload an attachment to a project data index. + + :param index_key: (required) + :type index_key: str + :param index_item_id: (required) + :type index_item_id: str + :param filename: (required) + :type filename: 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_attachment_upload_data_serialize( + index_key=index_key, + index_item_id=index_item_id, + filename=filename, + 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': "AttachmentUploadData", + '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_attachment_upload_data_without_preload_content( + self, + index_key: StrictStr, + index_item_id: StrictStr, + filename: 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 Attachment Upload Data + + Get url and path to upload an attachment to a project data index. + + :param index_key: (required) + :type index_key: str + :param index_item_id: (required) + :type index_item_id: str + :param filename: (required) + :type filename: 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_attachment_upload_data_serialize( + index_key=index_key, + index_item_id=index_item_id, + filename=filename, + 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': "AttachmentUploadData", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_attachment_upload_data_serialize( + self, + index_key, + index_item_id, + filename, + 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 index_item_id is not None: + _path_params['index_item_id'] = index_item_id + if filename is not None: + _path_params['filename'] = filename + 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}/documents/{index_item_id}/attachment_url/{filename}', + 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 html_print_convert_upload( + self, + index_key: StrictStr, + proj_key: StrictStr, + data_index_upload_file_source: DataIndexUploadFileSource, + _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, + ) -> CpsTask: + """Html Print Convert Upload + + Convert a list of HTML pages to PDF, convert them via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema). + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param data_index_upload_file_source: (required) + :type data_index_upload_file_source: DataIndexUploadFileSource + :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._html_print_convert_upload_serialize( + index_key=index_key, + proj_key=proj_key, + data_index_upload_file_source=data_index_upload_file_source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '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 html_print_convert_upload_with_http_info( + self, + index_key: StrictStr, + proj_key: StrictStr, + data_index_upload_file_source: DataIndexUploadFileSource, + _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[CpsTask]: + """Html Print Convert Upload + + Convert a list of HTML pages to PDF, convert them via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema). + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param data_index_upload_file_source: (required) + :type data_index_upload_file_source: DataIndexUploadFileSource + :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._html_print_convert_upload_serialize( + index_key=index_key, + proj_key=proj_key, + data_index_upload_file_source=data_index_upload_file_source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '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 html_print_convert_upload_without_preload_content( + self, + index_key: StrictStr, + proj_key: StrictStr, + data_index_upload_file_source: DataIndexUploadFileSource, + _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: + """Html Print Convert Upload + + Convert a list of HTML pages to PDF, convert them via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema). + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param data_index_upload_file_source: (required) + :type data_index_upload_file_source: DataIndexUploadFileSource + :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._html_print_convert_upload_serialize( + index_key=index_key, + proj_key=proj_key, + data_index_upload_file_source=data_index_upload_file_source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _html_print_convert_upload_serialize( + self, + index_key, + proj_key, + data_index_upload_file_source, + _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 + if data_index_upload_file_source is not None: + _body_params = data_index_upload_file_source + + + # 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}/actions/html_print_convert_upload', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def register_attachment( + self, + index_key: StrictStr, + index_item_id: StrictStr, + proj_key: StrictStr, + attachment_upload_request_body: AttachmentUploadRequestBody, + _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: + """Register Attachment + + Notify upload completion of an attachment to a project data index. + + :param index_key: (required) + :type index_key: str + :param index_item_id: (required) + :type index_item_id: str + :param proj_key: (required) + :type proj_key: str + :param attachment_upload_request_body: (required) + :type attachment_upload_request_body: AttachmentUploadRequestBody + :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._register_attachment_serialize( + index_key=index_key, + index_item_id=index_item_id, + proj_key=proj_key, + attachment_upload_request_body=attachment_upload_request_body, + _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 register_attachment_with_http_info( + self, + index_key: StrictStr, + index_item_id: StrictStr, + proj_key: StrictStr, + attachment_upload_request_body: AttachmentUploadRequestBody, + _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]: + """Register Attachment + + Notify upload completion of an attachment to a project data index. + + :param index_key: (required) + :type index_key: str + :param index_item_id: (required) + :type index_item_id: str + :param proj_key: (required) + :type proj_key: str + :param attachment_upload_request_body: (required) + :type attachment_upload_request_body: AttachmentUploadRequestBody + :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._register_attachment_serialize( + index_key=index_key, + index_item_id=index_item_id, + proj_key=proj_key, + attachment_upload_request_body=attachment_upload_request_body, + _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 register_attachment_without_preload_content( + self, + index_key: StrictStr, + index_item_id: StrictStr, + proj_key: StrictStr, + attachment_upload_request_body: AttachmentUploadRequestBody, + _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: + """Register Attachment + + Notify upload completion of an attachment to a project data index. + + :param index_key: (required) + :type index_key: str + :param index_item_id: (required) + :type index_item_id: str + :param proj_key: (required) + :type proj_key: str + :param attachment_upload_request_body: (required) + :type attachment_upload_request_body: AttachmentUploadRequestBody + :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._register_attachment_serialize( + index_key=index_key, + index_item_id=index_item_id, + proj_key=proj_key, + attachment_upload_request_body=attachment_upload_request_body, + _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 _register_attachment_serialize( + self, + index_key, + index_item_id, + proj_key, + attachment_upload_request_body, + _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 index_item_id is not None: + _path_params['index_item_id'] = index_item_id + 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 attachment_upload_request_body is not None: + _body_params = attachment_upload_request_body + + + # 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/{index_item_id}/attachment', + 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 upload_project_data_index_file( + self, + index_key: StrictStr, + proj_key: StrictStr, + json_upload_request_body: JsonUploadRequestBody, + _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, + ) -> CpsTask: + """Upload Project Data Index File + + Upload a file to a project data index. + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param json_upload_request_body: (required) + :type json_upload_request_body: JsonUploadRequestBody + :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._upload_project_data_index_file_serialize( + index_key=index_key, + proj_key=proj_key, + json_upload_request_body=json_upload_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '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 upload_project_data_index_file_with_http_info( + self, + index_key: StrictStr, + proj_key: StrictStr, + json_upload_request_body: JsonUploadRequestBody, + _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[CpsTask]: + """Upload Project Data Index File + + Upload a file to a project data index. + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param json_upload_request_body: (required) + :type json_upload_request_body: JsonUploadRequestBody + :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._upload_project_data_index_file_serialize( + index_key=index_key, + proj_key=proj_key, + json_upload_request_body=json_upload_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '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 upload_project_data_index_file_without_preload_content( + self, + index_key: StrictStr, + proj_key: StrictStr, + json_upload_request_body: JsonUploadRequestBody, + _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: + """Upload Project Data Index File + + Upload a file to a project data index. + + :param index_key: (required) + :type index_key: str + :param proj_key: (required) + :type proj_key: str + :param json_upload_request_body: (required) + :type json_upload_request_body: JsonUploadRequestBody + :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._upload_project_data_index_file_serialize( + index_key=index_key, + proj_key=proj_key, + json_upload_request_body=json_upload_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _upload_project_data_index_file_serialize( + self, + index_key, + proj_key, + json_upload_request_body, + _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 + if json_upload_request_body is not None: + _body_params = json_upload_request_body + + + # 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}/actions/upload', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/deepsearch/cps/apis/public_v2/api/knowledge_graphs_api.py b/deepsearch/cps/apis/public_v2/api/knowledge_graphs_api.py new file mode 100644 index 00000000..1620a901 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/knowledge_graphs_api.py @@ -0,0 +1,1171 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from typing import Any, Dict, Optional + +from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.rest import RESTResponseType + + +class KnowledgeGraphsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def backend_list_project_kgs( + self, + proj_key: StrictStr, + term: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[object]: + """Backend List Project Kgs + + List all bags in the project, backend-aware + + :param proj_key: (required) + :type proj_key: str + :param term: + :type term: object + :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._backend_list_project_kgs_serialize( + proj_key=proj_key, + term=term, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + '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 backend_list_project_kgs_with_http_info( + self, + proj_key: StrictStr, + term: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[object]]: + """Backend List Project Kgs + + List all bags in the project, backend-aware + + :param proj_key: (required) + :type proj_key: str + :param term: + :type term: object + :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._backend_list_project_kgs_serialize( + proj_key=proj_key, + term=term, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + '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 backend_list_project_kgs_without_preload_content( + self, + proj_key: StrictStr, + term: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Backend List Project Kgs + + List all bags in the project, backend-aware + + :param proj_key: (required) + :type proj_key: str + :param term: + :type term: object + :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._backend_list_project_kgs_serialize( + proj_key=proj_key, + term=term, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _backend_list_project_kgs_serialize( + self, + proj_key, + term, + _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 + if term is not None: + + _query_params.append(('term', term)) + + # 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='/backend/project/{proj_key}/bags', + 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 create_project_knowledge_graph( + self, + proj_key: StrictStr, + body: Dict[str, Any], + _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, + ) -> object: + """Create Project Knowledge Graph + + Create new BAG, backend-aware + + :param proj_key: (required) + :type proj_key: str + :param body: (required) + :type body: object + :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._create_project_knowledge_graph_serialize( + proj_key=proj_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 create_project_knowledge_graph_with_http_info( + self, + proj_key: StrictStr, + body: Dict[str, Any], + _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[object]: + """Create Project Knowledge Graph + + Create new BAG, backend-aware + + :param proj_key: (required) + :type proj_key: str + :param body: (required) + :type body: object + :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._create_project_knowledge_graph_serialize( + proj_key=proj_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 create_project_knowledge_graph_without_preload_content( + self, + proj_key: StrictStr, + body: Dict[str, Any], + _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: + """Create Project Knowledge Graph + + Create new BAG, backend-aware + + :param proj_key: (required) + :type proj_key: str + :param body: (required) + :type body: object + :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._create_project_knowledge_graph_serialize( + proj_key=proj_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_project_knowledge_graph_serialize( + self, + proj_key, + body, + _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 + if body is not None: + _body_params = body + + + # 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='/backend/project/{proj_key}/bags', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_public_knowledge_graphs( + self, + term: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[object]: + """List Public Knowledge Graphs + + List all public BAGs + + :param term: + :type term: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_public_knowledge_graphs_serialize( + term=term, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_public_knowledge_graphs_with_http_info( + self, + term: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[object]]: + """List Public Knowledge Graphs + + List all public BAGs + + :param term: + :type term: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_public_knowledge_graphs_serialize( + term=term, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_public_knowledge_graphs_without_preload_content( + self, + term: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Public Knowledge Graphs + + List all public BAGs + + :param term: + :type term: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_public_knowledge_graphs_serialize( + term=term, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_public_knowledge_graphs_serialize( + self, + term, + _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 + # process the query parameters + if term is not None: + + _query_params.append(('term', term)) + + # 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/public/bags', + 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_knowledge_graph_metadata( + self, + bag_key: Any, + proj_key: StrictStr, + body: Dict[str, Any], + _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, + ) -> object: + """Update Project Knowledge Graph Metadata + + Update the metadata of a Knowledge graph + + :param bag_key: (required) + :type bag_key: object + :param proj_key: (required) + :type proj_key: str + :param body: (required) + :type body: object + :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_knowledge_graph_metadata_serialize( + bag_key=bag_key, + proj_key=proj_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 update_project_knowledge_graph_metadata_with_http_info( + self, + bag_key: Any, + proj_key: StrictStr, + body: Dict[str, Any], + _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[object]: + """Update Project Knowledge Graph Metadata + + Update the metadata of a Knowledge graph + + :param bag_key: (required) + :type bag_key: object + :param proj_key: (required) + :type proj_key: str + :param body: (required) + :type body: object + :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_knowledge_graph_metadata_serialize( + bag_key=bag_key, + proj_key=proj_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 update_project_knowledge_graph_metadata_without_preload_content( + self, + bag_key: Any, + proj_key: StrictStr, + body: Dict[str, Any], + _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: + """Update Project Knowledge Graph Metadata + + Update the metadata of a Knowledge graph + + :param bag_key: (required) + :type bag_key: object + :param proj_key: (required) + :type proj_key: str + :param body: (required) + :type body: object + :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_knowledge_graph_metadata_serialize( + bag_key=bag_key, + proj_key=proj_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_project_knowledge_graph_metadata_serialize( + self, + bag_key, + proj_key, + body, + _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 bag_key is not None: + _path_params['bag_key'] = bag_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 body is not None: + _body_params = body + + + # 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='PATCH', + resource_path='/backend/project/{proj_key}/bags/{bag_key}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/deepsearch/cps/apis/public_v2/api/project_api.py b/deepsearch/cps/apis/public_v2/api/project_api.py new file mode 100644 index 00000000..378fef3a --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/project_api.py @@ -0,0 +1,1753 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictBool, StrictStr +from typing import Any, Dict, Optional +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 import ResponseGetProjectIntegrationConfig +from deepsearch.cps.apis.public_v2.models.task_context import TaskContext + +from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.rest import RESTResponseType + + +class ProjectApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def delete_project_integration_config( + self, + integration_name: 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, + ) -> object: + """Delete Project Integration Config + + Delete the config for a given project integration. + + :param integration_name: (required) + :type integration_name: 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._delete_project_integration_config_serialize( + integration_name=integration_name, + 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': "object", + '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 delete_project_integration_config_with_http_info( + self, + integration_name: 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[object]: + """Delete Project Integration Config + + Delete the config for a given project integration. + + :param integration_name: (required) + :type integration_name: 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._delete_project_integration_config_serialize( + integration_name=integration_name, + 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': "object", + '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 delete_project_integration_config_without_preload_content( + self, + integration_name: 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: + """Delete Project Integration Config + + Delete the config for a given project integration. + + :param integration_name: (required) + :type integration_name: 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._delete_project_integration_config_serialize( + integration_name=integration_name, + 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': "object", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_project_integration_config_serialize( + self, + integration_name, + 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 integration_name is not None: + _path_params['integration_name'] = integration_name + 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='DELETE', + resource_path='/project/{proj_key}/integrations/{integration_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_project_default_values( + 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, + ) -> DefaultValues: + """Get Project Default Values + + List project's default values. + + :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_default_values_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': "DefaultValues", + '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_default_values_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[DefaultValues]: + """Get Project Default Values + + List project's default values. + + :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_default_values_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': "DefaultValues", + '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_default_values_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 Default Values + + List project's default values. + + :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_default_values_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': "DefaultValues", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_project_default_values_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}/default_values', + 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_integration_config( + self, + integration_name: StrictStr, + proj_key: StrictStr, + decode_secrets: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ResponseGetProjectIntegrationConfig: + """Get Project Integration Config + + Get the config for a given project integration. + + :param integration_name: (required) + :type integration_name: str + :param proj_key: (required) + :type proj_key: str + :param decode_secrets: + :type decode_secrets: bool + :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_integration_config_serialize( + integration_name=integration_name, + proj_key=proj_key, + decode_secrets=decode_secrets, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResponseGetProjectIntegrationConfig", + '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_integration_config_with_http_info( + self, + integration_name: StrictStr, + proj_key: StrictStr, + decode_secrets: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ResponseGetProjectIntegrationConfig]: + """Get Project Integration Config + + Get the config for a given project integration. + + :param integration_name: (required) + :type integration_name: str + :param proj_key: (required) + :type proj_key: str + :param decode_secrets: + :type decode_secrets: bool + :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_integration_config_serialize( + integration_name=integration_name, + proj_key=proj_key, + decode_secrets=decode_secrets, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResponseGetProjectIntegrationConfig", + '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_integration_config_without_preload_content( + self, + integration_name: StrictStr, + proj_key: StrictStr, + decode_secrets: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Project Integration Config + + Get the config for a given project integration. + + :param integration_name: (required) + :type integration_name: str + :param proj_key: (required) + :type proj_key: str + :param decode_secrets: + :type decode_secrets: bool + :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_integration_config_serialize( + integration_name=integration_name, + proj_key=proj_key, + decode_secrets=decode_secrets, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResponseGetProjectIntegrationConfig", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_project_integration_config_serialize( + self, + integration_name, + proj_key, + decode_secrets, + _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 integration_name is not None: + _path_params['integration_name'] = integration_name + if proj_key is not None: + _path_params['proj_key'] = proj_key + # process the query parameters + if decode_secrets is not None: + + _query_params.append(('decode_secrets', decode_secrets)) + + # 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}/integrations/{integration_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def provision_project_packages( + self, + proj_key: StrictStr, + project_package_instalation_manifest: ProjectPackageInstalationManifest, + _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, + ) -> TaskContext: + """Provision Project Packages + + Install packages on a project. + + :param proj_key: (required) + :type proj_key: str + :param project_package_instalation_manifest: (required) + :type project_package_instalation_manifest: ProjectPackageInstalationManifest + :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._provision_project_packages_serialize( + proj_key=proj_key, + project_package_instalation_manifest=project_package_instalation_manifest, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskContext", + '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 provision_project_packages_with_http_info( + self, + proj_key: StrictStr, + project_package_instalation_manifest: ProjectPackageInstalationManifest, + _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[TaskContext]: + """Provision Project Packages + + Install packages on a project. + + :param proj_key: (required) + :type proj_key: str + :param project_package_instalation_manifest: (required) + :type project_package_instalation_manifest: ProjectPackageInstalationManifest + :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._provision_project_packages_serialize( + proj_key=proj_key, + project_package_instalation_manifest=project_package_instalation_manifest, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskContext", + '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 provision_project_packages_without_preload_content( + self, + proj_key: StrictStr, + project_package_instalation_manifest: ProjectPackageInstalationManifest, + _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: + """Provision Project Packages + + Install packages on a project. + + :param proj_key: (required) + :type proj_key: str + :param project_package_instalation_manifest: (required) + :type project_package_instalation_manifest: ProjectPackageInstalationManifest + :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._provision_project_packages_serialize( + proj_key=proj_key, + project_package_instalation_manifest=project_package_instalation_manifest, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskContext", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _provision_project_packages_serialize( + self, + proj_key, + project_package_instalation_manifest, + _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 + if project_package_instalation_manifest is not None: + _body_params = project_package_instalation_manifest + + + # 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}/packages', + 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_default_values( + self, + proj_key: StrictStr, + default_values: DefaultValues, + _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, + ) -> object: + """Update Project Default Values + + Update project's default values. + + :param proj_key: (required) + :type proj_key: str + :param default_values: (required) + :type default_values: DefaultValues + :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_default_values_serialize( + proj_key=proj_key, + default_values=default_values, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 update_project_default_values_with_http_info( + self, + proj_key: StrictStr, + default_values: DefaultValues, + _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[object]: + """Update Project Default Values + + Update project's default values. + + :param proj_key: (required) + :type proj_key: str + :param default_values: (required) + :type default_values: DefaultValues + :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_default_values_serialize( + proj_key=proj_key, + default_values=default_values, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 update_project_default_values_without_preload_content( + self, + proj_key: StrictStr, + default_values: DefaultValues, + _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: + """Update Project Default Values + + Update project's default values. + + :param proj_key: (required) + :type proj_key: str + :param default_values: (required) + :type default_values: DefaultValues + :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_default_values_serialize( + proj_key=proj_key, + default_values=default_values, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_project_default_values_serialize( + self, + proj_key, + default_values, + _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 + if default_values is not None: + _body_params = default_values + + + # 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}/default_values', + 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_integration_config( + self, + integration_name: StrictStr, + proj_key: StrictStr, + body: Dict[str, Any], + _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, + ) -> object: + """Update Project Integration Config + + Update the config for a given project integration. + + :param integration_name: (required) + :type integration_name: str + :param proj_key: (required) + :type proj_key: str + :param body: (required) + :type body: object + :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_integration_config_serialize( + integration_name=integration_name, + proj_key=proj_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 update_project_integration_config_with_http_info( + self, + integration_name: StrictStr, + proj_key: StrictStr, + body: Dict[str, Any], + _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[object]: + """Update Project Integration Config + + Update the config for a given project integration. + + :param integration_name: (required) + :type integration_name: str + :param proj_key: (required) + :type proj_key: str + :param body: (required) + :type body: object + :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_integration_config_serialize( + integration_name=integration_name, + proj_key=proj_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 update_project_integration_config_without_preload_content( + self, + integration_name: StrictStr, + proj_key: StrictStr, + body: Dict[str, Any], + _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: + """Update Project Integration Config + + Update the config for a given project integration. + + :param integration_name: (required) + :type integration_name: str + :param proj_key: (required) + :type proj_key: str + :param body: (required) + :type body: object + :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_integration_config_serialize( + integration_name=integration_name, + proj_key=proj_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_project_integration_config_serialize( + self, + integration_name, + proj_key, + body, + _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 integration_name is not None: + _path_params['integration_name'] = integration_name + 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 body is not None: + _body_params = body + + + # 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}/integrations/{integration_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/deepsearch/cps/apis/public_v2/api/semantic_api.py b/deepsearch/cps/apis/public_v2/api/semantic_api.py new file mode 100644 index 00000000..15781503 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/semantic_api.py @@ -0,0 +1,327 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask +from deepsearch.cps.apis.public_v2.models.semantic_ingest_request import SemanticIngestRequest + +from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.rest import RESTResponseType + + +class SemanticApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def ingest( + self, + proj_key: StrictStr, + semantic_ingest_request: SemanticIngestRequest, + _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, + ) -> CpsTask: + """Ingest + + Ingest documents and collections for RAG + + :param proj_key: (required) + :type proj_key: str + :param semantic_ingest_request: (required) + :type semantic_ingest_request: SemanticIngestRequest + :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._ingest_serialize( + proj_key=proj_key, + semantic_ingest_request=semantic_ingest_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '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 ingest_with_http_info( + self, + proj_key: StrictStr, + semantic_ingest_request: SemanticIngestRequest, + _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[CpsTask]: + """Ingest + + Ingest documents and collections for RAG + + :param proj_key: (required) + :type proj_key: str + :param semantic_ingest_request: (required) + :type semantic_ingest_request: SemanticIngestRequest + :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._ingest_serialize( + proj_key=proj_key, + semantic_ingest_request=semantic_ingest_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '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 ingest_without_preload_content( + self, + proj_key: StrictStr, + semantic_ingest_request: SemanticIngestRequest, + _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: + """Ingest + + Ingest documents and collections for RAG + + :param proj_key: (required) + :type proj_key: str + :param semantic_ingest_request: (required) + :type semantic_ingest_request: SemanticIngestRequest + :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._ingest_serialize( + proj_key=proj_key, + semantic_ingest_request=semantic_ingest_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CpsTask", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _ingest_serialize( + self, + proj_key, + semantic_ingest_request, + _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 + if semantic_ingest_request is not None: + _body_params = semantic_ingest_request + + + # 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}/semantic/ingest', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/deepsearch/cps/apis/public_v2/api/system_api.py b/deepsearch/cps/apis/public_v2/api/system_api.py new file mode 100644 index 00000000..a7007dd2 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/system_api.py @@ -0,0 +1,1775 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from typing import 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 + +from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.rest import RESTResponseType + + +class SystemApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_system_information( + self, + _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, + ) -> SystemInfo: + """Get System Information + + Get system info. + + :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_system_information_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SystemInfo", + } + 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_system_information_with_http_info( + self, + _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[SystemInfo]: + """Get System Information + + Get system info. + + :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_system_information_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SystemInfo", + } + 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_system_information_without_preload_content( + self, + _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 System Information + + Get system info. + + :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_system_information_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SystemInfo", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_system_information_serialize( + self, + _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 + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/system/info', + 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_system_modules_configuration( + self, + _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, + ) -> ModulesConfig: + """Get System Modules Configuration + + Get modules configuration. + + :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_system_modules_configuration_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModulesConfig", + } + 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_system_modules_configuration_with_http_info( + self, + _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[ModulesConfig]: + """Get System Modules Configuration + + Get modules configuration. + + :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_system_modules_configuration_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModulesConfig", + } + 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_system_modules_configuration_without_preload_content( + self, + _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 System Modules Configuration + + Get modules configuration. + + :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_system_modules_configuration_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModulesConfig", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_system_modules_configuration_serialize( + self, + _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 + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/system/modules/configuration', + 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_system_modules_tasks( + self, + _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, + ) -> object: + """Get System Modules Tasks + + Get modules configuration. + + :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_system_modules_tasks_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + } + 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_system_modules_tasks_with_http_info( + self, + _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[object]: + """Get System Modules Tasks + + Get modules configuration. + + :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_system_modules_tasks_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + } + 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_system_modules_tasks_without_preload_content( + self, + _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 System Modules Tasks + + Get modules configuration. + + :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_system_modules_tasks_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_system_modules_tasks_serialize( + self, + _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 + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/system/modules/tasks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_packages( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[CPSPackage]: + """List Packages + + Get packages available in this CPS installation for installing in a project. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_packages_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CPSPackage]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_packages_with_http_info( + self, + _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[CPSPackage]]: + """List Packages + + Get packages available in this CPS installation for installing in a project. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_packages_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CPSPackage]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_packages_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Packages + + Get packages available in this CPS installation for installing in a project. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_packages_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CPSPackage]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_packages_serialize( + self, + _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 + # 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='/system/packages', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_system_knowledge_graphs( + self, + proj_key: Optional[StrictStr] = None, + term: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[object]: + """List System Knowledge Graphs + + List all Knowledge Graphs in the system. + + :param proj_key: + :type proj_key: str + :param term: + :type term: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_system_knowledge_graphs_serialize( + proj_key=proj_key, + term=term, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_system_knowledge_graphs_with_http_info( + self, + proj_key: Optional[StrictStr] = None, + term: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[object]]: + """List System Knowledge Graphs + + List all Knowledge Graphs in the system. + + :param proj_key: + :type proj_key: str + :param term: + :type term: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_system_knowledge_graphs_serialize( + proj_key=proj_key, + term=term, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_system_knowledge_graphs_without_preload_content( + self, + proj_key: Optional[StrictStr] = None, + term: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List System Knowledge Graphs + + List all Knowledge Graphs in the system. + + :param proj_key: + :type proj_key: str + :param term: + :type term: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_system_knowledge_graphs_serialize( + proj_key=proj_key, + term=term, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_system_knowledge_graphs_serialize( + self, + proj_key, + term, + _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 + # process the query parameters + if proj_key is not None: + + _query_params.append(('proj_key', proj_key)) + + if term is not None: + + _query_params.append(('term', term)) + + # 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='/system/kgs', + 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 system_get_all_dcs_admin( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[str]: + """System Get All Dcs Admin + + Get all data catalogs (only dc_key) for admin use. + + :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._system_get_all_dcs_admin_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + } + 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 system_get_all_dcs_admin_with_http_info( + self, + _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[str]]: + """System Get All Dcs Admin + + Get all data catalogs (only dc_key) for admin use. + + :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._system_get_all_dcs_admin_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + } + 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 system_get_all_dcs_admin_without_preload_content( + self, + _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: + """System Get All Dcs Admin + + Get all data catalogs (only dc_key) for admin use. + + :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._system_get_all_dcs_admin_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _system_get_all_dcs_admin_serialize( + self, + _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 + # 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='/system/admin/get_all_dcs', + 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 system_get_all_kgs_admin( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[object]: + """System Get All Kgs Admin + + Get all kgs (only bag_key) for admin use. + + :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._system_get_all_kgs_admin_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + } + 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 system_get_all_kgs_admin_with_http_info( + self, + _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[object]]: + """System Get All Kgs Admin + + Get all kgs (only bag_key) for admin use. + + :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._system_get_all_kgs_admin_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + } + 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 system_get_all_kgs_admin_without_preload_content( + self, + _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: + """System Get All Kgs Admin + + Get all kgs (only bag_key) for admin use. + + :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._system_get_all_kgs_admin_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[object]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _system_get_all_kgs_admin_serialize( + self, + _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 + # 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='/system/admin/get_all_kgs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/deepsearch/cps/apis/public_v2/api/system_flavours_api.py b/deepsearch/cps/apis/public_v2/api/system_flavours_api.py new file mode 100644 index 00000000..eecf81fc --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/system_flavours_api.py @@ -0,0 +1,1873 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictBool, StrictStr +from deepsearch.cps.apis.public_v2.models.bag_flavour_full_data import BagFlavourFullData +from deepsearch.cps.apis.public_v2.models.list_project_flavours import ListProjectFlavours +from deepsearch.cps.apis.public_v2.models.projects_flavours import ProjectsFlavours + +from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.rest import RESTResponseType + + +class SystemFlavoursApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def delete_flavour( + self, + flavour_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> object: + """Delete Flavour + + Delete flavour from db. + + :param flavour_name: (required) + :type flavour_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_flavour_serialize( + flavour_name=flavour_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 delete_flavour_with_http_info( + self, + flavour_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[object]: + """Delete Flavour + + Delete flavour from db. + + :param flavour_name: (required) + :type flavour_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_flavour_serialize( + flavour_name=flavour_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 delete_flavour_without_preload_content( + self, + flavour_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Flavour + + Delete flavour from db. + + :param flavour_name: (required) + :type flavour_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_flavour_serialize( + flavour_name=flavour_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_flavour_serialize( + self, + flavour_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if flavour_name is not None: + _path_params['flavour_name'] = flavour_name + # 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='DELETE', + resource_path='/system/admin/delete_flavour/{flavour_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_flavour( + self, + flavour_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BagFlavourFullData: + """Get Flavour + + Get flavour from db. + + :param flavour_name: (required) + :type flavour_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_flavour_serialize( + flavour_name=flavour_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BagFlavourFullData", + '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_flavour_with_http_info( + self, + flavour_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BagFlavourFullData]: + """Get Flavour + + Get flavour from db. + + :param flavour_name: (required) + :type flavour_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_flavour_serialize( + flavour_name=flavour_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BagFlavourFullData", + '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_flavour_without_preload_content( + self, + flavour_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Flavour + + Get flavour from db. + + :param flavour_name: (required) + :type flavour_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_flavour_serialize( + flavour_name=flavour_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BagFlavourFullData", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_flavour_serialize( + self, + flavour_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if flavour_name is not None: + _path_params['flavour_name'] = flavour_name + # 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='/system/admin/get_flavour/{flavour_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_all_flavours( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[BagFlavourFullData]: + """List All Flavours + + Get all KG flavours storage on db. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_all_flavours_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[BagFlavourFullData]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_all_flavours_with_http_info( + self, + _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[BagFlavourFullData]]: + """List All Flavours + + Get all KG flavours storage on db. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_all_flavours_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[BagFlavourFullData]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_all_flavours_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List All Flavours + + Get all KG flavours storage on db. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_all_flavours_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[BagFlavourFullData]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_all_flavours_serialize( + self, + _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 + # 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='/system/admin/list_all_flavours', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_flavours_by_project( + 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, + ) -> ListProjectFlavours: + """List Flavours By Project + + Get project assignment flavours. + + :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._list_flavours_by_project_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': "ListProjectFlavours", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_flavours_by_project_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[ListProjectFlavours]: + """List Flavours By Project + + Get project assignment flavours. + + :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._list_flavours_by_project_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': "ListProjectFlavours", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_flavours_by_project_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: + """List Flavours By Project + + Get project assignment flavours. + + :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._list_flavours_by_project_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': "ListProjectFlavours", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_flavours_by_project_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='/system/admin/get_project_flavours/{proj_key}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_projects_flavours( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ProjectsFlavours]: + """List Projects Flavours + + Get all projects and their flavours. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_projects_flavours_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectsFlavours]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_projects_flavours_with_http_info( + self, + _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[ProjectsFlavours]]: + """List Projects Flavours + + Get all projects and their flavours. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_projects_flavours_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectsFlavours]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_projects_flavours_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Projects Flavours + + Get all projects and their flavours. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_projects_flavours_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectsFlavours]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_projects_flavours_serialize( + self, + _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 + # 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='/system/admin/list_projects_flavours', + 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 save_flavour( + self, + new_flavour: StrictBool, + bag_flavour_full_data: BagFlavourFullData, + _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, + ) -> object: + """Save Flavour + + Save flavour on db. + + :param new_flavour: (required) + :type new_flavour: bool + :param bag_flavour_full_data: (required) + :type bag_flavour_full_data: BagFlavourFullData + :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._save_flavour_serialize( + new_flavour=new_flavour, + bag_flavour_full_data=bag_flavour_full_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 save_flavour_with_http_info( + self, + new_flavour: StrictBool, + bag_flavour_full_data: BagFlavourFullData, + _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[object]: + """Save Flavour + + Save flavour on db. + + :param new_flavour: (required) + :type new_flavour: bool + :param bag_flavour_full_data: (required) + :type bag_flavour_full_data: BagFlavourFullData + :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._save_flavour_serialize( + new_flavour=new_flavour, + bag_flavour_full_data=bag_flavour_full_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 save_flavour_without_preload_content( + self, + new_flavour: StrictBool, + bag_flavour_full_data: BagFlavourFullData, + _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: + """Save Flavour + + Save flavour on db. + + :param new_flavour: (required) + :type new_flavour: bool + :param bag_flavour_full_data: (required) + :type bag_flavour_full_data: BagFlavourFullData + :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._save_flavour_serialize( + new_flavour=new_flavour, + bag_flavour_full_data=bag_flavour_full_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _save_flavour_serialize( + self, + new_flavour, + bag_flavour_full_data, + _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 + # process the query parameters + if new_flavour is not None: + + _query_params.append(('new_flavour', new_flavour)) + + # process the header parameters + # process the form parameters + # process the body parameter + if bag_flavour_full_data is not None: + _body_params = bag_flavour_full_data + + + # 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='PUT', + resource_path='/system/admin/save_flavour', + 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 save_project_flavours( + self, + projects_flavours: ProjectsFlavours, + _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, + ) -> object: + """Save Project Flavours + + Save project flavours assignment on db. + + :param projects_flavours: (required) + :type projects_flavours: ProjectsFlavours + :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._save_project_flavours_serialize( + projects_flavours=projects_flavours, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 save_project_flavours_with_http_info( + self, + projects_flavours: ProjectsFlavours, + _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[object]: + """Save Project Flavours + + Save project flavours assignment on db. + + :param projects_flavours: (required) + :type projects_flavours: ProjectsFlavours + :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._save_project_flavours_serialize( + projects_flavours=projects_flavours, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 save_project_flavours_without_preload_content( + self, + projects_flavours: ProjectsFlavours, + _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: + """Save Project Flavours + + Save project flavours assignment on db. + + :param projects_flavours: (required) + :type projects_flavours: ProjectsFlavours + :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._save_project_flavours_serialize( + projects_flavours=projects_flavours, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _save_project_flavours_serialize( + self, + projects_flavours, + _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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if projects_flavours is not None: + _body_params = projects_flavours + + + # 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='PUT', + resource_path='/system/admin/save_project_flavours', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/deepsearch/cps/apis/public_v2/api/system_quotas_api.py b/deepsearch/cps/apis/public_v2/api/system_quotas_api.py new file mode 100644 index 00000000..ca6f4311 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/system_quotas_api.py @@ -0,0 +1,1613 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from typing import List +from 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.project_flavour_total_kgs import ProjectFlavourTotalKgs +from deepsearch.cps.apis.public_v2.models.project_flavours_quota import ProjectFlavoursQuota + +from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.rest import RESTResponseType + + +class SystemQuotasApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_flavours_default_quotas( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[FlavoursDefaultQuota]: + """Get Flavours Default Quotas + + Get flavours default values. + + :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_flavours_default_quotas_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[FlavoursDefaultQuota]", + } + 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_flavours_default_quotas_with_http_info( + self, + _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[FlavoursDefaultQuota]]: + """Get Flavours Default Quotas + + Get flavours default values. + + :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_flavours_default_quotas_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[FlavoursDefaultQuota]", + } + 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_flavours_default_quotas_without_preload_content( + self, + _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 Flavours Default Quotas + + Get flavours default values. + + :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_flavours_default_quotas_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[FlavoursDefaultQuota]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_flavours_default_quotas_serialize( + self, + _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 + # 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='/system/admin/get_flavours_default_quota', + 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_flavour_total_kgs( + self, + flavour_name: 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, + ) -> ProjectFlavourTotalKgs: + """Get Project Flavour Total Kgs + + Gets kg total number by proj_key and flavour_key. + + :param flavour_name: (required) + :type flavour_name: 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_flavour_total_kgs_serialize( + flavour_name=flavour_name, + 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': "ProjectFlavourTotalKgs", + '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_flavour_total_kgs_with_http_info( + self, + flavour_name: 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[ProjectFlavourTotalKgs]: + """Get Project Flavour Total Kgs + + Gets kg total number by proj_key and flavour_key. + + :param flavour_name: (required) + :type flavour_name: 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_flavour_total_kgs_serialize( + flavour_name=flavour_name, + 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': "ProjectFlavourTotalKgs", + '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_flavour_total_kgs_without_preload_content( + self, + flavour_name: 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 Flavour Total Kgs + + Gets kg total number by proj_key and flavour_key. + + :param flavour_name: (required) + :type flavour_name: 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_flavour_total_kgs_serialize( + flavour_name=flavour_name, + 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': "ProjectFlavourTotalKgs", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_project_flavour_total_kgs_serialize( + self, + flavour_name, + 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 flavour_name is not None: + _path_params['flavour_name'] = flavour_name + 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='/system/admin/get_project_flavour_total_kgs/{proj_key}/{flavour_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_project_flavours_quota( + 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, + ) -> List[FlavoursQuota]: + """Get Project Flavours Quota + + Get project flavours quota. + + :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_flavours_quota_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[FlavoursQuota]", + '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_flavours_quota_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[FlavoursQuota]]: + """Get Project Flavours Quota + + Get project flavours quota. + + :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_flavours_quota_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[FlavoursQuota]", + '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_flavours_quota_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 Flavours Quota + + Get project flavours quota. + + :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_flavours_quota_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[FlavoursQuota]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_project_flavours_quota_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='/system/admin/get_project_flavours_quota/{proj_key}', + 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_projects_flavours_quota( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ProjectFlavoursQuota]: + """Get Projects Flavours Quota + + Get projects flavours quotas. + + :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_projects_flavours_quota_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectFlavoursQuota]", + } + 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_projects_flavours_quota_with_http_info( + self, + _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[ProjectFlavoursQuota]]: + """Get Projects Flavours Quota + + Get projects flavours quotas. + + :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_projects_flavours_quota_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectFlavoursQuota]", + } + 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_projects_flavours_quota_without_preload_content( + self, + _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 Projects Flavours Quota + + Get projects flavours quotas. + + :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_projects_flavours_quota_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectFlavoursQuota]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_projects_flavours_quota_serialize( + self, + _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 + # 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='/system/admin/get_projects_flavours_quota', + 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 save_flavours_default_quotas( + self, + flavours_default_quota: List[FlavoursDefaultQuota], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[FlavoursDefaultQuota]: + """Save Flavours Default Quotas + + Save flavours default quota. + + :param flavours_default_quota: (required) + :type flavours_default_quota: List[FlavoursDefaultQuota] + :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._save_flavours_default_quotas_serialize( + flavours_default_quota=flavours_default_quota, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[FlavoursDefaultQuota]", + '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 save_flavours_default_quotas_with_http_info( + self, + flavours_default_quota: List[FlavoursDefaultQuota], + _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[FlavoursDefaultQuota]]: + """Save Flavours Default Quotas + + Save flavours default quota. + + :param flavours_default_quota: (required) + :type flavours_default_quota: List[FlavoursDefaultQuota] + :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._save_flavours_default_quotas_serialize( + flavours_default_quota=flavours_default_quota, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[FlavoursDefaultQuota]", + '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 save_flavours_default_quotas_without_preload_content( + self, + flavours_default_quota: List[FlavoursDefaultQuota], + _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: + """Save Flavours Default Quotas + + Save flavours default quota. + + :param flavours_default_quota: (required) + :type flavours_default_quota: List[FlavoursDefaultQuota] + :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._save_flavours_default_quotas_serialize( + flavours_default_quota=flavours_default_quota, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[FlavoursDefaultQuota]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _save_flavours_default_quotas_serialize( + self, + flavours_default_quota, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'FlavoursDefaultQuota': '', + } + + _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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if flavours_default_quota is not None: + _body_params = flavours_default_quota + + + # 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='PUT', + resource_path='/system/admin/save_flavours_default_quota', + 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 save_project_flavours_quota( + self, + project_flavours_quota: ProjectFlavoursQuota, + _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, + ) -> object: + """Save Project Flavours Quota + + Save project flavours quota. + + :param project_flavours_quota: (required) + :type project_flavours_quota: ProjectFlavoursQuota + :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._save_project_flavours_quota_serialize( + project_flavours_quota=project_flavours_quota, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 save_project_flavours_quota_with_http_info( + self, + project_flavours_quota: ProjectFlavoursQuota, + _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[object]: + """Save Project Flavours Quota + + Save project flavours quota. + + :param project_flavours_quota: (required) + :type project_flavours_quota: ProjectFlavoursQuota + :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._save_project_flavours_quota_serialize( + project_flavours_quota=project_flavours_quota, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '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 save_project_flavours_quota_without_preload_content( + self, + project_flavours_quota: ProjectFlavoursQuota, + _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: + """Save Project Flavours Quota + + Save project flavours quota. + + :param project_flavours_quota: (required) + :type project_flavours_quota: ProjectFlavoursQuota + :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._save_project_flavours_quota_serialize( + project_flavours_quota=project_flavours_quota, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _save_project_flavours_quota_serialize( + self, + project_flavours_quota, + _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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if project_flavours_quota is not None: + _body_params = project_flavours_quota + + + # 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='PUT', + resource_path='/system/admin/save_project_flavours_quota', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/deepsearch/cps/apis/public_v2/api/system_summary_api.py b/deepsearch/cps/apis/public_v2/api/system_summary_api.py new file mode 100644 index 00000000..dd511052 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/system_summary_api.py @@ -0,0 +1,803 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from deepsearch.cps.apis.public_v2.models.cps_summary import CPSSummary +from deepsearch.cps.apis.public_v2.models.storage_summary_task import StorageSummaryTask + +from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.rest import RESTResponseType + + +class SystemSummaryApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def system_get_cps_summary( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[CPSSummary]: + """System Get Cps Summary + + Get cps summary 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._system_get_cps_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CPSSummary]", + } + 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 system_get_cps_summary_with_http_info( + self, + _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[CPSSummary]]: + """System Get Cps Summary + + Get cps summary 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._system_get_cps_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CPSSummary]", + } + 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 system_get_cps_summary_without_preload_content( + self, + _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: + """System Get Cps Summary + + Get cps summary 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._system_get_cps_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CPSSummary]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _system_get_cps_summary_serialize( + self, + _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 + # 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='/system/admin/summary', + 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 system_get_dc_storage_summary_async( + self, + dc_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, + ) -> StorageSummaryTask: + """System Get Dc Storage Summary Async + + Get data catalog storage summary. + + :param dc_key: (required) + :type dc_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._system_get_dc_storage_summary_async_serialize( + dc_key=dc_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageSummaryTask", + '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 system_get_dc_storage_summary_async_with_http_info( + self, + dc_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[StorageSummaryTask]: + """System Get Dc Storage Summary Async + + Get data catalog storage summary. + + :param dc_key: (required) + :type dc_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._system_get_dc_storage_summary_async_serialize( + dc_key=dc_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageSummaryTask", + '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 system_get_dc_storage_summary_async_without_preload_content( + self, + dc_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: + """System Get Dc Storage Summary Async + + Get data catalog storage summary. + + :param dc_key: (required) + :type dc_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._system_get_dc_storage_summary_async_serialize( + dc_key=dc_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageSummaryTask", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _system_get_dc_storage_summary_async_serialize( + self, + dc_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 dc_key is not None: + _path_params['dc_key'] = dc_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='/system/admin/dc_storage_summary/{dc_key}', + 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 system_get_kg_storage_summary_async( + self, + kg_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, + ) -> StorageSummaryTask: + """System Get Kg Storage Summary Async + + Get knowledge graph storage summary. + + :param kg_key: (required) + :type kg_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._system_get_kg_storage_summary_async_serialize( + kg_key=kg_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageSummaryTask", + '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 system_get_kg_storage_summary_async_with_http_info( + self, + kg_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[StorageSummaryTask]: + """System Get Kg Storage Summary Async + + Get knowledge graph storage summary. + + :param kg_key: (required) + :type kg_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._system_get_kg_storage_summary_async_serialize( + kg_key=kg_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageSummaryTask", + '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 system_get_kg_storage_summary_async_without_preload_content( + self, + kg_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: + """System Get Kg Storage Summary Async + + Get knowledge graph storage summary. + + :param kg_key: (required) + :type kg_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._system_get_kg_storage_summary_async_serialize( + kg_key=kg_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageSummaryTask", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _system_get_kg_storage_summary_async_serialize( + self, + kg_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 kg_key is not None: + _path_params['kg_key'] = kg_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='/system/admin/kg_storage_summary/{kg_key}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/deepsearch/cps/apis/public_v2/api/tasks_api.py b/deepsearch/cps/apis/public_v2/api/tasks_api.py new file mode 100644 index 00000000..3fa56bcf --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/tasks_api.py @@ -0,0 +1,1213 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictInt, StrictStr, field_validator +from typing import Optional +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.api_client import ApiClient, RequestSerialized +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.rest import RESTResponseType + + +class TasksApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def abort_project_task( + self, + task_id: 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, + ) -> None: + """Abort Project Task + + Abort a task. + + :param task_id: (required) + :type task_id: 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._abort_project_task_serialize( + task_id=task_id, + 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]] = { + '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 abort_project_task_with_http_info( + self, + task_id: 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[None]: + """Abort Project Task + + Abort a task. + + :param task_id: (required) + :type task_id: 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._abort_project_task_serialize( + task_id=task_id, + 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]] = { + '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 abort_project_task_without_preload_content( + self, + task_id: 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: + """Abort Project Task + + Abort a task. + + :param task_id: (required) + :type task_id: 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._abort_project_task_serialize( + task_id=task_id, + 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]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _abort_project_task_serialize( + self, + task_id, + 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 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 + # 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='POST', + resource_path='/project/{proj_key}/tasks/{task_id}/actions/abort', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_project_celery_task( + self, + task_id: 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, + ) -> TaskResult: + """Get Project Celery Task + + Get a celery task for a project. + + :param task_id: (required) + :type task_id: 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_celery_task_serialize( + task_id=task_id, + 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': "TaskResult", + '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_celery_task_with_http_info( + self, + task_id: 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[TaskResult]: + """Get Project Celery Task + + Get a celery task for a project. + + :param task_id: (required) + :type task_id: 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_celery_task_serialize( + task_id=task_id, + 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': "TaskResult", + '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_celery_task_without_preload_content( + self, + task_id: 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 Celery Task + + Get a celery task for a project. + + :param task_id: (required) + :type task_id: 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_celery_task_serialize( + task_id=task_id, + 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': "TaskResult", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_project_celery_task_serialize( + self, + task_id, + 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 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 + # 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}/celery_tasks/{task_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_project_task( + self, + task_id: 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, + ) -> TaskContext: + """Get Project Task + + Get a task for a project. + + :param task_id: (required) + :type task_id: 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_task_serialize( + task_id=task_id, + 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': "TaskContext", + '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_task_with_http_info( + self, + task_id: 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[TaskContext]: + """Get Project Task + + Get a task for a project. + + :param task_id: (required) + :type task_id: 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_task_serialize( + task_id=task_id, + 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': "TaskContext", + '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_task_without_preload_content( + self, + task_id: 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 Task + + Get a task for a project. + + :param task_id: (required) + :type task_id: 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_task_serialize( + task_id=task_id, + 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': "TaskContext", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_project_task_serialize( + self, + task_id, + 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 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 + # 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}/tasks/{task_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_project_tasks( + self, + proj_key: StrictStr, + task_type: Optional[StrictStr] = None, + skip: Optional[StrictInt] = None, + limit: Optional[StrictInt] = None, + sort_by: Optional[StrictStr] = None, + sort_order: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[TaskContext]: + """List Project Tasks + + List tasks for a project. + + :param proj_key: (required) + :type proj_key: str + :param task_type: + :type task_type: str + :param skip: + :type skip: int + :param limit: + :type limit: int + :param sort_by: + :type sort_by: str + :param sort_order: + :type sort_order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_tasks_serialize( + proj_key=proj_key, + task_type=task_type, + skip=skip, + limit=limit, + sort_by=sort_by, + sort_order=sort_order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[TaskContext]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_project_tasks_with_http_info( + self, + proj_key: StrictStr, + task_type: Optional[StrictStr] = None, + skip: Optional[StrictInt] = None, + limit: Optional[StrictInt] = None, + sort_by: Optional[StrictStr] = None, + sort_order: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[TaskContext]]: + """List Project Tasks + + List tasks for a project. + + :param proj_key: (required) + :type proj_key: str + :param task_type: + :type task_type: str + :param skip: + :type skip: int + :param limit: + :type limit: int + :param sort_by: + :type sort_by: str + :param sort_order: + :type sort_order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_tasks_serialize( + proj_key=proj_key, + task_type=task_type, + skip=skip, + limit=limit, + sort_by=sort_by, + sort_order=sort_order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[TaskContext]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_project_tasks_without_preload_content( + self, + proj_key: StrictStr, + task_type: Optional[StrictStr] = None, + skip: Optional[StrictInt] = None, + limit: Optional[StrictInt] = None, + sort_by: Optional[StrictStr] = None, + sort_order: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Project Tasks + + List tasks for a project. + + :param proj_key: (required) + :type proj_key: str + :param task_type: + :type task_type: str + :param skip: + :type skip: int + :param limit: + :type limit: int + :param sort_by: + :type sort_by: str + :param sort_order: + :type sort_order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_tasks_serialize( + proj_key=proj_key, + task_type=task_type, + skip=skip, + limit=limit, + sort_by=sort_by, + sort_order=sort_order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[TaskContext]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_project_tasks_serialize( + self, + proj_key, + task_type, + skip, + limit, + sort_by, + sort_order, + _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 + if task_type is not None: + + _query_params.append(('task_type', task_type)) + + if skip is not None: + + _query_params.append(('skip', skip)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if sort_by is not None: + + _query_params.append(('sort_by', sort_by)) + + if sort_order is not None: + + _query_params.append(('sort_order', sort_order)) + + # 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}/tasks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/deepsearch/cps/apis/public_v2/api/upload_api.py b/deepsearch/cps/apis/public_v2/api/upload_api.py new file mode 100644 index 00000000..a325c756 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api/upload_api.py @@ -0,0 +1,940 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictInt, StrictStr +from typing import 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 + +from deepsearch.cps.apis.public_v2.api_client import ApiClient, RequestSerialized +from deepsearch.cps.apis.public_v2.api_response import ApiResponse +from deepsearch.cps.apis.public_v2.rest import RESTResponseType + + +class UploadApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_project_scratch_file( + self, + filename: 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, + ) -> TemporaryUploadFileResult: + """Create Project Scratch File + + Create file pointers for temporary storage. + + :param filename: (required) + :type filename: 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._create_project_scratch_file_serialize( + filename=filename, + 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': "TemporaryUploadFileResult", + '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 create_project_scratch_file_with_http_info( + self, + filename: 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[TemporaryUploadFileResult]: + """Create Project Scratch File + + Create file pointers for temporary storage. + + :param filename: (required) + :type filename: 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._create_project_scratch_file_serialize( + filename=filename, + 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': "TemporaryUploadFileResult", + '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 create_project_scratch_file_without_preload_content( + self, + filename: 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: + """Create Project Scratch File + + Create file pointers for temporary storage. + + :param filename: (required) + :type filename: 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._create_project_scratch_file_serialize( + filename=filename, + 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': "TemporaryUploadFileResult", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_project_scratch_file_serialize( + self, + filename, + 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 filename is not None: + _path_params['filename'] = filename + 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='POST', + resource_path='/project/{proj_key}/scratch/files/upload/{filename}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_project_scratch_files( + self, + proj_key: StrictStr, + scratch_ids: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ProjectScratchFiles]: + """List Project Scratch Files + + Get temporary files uploaded to a project. + + :param proj_key: (required) + :type proj_key: str + :param scratch_ids: + :type scratch_ids: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_scratch_files_serialize( + proj_key=proj_key, + scratch_ids=scratch_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectScratchFiles]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_project_scratch_files_with_http_info( + self, + proj_key: StrictStr, + scratch_ids: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ProjectScratchFiles]]: + """List Project Scratch Files + + Get temporary files uploaded to a project. + + :param proj_key: (required) + :type proj_key: str + :param scratch_ids: + :type scratch_ids: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_scratch_files_serialize( + proj_key=proj_key, + scratch_ids=scratch_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectScratchFiles]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_project_scratch_files_without_preload_content( + self, + proj_key: StrictStr, + scratch_ids: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Project Scratch Files + + Get temporary files uploaded to a project. + + :param proj_key: (required) + :type proj_key: str + :param scratch_ids: + :type scratch_ids: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_scratch_files_serialize( + proj_key=proj_key, + scratch_ids=scratch_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectScratchFiles]", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_project_scratch_files_serialize( + self, + proj_key, + scratch_ids, + _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 + if scratch_ids is not None: + + _query_params.append(('scratch_ids', scratch_ids)) + + # 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}/scratch/files', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_project_scratch_files_paginated( + self, + proj_key: StrictStr, + page: Optional[StrictInt] = None, + items_per_page: Optional[StrictInt] = None, + search_string: Optional[StrictStr] = None, + begin_date: Optional[StrictInt] = None, + end_date: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProjectScratchFilesPaginated: + """List Project Scratch Files Paginated + + Get paginated list of temporary files uploaded to a project. + + :param proj_key: (required) + :type proj_key: str + :param page: + :type page: int + :param items_per_page: + :type items_per_page: int + :param search_string: + :type search_string: str + :param begin_date: + :type begin_date: int + :param end_date: + :type end_date: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_scratch_files_paginated_serialize( + proj_key=proj_key, + page=page, + items_per_page=items_per_page, + search_string=search_string, + begin_date=begin_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectScratchFilesPaginated", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_project_scratch_files_paginated_with_http_info( + self, + proj_key: StrictStr, + page: Optional[StrictInt] = None, + items_per_page: Optional[StrictInt] = None, + search_string: Optional[StrictStr] = None, + begin_date: Optional[StrictInt] = None, + end_date: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProjectScratchFilesPaginated]: + """List Project Scratch Files Paginated + + Get paginated list of temporary files uploaded to a project. + + :param proj_key: (required) + :type proj_key: str + :param page: + :type page: int + :param items_per_page: + :type items_per_page: int + :param search_string: + :type search_string: str + :param begin_date: + :type begin_date: int + :param end_date: + :type end_date: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_scratch_files_paginated_serialize( + proj_key=proj_key, + page=page, + items_per_page=items_per_page, + search_string=search_string, + begin_date=begin_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectScratchFilesPaginated", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_project_scratch_files_paginated_without_preload_content( + self, + proj_key: StrictStr, + page: Optional[StrictInt] = None, + items_per_page: Optional[StrictInt] = None, + search_string: Optional[StrictStr] = None, + begin_date: Optional[StrictInt] = None, + end_date: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Project Scratch Files Paginated + + Get paginated list of temporary files uploaded to a project. + + :param proj_key: (required) + :type proj_key: str + :param page: + :type page: int + :param items_per_page: + :type items_per_page: int + :param search_string: + :type search_string: str + :param begin_date: + :type begin_date: int + :param end_date: + :type end_date: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_scratch_files_paginated_serialize( + proj_key=proj_key, + page=page, + items_per_page=items_per_page, + search_string=search_string, + begin_date=begin_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectScratchFilesPaginated", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_project_scratch_files_paginated_serialize( + self, + proj_key, + page, + items_per_page, + search_string, + begin_date, + end_date, + _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 + if page is not None: + + _query_params.append(('page', page)) + + if items_per_page is not None: + + _query_params.append(('items_per_page', items_per_page)) + + if search_string is not None: + + _query_params.append(('search_string', search_string)) + + if begin_date is not None: + + _query_params.append(('begin_date', begin_date)) + + if end_date is not None: + + _query_params.append(('end_date', end_date)) + + # 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}/scratch/files_paginated', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/deepsearch/cps/apis/public_v2/api_client.py b/deepsearch/cps/apis/public_v2/api_client.py new file mode 100644 index 00000000..c9a5f684 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api_client.py @@ -0,0 +1,758 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import datetime +from dateutil.parser import parse +from enum import Enum +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict + +from deepsearch.cps.apis.public_v2.configuration import Configuration +from deepsearch.cps.apis.public_v2.api_response import ApiResponse, T as ApiResponseT +import deepsearch.cps.apis.public_v2.models +from deepsearch.cps.apis.public_v2 import rest +from deepsearch.cps.apis.public_v2.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/2.0.0/python' + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :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. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = obj.to_dict() + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + + # fetch data from response object + try: + data = json.loads(response_text) + except ValueError: + data = response_text + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(deepsearch.cps.apis.public_v2.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if files: + for k, v in files.items(): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/deepsearch/cps/apis/public_v2/api_response.py b/deepsearch/cps/apis/public_v2/api_response.py new file mode 100644 index 00000000..9bc7c11f --- /dev/null +++ b/deepsearch/cps/apis/public_v2/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/deepsearch/cps/apis/public_v2/configuration.py b/deepsearch/cps/apis/public_v2/configuration.py new file mode 100644 index 00000000..a9c69dcb --- /dev/null +++ b/deepsearch/cps/apis/public_v2/configuration.py @@ -0,0 +1,465 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import copy +import logging +from logging import FileHandler +import multiprocessing +import sys +from typing import Optional +import urllib3 + +import http.client as httplib + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = deepsearch.cps.apis.public_v2.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + access_token=None, + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ssl_ca_cert=None, + ) -> None: + """Constructor + """ + self._base_path = "/api/cps/public/v2" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("deepsearch.cps.apis.public_v2") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls): + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = Configuration() + return cls._default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if 'Bearer' in self.api_key: + auth['Bearer'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_api_key_with_prefix( + 'Bearer', + ), + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 3.0.0\n"\ + "SDK Package Version: 2.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "/api/cps/public/v2", + 'description': "No description provided", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/deepsearch/cps/apis/public_v2/exceptions.py b/deepsearch/cps/apis/public_v2/exceptions.py new file mode 100644 index 00000000..feea1ab0 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/exceptions.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/deepsearch/cps/apis/public_v2/models/__init__.py b/deepsearch/cps/apis/public_v2/models/__init__.py new file mode 100644 index 00000000..e8da4c6d --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/__init__.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +# flake8: noqa +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +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.bag_flavour_full_data import BagFlavourFullData +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.collection_metadata_settings import CollectionMetadataSettings +from deepsearch.cps.apis.public_v2.models.convert_documents_request_body import ConvertDocumentsRequestBody +from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask +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.default_values import DefaultValues +from deepsearch.cps.apis.public_v2.models.deployment import Deployment +from deepsearch.cps.apis.public_v2.models.direct_model_config import DirectModelConfig +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.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.http_validation_error import HTTPValidationError +from deepsearch.cps.apis.public_v2.models.json_upload_request_body import JsonUploadRequestBody +from deepsearch.cps.apis.public_v2.models.list_project_flavours import ListProjectFlavours +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.ocr_settings import OcrSettings +from deepsearch.cps.apis.public_v2.models.package import Package +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters import PartialDirectConversionParameters +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_flavour_total_kgs import ProjectFlavourTotalKgs +from deepsearch.cps.apis.public_v2.models.project_flavours_quota import ProjectFlavoursQuota +from deepsearch.cps.apis.public_v2.models.project_package_instalation_manifest import ProjectPackageInstalationManifest +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.project_source_data_index import ProjectSourceDataIndex +from deepsearch.cps.apis.public_v2.models.projects_flavours import ProjectsFlavours +from deepsearch.cps.apis.public_v2.models.properties import Properties +from deepsearch.cps.apis.public_v2.models.reference_to_model import ReferenceToModel +from deepsearch.cps.apis.public_v2.models.response_get_project_integration_config import ResponseGetProjectIntegrationConfig +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.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.source import Source +from deepsearch.cps.apis.public_v2.models.source1 import Source1 +from deepsearch.cps.apis.public_v2.models.storage_summary_task import StorageSummaryTask +from deepsearch.cps.apis.public_v2.models.system_info import SystemInfo +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.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.token_response import TokenResponse +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.view_of import ViewOf diff --git a/deepsearch/cps/apis/public_v2/models/assemble_mode.py b/deepsearch/cps/apis/public_v2/models/assemble_mode.py new file mode 100644 index 00000000..c642df29 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/assemble_mode.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, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AssembleMode(BaseModel): + """ + AssembleMode + """ # noqa: E501 + page_elements: List[StrictStr] + tables: List[StrictStr] + __properties: ClassVar[List[str]] = ["page_elements", "tables"] + + @field_validator('page_elements') + def page_elements_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['H', 'M', 'None']): + raise ValueError("each list item must be one of ('H', 'M', 'None')") + return value + + @field_validator('tables') + def tables_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['H', 'M', 'None']): + raise ValueError("each list item must be one of ('H', 'M', 'None')") + 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 AssembleMode 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 AssembleMode from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page_elements": obj.get("page_elements"), + "tables": obj.get("tables") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/assemble_settings.py b/deepsearch/cps/apis/public_v2/models/assemble_settings.py new file mode 100644 index 00000000..558b6f07 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/assemble_settings.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from deepsearch.cps.apis.public_v2.models.assemble_mode import AssembleMode +from typing import Optional, Set +from typing_extensions import Self + +class AssembleSettings(BaseModel): + """ + AssembleSettings + """ # noqa: E501 + mode: AssembleMode + include_incomplete_documents: StrictBool + __properties: ClassVar[List[str]] = ["mode", "include_incomplete_documents"] + + 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 AssembleSettings 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 mode + if self.mode: + _dict['mode'] = self.mode.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssembleSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": AssembleMode.from_dict(obj["mode"]) if obj.get("mode") is not None else None, + "include_incomplete_documents": obj.get("include_incomplete_documents") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/attachment_upload_data.py b/deepsearch/cps/apis/public_v2/models/attachment_upload_data.py new file mode 100644 index 00000000..b5a596ce --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/attachment_upload_data.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Optional, Set +from typing_extensions import Self + +class AttachmentUploadData(BaseModel): + """ + AttachmentUploadData + """ # noqa: E501 + attachment_path: StrictStr + upload_data: StrictStr + __properties: ClassVar[List[str]] = ["attachment_path", "upload_data"] + + 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 AttachmentUploadData 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 AttachmentUploadData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attachment_path": obj.get("attachment_path"), + "upload_data": obj.get("upload_data") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/attachment_upload_request_body.py b/deepsearch/cps/apis/public_v2/models/attachment_upload_request_body.py new file mode 100644 index 00000000..5d56bdc8 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/attachment_upload_request_body.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 typing import Optional, Set +from typing_extensions import Self + +class AttachmentUploadRequestBody(BaseModel): + """ + AttachmentUploadRequestBody + """ # noqa: E501 + attachment_path: StrictStr + attachment_key: Optional[StrictStr] = 'usr_attachments' + __properties: ClassVar[List[str]] = ["attachment_path", "attachment_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 AttachmentUploadRequestBody 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 AttachmentUploadRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attachment_path": obj.get("attachment_path"), + "attachment_key": obj.get("attachment_key") if obj.get("attachment_key") is not None else 'usr_attachments' + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/bag_flavour_full_data.py b/deepsearch/cps/apis/public_v2/models/bag_flavour_full_data.py new file mode 100644 index 00000000..6d57713d --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/bag_flavour_full_data.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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BagFlavourFullData(BaseModel): + """ + BagFlavourFullData + """ # noqa: E501 + backend: StrictStr + config: Dict[str, Any] + default_quota: Optional[StrictInt] = 0 + description: StrictStr + display_name: StrictStr + is_from_deployment: Optional[StrictBool] = True + name: StrictStr + order: Optional[StrictInt] = 0 + project_specific: StrictBool + __properties: ClassVar[List[str]] = ["backend", "config", "default_quota", "description", "display_name", "is_from_deployment", "name", "order", "project_specific"] + + 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 BagFlavourFullData 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 BagFlavourFullData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "backend": obj.get("backend"), + "config": obj.get("config"), + "default_quota": obj.get("default_quota") if obj.get("default_quota") is not None else 0, + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "is_from_deployment": obj.get("is_from_deployment") if obj.get("is_from_deployment") is not None else True, + "name": obj.get("name"), + "order": obj.get("order") if obj.get("order") is not None else 0, + "project_specific": obj.get("project_specific") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/ccs_project.py b/deepsearch/cps/apis/public_v2/models/ccs_project.py new file mode 100644 index 00000000..4cc0c437 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/ccs_project.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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CCSProject(BaseModel): + """ + CCSProject + """ # noqa: E501 + name: StrictStr + proj_key: StrictStr + collection_name: StrictStr + __properties: ClassVar[List[str]] = ["name", "proj_key", "collection_name"] + + 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 CCSProject 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 CCSProject 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"), + "proj_key": obj.get("proj_key"), + "collection_name": obj.get("collection_name") + }) + 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 new file mode 100644 index 00000000..e7091f9d --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/collection_metadata_settings.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 typing import Optional, Set +from typing_extensions import Self + +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 + __properties: ClassVar[List[str]] = ["description", "display_name", "license", "source", "version"] + + 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 CollectionMetadataSettings 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 CollectionMetadataSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + 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") + }) + return _obj + + 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 new file mode 100644 index 00000000..1e19dac0 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/convert_documents_request_body.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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.partial_direct_conversion_parameters import PartialDirectConversionParameters +from deepsearch.cps.apis.public_v2.models.s3_document_source import S3DocumentSource +from typing import Optional, Set +from typing_extensions import Self + +class ConvertDocumentsRequestBody(BaseModel): + """ + ConvertDocumentsRequestBody + """ # 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.") + s3_source: Optional[S3DocumentSource] = Field(default=None, description="Coordinates to object store to get files to convert. Can specify which files with object keys.") + scratch_files_id: Optional[List[StrictStr]] = Field(default=None, description="List of CCS's scratch files id to be converted and uploaded to the data index.") + conversion_settings: Optional[PartialDirectConversionParameters] = Field(default=None, description="Specify the conversion settings to use.") + __properties: ClassVar[List[str]] = ["file_url", "s3_source", "scratch_files_id", "conversion_settings"] + + 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 ConvertDocumentsRequestBody 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 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 conversion_settings + if self.conversion_settings: + _dict['conversion_settings'] = self.conversion_settings.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConvertDocumentsRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "file_url": obj.get("file_url"), + "s3_source": S3DocumentSource.from_dict(obj["s3_source"]) if obj.get("s3_source") is not None else None, + "scratch_files_id": obj.get("scratch_files_id"), + "conversion_settings": PartialDirectConversionParameters.from_dict(obj["conversion_settings"]) if obj.get("conversion_settings") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/cps_package.py b/deepsearch/cps/apis/public_v2/models/cps_package.py new file mode 100644 index 00000000..dbe7dd6e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/cps_package.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CPSPackage(BaseModel): + """ + CPSPackage + """ # noqa: E501 + name: StrictStr + description: StrictStr + package_id: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["name", "description", "package_id", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['model', 'dictionary', 'knowledge_graph', 'data_catalog', 'data_flow', 'bundle']): + raise ValueError("must be one of enum values ('model', 'dictionary', 'knowledge_graph', 'data_catalog', 'data_flow', 'bundle')") + 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 CPSPackage 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 CPSPackage 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"), + "description": obj.get("description"), + "package_id": obj.get("package_id"), + "type": obj.get("type") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/cps_summary.py b/deepsearch/cps/apis/public_v2/models/cps_summary.py new file mode 100644 index 00000000..2b3b66d6 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/cps_summary.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CPSSummary(BaseModel): + """ + CPSSummary + """ # noqa: E501 + avail_cpu_slots: StrictInt = Field(alias="availCpuSlots") + avail_mem_slots: StrictInt = Field(alias="availMemSlots") + avail_slots: StrictInt = Field(alias="availSlots") + name: StrictStr + num_nodes: StrictInt = Field(alias="numNodes") + number_kgs: StrictInt = Field(alias="numberKgs") + running_kgs: StrictInt = Field(alias="runningKgs") + workers_pool: StrictStr = Field(alias="workersPool") + __properties: ClassVar[List[str]] = ["availCpuSlots", "availMemSlots", "availSlots", "name", "numNodes", "numberKgs", "runningKgs", "workersPool"] + + 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 CPSSummary 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 CPSSummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "availCpuSlots": obj.get("availCpuSlots"), + "availMemSlots": obj.get("availMemSlots"), + "availSlots": obj.get("availSlots"), + "name": obj.get("name"), + "numNodes": obj.get("numNodes"), + "numberKgs": obj.get("numberKgs"), + "runningKgs": obj.get("runningKgs"), + "workersPool": obj.get("workersPool") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/cps_task.py b/deepsearch/cps/apis/public_v2/models/cps_task.py new file mode 100644 index 00000000..f2b215a6 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/cps_task.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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CpsTask(BaseModel): + """ + CpsTask + """ # noqa: E501 + task_id: StrictStr + task_type: StrictStr + task_status: StrictStr + __properties: ClassVar[List[str]] = ["task_id", "task_type", "task_status"] + + 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 CpsTask 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 CpsTask from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "task_id": obj.get("task_id"), + "task_type": obj.get("task_type"), + "task_status": obj.get("task_status") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/data.py b/deepsearch/cps/apis/public_v2/models/data.py new file mode 100644 index 00000000..68be2f6f --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/data.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.project_data_index_non_view import ProjectDataIndexNonView +from deepsearch.cps.apis.public_v2.models.project_data_index_view import ProjectDataIndexView +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DATA_ANY_OF_SCHEMAS = ["ProjectDataIndexNonView", "ProjectDataIndexView"] + +class Data(BaseModel): + """ + Data + """ + + # data type: ProjectDataIndexView + anyof_schema_1_validator: Optional[ProjectDataIndexView] = None + # data type: ProjectDataIndexNonView + anyof_schema_2_validator: Optional[ProjectDataIndexNonView] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ProjectDataIndexNonView, ProjectDataIndexView]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ProjectDataIndexNonView", "ProjectDataIndexView"]) + + 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 = Data.model_construct() + error_messages = [] + # validate data type: ProjectDataIndexView + if not isinstance(v, ProjectDataIndexView): + error_messages.append(f"Error! Input type `{type(v)}` is not `ProjectDataIndexView`") + else: + return v + + # validate data type: ProjectDataIndexNonView + if not isinstance(v, ProjectDataIndexNonView): + error_messages.append(f"Error! Input type `{type(v)}` is not `ProjectDataIndexNonView`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Data with anyOf schemas: ProjectDataIndexNonView, ProjectDataIndexView. 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[ProjectDataIndexView] = None + try: + instance.actual_instance = ProjectDataIndexView.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[ProjectDataIndexNonView] = None + try: + instance.actual_instance = ProjectDataIndexNonView.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 Data with anyOf schemas: ProjectDataIndexNonView, ProjectDataIndexView. 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], ProjectDataIndexNonView, ProjectDataIndexView]]: + """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_flow.py b/deepsearch/cps/apis/public_v2/models/data_flow.py new file mode 100644 index 00000000..6da31e5a --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/data_flow.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Optional, Set +from typing_extensions import Self + +class DataFlow(BaseModel): + """ + DataFlow + """ # noqa: E501 + df_tpl_key: StrictStr + name: StrictStr + __properties: ClassVar[List[str]] = ["df_tpl_key", "name"] + + 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 DataFlow 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 DataFlow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "df_tpl_key": obj.get("df_tpl_key"), + "name": obj.get("name") + }) + return _obj + + 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 new file mode 100644 index 00000000..09625782 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/data_index_upload_file_source.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, Field +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.urls import Urls +from typing import Optional, Set +from typing_extensions import Self + +class DataIndexUploadFileSource(BaseModel): + """ + DataIndexUploadFileSource + """ # noqa: E501 + urls: Urls + conversion_settings: Optional[PartialDirectConversionParameters] = Field(default=None, description="Specify the conversion settings to use.") + __properties: ClassVar[List[str]] = ["urls", "conversion_settings"] + + 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 DataIndexUploadFileSource 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 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() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DataIndexUploadFileSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "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 + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/default_values.py b/deepsearch/cps/apis/public_v2/models/default_values.py new file mode 100644 index 00000000..ac80f379 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/default_values.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.ccs_project import CCSProject +from deepsearch.cps.apis.public_v2.models.data_flow import DataFlow +from typing import Optional, Set +from typing_extensions import Self + +class DefaultValues(BaseModel): + """ + DefaultValues + """ # noqa: E501 + ccs_project: CCSProject + dataflow: Optional[DataFlow] = None + __properties: ClassVar[List[str]] = ["ccs_project", "dataflow"] + + 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 DefaultValues 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 ccs_project + if self.ccs_project: + _dict['ccs_project'] = self.ccs_project.to_dict() + # override the default output from pydantic by calling `to_dict()` of dataflow + if self.dataflow: + _dict['dataflow'] = self.dataflow.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DefaultValues from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _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 + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/deployment.py b/deepsearch/cps/apis/public_v2/models/deployment.py new file mode 100644 index 00000000..2c5cd4cd --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/deployment.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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class Deployment(BaseModel): + """ + Deployment + """ # noqa: E501 + name: StrictStr + disclaimer: StrictStr + should_show_warning: StrictBool + disable_kg_actions: StrictBool + linked_ccs_api: Dict[str, Any] + __properties: ClassVar[List[str]] = ["name", "disclaimer", "should_show_warning", "disable_kg_actions", "linked_ccs_api"] + + 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 Deployment 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 Deployment 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"), + "disclaimer": obj.get("disclaimer"), + "should_show_warning": obj.get("should_show_warning"), + "disable_kg_actions": obj.get("disable_kg_actions"), + "linked_ccs_api": obj.get("linked_ccs_api") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/direct_model_config.py b/deepsearch/cps/apis/public_v2/models/direct_model_config.py new file mode 100644 index 00000000..2f20062f --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/direct_model_config.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Optional, Set +from typing_extensions import Self + +class DirectModelConfig(BaseModel): + """ + Direct configuration of a model. + """ # noqa: E501 + type: StrictStr + config: Dict[str, Any] + __properties: ClassVar[List[str]] = ["type", "config"] + + 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 DirectModelConfig 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 DirectModelConfig 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"), + "config": obj.get("config") + }) + return _obj + + 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 new file mode 100644 index 00000000..74f86fc8 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/elastic_index_property_object.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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ElasticIndexPropertyObject(BaseModel): + """ + ElasticIndexPropertyObject + """ # noqa: E501 + type: StrictStr + enabled: Optional[StrictBool] = None + ignore_above: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["type", "enabled", "ignore_above"] + + 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 ElasticIndexPropertyObject 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 ElasticIndexPropertyObject 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"), + "enabled": obj.get("enabled"), + "ignore_above": obj.get("ignore_above") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/elastic_index_property_primitive.py b/deepsearch/cps/apis/public_v2/models/elastic_index_property_primitive.py new file mode 100644 index 00000000..10dbbbee --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/elastic_index_property_primitive.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Optional, Set +from typing_extensions import Self + +class ElasticIndexPropertyPrimitive(BaseModel): + """ + ElasticIndexPropertyPrimitive + """ # noqa: E501 + properties: Dict[str, Any] + __properties: ClassVar[List[str]] = ["properties"] + + 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 ElasticIndexPropertyPrimitive 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 ElasticIndexPropertyPrimitive from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "properties": obj.get("properties") + }) + 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 new file mode 100644 index 00000000..0deed05a --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/elastic_index_search_query_options.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, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +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 + __properties: ClassVar[List[str]] = ["_source", "from_", "size", "query", "aggs", "sort"] + + 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 ElasticIndexSearchQueryOptions 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 ElasticIndexSearchQueryOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + 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") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/elastic_index_source.py b/deepsearch/cps/apis/public_v2/models/elastic_index_source.py new file mode 100644 index 00000000..c1621b60 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/elastic_index_source.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Optional, Set +from typing_extensions import Self + +class ElasticIndexSource(BaseModel): + """ + ElasticIndexSource + """ # noqa: E501 + index_key: StrictStr + elastic_id: StrictStr + __properties: ClassVar[List[str]] = ["index_key", "elastic_id"] + + 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 ElasticIndexSource 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 ElasticIndexSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "index_key": obj.get("index_key"), + "elastic_id": obj.get("elastic_id") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/elastic_instance_data_index.py b/deepsearch/cps/apis/public_v2/models/elastic_instance_data_index.py new file mode 100644 index 00000000..108ca0c8 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/elastic_instance_data_index.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 +from deepsearch.cps.apis.public_v2.models.elastic_index_search_query_options import ElasticIndexSearchQueryOptions +from typing import Optional, Set +from typing_extensions import Self + +class ElasticInstanceDataIndex(BaseModel): + """ + ElasticInstanceDataIndex + """ # noqa: E501 + index_key: StrictStr + query_options: ElasticIndexSearchQueryOptions + elastic_id: StrictStr + __properties: ClassVar[List[str]] = ["index_key", "query_options", "elastic_id"] + + 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 ElasticInstanceDataIndex 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 query_options + if self.query_options: + _dict['query_options'] = self.query_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ElasticInstanceDataIndex from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "index_key": obj.get("index_key"), + "query_options": ElasticIndexSearchQueryOptions.from_dict(obj["query_options"]) if obj.get("query_options") is not None else None, + "elastic_id": obj.get("elastic_id") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/elastic_metadata.py b/deepsearch/cps/apis/public_v2/models/elastic_metadata.py new file mode 100644 index 00000000..761d242c --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/elastic_metadata.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 typing import Optional, Set +from typing_extensions import Self + +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 + classification: List[StrictStr] + __properties: ClassVar[List[str]] = ["aliases", "created", "description", "display_name", "source", "storage", "version", "type", "domain", "classification"] + + 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 ElasticMetadata 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 ElasticMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + 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"), + "classification": obj.get("classification") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/flavour.py b/deepsearch/cps/apis/public_v2/models/flavour.py new file mode 100644 index 00000000..db23e683 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/flavour.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 typing import Optional, Set +from typing_extensions import Self + +class Flavour(BaseModel): + """ + Flavour + """ # noqa: E501 + name: StrictStr + display_name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "display_name"] + + 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 Flavour 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 Flavour 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"), + "display_name": obj.get("display_name") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/flavours_default_quota.py b/deepsearch/cps/apis/public_v2/models/flavours_default_quota.py new file mode 100644 index 00000000..b246860b --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/flavours_default_quota.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class FlavoursDefaultQuota(BaseModel): + """ + FlavoursDefaultQuota + """ # noqa: E501 + display_name: StrictStr + name: StrictStr + default_quota: StrictInt + __properties: ClassVar[List[str]] = ["display_name", "name", "default_quota"] + + 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 FlavoursDefaultQuota 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 FlavoursDefaultQuota from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "display_name": obj.get("display_name"), + "name": obj.get("name"), + "default_quota": obj.get("default_quota") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/flavours_quota.py b/deepsearch/cps/apis/public_v2/models/flavours_quota.py new file mode 100644 index 00000000..f8493b69 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/flavours_quota.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class FlavoursQuota(BaseModel): + """ + FlavoursQuota + """ # noqa: E501 + display_name: StrictStr + name: StrictStr + quota: StrictInt + __properties: ClassVar[List[str]] = ["display_name", "name", "quota"] + + 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 FlavoursQuota 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 FlavoursQuota from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "display_name": obj.get("display_name"), + "name": obj.get("name"), + "quota": obj.get("quota") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/http_validation_error.py b/deepsearch/cps/apis/public_v2/models/http_validation_error.py new file mode 100644 index 00000000..6ae40f4e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/http_validation_error.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 +from typing import Any, ClassVar, Dict, List, Optional +from deepsearch.cps.apis.public_v2.models.validation_error import ValidationError +from typing import Optional, Set +from typing_extensions import Self + +class HTTPValidationError(BaseModel): + """ + HTTPValidationError + """ # noqa: E501 + detail: Optional[List[ValidationError]] = None + __properties: ClassVar[List[str]] = ["detail"] + + 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 HTTPValidationError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in detail (list) + _items = [] + if self.detail: + for _item in self.detail: + if _item: + _items.append(_item.to_dict()) + _dict['detail'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HTTPValidationError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "detail": [ValidationError.from_dict(_item) for _item in obj["detail"]] if obj.get("detail") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/json_upload_request_body.py b/deepsearch/cps/apis/public_v2/models/json_upload_request_body.py new file mode 100644 index 00000000..0365ce39 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/json_upload_request_body.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Optional, Set +from typing_extensions import Self + +class JsonUploadRequestBody(BaseModel): + """ + JsonUploadRequestBody + """ # noqa: E501 + file_url: StrictStr + __properties: ClassVar[List[str]] = ["file_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 JsonUploadRequestBody 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 JsonUploadRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "file_url": obj.get("file_url") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/list_project_flavours.py b/deepsearch/cps/apis/public_v2/models/list_project_flavours.py new file mode 100644 index 00000000..f6073719 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/list_project_flavours.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, StrictStr +from typing import Any, ClassVar, Dict, List +from deepsearch.cps.apis.public_v2.models.bag_flavour_full_data import BagFlavourFullData +from typing import Optional, Set +from typing_extensions import Self + +class ListProjectFlavours(BaseModel): + """ + ListProjectFlavours + """ # noqa: E501 + flavours: List[BagFlavourFullData] + proj_key: StrictStr + __properties: ClassVar[List[str]] = ["flavours", "proj_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 ListProjectFlavours from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in flavours (list) + _items = [] + if self.flavours: + for _item in self.flavours: + if _item: + _items.append(_item.to_dict()) + _dict['flavours'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListProjectFlavours from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "flavours": [BagFlavourFullData.from_dict(_item) for _item in obj["flavours"]] if obj.get("flavours") is not None else None, + "proj_key": obj.get("proj_key") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/model_pipeline_settings.py b/deepsearch/cps/apis/public_v2/models/model_pipeline_settings.py new file mode 100644 index 00000000..25cad0be --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/model_pipeline_settings.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from deepsearch.cps.apis.public_v2.models.model_pipeline_settings_clusters_inner import ModelPipelineSettingsClustersInner +from typing import Optional, Set +from typing_extensions import Self + +class ModelPipelineSettings(BaseModel): + """ + ModelPipelineSettings + """ # noqa: E501 + clusters: List[ModelPipelineSettingsClustersInner] + page: List[ModelPipelineSettingsClustersInner] + tables: List[ModelPipelineSettingsClustersInner] + normalization: List[ModelPipelineSettingsClustersInner] + __properties: ClassVar[List[str]] = ["clusters", "page", "tables", "normalization"] + + 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 ModelPipelineSettings from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in clusters (list) + _items = [] + if self.clusters: + for _item in self.clusters: + if _item: + _items.append(_item.to_dict()) + _dict['clusters'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in page (list) + _items = [] + if self.page: + for _item in self.page: + if _item: + _items.append(_item.to_dict()) + _dict['page'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in tables (list) + _items = [] + if self.tables: + for _item in self.tables: + if _item: + _items.append(_item.to_dict()) + _dict['tables'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in normalization (list) + _items = [] + if self.normalization: + for _item in self.normalization: + if _item: + _items.append(_item.to_dict()) + _dict['normalization'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ModelPipelineSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "clusters": [ModelPipelineSettingsClustersInner.from_dict(_item) for _item in obj["clusters"]] if obj.get("clusters") is not None else None, + "page": [ModelPipelineSettingsClustersInner.from_dict(_item) for _item in obj["page"]] if obj.get("page") is not None else None, + "tables": [ModelPipelineSettingsClustersInner.from_dict(_item) for _item in obj["tables"]] if obj.get("tables") is not None else None, + "normalization": [ModelPipelineSettingsClustersInner.from_dict(_item) for _item in obj["normalization"]] if obj.get("normalization") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/model_pipeline_settings_clusters_inner.py b/deepsearch/cps/apis/public_v2/models/model_pipeline_settings_clusters_inner.py new file mode 100644 index 00000000..49a5816e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/model_pipeline_settings_clusters_inner.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.direct_model_config import DirectModelConfig +from deepsearch.cps.apis.public_v2.models.reference_to_model import ReferenceToModel +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +MODELPIPELINESETTINGSCLUSTERSINNER_ANY_OF_SCHEMAS = ["DirectModelConfig", "ReferenceToModel"] + +class ModelPipelineSettingsClustersInner(BaseModel): + """ + ModelPipelineSettingsClustersInner + """ + + # data type: ReferenceToModel + anyof_schema_1_validator: Optional[ReferenceToModel] = None + # data type: DirectModelConfig + anyof_schema_2_validator: Optional[DirectModelConfig] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[DirectModelConfig, ReferenceToModel]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["DirectModelConfig", "ReferenceToModel"]) + + 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 = ModelPipelineSettingsClustersInner.model_construct() + error_messages = [] + # validate data type: ReferenceToModel + if not isinstance(v, ReferenceToModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `ReferenceToModel`") + else: + return v + + # validate data type: DirectModelConfig + if not isinstance(v, DirectModelConfig): + error_messages.append(f"Error! Input type `{type(v)}` is not `DirectModelConfig`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ModelPipelineSettingsClustersInner with anyOf schemas: DirectModelConfig, ReferenceToModel. 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[ReferenceToModel] = None + try: + instance.actual_instance = ReferenceToModel.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[DirectModelConfig] = None + try: + instance.actual_instance = DirectModelConfig.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 ModelPipelineSettingsClustersInner with anyOf schemas: DirectModelConfig, ReferenceToModel. 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], DirectModelConfig, ReferenceToModel]]: + """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/modules_config.py b/deepsearch/cps/apis/public_v2/models/modules_config.py new file mode 100644 index 00000000..6d38b417 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/modules_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 +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ModulesConfig(BaseModel): + """ + ModulesConfig + """ # noqa: E501 + df_template_variables: List[Any] + linked_ccs_instances: List[Any] + linked_elastic_instances: List[Any] + __properties: ClassVar[List[str]] = ["df_template_variables", "linked_ccs_instances", "linked_elastic_instances"] + + 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 ModulesConfig 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 ModulesConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "df_template_variables": obj.get("df_template_variables"), + "linked_ccs_instances": obj.get("linked_ccs_instances"), + "linked_elastic_instances": obj.get("linked_elastic_instances") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/ocr_settings.py b/deepsearch/cps/apis/public_v2/models/ocr_settings.py new file mode 100644 index 00000000..6bab580f --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/ocr_settings.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +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 + __properties: ClassVar[List[str]] = ["enabled", "backend", "backend_settings", "merge_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 OcrSettings 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 OcrSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _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") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/package.py b/deepsearch/cps/apis/public_v2/models/package.py new file mode 100644 index 00000000..7078c4f6 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/package.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Optional, Set +from typing_extensions import Self + +class Package(BaseModel): + """ + Package + """ # noqa: E501 + overrides: Dict[str, Any] + package_id: StrictStr + __properties: ClassVar[List[str]] = ["overrides", "package_id"] + + 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 Package 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 Package from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "overrides": obj.get("overrides"), + "package_id": obj.get("package_id") + }) + return _obj + + 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 new file mode 100644 index 00000000..3d0e1bb9 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/partial_direct_conversion_parameters.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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, field_validator +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 typing import Optional, Set +from typing_extensions import Self + +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 + __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, + 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 PartialDirectConversionParameters 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 assemble + if self.assemble: + _dict['assemble'] = self.assemble.to_dict() + # 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 model_pipeline + if self.model_pipeline: + _dict['model_pipeline'] = self.model_pipeline.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartialDirectConversionParameters 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") 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 + }) + 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 new file mode 100644 index 00000000..c55efc5a --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_data_index_non_view.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ProjectDataIndexNonView(BaseModel): + """ + ProjectDataIndexNonView + """ # noqa: E501 + name: StrictStr + description: Optional[StrictStr] = None + schema_key: Optional[StrictStr] = 'generic' + __properties: ClassVar[List[str]] = ["name", "description", "schema_key"] + + @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, + 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 ProjectDataIndexNonView 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 ProjectDataIndexNonView 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"), + "description": obj.get("description"), + "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_source.py b/deepsearch/cps/apis/public_v2/models/project_data_index_source.py new file mode 100644 index 00000000..2d9b43a2 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_data_index_source.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Optional, Set +from typing_extensions import Self + +class ProjectDataIndexSource(BaseModel): + """ + ProjectDataIndexSource + """ # noqa: E501 + index_key: StrictStr + proj_key: StrictStr + __properties: ClassVar[List[str]] = ["index_key", "proj_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 ProjectDataIndexSource 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 ProjectDataIndexSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "index_key": obj.get("index_key"), + "proj_key": obj.get("proj_key") + }) + 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 new file mode 100644 index 00000000..850877d1 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_data_index_view.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.view_of import ViewOf +from typing import Optional, Set +from typing_extensions import Self + +class ProjectDataIndexView(BaseModel): + """ + ProjectDataIndexView + """ # noqa: E501 + name: StrictStr + description: Optional[StrictStr] = None + view_of: ViewOf + __properties: ClassVar[List[str]] = ["name", "description", "view_of"] + + 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 ProjectDataIndexView 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 view_of + if self.view_of: + _dict['view_of'] = self.view_of.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectDataIndexView 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"), + "description": obj.get("description"), + "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 new file mode 100644 index 00000000..9bb15939 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_data_index_with_status.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, StrictInt, StrictStr, field_validator +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 typing import Optional, Set +from typing_extensions import Self + +class ProjectDataIndexWithStatus(BaseModel): + """ + ProjectDataIndexWithStatus + """ # noqa: E501 + source: Source + name: StrictStr + documents: StrictInt + health: StrictStr + status: StrictStr + creation_date: StrictStr + metadata: Optional[ElasticMetadata] = None + description: StrictStr + schema_key: Optional[StrictStr] = None + type: StrictStr + view_of: Optional[ViewOf] = None + record_properties: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["source", "name", "documents", "health", "status", "creation_date", "metadata", "description", "schema_key", "type", "view_of", "record_properties"] + + @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, + 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 ProjectDataIndexWithStatus 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 source + if self.source: + _dict['source'] = self.source.to_dict() + # 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 view_of + if self.view_of: + _dict['view_of'] = self.view_of.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectDataIndexWithStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "source": Source.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, + "description": obj.get("description"), + "schema_key": obj.get("schema_key"), + "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") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/project_flavour_total_kgs.py b/deepsearch/cps/apis/public_v2/models/project_flavour_total_kgs.py new file mode 100644 index 00000000..34acdafe --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_flavour_total_kgs.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ProjectFlavourTotalKgs(BaseModel): + """ + ProjectFlavourTotalKgs + """ # noqa: E501 + proj_key: StrictStr + flavour_name: StrictStr + total_kgs: StrictInt + __properties: ClassVar[List[str]] = ["proj_key", "flavour_name", "total_kgs"] + + 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 ProjectFlavourTotalKgs 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 ProjectFlavourTotalKgs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "proj_key": obj.get("proj_key"), + "flavour_name": obj.get("flavour_name"), + "total_kgs": obj.get("total_kgs") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/project_flavours_quota.py b/deepsearch/cps/apis/public_v2/models/project_flavours_quota.py new file mode 100644 index 00000000..a41bb636 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_flavours_quota.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 +from deepsearch.cps.apis.public_v2.models.flavours_quota import FlavoursQuota +from typing import Optional, Set +from typing_extensions import Self + +class ProjectFlavoursQuota(BaseModel): + """ + ProjectFlavoursQuota + """ # noqa: E501 + name: StrictStr + proj_key: StrictStr + quotas: List[FlavoursQuota] + __properties: ClassVar[List[str]] = ["name", "proj_key", "quotas"] + + 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 ProjectFlavoursQuota from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in quotas (list) + _items = [] + if self.quotas: + for _item in self.quotas: + if _item: + _items.append(_item.to_dict()) + _dict['quotas'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectFlavoursQuota 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"), + "proj_key": obj.get("proj_key"), + "quotas": [FlavoursQuota.from_dict(_item) for _item in obj["quotas"]] if obj.get("quotas") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/project_package_instalation_manifest.py b/deepsearch/cps/apis/public_v2/models/project_package_instalation_manifest.py new file mode 100644 index 00000000..106835be --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_package_instalation_manifest.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 +from typing import Any, ClassVar, Dict, List +from deepsearch.cps.apis.public_v2.models.package import Package +from typing import Optional, Set +from typing_extensions import Self + +class ProjectPackageInstalationManifest(BaseModel): + """ + ProjectPackageInstalationManifest + """ # noqa: E501 + packages: List[Package] + __properties: ClassVar[List[str]] = ["packages"] + + 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 ProjectPackageInstalationManifest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in packages (list) + _items = [] + if self.packages: + for _item in self.packages: + if _item: + _items.append(_item.to_dict()) + _dict['packages'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectPackageInstalationManifest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "packages": [Package.from_dict(_item) for _item in obj["packages"]] if obj.get("packages") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/project_scratch_files.py b/deepsearch/cps/apis/public_v2/models/project_scratch_files.py new file mode 100644 index 00000000..e64eea62 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_scratch_files.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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ProjectScratchFiles(BaseModel): + """ + ProjectScratchFiles + """ # noqa: E501 + id: StrictStr + proj_key: StrictStr + user_key: StrictStr + filename: StrictStr + timestamp: StrictStr + url: StrictStr + __properties: ClassVar[List[str]] = ["id", "proj_key", "user_key", "filename", "timestamp", "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 ProjectScratchFiles 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 ProjectScratchFiles from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "proj_key": obj.get("proj_key"), + "user_key": obj.get("user_key"), + "filename": obj.get("filename"), + "timestamp": obj.get("timestamp"), + "url": obj.get("url") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/project_scratch_files_paginated.py b/deepsearch/cps/apis/public_v2/models/project_scratch_files_paginated.py new file mode 100644 index 00000000..a9e52867 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_scratch_files_paginated.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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, StrictInt +from typing import Any, ClassVar, Dict, List +from deepsearch.cps.apis.public_v2.models.project_scratch_files import ProjectScratchFiles +from typing import Optional, Set +from typing_extensions import Self + +class ProjectScratchFilesPaginated(BaseModel): + """ + ProjectScratchFilesPaginated + """ # noqa: E501 + files: List[ProjectScratchFiles] + count: StrictInt + page: StrictInt + items_per_page: StrictInt + __properties: ClassVar[List[str]] = ["files", "count", "page", "items_per_page"] + + 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 ProjectScratchFilesPaginated from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in files (list) + _items = [] + if self.files: + for _item in self.files: + if _item: + _items.append(_item.to_dict()) + _dict['files'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectScratchFilesPaginated from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "files": [ProjectScratchFiles.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None, + "count": obj.get("count"), + "page": obj.get("page"), + "items_per_page": obj.get("items_per_page") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/project_source_data_index.py b/deepsearch/cps/apis/public_v2/models/project_source_data_index.py new file mode 100644 index 00000000..b03917c6 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/project_source_data_index.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 +from deepsearch.cps.apis.public_v2.models.elastic_index_search_query_options import ElasticIndexSearchQueryOptions +from typing import Optional, Set +from typing_extensions import Self + +class ProjectSourceDataIndex(BaseModel): + """ + ProjectSourceDataIndex + """ # noqa: E501 + index_key: StrictStr + query_options: ElasticIndexSearchQueryOptions + proj_key: StrictStr + __properties: ClassVar[List[str]] = ["index_key", "query_options", "proj_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 ProjectSourceDataIndex 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 query_options + if self.query_options: + _dict['query_options'] = self.query_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectSourceDataIndex from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "index_key": obj.get("index_key"), + "query_options": ElasticIndexSearchQueryOptions.from_dict(obj["query_options"]) if obj.get("query_options") is not None else None, + "proj_key": obj.get("proj_key") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/projects_flavours.py b/deepsearch/cps/apis/public_v2/models/projects_flavours.py new file mode 100644 index 00000000..302923ee --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/projects_flavours.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 +from deepsearch.cps.apis.public_v2.models.flavour import Flavour +from typing import Optional, Set +from typing_extensions import Self + +class ProjectsFlavours(BaseModel): + """ + ProjectsFlavours + """ # noqa: E501 + proj_key: StrictStr + name: StrictStr + flavours: List[Flavour] + __properties: ClassVar[List[str]] = ["proj_key", "name", "flavours"] + + 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 ProjectsFlavours from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in flavours (list) + _items = [] + if self.flavours: + for _item in self.flavours: + if _item: + _items.append(_item.to_dict()) + _dict['flavours'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectsFlavours from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "proj_key": obj.get("proj_key"), + "name": obj.get("name"), + "flavours": [Flavour.from_dict(_item) for _item in obj["flavours"]] if obj.get("flavours") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/properties.py b/deepsearch/cps/apis/public_v2/models/properties.py new file mode 100644 index 00000000..3e3e58ca --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/properties.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_property_object import ElasticIndexPropertyObject +from deepsearch.cps.apis.public_v2.models.elastic_index_property_primitive import ElasticIndexPropertyPrimitive +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +PROPERTIES_ANY_OF_SCHEMAS = ["ElasticIndexPropertyObject", "ElasticIndexPropertyPrimitive"] + +class Properties(BaseModel): + """ + Properties + """ + + # data type: ElasticIndexPropertyPrimitive + anyof_schema_1_validator: Optional[ElasticIndexPropertyPrimitive] = None + # data type: ElasticIndexPropertyObject + anyof_schema_2_validator: Optional[ElasticIndexPropertyObject] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ElasticIndexPropertyObject, ElasticIndexPropertyPrimitive]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ElasticIndexPropertyObject", "ElasticIndexPropertyPrimitive"]) + + 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 = Properties.model_construct() + error_messages = [] + # validate data type: ElasticIndexPropertyPrimitive + if not isinstance(v, ElasticIndexPropertyPrimitive): + error_messages.append(f"Error! Input type `{type(v)}` is not `ElasticIndexPropertyPrimitive`") + else: + return v + + # validate data type: ElasticIndexPropertyObject + if not isinstance(v, ElasticIndexPropertyObject): + error_messages.append(f"Error! Input type `{type(v)}` is not `ElasticIndexPropertyObject`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Properties with anyOf schemas: ElasticIndexPropertyObject, ElasticIndexPropertyPrimitive. 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[ElasticIndexPropertyPrimitive] = None + try: + instance.actual_instance = ElasticIndexPropertyPrimitive.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[ElasticIndexPropertyObject] = None + try: + instance.actual_instance = ElasticIndexPropertyObject.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 Properties with anyOf schemas: ElasticIndexPropertyObject, ElasticIndexPropertyPrimitive. 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], ElasticIndexPropertyObject, ElasticIndexPropertyPrimitive]]: + """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_to_model.py b/deepsearch/cps/apis/public_v2/models/reference_to_model.py new file mode 100644 index 00000000..74c85c05 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/reference_to_model.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 typing import Optional, Set +from typing_extensions import Self + +class ReferenceToModel(BaseModel): + """ + Reference to a model configuration. + """ # noqa: E501 + model_config_key: StrictStr + proj_key: StrictStr + name: Optional[StrictStr] = '' + description: Optional[StrictStr] = '' + __properties: ClassVar[List[str]] = ["model_config_key", "proj_key", "name", "description"] + + 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 ReferenceToModel 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 ReferenceToModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "model_config_key": obj.get("model_config_key"), + "proj_key": obj.get("proj_key"), + "name": obj.get("name") if obj.get("name") is not None else '', + "description": obj.get("description") if obj.get("description") is not None else '' + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/response_get_project_integration_config.py b/deepsearch/cps/apis/public_v2/models/response_get_project_integration_config.py new file mode 100644 index 00000000..271a3442 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/response_get_project_integration_config.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 + +RESPONSEGETPROJECTINTEGRATIONCONFIG_ANY_OF_SCHEMAS = ["object", "str"] + +class ResponseGetProjectIntegrationConfig(BaseModel): + """ + ResponseGetProjectIntegrationConfig + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: object + anyof_schema_2_validator: Optional[Dict[str, Any]] = None + # data type: object + anyof_schema_3_validator: Optional[Any] = None + # data type: object + anyof_schema_4_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 = ResponseGetProjectIntegrationConfig.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)) + # validate data type: object + try: + instance.anyof_schema_3_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_4_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 ResponseGetProjectIntegrationConfig 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)) + # 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)) + # deserialize data into object + try: + # validation + instance.anyof_schema_4_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_4_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 ResponseGetProjectIntegrationConfig 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/s3_coordinates.py b/deepsearch/cps/apis/public_v2/models/s3_coordinates.py new file mode 100644 index 00000000..4868ff54 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/s3_coordinates.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, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class S3Coordinates(BaseModel): + """ + S3Coordinates + """ # noqa: E501 + host: StrictStr + port: StrictInt + ssl: StrictBool + verify_ssl: StrictBool = Field(alias="verifySSL") + access_key: StrictStr = Field(alias="access-key") + secret_key: StrictStr = Field(alias="secret-key") + bucket: StrictStr + key_prefix: Optional[StrictStr] = None + location: StrictStr + __properties: ClassVar[List[str]] = ["host", "port", "ssl", "verifySSL", "access-key", "secret-key", "bucket", "key_prefix", "location"] + + 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 S3Coordinates 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 S3Coordinates from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "host": obj.get("host"), + "port": obj.get("port"), + "ssl": obj.get("ssl"), + "verifySSL": obj.get("verifySSL"), + "access-key": obj.get("access-key"), + "secret-key": obj.get("secret-key"), + "bucket": obj.get("bucket"), + "key_prefix": obj.get("key_prefix"), + "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 new file mode 100644 index 00000000..1931307a --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/s3_document_source.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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.s3_coordinates import S3Coordinates +from typing import Optional, Set +from typing_extensions import Self + +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.") + __properties: ClassVar[List[str]] = ["coordinates", "object_keys"] + + 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 S3DocumentSource 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 coordinates + if self.coordinates: + _dict['coordinates'] = self.coordinates.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of S3DocumentSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _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") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/semantic_ingest_request.py b/deepsearch/cps/apis/public_v2/models/semantic_ingest_request.py new file mode 100644 index 00000000..e09b784c --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/semantic_ingest_request.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 +from typing import Any, ClassVar, Dict, List +from deepsearch.cps.apis.public_v2.models.source1 import Source1 +from typing import Optional, Set +from typing_extensions import Self + +class SemanticIngestRequest(BaseModel): + """ + SemanticIngestRequest + """ # noqa: E501 + source: Source1 + __properties: ClassVar[List[str]] = ["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 SemanticIngestRequest 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 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 SemanticIngestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "source": Source1.from_dict(obj["source"]) if obj.get("source") 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 new file mode 100644 index 00000000..b71a9ffb --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_private_data_collection.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class SemanticIngestSourcePrivateDataCollection(BaseModel): + """ + SemanticIngestSourcePrivateDataCollection + """ # noqa: E501 + type: StrictStr + proj_key: StrictStr + 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, + 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 SemanticIngestSourcePrivateDataCollection 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 SemanticIngestSourcePrivateDataCollection 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"), + "proj_key": obj.get("proj_key"), + "index_key": obj.get("index_key") + }) + return _obj + + 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 new file mode 100644 index 00000000..657fd06c --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_private_data_document.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class SemanticIngestSourcePrivateDataDocument(BaseModel): + """ + SemanticIngestSourcePrivateDataDocument + """ # noqa: E501 + type: StrictStr + proj_key: StrictStr + index_key: StrictStr + 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, + 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 SemanticIngestSourcePrivateDataDocument 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 SemanticIngestSourcePrivateDataDocument 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"), + "proj_key": obj.get("proj_key"), + "index_key": obj.get("index_key"), + "document_hash": obj.get("document_hash") + }) + return _obj + + 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 new file mode 100644 index 00000000..1756cf96 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_public_data_document.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class SemanticIngestSourcePublicDataDocument(BaseModel): + """ + SemanticIngestSourcePublicDataDocument + """ # noqa: E501 + type: StrictStr + elastic_id: StrictStr + index_key: StrictStr + 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, + 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 SemanticIngestSourcePublicDataDocument 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 SemanticIngestSourcePublicDataDocument 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"), + "elastic_id": obj.get("elastic_id"), + "index_key": obj.get("index_key"), + "document_hash": obj.get("document_hash") + }) + return _obj + + 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 new file mode 100644 index 00000000..0239c91c --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/semantic_ingest_source_url.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class SemanticIngestSourceUrl(BaseModel): + """ + SemanticIngestSourceUrl + """ # noqa: E501 + type: StrictStr + 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, + 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 SemanticIngestSourceUrl 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 SemanticIngestSourceUrl 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"), + "url": obj.get("url") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/source.py b/deepsearch/cps/apis/public_v2/models/source.py new file mode 100644 index 00000000..4b34e6b3 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/source.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 + +SOURCE_ANY_OF_SCHEMAS = ["ElasticIndexSource", "ProjectDataIndexSource"] + +class Source(BaseModel): + """ + Source + """ + + # 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 = 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: + 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 Source 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 Source 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/source1.py b/deepsearch/cps/apis/public_v2/models/source1.py new file mode 100644 index 00000000..96c4d3bf --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/source1.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 + +SOURCE1_ANY_OF_SCHEMAS = ["SemanticIngestSourcePrivateDataCollection", "SemanticIngestSourcePrivateDataDocument", "SemanticIngestSourcePublicDataDocument", "SemanticIngestSourceUrl"] + +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 + 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 = 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: + 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 Source1 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 Source1 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/storage_summary_task.py b/deepsearch/cps/apis/public_v2/models/storage_summary_task.py new file mode 100644 index 00000000..7e09dae8 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/storage_summary_task.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class StorageSummaryTask(BaseModel): + """ + StorageSummaryTask + """ # noqa: E501 + dc_key: Optional[StrictStr] = None + kg_key: Optional[StrictStr] = None + kind: StrictStr + proj_key: StrictStr + task_id: StrictStr + __properties: ClassVar[List[str]] = ["dc_key", "kg_key", "kind", "proj_key", "task_id"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['project_task', 'celery_task']): + raise ValueError("must be one of enum values ('project_task', 'celery_task')") + 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 StorageSummaryTask 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 StorageSummaryTask from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "dc_key": obj.get("dc_key"), + "kg_key": obj.get("kg_key"), + "kind": obj.get("kind"), + "proj_key": obj.get("proj_key"), + "task_id": obj.get("task_id") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/system_info.py b/deepsearch/cps/apis/public_v2/models/system_info.py new file mode 100644 index 00000000..4f02174e --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/system_info.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from deepsearch.cps.apis.public_v2.models.deployment import Deployment +from typing import Optional, Set +from typing_extensions import Self + +class SystemInfo(BaseModel): + """ + SystemInfo + """ # noqa: E501 + notifications: List[Any] + default_project: Dict[str, Any] + deployment: Deployment + toolkit: Dict[str, Any] + allow_non_admins_to_make_resources_public: StrictBool + api: Dict[str, Any] + __properties: ClassVar[List[str]] = ["notifications", "default_project", "deployment", "toolkit", "allow_non_admins_to_make_resources_public", "api"] + + 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 SystemInfo 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 deployment + if self.deployment: + _dict['deployment'] = self.deployment.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SystemInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "notifications": obj.get("notifications"), + "default_project": obj.get("default_project"), + "deployment": Deployment.from_dict(obj["deployment"]) if obj.get("deployment") is not None else None, + "toolkit": obj.get("toolkit"), + "allow_non_admins_to_make_resources_public": obj.get("allow_non_admins_to_make_resources_public"), + "api": obj.get("api") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/task_context.py b/deepsearch/cps/apis/public_v2/models/task_context.py new file mode 100644 index 00000000..80a0b643 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/task_context.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class TaskContext(BaseModel): + """ + TaskContext + """ # noqa: E501 + proj_key: StrictStr + user_key: StrictStr + task_type: StrictStr + task_id: StrictStr + task_status: StrictStr + execution_mode: StrictStr + 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 + __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( + 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 TaskContext 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 TaskContext from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "proj_key": obj.get("proj_key"), + "user_key": obj.get("user_key"), + "task_type": obj.get("task_type"), + "task_id": obj.get("task_id"), + "task_status": obj.get("task_status"), + "execution_mode": obj.get("execution_mode"), + "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") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/task_result.py b/deepsearch/cps/apis/public_v2/models/task_result.py new file mode 100644 index 00000000..a81f82ee --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/task_result.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 typing import Optional, Set +from typing_extensions import Self + +class TaskResult(BaseModel): + """ + TaskResult + """ # noqa: E501 + result: Optional[Any] = None + task_id: StrictStr + task_status: StrictStr + __properties: ClassVar[List[str]] = ["result", "task_id", "task_status"] + + 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 TaskResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if result (nullable) is None + # and model_fields_set contains the field + if self.result is None and "result" in self.model_fields_set: + _dict['result'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "result": obj.get("result"), + "task_id": obj.get("task_id"), + "task_status": obj.get("task_status") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/temporary_upload_file_result.py b/deepsearch/cps/apis/public_v2/models/temporary_upload_file_result.py new file mode 100644 index 00000000..d78c1977 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/temporary_upload_file_result.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from deepsearch.cps.apis.public_v2.models.temporary_url import TemporaryUrl +from deepsearch.cps.apis.public_v2.models.temporary_url_fields import TemporaryUrlFields +from typing import Optional, Set +from typing_extensions import Self + +class TemporaryUploadFileResult(BaseModel): + """ + TemporaryUploadFileResult + """ # noqa: E501 + id: StrictStr + upload: TemporaryUrlFields + download: TemporaryUrl + metadata: TemporaryUrl + upload_private: TemporaryUrlFields + download_private: TemporaryUrl + metadata_private: TemporaryUrl + __properties: ClassVar[List[str]] = ["id", "upload", "download", "metadata", "upload_private", "download_private", "metadata_private"] + + 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 TemporaryUploadFileResult 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 upload + if self.upload: + _dict['upload'] = self.upload.to_dict() + # override the default output from pydantic by calling `to_dict()` of download + if self.download: + _dict['download'] = self.download.to_dict() + # 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 upload_private + if self.upload_private: + _dict['upload_private'] = self.upload_private.to_dict() + # override the default output from pydantic by calling `to_dict()` of download_private + if self.download_private: + _dict['download_private'] = self.download_private.to_dict() + # override the default output from pydantic by calling `to_dict()` of metadata_private + if self.metadata_private: + _dict['metadata_private'] = self.metadata_private.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemporaryUploadFileResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "upload": TemporaryUrlFields.from_dict(obj["upload"]) if obj.get("upload") is not None else None, + "download": TemporaryUrl.from_dict(obj["download"]) if obj.get("download") is not None else None, + "metadata": TemporaryUrl.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "upload_private": TemporaryUrlFields.from_dict(obj["upload_private"]) if obj.get("upload_private") is not None else None, + "download_private": TemporaryUrl.from_dict(obj["download_private"]) if obj.get("download_private") is not None else None, + "metadata_private": TemporaryUrl.from_dict(obj["metadata_private"]) if obj.get("metadata_private") is not None else None + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/temporary_url.py b/deepsearch/cps/apis/public_v2/models/temporary_url.py new file mode 100644 index 00000000..c287424c --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/temporary_url.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Optional, Set +from typing_extensions import Self + +class TemporaryUrl(BaseModel): + """ + TemporaryUrl + """ # noqa: E501 + url: StrictStr + __properties: ClassVar[List[str]] = ["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 TemporaryUrl 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 TemporaryUrl from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "url": obj.get("url") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/temporary_url_fields.py b/deepsearch/cps/apis/public_v2/models/temporary_url_fields.py new file mode 100644 index 00000000..cd592ee5 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/temporary_url_fields.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Optional, Set +from typing_extensions import Self + +class TemporaryUrlFields(BaseModel): + """ + TemporaryUrlFields + """ # noqa: E501 + url: StrictStr + fields: Dict[str, Any] + __properties: ClassVar[List[str]] = ["url", "fields"] + + 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 TemporaryUrlFields 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 TemporaryUrlFields from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "url": obj.get("url"), + "fields": obj.get("fields") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/token_response.py b/deepsearch/cps/apis/public_v2/models/token_response.py new file mode 100644 index 00000000..4cd98238 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/token_response.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI 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 +from typing import Optional, Set +from typing_extensions import Self + +class TokenResponse(BaseModel): + """ + TokenResponse + """ # noqa: E501 + token: StrictStr + __properties: ClassVar[List[str]] = ["token"] + + 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 TokenResponse 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 TokenResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "token": obj.get("token") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/urls.py b/deepsearch/cps/apis/public_v2/models/urls.py new file mode 100644 index 00000000..a242d1a7 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/urls.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 + +URLS_ANY_OF_SCHEMAS = ["object", "str"] + +class Urls(BaseModel): + """ + List of URLs to be printed to PDF, converted and uploaded to the data index. + """ + + # 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 = Urls.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 Urls 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 Urls 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/validation_error.py b/deepsearch/cps/apis/public_v2/models/validation_error.py new file mode 100644 index 00000000..b4f09a76 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/validation_error.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 +from deepsearch.cps.apis.public_v2.models.validation_error_loc_inner import ValidationErrorLocInner +from typing import Optional, Set +from typing_extensions import Self + +class ValidationError(BaseModel): + """ + ValidationError + """ # noqa: E501 + loc: List[ValidationErrorLocInner] + msg: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["loc", "msg", "type"] + + 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 ValidationError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in loc (list) + _items = [] + if self.loc: + for _item in self.loc: + if _item: + _items.append(_item.to_dict()) + _dict['loc'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ValidationError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "loc": [ValidationErrorLocInner.from_dict(_item) for _item in obj["loc"]] if obj.get("loc") is not None else None, + "msg": obj.get("msg"), + "type": obj.get("type") + }) + return _obj + + diff --git a/deepsearch/cps/apis/public_v2/models/validation_error_loc_inner.py b/deepsearch/cps/apis/public_v2/models/validation_error_loc_inner.py new file mode 100644 index 00000000..c4cd3a61 --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/validation_error_loc_inner.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 Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +VALIDATIONERRORLOCINNER_ANY_OF_SCHEMAS = ["int", "str"] + +class ValidationErrorLocInner(BaseModel): + """ + ValidationErrorLocInner + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: int + anyof_schema_2_validator: Optional[StrictInt] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["int", "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 = ValidationErrorLocInner.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: int + 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 ValidationErrorLocInner with anyOf schemas: int, 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 int + 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 ValidationErrorLocInner with anyOf schemas: int, 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], int, 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_of.py b/deepsearch/cps/apis/public_v2/models/view_of.py new file mode 100644 index 00000000..d3f637df --- /dev/null +++ b/deepsearch/cps/apis/public_v2/models/view_of.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_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 + +VIEWOF_ANY_OF_SCHEMAS = ["ElasticInstanceDataIndex", "ProjectSourceDataIndex"] + +class ViewOf(BaseModel): + """ + ViewOf + """ + + # data type: ProjectSourceDataIndex + anyof_schema_1_validator: Optional[ProjectSourceDataIndex] = None + # data type: ElasticInstanceDataIndex + anyof_schema_2_validator: Optional[ElasticInstanceDataIndex] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ElasticInstanceDataIndex, ProjectSourceDataIndex]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["ElasticInstanceDataIndex", "ProjectSourceDataIndex"]) + + 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 = ViewOf.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 + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ViewOf with anyOf schemas: ElasticInstanceDataIndex, ProjectSourceDataIndex. 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)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ViewOf with anyOf schemas: ElasticInstanceDataIndex, ProjectSourceDataIndex. 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]]: + """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/py.typed b/deepsearch/cps/apis/public_v2/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/deepsearch/cps/apis/public_v2/rest.py b/deepsearch/cps/apis/public_v2/rest.py new file mode 100644 index 00000000..8a24c79f --- /dev/null +++ b/deepsearch/cps/apis/public_v2/rest.py @@ -0,0 +1,255 @@ +# coding: utf-8 + +""" + Deep Search (DS) API + + API for Deep Search. **WARNING**: This API is subject to change without warning! + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl + +import urllib3 + +from deepsearch.cps.apis.public_v2.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } + if configuration.assert_hostname is not None: + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) + + if configuration.retries is not None: + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize + + # https pool manager + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) + else: + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-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. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): + timeout = urllib3.Timeout( + connect=_request_timeout[0], + read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False + ) + # Pass a `string` parameter directly in the body to support + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) diff --git a/docs/apis/public_v2/AssembleMode.md b/docs/apis/public_v2/AssembleMode.md new file mode 100644 index 00000000..bd737f89 --- /dev/null +++ b/docs/apis/public_v2/AssembleMode.md @@ -0,0 +1,30 @@ +# AssembleMode + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page_elements** | **List[str]** | | +**tables** | **List[str]** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.assemble_mode import AssembleMode + +# TODO update the JSON string below +json = "{}" +# create an instance of AssembleMode from a JSON string +assemble_mode_instance = AssembleMode.from_json(json) +# print the JSON string representation of the object +print(AssembleMode.to_json()) + +# convert the object into a dict +assemble_mode_dict = assemble_mode_instance.to_dict() +# create an instance of AssembleMode from a dict +assemble_mode_form_dict = assemble_mode.from_dict(assemble_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/AssembleSettings.md b/docs/apis/public_v2/AssembleSettings.md new file mode 100644 index 00000000..2ea6cfe9 --- /dev/null +++ b/docs/apis/public_v2/AssembleSettings.md @@ -0,0 +1,30 @@ +# AssembleSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | [**AssembleMode**](AssembleMode.md) | | +**include_incomplete_documents** | **bool** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.assemble_settings import AssembleSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of AssembleSettings from a JSON string +assemble_settings_instance = AssembleSettings.from_json(json) +# print the JSON string representation of the object +print(AssembleSettings.to_json()) + +# convert the object into a dict +assemble_settings_dict = assemble_settings_instance.to_dict() +# create an instance of AssembleSettings from a dict +assemble_settings_form_dict = assemble_settings.from_dict(assemble_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/AttachmentUploadData.md b/docs/apis/public_v2/AttachmentUploadData.md new file mode 100644 index 00000000..6d763f64 --- /dev/null +++ b/docs/apis/public_v2/AttachmentUploadData.md @@ -0,0 +1,30 @@ +# AttachmentUploadData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attachment_path** | **str** | | +**upload_data** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.attachment_upload_data import AttachmentUploadData + +# TODO update the JSON string below +json = "{}" +# create an instance of AttachmentUploadData from a JSON string +attachment_upload_data_instance = AttachmentUploadData.from_json(json) +# print the JSON string representation of the object +print(AttachmentUploadData.to_json()) + +# convert the object into a dict +attachment_upload_data_dict = attachment_upload_data_instance.to_dict() +# create an instance of AttachmentUploadData from a dict +attachment_upload_data_form_dict = attachment_upload_data.from_dict(attachment_upload_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/AttachmentUploadRequestBody.md b/docs/apis/public_v2/AttachmentUploadRequestBody.md new file mode 100644 index 00000000..b964de21 --- /dev/null +++ b/docs/apis/public_v2/AttachmentUploadRequestBody.md @@ -0,0 +1,30 @@ +# AttachmentUploadRequestBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attachment_path** | **str** | | +**attachment_key** | **str** | | [optional] [default to 'usr_attachments'] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.attachment_upload_request_body import AttachmentUploadRequestBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AttachmentUploadRequestBody from a JSON string +attachment_upload_request_body_instance = AttachmentUploadRequestBody.from_json(json) +# print the JSON string representation of the object +print(AttachmentUploadRequestBody.to_json()) + +# convert the object into a dict +attachment_upload_request_body_dict = attachment_upload_request_body_instance.to_dict() +# create an instance of AttachmentUploadRequestBody from a dict +attachment_upload_request_body_form_dict = attachment_upload_request_body.from_dict(attachment_upload_request_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/BagFlavourFullData.md b/docs/apis/public_v2/BagFlavourFullData.md new file mode 100644 index 00000000..bfadfaf1 --- /dev/null +++ b/docs/apis/public_v2/BagFlavourFullData.md @@ -0,0 +1,37 @@ +# BagFlavourFullData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**backend** | **str** | | +**config** | **object** | | +**default_quota** | **int** | | [optional] [default to 0] +**description** | **str** | | +**display_name** | **str** | | +**is_from_deployment** | **bool** | | [optional] [default to True] +**name** | **str** | | +**order** | **int** | | [optional] [default to 0] +**project_specific** | **bool** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.bag_flavour_full_data import BagFlavourFullData + +# TODO update the JSON string below +json = "{}" +# create an instance of BagFlavourFullData from a JSON string +bag_flavour_full_data_instance = BagFlavourFullData.from_json(json) +# print the JSON string representation of the object +print(BagFlavourFullData.to_json()) + +# convert the object into a dict +bag_flavour_full_data_dict = bag_flavour_full_data_instance.to_dict() +# create an instance of BagFlavourFullData from a dict +bag_flavour_full_data_form_dict = bag_flavour_full_data.from_dict(bag_flavour_full_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/CCSProject.md b/docs/apis/public_v2/CCSProject.md new file mode 100644 index 00000000..2132708f --- /dev/null +++ b/docs/apis/public_v2/CCSProject.md @@ -0,0 +1,31 @@ +# CCSProject + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**proj_key** | **str** | | +**collection_name** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.ccs_project import CCSProject + +# TODO update the JSON string below +json = "{}" +# create an instance of CCSProject from a JSON string +ccs_project_instance = CCSProject.from_json(json) +# print the JSON string representation of the object +print(CCSProject.to_json()) + +# convert the object into a dict +ccs_project_dict = ccs_project_instance.to_dict() +# create an instance of CCSProject from a dict +ccs_project_form_dict = ccs_project.from_dict(ccs_project_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/CPSPackage.md b/docs/apis/public_v2/CPSPackage.md new file mode 100644 index 00000000..c449b690 --- /dev/null +++ b/docs/apis/public_v2/CPSPackage.md @@ -0,0 +1,32 @@ +# CPSPackage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**description** | **str** | | +**package_id** | **str** | | +**type** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.cps_package import CPSPackage + +# TODO update the JSON string below +json = "{}" +# create an instance of CPSPackage from a JSON string +cps_package_instance = CPSPackage.from_json(json) +# print the JSON string representation of the object +print(CPSPackage.to_json()) + +# convert the object into a dict +cps_package_dict = cps_package_instance.to_dict() +# create an instance of CPSPackage from a dict +cps_package_form_dict = cps_package.from_dict(cps_package_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/CPSSummary.md b/docs/apis/public_v2/CPSSummary.md new file mode 100644 index 00000000..e7eebecc --- /dev/null +++ b/docs/apis/public_v2/CPSSummary.md @@ -0,0 +1,36 @@ +# CPSSummary + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avail_cpu_slots** | **int** | | +**avail_mem_slots** | **int** | | +**avail_slots** | **int** | | +**name** | **str** | | +**num_nodes** | **int** | | +**number_kgs** | **int** | | +**running_kgs** | **int** | | +**workers_pool** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.cps_summary import CPSSummary + +# TODO update the JSON string below +json = "{}" +# create an instance of CPSSummary from a JSON string +cps_summary_instance = CPSSummary.from_json(json) +# print the JSON string representation of the object +print(CPSSummary.to_json()) + +# convert the object into a dict +cps_summary_dict = cps_summary_instance.to_dict() +# create an instance of CPSSummary from a dict +cps_summary_form_dict = cps_summary.from_dict(cps_summary_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/CollectionMetadataSettings.md b/docs/apis/public_v2/CollectionMetadataSettings.md new file mode 100644 index 00000000..6b9dd94f --- /dev/null +++ b/docs/apis/public_v2/CollectionMetadataSettings.md @@ -0,0 +1,33 @@ +# CollectionMetadataSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**display_name** | **str** | | [optional] +**license** | **str** | | [optional] +**source** | **str** | | [optional] +**version** | **str** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.collection_metadata_settings import CollectionMetadataSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of CollectionMetadataSettings from a JSON string +collection_metadata_settings_instance = CollectionMetadataSettings.from_json(json) +# print the JSON string representation of the object +print(CollectionMetadataSettings.to_json()) + +# convert the object into a dict +collection_metadata_settings_dict = collection_metadata_settings_instance.to_dict() +# create an instance of CollectionMetadataSettings from a dict +collection_metadata_settings_form_dict = collection_metadata_settings.from_dict(collection_metadata_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/ConvertDocumentsRequestBody.md b/docs/apis/public_v2/ConvertDocumentsRequestBody.md new file mode 100644 index 00000000..87d5bebc --- /dev/null +++ b/docs/apis/public_v2/ConvertDocumentsRequestBody.md @@ -0,0 +1,32 @@ +# ConvertDocumentsRequestBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file_url** | **List[str]** | List of File's URL 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] +**scratch_files_id** | **List[str]** | List of CCS's scratch files id to be converted and uploaded to the data index. | [optional] +**conversion_settings** | [**PartialDirectConversionParameters**](PartialDirectConversionParameters.md) | Specify the conversion settings to use. | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.convert_documents_request_body import ConvertDocumentsRequestBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ConvertDocumentsRequestBody from a JSON string +convert_documents_request_body_instance = ConvertDocumentsRequestBody.from_json(json) +# print the JSON string representation of the object +print(ConvertDocumentsRequestBody.to_json()) + +# convert the object into a dict +convert_documents_request_body_dict = convert_documents_request_body_instance.to_dict() +# create an instance of ConvertDocumentsRequestBody from a dict +convert_documents_request_body_form_dict = convert_documents_request_body.from_dict(convert_documents_request_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/CpsTask.md b/docs/apis/public_v2/CpsTask.md new file mode 100644 index 00000000..253073a0 --- /dev/null +++ b/docs/apis/public_v2/CpsTask.md @@ -0,0 +1,31 @@ +# CpsTask + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_id** | **str** | | +**task_type** | **str** | | +**task_status** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask + +# TODO update the JSON string below +json = "{}" +# create an instance of CpsTask from a JSON string +cps_task_instance = CpsTask.from_json(json) +# print the JSON string representation of the object +print(CpsTask.to_json()) + +# convert the object into a dict +cps_task_dict = cps_task_instance.to_dict() +# create an instance of CpsTask from a dict +cps_task_form_dict = cps_task.from_dict(cps_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/Data.md b/docs/apis/public_v2/Data.md new file mode 100644 index 00000000..0c83e8da --- /dev/null +++ b/docs/apis/public_v2/Data.md @@ -0,0 +1,32 @@ +# Data + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **object** | | +**description** | **object** | | [optional] +**view_of** | [**ViewOf**](ViewOf.md) | | +**schema_key** | **object** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.data import Data + +# TODO update the JSON string below +json = "{}" +# create an instance of Data from a JSON string +data_instance = Data.from_json(json) +# print the JSON string representation of the object +print(Data.to_json()) + +# convert the object into a dict +data_dict = data_instance.to_dict() +# create an instance of Data from a dict +data_form_dict = data.from_dict(data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/DataFlow.md b/docs/apis/public_v2/DataFlow.md new file mode 100644 index 00000000..ec9cf9a1 --- /dev/null +++ b/docs/apis/public_v2/DataFlow.md @@ -0,0 +1,30 @@ +# DataFlow + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**df_tpl_key** | **str** | | +**name** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.data_flow import DataFlow + +# TODO update the JSON string below +json = "{}" +# create an instance of DataFlow from a JSON string +data_flow_instance = DataFlow.from_json(json) +# print the JSON string representation of the object +print(DataFlow.to_json()) + +# convert the object into a dict +data_flow_dict = data_flow_instance.to_dict() +# create an instance of DataFlow from a dict +data_flow_form_dict = data_flow.from_dict(data_flow_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/DataIndexUploadFileSource.md b/docs/apis/public_v2/DataIndexUploadFileSource.md new file mode 100644 index 00000000..b435419e --- /dev/null +++ b/docs/apis/public_v2/DataIndexUploadFileSource.md @@ -0,0 +1,30 @@ +# DataIndexUploadFileSource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**urls** | [**Urls**](Urls.md) | | +**conversion_settings** | [**PartialDirectConversionParameters**](PartialDirectConversionParameters.md) | Specify the conversion settings to use. | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.data_index_upload_file_source import DataIndexUploadFileSource + +# TODO update the JSON string below +json = "{}" +# create an instance of DataIndexUploadFileSource from a JSON string +data_index_upload_file_source_instance = DataIndexUploadFileSource.from_json(json) +# print the JSON string representation of the object +print(DataIndexUploadFileSource.to_json()) + +# convert the object into a dict +data_index_upload_file_source_dict = data_index_upload_file_source_instance.to_dict() +# create an instance of DataIndexUploadFileSource from a dict +data_index_upload_file_source_form_dict = data_index_upload_file_source.from_dict(data_index_upload_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/DataIndicesApi.md b/docs/apis/public_v2/DataIndicesApi.md new file mode 100644 index 00000000..69ade51f --- /dev/null +++ b/docs/apis/public_v2/DataIndicesApi.md @@ -0,0 +1,509 @@ +# deepsearch.cps.apis.public_v2.DataIndicesApi + +All URIs are relative to */api/cps/public/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_project_data_index**](DataIndicesApi.md#create_project_data_index) | **POST** /project/{proj_key}/data_indices | Create Project Data Index +[**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_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 + + +# **create_project_data_index** +> ProjectDataIndexWithStatus create_project_data_index(proj_key, data) + +Create Project Data Index + +Create a project data index. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.data import Data +from deepsearch.cps.apis.public_v2.models.project_data_index_with_status import ProjectDataIndexWithStatus +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) + proj_key = 'proj_key_example' # str | + data = deepsearch.cps.apis.public_v2.Data() # Data | + + try: + # Create Project Data Index + api_response = api_instance.create_project_data_index(proj_key, data) + print("The response of DataIndicesApi->create_project_data_index:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesApi->create_project_data_index: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + **data** | [**Data**](Data.md)| | + +### Return type + +[**ProjectDataIndexWithStatus**](ProjectDataIndexWithStatus.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) + +# **create_project_data_index_delete_token** +> TokenResponse create_project_data_index_delete_token(index_key, proj_key) + +Create Project Data Index Delete Token + +Get a token used to confirm the deletion of a project data index. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.token_response import TokenResponse +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: + # Create Project Data Index Delete Token + api_response = api_instance.create_project_data_index_delete_token(index_key, proj_key) + print("The response of DataIndicesApi->create_project_data_index_delete_token:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesApi->create_project_data_index_delete_token: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **proj_key** | **str**| | + +### Return type + +[**TokenResponse**](TokenResponse.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) + +# **delete_project_data_index** +> object delete_project_data_index(index_key, proj_key, confirmation_token) + +Delete Project Data Index + +Delete a project index data. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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 | + confirmation_token = 'confirmation_token_example' # str | + + try: + # Delete Project Data Index + api_response = api_instance.delete_project_data_index(index_key, proj_key, confirmation_token) + print("The response of DataIndicesApi->delete_project_data_index:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesApi->delete_project_data_index: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **proj_key** | **str**| | + **confirmation_token** | **str**| | + +### Return type + +**object** + +### 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_index** +> ProjectDataIndexWithStatus get_project_data_index(index_key, proj_key) + +Get Project Data Index + +Get project data index. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.project_data_index_with_status import ProjectDataIndexWithStatus +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 + api_response = api_instance.get_project_data_index(index_key, proj_key) + print("The response of DataIndicesApi->get_project_data_index:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesApi->get_project_data_index: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **proj_key** | **str**| | + +### Return type + +[**ProjectDataIndexWithStatus**](ProjectDataIndexWithStatus.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) + +Get Project Data Indices + +Get project data indices. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.project_data_index_with_status import ProjectDataIndexWithStatus +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) + proj_key = 'proj_key_example' # str | + + try: + # Get Project Data Indices + api_response = api_instance.get_project_data_indices(proj_key) + print("The response of DataIndicesApi->get_project_data_indices:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesApi->get_project_data_indices: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + +### Return type + +[**List[ProjectDataIndexWithStatus]**](ProjectDataIndexWithStatus.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) + +# **update_project_data_index** +> ProjectDataIndexWithStatus update_project_data_index(index_key, proj_key, data) + +Update Project Data Index + +Update a project data index. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.data import Data +from deepsearch.cps.apis.public_v2.models.project_data_index_with_status import ProjectDataIndexWithStatus +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 | + data = deepsearch.cps.apis.public_v2.Data() # Data | + + try: + # Update Project Data Index + api_response = api_instance.update_project_data_index(index_key, proj_key, data) + print("The response of DataIndicesApi->update_project_data_index:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesApi->update_project_data_index: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **proj_key** | **str**| | + **data** | [**Data**](Data.md)| | + +### Return type + +[**ProjectDataIndexWithStatus**](ProjectDataIndexWithStatus.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/DataIndicesUploadApi.md b/docs/apis/public_v2/DataIndicesUploadApi.md new file mode 100644 index 00000000..56d3eb23 --- /dev/null +++ b/docs/apis/public_v2/DataIndicesUploadApi.md @@ -0,0 +1,438 @@ +# deepsearch.cps.apis.public_v2.DataIndicesUploadApi + +All URIs are relative to */api/cps/public/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ccs_convert_upload_file_project_data_index**](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 +[**get_attachment_upload_data**](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 +[**html_print_convert_upload**](DataIndicesUploadApi.md#html_print_convert_upload) | **POST** /project/{proj_key}/data_indices/{index_key}/actions/html_print_convert_upload | Html Print Convert Upload +[**register_attachment**](DataIndicesUploadApi.md#register_attachment) | **POST** /project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment | Register Attachment +[**upload_project_data_index_file**](DataIndicesUploadApi.md#upload_project_data_index_file) | **POST** /project/{proj_key}/data_indices/{index_key}/actions/upload | Upload Project Data Index File + + +# **ccs_convert_upload_file_project_data_index** +> CpsTask ccs_convert_upload_file_project_data_index(index_key, proj_key, convert_documents_request_body) + +Ccs Convert Upload File Project Data Index + +Convert files via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema). + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.convert_documents_request_body import ConvertDocumentsRequestBody +from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask +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.DataIndicesUploadApi(api_client) + index_key = 'index_key_example' # str | + proj_key = 'proj_key_example' # str | + convert_documents_request_body = deepsearch.cps.apis.public_v2.ConvertDocumentsRequestBody() # ConvertDocumentsRequestBody | + + try: + # Ccs Convert Upload File Project Data Index + api_response = api_instance.ccs_convert_upload_file_project_data_index(index_key, proj_key, convert_documents_request_body) + print("The response of DataIndicesUploadApi->ccs_convert_upload_file_project_data_index:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesUploadApi->ccs_convert_upload_file_project_data_index: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **proj_key** | **str**| | + **convert_documents_request_body** | [**ConvertDocumentsRequestBody**](ConvertDocumentsRequestBody.md)| | + +### Return type + +[**CpsTask**](CpsTask.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) + +# **get_attachment_upload_data** +> AttachmentUploadData get_attachment_upload_data(index_key, index_item_id, filename, proj_key) + +Get Attachment Upload Data + +Get url and path to upload an attachment to a project data index. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.attachment_upload_data import AttachmentUploadData +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.DataIndicesUploadApi(api_client) + index_key = 'index_key_example' # str | + index_item_id = 'index_item_id_example' # str | + filename = 'filename_example' # str | + proj_key = 'proj_key_example' # str | + + try: + # Get Attachment Upload Data + api_response = api_instance.get_attachment_upload_data(index_key, index_item_id, filename, proj_key) + print("The response of DataIndicesUploadApi->get_attachment_upload_data:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesUploadApi->get_attachment_upload_data: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **index_item_id** | **str**| | + **filename** | **str**| | + **proj_key** | **str**| | + +### Return type + +[**AttachmentUploadData**](AttachmentUploadData.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) + +# **html_print_convert_upload** +> CpsTask html_print_convert_upload(index_key, proj_key, data_index_upload_file_source) + +Html Print Convert Upload + +Convert a list of HTML pages to PDF, convert them via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema). + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask +from deepsearch.cps.apis.public_v2.models.data_index_upload_file_source import DataIndexUploadFileSource +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.DataIndicesUploadApi(api_client) + index_key = 'index_key_example' # str | + proj_key = 'proj_key_example' # str | + data_index_upload_file_source = deepsearch.cps.apis.public_v2.DataIndexUploadFileSource() # DataIndexUploadFileSource | + + try: + # Html Print Convert Upload + api_response = api_instance.html_print_convert_upload(index_key, proj_key, data_index_upload_file_source) + print("The response of DataIndicesUploadApi->html_print_convert_upload:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesUploadApi->html_print_convert_upload: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **proj_key** | **str**| | + **data_index_upload_file_source** | [**DataIndexUploadFileSource**](DataIndexUploadFileSource.md)| | + +### Return type + +[**CpsTask**](CpsTask.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) + +# **register_attachment** +> register_attachment(index_key, index_item_id, proj_key, attachment_upload_request_body) + +Register Attachment + +Notify upload completion of an attachment to a project data index. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.attachment_upload_request_body import AttachmentUploadRequestBody +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.DataIndicesUploadApi(api_client) + index_key = 'index_key_example' # str | + index_item_id = 'index_item_id_example' # str | + proj_key = 'proj_key_example' # str | + attachment_upload_request_body = deepsearch.cps.apis.public_v2.AttachmentUploadRequestBody() # AttachmentUploadRequestBody | + + try: + # Register Attachment + api_instance.register_attachment(index_key, index_item_id, proj_key, attachment_upload_request_body) + except Exception as e: + print("Exception when calling DataIndicesUploadApi->register_attachment: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **index_item_id** | **str**| | + **proj_key** | **str**| | + **attachment_upload_request_body** | [**AttachmentUploadRequestBody**](AttachmentUploadRequestBody.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) + +# **upload_project_data_index_file** +> CpsTask upload_project_data_index_file(index_key, proj_key, json_upload_request_body) + +Upload Project Data Index File + +Upload a file to a project data index. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask +from deepsearch.cps.apis.public_v2.models.json_upload_request_body import JsonUploadRequestBody +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.DataIndicesUploadApi(api_client) + index_key = 'index_key_example' # str | + proj_key = 'proj_key_example' # str | + json_upload_request_body = deepsearch.cps.apis.public_v2.JsonUploadRequestBody() # JsonUploadRequestBody | + + try: + # Upload Project Data Index File + api_response = api_instance.upload_project_data_index_file(index_key, proj_key, json_upload_request_body) + print("The response of DataIndicesUploadApi->upload_project_data_index_file:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataIndicesUploadApi->upload_project_data_index_file: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index_key** | **str**| | + **proj_key** | **str**| | + **json_upload_request_body** | [**JsonUploadRequestBody**](JsonUploadRequestBody.md)| | + +### Return type + +[**CpsTask**](CpsTask.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/DefaultValues.md b/docs/apis/public_v2/DefaultValues.md new file mode 100644 index 00000000..680c5f6a --- /dev/null +++ b/docs/apis/public_v2/DefaultValues.md @@ -0,0 +1,30 @@ +# DefaultValues + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ccs_project** | [**CCSProject**](CCSProject.md) | | +**dataflow** | [**DataFlow**](DataFlow.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.default_values import DefaultValues + +# TODO update the JSON string below +json = "{}" +# create an instance of DefaultValues from a JSON string +default_values_instance = DefaultValues.from_json(json) +# print the JSON string representation of the object +print(DefaultValues.to_json()) + +# convert the object into a dict +default_values_dict = default_values_instance.to_dict() +# create an instance of DefaultValues from a dict +default_values_form_dict = default_values.from_dict(default_values_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/Deployment.md b/docs/apis/public_v2/Deployment.md new file mode 100644 index 00000000..cf3e8822 --- /dev/null +++ b/docs/apis/public_v2/Deployment.md @@ -0,0 +1,33 @@ +# Deployment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**disclaimer** | **str** | | +**should_show_warning** | **bool** | | +**disable_kg_actions** | **bool** | | +**linked_ccs_api** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.deployment import Deployment + +# TODO update the JSON string below +json = "{}" +# create an instance of Deployment from a JSON string +deployment_instance = Deployment.from_json(json) +# print the JSON string representation of the object +print(Deployment.to_json()) + +# convert the object into a dict +deployment_dict = deployment_instance.to_dict() +# create an instance of Deployment from a dict +deployment_form_dict = deployment.from_dict(deployment_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/DirectModelConfig.md b/docs/apis/public_v2/DirectModelConfig.md new file mode 100644 index 00000000..ea682166 --- /dev/null +++ b/docs/apis/public_v2/DirectModelConfig.md @@ -0,0 +1,31 @@ +# DirectModelConfig + +Direct configuration of a model. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | +**config** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.direct_model_config import DirectModelConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of DirectModelConfig from a JSON string +direct_model_config_instance = DirectModelConfig.from_json(json) +# print the JSON string representation of the object +print(DirectModelConfig.to_json()) + +# convert the object into a dict +direct_model_config_dict = direct_model_config_instance.to_dict() +# create an instance of DirectModelConfig from a dict +direct_model_config_form_dict = direct_model_config.from_dict(direct_model_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/ElasticIndexPropertyObject.md b/docs/apis/public_v2/ElasticIndexPropertyObject.md new file mode 100644 index 00000000..00d1d908 --- /dev/null +++ b/docs/apis/public_v2/ElasticIndexPropertyObject.md @@ -0,0 +1,31 @@ +# ElasticIndexPropertyObject + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | +**enabled** | **bool** | | [optional] +**ignore_above** | **int** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.elastic_index_property_object import ElasticIndexPropertyObject + +# TODO update the JSON string below +json = "{}" +# create an instance of ElasticIndexPropertyObject from a JSON string +elastic_index_property_object_instance = ElasticIndexPropertyObject.from_json(json) +# print the JSON string representation of the object +print(ElasticIndexPropertyObject.to_json()) + +# convert the object into a dict +elastic_index_property_object_dict = elastic_index_property_object_instance.to_dict() +# create an instance of ElasticIndexPropertyObject from a dict +elastic_index_property_object_form_dict = elastic_index_property_object.from_dict(elastic_index_property_object_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ElasticIndexPropertyPrimitive.md b/docs/apis/public_v2/ElasticIndexPropertyPrimitive.md new file mode 100644 index 00000000..b437e435 --- /dev/null +++ b/docs/apis/public_v2/ElasticIndexPropertyPrimitive.md @@ -0,0 +1,29 @@ +# ElasticIndexPropertyPrimitive + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**properties** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.elastic_index_property_primitive import ElasticIndexPropertyPrimitive + +# TODO update the JSON string below +json = "{}" +# create an instance of ElasticIndexPropertyPrimitive from a JSON string +elastic_index_property_primitive_instance = ElasticIndexPropertyPrimitive.from_json(json) +# print the JSON string representation of the object +print(ElasticIndexPropertyPrimitive.to_json()) + +# convert the object into a dict +elastic_index_property_primitive_dict = elastic_index_property_primitive_instance.to_dict() +# create an instance of ElasticIndexPropertyPrimitive from a dict +elastic_index_property_primitive_form_dict = elastic_index_property_primitive.from_dict(elastic_index_property_primitive_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ElasticIndexSearchQueryOptions.md b/docs/apis/public_v2/ElasticIndexSearchQueryOptions.md new file mode 100644 index 00000000..2ffa2c35 --- /dev/null +++ b/docs/apis/public_v2/ElasticIndexSearchQueryOptions.md @@ -0,0 +1,34 @@ +# ElasticIndexSearchQueryOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source** | **List[str]** | | [optional] +**from_** | **int** | | [optional] +**size** | **int** | | [optional] +**query** | **object** | | [optional] +**aggs** | **object** | | [optional] +**sort** | **List[object]** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.elastic_index_search_query_options import ElasticIndexSearchQueryOptions + +# TODO update the JSON string below +json = "{}" +# create an instance of ElasticIndexSearchQueryOptions from a JSON string +elastic_index_search_query_options_instance = ElasticIndexSearchQueryOptions.from_json(json) +# print the JSON string representation of the object +print(ElasticIndexSearchQueryOptions.to_json()) + +# convert the object into a dict +elastic_index_search_query_options_dict = elastic_index_search_query_options_instance.to_dict() +# create an instance of ElasticIndexSearchQueryOptions from a dict +elastic_index_search_query_options_form_dict = elastic_index_search_query_options.from_dict(elastic_index_search_query_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/ElasticIndexSource.md b/docs/apis/public_v2/ElasticIndexSource.md new file mode 100644 index 00000000..fec0f4cc --- /dev/null +++ b/docs/apis/public_v2/ElasticIndexSource.md @@ -0,0 +1,30 @@ +# ElasticIndexSource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index_key** | **str** | | +**elastic_id** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.elastic_index_source import ElasticIndexSource + +# TODO update the JSON string below +json = "{}" +# create an instance of ElasticIndexSource from a JSON string +elastic_index_source_instance = ElasticIndexSource.from_json(json) +# print the JSON string representation of the object +print(ElasticIndexSource.to_json()) + +# convert the object into a dict +elastic_index_source_dict = elastic_index_source_instance.to_dict() +# create an instance of ElasticIndexSource from a dict +elastic_index_source_form_dict = elastic_index_source.from_dict(elastic_index_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/ElasticInstanceDataIndex.md b/docs/apis/public_v2/ElasticInstanceDataIndex.md new file mode 100644 index 00000000..8fed9505 --- /dev/null +++ b/docs/apis/public_v2/ElasticInstanceDataIndex.md @@ -0,0 +1,31 @@ +# ElasticInstanceDataIndex + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index_key** | **str** | | +**query_options** | [**ElasticIndexSearchQueryOptions**](ElasticIndexSearchQueryOptions.md) | | +**elastic_id** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.elastic_instance_data_index import ElasticInstanceDataIndex + +# TODO update the JSON string below +json = "{}" +# create an instance of ElasticInstanceDataIndex from a JSON string +elastic_instance_data_index_instance = ElasticInstanceDataIndex.from_json(json) +# print the JSON string representation of the object +print(ElasticInstanceDataIndex.to_json()) + +# convert the object into a dict +elastic_instance_data_index_dict = elastic_instance_data_index_instance.to_dict() +# create an instance of ElasticInstanceDataIndex from a dict +elastic_instance_data_index_form_dict = elastic_instance_data_index.from_dict(elastic_instance_data_index_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ElasticMetadata.md b/docs/apis/public_v2/ElasticMetadata.md new file mode 100644 index 00000000..11987b66 --- /dev/null +++ b/docs/apis/public_v2/ElasticMetadata.md @@ -0,0 +1,38 @@ +# ElasticMetadata + + +## Properties + +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] +**classification** | **List[str]** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.elastic_metadata import ElasticMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of ElasticMetadata from a JSON string +elastic_metadata_instance = ElasticMetadata.from_json(json) +# print the JSON string representation of the object +print(ElasticMetadata.to_json()) + +# convert the object into a dict +elastic_metadata_dict = elastic_metadata_instance.to_dict() +# create an instance of ElasticMetadata from a dict +elastic_metadata_form_dict = elastic_metadata.from_dict(elastic_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/Flavour.md b/docs/apis/public_v2/Flavour.md new file mode 100644 index 00000000..8dc5b2c2 --- /dev/null +++ b/docs/apis/public_v2/Flavour.md @@ -0,0 +1,30 @@ +# Flavour + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**display_name** | **str** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.flavour import Flavour + +# TODO update the JSON string below +json = "{}" +# create an instance of Flavour from a JSON string +flavour_instance = Flavour.from_json(json) +# print the JSON string representation of the object +print(Flavour.to_json()) + +# convert the object into a dict +flavour_dict = flavour_instance.to_dict() +# create an instance of Flavour from a dict +flavour_form_dict = flavour.from_dict(flavour_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/FlavoursDefaultQuota.md b/docs/apis/public_v2/FlavoursDefaultQuota.md new file mode 100644 index 00000000..9050ff82 --- /dev/null +++ b/docs/apis/public_v2/FlavoursDefaultQuota.md @@ -0,0 +1,31 @@ +# FlavoursDefaultQuota + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**display_name** | **str** | | +**name** | **str** | | +**default_quota** | **int** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.flavours_default_quota import FlavoursDefaultQuota + +# TODO update the JSON string below +json = "{}" +# create an instance of FlavoursDefaultQuota from a JSON string +flavours_default_quota_instance = FlavoursDefaultQuota.from_json(json) +# print the JSON string representation of the object +print(FlavoursDefaultQuota.to_json()) + +# convert the object into a dict +flavours_default_quota_dict = flavours_default_quota_instance.to_dict() +# create an instance of FlavoursDefaultQuota from a dict +flavours_default_quota_form_dict = flavours_default_quota.from_dict(flavours_default_quota_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/FlavoursQuota.md b/docs/apis/public_v2/FlavoursQuota.md new file mode 100644 index 00000000..5c12b3b7 --- /dev/null +++ b/docs/apis/public_v2/FlavoursQuota.md @@ -0,0 +1,31 @@ +# FlavoursQuota + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**display_name** | **str** | | +**name** | **str** | | +**quota** | **int** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.flavours_quota import FlavoursQuota + +# TODO update the JSON string below +json = "{}" +# create an instance of FlavoursQuota from a JSON string +flavours_quota_instance = FlavoursQuota.from_json(json) +# print the JSON string representation of the object +print(FlavoursQuota.to_json()) + +# convert the object into a dict +flavours_quota_dict = flavours_quota_instance.to_dict() +# create an instance of FlavoursQuota from a dict +flavours_quota_form_dict = flavours_quota.from_dict(flavours_quota_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/HTTPValidationError.md b/docs/apis/public_v2/HTTPValidationError.md new file mode 100644 index 00000000..8fc3045f --- /dev/null +++ b/docs/apis/public_v2/HTTPValidationError.md @@ -0,0 +1,29 @@ +# HTTPValidationError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**detail** | [**List[ValidationError]**](ValidationError.md) | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.http_validation_error import HTTPValidationError + +# TODO update the JSON string below +json = "{}" +# create an instance of HTTPValidationError from a JSON string +http_validation_error_instance = HTTPValidationError.from_json(json) +# print the JSON string representation of the object +print(HTTPValidationError.to_json()) + +# convert the object into a dict +http_validation_error_dict = http_validation_error_instance.to_dict() +# create an instance of HTTPValidationError from a dict +http_validation_error_form_dict = http_validation_error.from_dict(http_validation_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/JsonUploadRequestBody.md b/docs/apis/public_v2/JsonUploadRequestBody.md new file mode 100644 index 00000000..2fdee82b --- /dev/null +++ b/docs/apis/public_v2/JsonUploadRequestBody.md @@ -0,0 +1,29 @@ +# JsonUploadRequestBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file_url** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.json_upload_request_body import JsonUploadRequestBody + +# TODO update the JSON string below +json = "{}" +# create an instance of JsonUploadRequestBody from a JSON string +json_upload_request_body_instance = JsonUploadRequestBody.from_json(json) +# print the JSON string representation of the object +print(JsonUploadRequestBody.to_json()) + +# convert the object into a dict +json_upload_request_body_dict = json_upload_request_body_instance.to_dict() +# create an instance of JsonUploadRequestBody from a dict +json_upload_request_body_form_dict = json_upload_request_body.from_dict(json_upload_request_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/KnowledgeGraphsApi.md b/docs/apis/public_v2/KnowledgeGraphsApi.md new file mode 100644 index 00000000..59878ecf --- /dev/null +++ b/docs/apis/public_v2/KnowledgeGraphsApi.md @@ -0,0 +1,336 @@ +# deepsearch.cps.apis.public_v2.KnowledgeGraphsApi + +All URIs are relative to */api/cps/public/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**backend_list_project_kgs**](KnowledgeGraphsApi.md#backend_list_project_kgs) | **GET** /backend/project/{proj_key}/bags | Backend List Project Kgs +[**create_project_knowledge_graph**](KnowledgeGraphsApi.md#create_project_knowledge_graph) | **POST** /backend/project/{proj_key}/bags | Create Project Knowledge Graph +[**list_public_knowledge_graphs**](KnowledgeGraphsApi.md#list_public_knowledge_graphs) | **GET** /project/public/bags | List Public Knowledge Graphs +[**update_project_knowledge_graph_metadata**](KnowledgeGraphsApi.md#update_project_knowledge_graph_metadata) | **PATCH** /backend/project/{proj_key}/bags/{bag_key} | Update Project Knowledge Graph Metadata + + +# **backend_list_project_kgs** +> List[object] backend_list_project_kgs(proj_key, term=term) + +Backend List Project Kgs + +List all bags in the project, backend-aware + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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.KnowledgeGraphsApi(api_client) + proj_key = 'proj_key_example' # str | + term = None # object | (optional) + + try: + # Backend List Project Kgs + api_response = api_instance.backend_list_project_kgs(proj_key, term=term) + print("The response of KnowledgeGraphsApi->backend_list_project_kgs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KnowledgeGraphsApi->backend_list_project_kgs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + **term** | [**object**](.md)| | [optional] + +### Return type + +**List[object]** + +### 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) + +# **create_project_knowledge_graph** +> object create_project_knowledge_graph(proj_key, body) + +Create Project Knowledge Graph + +Create new BAG, backend-aware + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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.KnowledgeGraphsApi(api_client) + proj_key = 'proj_key_example' # str | + body = None # object | + + try: + # Create Project Knowledge Graph + api_response = api_instance.create_project_knowledge_graph(proj_key, body) + print("The response of KnowledgeGraphsApi->create_project_knowledge_graph:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KnowledgeGraphsApi->create_project_knowledge_graph: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + **body** | **object**| | + +### Return type + +**object** + +### 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) + +# **list_public_knowledge_graphs** +> List[object] list_public_knowledge_graphs(term=term) + +List Public Knowledge Graphs + +List all public BAGs + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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.KnowledgeGraphsApi(api_client) + term = None # object | (optional) + + try: + # List Public Knowledge Graphs + api_response = api_instance.list_public_knowledge_graphs(term=term) + print("The response of KnowledgeGraphsApi->list_public_knowledge_graphs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KnowledgeGraphsApi->list_public_knowledge_graphs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **term** | [**object**](.md)| | [optional] + +### Return type + +**List[object]** + +### 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) + +# **update_project_knowledge_graph_metadata** +> object update_project_knowledge_graph_metadata(bag_key, proj_key, body) + +Update Project Knowledge Graph Metadata + +Update the metadata of a Knowledge graph + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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.KnowledgeGraphsApi(api_client) + bag_key = None # object | + proj_key = 'proj_key_example' # str | + body = None # object | + + try: + # Update Project Knowledge Graph Metadata + api_response = api_instance.update_project_knowledge_graph_metadata(bag_key, proj_key, body) + print("The response of KnowledgeGraphsApi->update_project_knowledge_graph_metadata:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KnowledgeGraphsApi->update_project_knowledge_graph_metadata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bag_key** | [**object**](.md)| | + **proj_key** | **str**| | + **body** | **object**| | + +### Return type + +**object** + +### 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/ListProjectFlavours.md b/docs/apis/public_v2/ListProjectFlavours.md new file mode 100644 index 00000000..8405c047 --- /dev/null +++ b/docs/apis/public_v2/ListProjectFlavours.md @@ -0,0 +1,30 @@ +# ListProjectFlavours + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**flavours** | [**List[BagFlavourFullData]**](BagFlavourFullData.md) | | +**proj_key** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.list_project_flavours import ListProjectFlavours + +# TODO update the JSON string below +json = "{}" +# create an instance of ListProjectFlavours from a JSON string +list_project_flavours_instance = ListProjectFlavours.from_json(json) +# print the JSON string representation of the object +print(ListProjectFlavours.to_json()) + +# convert the object into a dict +list_project_flavours_dict = list_project_flavours_instance.to_dict() +# create an instance of ListProjectFlavours from a dict +list_project_flavours_form_dict = list_project_flavours.from_dict(list_project_flavours_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ModelPipelineSettings.md b/docs/apis/public_v2/ModelPipelineSettings.md new file mode 100644 index 00000000..7bf72a64 --- /dev/null +++ b/docs/apis/public_v2/ModelPipelineSettings.md @@ -0,0 +1,32 @@ +# ModelPipelineSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clusters** | [**List[ModelPipelineSettingsClustersInner]**](ModelPipelineSettingsClustersInner.md) | | +**page** | [**List[ModelPipelineSettingsClustersInner]**](ModelPipelineSettingsClustersInner.md) | | +**tables** | [**List[ModelPipelineSettingsClustersInner]**](ModelPipelineSettingsClustersInner.md) | | +**normalization** | [**List[ModelPipelineSettingsClustersInner]**](ModelPipelineSettingsClustersInner.md) | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.model_pipeline_settings import ModelPipelineSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelPipelineSettings from a JSON string +model_pipeline_settings_instance = ModelPipelineSettings.from_json(json) +# print the JSON string representation of the object +print(ModelPipelineSettings.to_json()) + +# convert the object into a dict +model_pipeline_settings_dict = model_pipeline_settings_instance.to_dict() +# create an instance of ModelPipelineSettings from a dict +model_pipeline_settings_form_dict = model_pipeline_settings.from_dict(model_pipeline_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/ModelPipelineSettingsClustersInner.md b/docs/apis/public_v2/ModelPipelineSettingsClustersInner.md new file mode 100644 index 00000000..9d127c26 --- /dev/null +++ b/docs/apis/public_v2/ModelPipelineSettingsClustersInner.md @@ -0,0 +1,34 @@ +# ModelPipelineSettingsClustersInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**model_config_key** | **object** | | +**proj_key** | **object** | | +**name** | **object** | | [optional] +**description** | **object** | | [optional] +**type** | **object** | | +**config** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.model_pipeline_settings_clusters_inner import ModelPipelineSettingsClustersInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelPipelineSettingsClustersInner from a JSON string +model_pipeline_settings_clusters_inner_instance = ModelPipelineSettingsClustersInner.from_json(json) +# print the JSON string representation of the object +print(ModelPipelineSettingsClustersInner.to_json()) + +# convert the object into a dict +model_pipeline_settings_clusters_inner_dict = model_pipeline_settings_clusters_inner_instance.to_dict() +# create an instance of ModelPipelineSettingsClustersInner from a dict +model_pipeline_settings_clusters_inner_form_dict = model_pipeline_settings_clusters_inner.from_dict(model_pipeline_settings_clusters_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ModulesConfig.md b/docs/apis/public_v2/ModulesConfig.md new file mode 100644 index 00000000..cc5bca64 --- /dev/null +++ b/docs/apis/public_v2/ModulesConfig.md @@ -0,0 +1,31 @@ +# ModulesConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**df_template_variables** | **List[object]** | | +**linked_ccs_instances** | **List[object]** | | +**linked_elastic_instances** | **List[object]** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.modules_config import ModulesConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of ModulesConfig from a JSON string +modules_config_instance = ModulesConfig.from_json(json) +# print the JSON string representation of the object +print(ModulesConfig.to_json()) + +# convert the object into a dict +modules_config_dict = modules_config_instance.to_dict() +# create an instance of ModulesConfig from a dict +modules_config_form_dict = modules_config.from_dict(modules_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/OcrSettings.md b/docs/apis/public_v2/OcrSettings.md new file mode 100644 index 00000000..8cb652a4 --- /dev/null +++ b/docs/apis/public_v2/OcrSettings.md @@ -0,0 +1,32 @@ +# OcrSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | | [optional] [default to False] +**backend** | **str** | | [optional] +**backend_settings** | **object** | | [optional] +**merge_mode** | **str** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.ocr_settings import OcrSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of OcrSettings from a JSON string +ocr_settings_instance = OcrSettings.from_json(json) +# print the JSON string representation of the object +print(OcrSettings.to_json()) + +# convert the object into a dict +ocr_settings_dict = ocr_settings_instance.to_dict() +# create an instance of OcrSettings from a dict +ocr_settings_form_dict = ocr_settings.from_dict(ocr_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/Package.md b/docs/apis/public_v2/Package.md new file mode 100644 index 00000000..5d49b5dd --- /dev/null +++ b/docs/apis/public_v2/Package.md @@ -0,0 +1,30 @@ +# Package + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**overrides** | **object** | | +**package_id** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.package import Package + +# TODO update the JSON string below +json = "{}" +# create an instance of Package from a JSON string +package_instance = Package.from_json(json) +# print the JSON string representation of the object +print(Package.to_json()) + +# convert the object into a dict +package_dict = package_instance.to_dict() +# create an instance of Package from a dict +package_form_dict = package.from_dict(package_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/PartialDirectConversionParameters.md b/docs/apis/public_v2/PartialDirectConversionParameters.md new file mode 100644 index 00000000..0daec9b8 --- /dev/null +++ b/docs/apis/public_v2/PartialDirectConversionParameters.md @@ -0,0 +1,35 @@ +# PartialDirectConversionParameters + +Specify conversion settings (OCR, Assemble, ML Models) directly. Fields left null are set to platform defaults. + +## Properties + +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] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.partial_direct_conversion_parameters import PartialDirectConversionParameters + +# TODO update the JSON string below +json = "{}" +# create an instance of PartialDirectConversionParameters from a JSON string +partial_direct_conversion_parameters_instance = PartialDirectConversionParameters.from_json(json) +# print the JSON string representation of the object +print(PartialDirectConversionParameters.to_json()) + +# convert the object into a dict +partial_direct_conversion_parameters_dict = partial_direct_conversion_parameters_instance.to_dict() +# create an instance of PartialDirectConversionParameters from a dict +partial_direct_conversion_parameters_form_dict = partial_direct_conversion_parameters.from_dict(partial_direct_conversion_parameters_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ProjectApi.md b/docs/apis/public_v2/ProjectApi.md new file mode 100644 index 00000000..9475d685 --- /dev/null +++ b/docs/apis/public_v2/ProjectApi.md @@ -0,0 +1,507 @@ +# deepsearch.cps.apis.public_v2.ProjectApi + +All URIs are relative to */api/cps/public/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_project_integration_config**](ProjectApi.md#delete_project_integration_config) | **DELETE** /project/{proj_key}/integrations/{integration_name} | Delete Project Integration Config +[**get_project_default_values**](ProjectApi.md#get_project_default_values) | **GET** /project/{proj_key}/default_values | Get Project Default Values +[**get_project_integration_config**](ProjectApi.md#get_project_integration_config) | **GET** /project/{proj_key}/integrations/{integration_name} | Get Project Integration Config +[**provision_project_packages**](ProjectApi.md#provision_project_packages) | **POST** /project/{proj_key}/packages | Provision Project Packages +[**update_project_default_values**](ProjectApi.md#update_project_default_values) | **POST** /project/{proj_key}/default_values | Update Project Default Values +[**update_project_integration_config**](ProjectApi.md#update_project_integration_config) | **POST** /project/{proj_key}/integrations/{integration_name} | Update Project Integration Config + + +# **delete_project_integration_config** +> object delete_project_integration_config(integration_name, proj_key) + +Delete Project Integration Config + +Delete the config for a given project integration. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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.ProjectApi(api_client) + integration_name = 'integration_name_example' # str | + proj_key = 'proj_key_example' # str | + + try: + # Delete Project Integration Config + api_response = api_instance.delete_project_integration_config(integration_name, proj_key) + print("The response of ProjectApi->delete_project_integration_config:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->delete_project_integration_config: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_name** | **str**| | + **proj_key** | **str**| | + +### Return type + +**object** + +### 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_default_values** +> DefaultValues get_project_default_values(proj_key) + +Get Project Default Values + +List project's default values. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.default_values import DefaultValues +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.ProjectApi(api_client) + proj_key = 'proj_key_example' # str | + + try: + # Get Project Default Values + api_response = api_instance.get_project_default_values(proj_key) + print("The response of ProjectApi->get_project_default_values:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->get_project_default_values: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + +### Return type + +[**DefaultValues**](DefaultValues.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_integration_config** +> ResponseGetProjectIntegrationConfig get_project_integration_config(integration_name, proj_key, decode_secrets=decode_secrets) + +Get Project Integration Config + +Get the config for a given project integration. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.response_get_project_integration_config import ResponseGetProjectIntegrationConfig +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.ProjectApi(api_client) + integration_name = 'integration_name_example' # str | + proj_key = 'proj_key_example' # str | + decode_secrets = True # bool | (optional) + + try: + # Get Project Integration Config + api_response = api_instance.get_project_integration_config(integration_name, proj_key, decode_secrets=decode_secrets) + print("The response of ProjectApi->get_project_integration_config:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->get_project_integration_config: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_name** | **str**| | + **proj_key** | **str**| | + **decode_secrets** | **bool**| | [optional] + +### Return type + +[**ResponseGetProjectIntegrationConfig**](ResponseGetProjectIntegrationConfig.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) + +# **provision_project_packages** +> TaskContext provision_project_packages(proj_key, project_package_instalation_manifest) + +Provision Project Packages + +Install packages on a project. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.project_package_instalation_manifest import ProjectPackageInstalationManifest +from deepsearch.cps.apis.public_v2.models.task_context import TaskContext +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.ProjectApi(api_client) + proj_key = 'proj_key_example' # str | + project_package_instalation_manifest = deepsearch.cps.apis.public_v2.ProjectPackageInstalationManifest() # ProjectPackageInstalationManifest | + + try: + # Provision Project Packages + api_response = api_instance.provision_project_packages(proj_key, project_package_instalation_manifest) + print("The response of ProjectApi->provision_project_packages:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->provision_project_packages: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + **project_package_instalation_manifest** | [**ProjectPackageInstalationManifest**](ProjectPackageInstalationManifest.md)| | + +### Return type + +[**TaskContext**](TaskContext.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) + +# **update_project_default_values** +> object update_project_default_values(proj_key, default_values) + +Update Project Default Values + +Update project's default values. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.default_values import DefaultValues +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.ProjectApi(api_client) + proj_key = 'proj_key_example' # str | + default_values = deepsearch.cps.apis.public_v2.DefaultValues() # DefaultValues | + + try: + # Update Project Default Values + api_response = api_instance.update_project_default_values(proj_key, default_values) + print("The response of ProjectApi->update_project_default_values:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->update_project_default_values: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + **default_values** | [**DefaultValues**](DefaultValues.md)| | + +### Return type + +**object** + +### 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) + +# **update_project_integration_config** +> object update_project_integration_config(integration_name, proj_key, body) + +Update Project Integration Config + +Update the config for a given project integration. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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.ProjectApi(api_client) + integration_name = 'integration_name_example' # str | + proj_key = 'proj_key_example' # str | + body = None # object | + + try: + # Update Project Integration Config + api_response = api_instance.update_project_integration_config(integration_name, proj_key, body) + print("The response of ProjectApi->update_project_integration_config:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->update_project_integration_config: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_name** | **str**| | + **proj_key** | **str**| | + **body** | **object**| | + +### Return type + +**object** + +### 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/ProjectDataIndexNonView.md b/docs/apis/public_v2/ProjectDataIndexNonView.md new file mode 100644 index 00000000..28912138 --- /dev/null +++ b/docs/apis/public_v2/ProjectDataIndexNonView.md @@ -0,0 +1,31 @@ +# ProjectDataIndexNonView + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**description** | **str** | | [optional] +**schema_key** | **str** | | [optional] [default to 'generic'] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_data_index_non_view import ProjectDataIndexNonView + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectDataIndexNonView from a JSON string +project_data_index_non_view_instance = ProjectDataIndexNonView.from_json(json) +# print the JSON string representation of the object +print(ProjectDataIndexNonView.to_json()) + +# convert the object into a dict +project_data_index_non_view_dict = project_data_index_non_view_instance.to_dict() +# create an instance of ProjectDataIndexNonView from a dict +project_data_index_non_view_form_dict = project_data_index_non_view.from_dict(project_data_index_non_view_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ProjectDataIndexSource.md b/docs/apis/public_v2/ProjectDataIndexSource.md new file mode 100644 index 00000000..d04fdb0c --- /dev/null +++ b/docs/apis/public_v2/ProjectDataIndexSource.md @@ -0,0 +1,30 @@ +# ProjectDataIndexSource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index_key** | **str** | | +**proj_key** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_data_index_source import ProjectDataIndexSource + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectDataIndexSource from a JSON string +project_data_index_source_instance = ProjectDataIndexSource.from_json(json) +# print the JSON string representation of the object +print(ProjectDataIndexSource.to_json()) + +# convert the object into a dict +project_data_index_source_dict = project_data_index_source_instance.to_dict() +# create an instance of ProjectDataIndexSource from a dict +project_data_index_source_form_dict = project_data_index_source.from_dict(project_data_index_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/ProjectDataIndexView.md b/docs/apis/public_v2/ProjectDataIndexView.md new file mode 100644 index 00000000..83b93f76 --- /dev/null +++ b/docs/apis/public_v2/ProjectDataIndexView.md @@ -0,0 +1,31 @@ +# ProjectDataIndexView + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**description** | **str** | | [optional] +**view_of** | [**ViewOf**](ViewOf.md) | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_data_index_view import ProjectDataIndexView + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectDataIndexView from a JSON string +project_data_index_view_instance = ProjectDataIndexView.from_json(json) +# print the JSON string representation of the object +print(ProjectDataIndexView.to_json()) + +# convert the object into a dict +project_data_index_view_dict = project_data_index_view_instance.to_dict() +# create an instance of ProjectDataIndexView from a dict +project_data_index_view_form_dict = project_data_index_view.from_dict(project_data_index_view_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ProjectDataIndexWithStatus.md b/docs/apis/public_v2/ProjectDataIndexWithStatus.md new file mode 100644 index 00000000..aeeb0b80 --- /dev/null +++ b/docs/apis/public_v2/ProjectDataIndexWithStatus.md @@ -0,0 +1,40 @@ +# ProjectDataIndexWithStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source** | [**Source**](Source.md) | | +**name** | **str** | | +**documents** | **int** | | +**health** | **str** | | +**status** | **str** | | +**creation_date** | **str** | | +**metadata** | [**ElasticMetadata**](ElasticMetadata.md) | | [optional] +**description** | **str** | | +**schema_key** | **str** | | [optional] +**type** | **str** | | +**view_of** | [**ViewOf**](ViewOf.md) | | [optional] +**record_properties** | **object** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_data_index_with_status import ProjectDataIndexWithStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectDataIndexWithStatus from a JSON string +project_data_index_with_status_instance = ProjectDataIndexWithStatus.from_json(json) +# print the JSON string representation of the object +print(ProjectDataIndexWithStatus.to_json()) + +# convert the object into a dict +project_data_index_with_status_dict = project_data_index_with_status_instance.to_dict() +# create an instance of ProjectDataIndexWithStatus from a dict +project_data_index_with_status_form_dict = project_data_index_with_status.from_dict(project_data_index_with_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/ProjectFlavourTotalKgs.md b/docs/apis/public_v2/ProjectFlavourTotalKgs.md new file mode 100644 index 00000000..b3e669c9 --- /dev/null +++ b/docs/apis/public_v2/ProjectFlavourTotalKgs.md @@ -0,0 +1,31 @@ +# ProjectFlavourTotalKgs + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**proj_key** | **str** | | +**flavour_name** | **str** | | +**total_kgs** | **int** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_flavour_total_kgs import ProjectFlavourTotalKgs + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectFlavourTotalKgs from a JSON string +project_flavour_total_kgs_instance = ProjectFlavourTotalKgs.from_json(json) +# print the JSON string representation of the object +print(ProjectFlavourTotalKgs.to_json()) + +# convert the object into a dict +project_flavour_total_kgs_dict = project_flavour_total_kgs_instance.to_dict() +# create an instance of ProjectFlavourTotalKgs from a dict +project_flavour_total_kgs_form_dict = project_flavour_total_kgs.from_dict(project_flavour_total_kgs_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ProjectFlavoursQuota.md b/docs/apis/public_v2/ProjectFlavoursQuota.md new file mode 100644 index 00000000..205a7012 --- /dev/null +++ b/docs/apis/public_v2/ProjectFlavoursQuota.md @@ -0,0 +1,31 @@ +# ProjectFlavoursQuota + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**proj_key** | **str** | | +**quotas** | [**List[FlavoursQuota]**](FlavoursQuota.md) | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_flavours_quota import ProjectFlavoursQuota + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectFlavoursQuota from a JSON string +project_flavours_quota_instance = ProjectFlavoursQuota.from_json(json) +# print the JSON string representation of the object +print(ProjectFlavoursQuota.to_json()) + +# convert the object into a dict +project_flavours_quota_dict = project_flavours_quota_instance.to_dict() +# create an instance of ProjectFlavoursQuota from a dict +project_flavours_quota_form_dict = project_flavours_quota.from_dict(project_flavours_quota_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ProjectPackageInstalationManifest.md b/docs/apis/public_v2/ProjectPackageInstalationManifest.md new file mode 100644 index 00000000..a575fa2e --- /dev/null +++ b/docs/apis/public_v2/ProjectPackageInstalationManifest.md @@ -0,0 +1,29 @@ +# ProjectPackageInstalationManifest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**packages** | [**List[Package]**](Package.md) | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_package_instalation_manifest import ProjectPackageInstalationManifest + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectPackageInstalationManifest from a JSON string +project_package_instalation_manifest_instance = ProjectPackageInstalationManifest.from_json(json) +# print the JSON string representation of the object +print(ProjectPackageInstalationManifest.to_json()) + +# convert the object into a dict +project_package_instalation_manifest_dict = project_package_instalation_manifest_instance.to_dict() +# create an instance of ProjectPackageInstalationManifest from a dict +project_package_instalation_manifest_form_dict = project_package_instalation_manifest.from_dict(project_package_instalation_manifest_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ProjectScratchFiles.md b/docs/apis/public_v2/ProjectScratchFiles.md new file mode 100644 index 00000000..d46c3a31 --- /dev/null +++ b/docs/apis/public_v2/ProjectScratchFiles.md @@ -0,0 +1,34 @@ +# ProjectScratchFiles + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**proj_key** | **str** | | +**user_key** | **str** | | +**filename** | **str** | | +**timestamp** | **str** | | +**url** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_scratch_files import ProjectScratchFiles + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectScratchFiles from a JSON string +project_scratch_files_instance = ProjectScratchFiles.from_json(json) +# print the JSON string representation of the object +print(ProjectScratchFiles.to_json()) + +# convert the object into a dict +project_scratch_files_dict = project_scratch_files_instance.to_dict() +# create an instance of ProjectScratchFiles from a dict +project_scratch_files_form_dict = project_scratch_files.from_dict(project_scratch_files_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ProjectScratchFilesPaginated.md b/docs/apis/public_v2/ProjectScratchFilesPaginated.md new file mode 100644 index 00000000..7dc8cfb0 --- /dev/null +++ b/docs/apis/public_v2/ProjectScratchFilesPaginated.md @@ -0,0 +1,32 @@ +# ProjectScratchFilesPaginated + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**files** | [**List[ProjectScratchFiles]**](ProjectScratchFiles.md) | | +**count** | **int** | | +**page** | **int** | | +**items_per_page** | **int** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_scratch_files_paginated import ProjectScratchFilesPaginated + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectScratchFilesPaginated from a JSON string +project_scratch_files_paginated_instance = ProjectScratchFilesPaginated.from_json(json) +# print the JSON string representation of the object +print(ProjectScratchFilesPaginated.to_json()) + +# convert the object into a dict +project_scratch_files_paginated_dict = project_scratch_files_paginated_instance.to_dict() +# create an instance of ProjectScratchFilesPaginated from a dict +project_scratch_files_paginated_form_dict = project_scratch_files_paginated.from_dict(project_scratch_files_paginated_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ProjectSourceDataIndex.md b/docs/apis/public_v2/ProjectSourceDataIndex.md new file mode 100644 index 00000000..18e71d3c --- /dev/null +++ b/docs/apis/public_v2/ProjectSourceDataIndex.md @@ -0,0 +1,31 @@ +# ProjectSourceDataIndex + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index_key** | **str** | | +**query_options** | [**ElasticIndexSearchQueryOptions**](ElasticIndexSearchQueryOptions.md) | | +**proj_key** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.project_source_data_index import ProjectSourceDataIndex + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectSourceDataIndex from a JSON string +project_source_data_index_instance = ProjectSourceDataIndex.from_json(json) +# print the JSON string representation of the object +print(ProjectSourceDataIndex.to_json()) + +# convert the object into a dict +project_source_data_index_dict = project_source_data_index_instance.to_dict() +# create an instance of ProjectSourceDataIndex from a dict +project_source_data_index_form_dict = project_source_data_index.from_dict(project_source_data_index_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ProjectsFlavours.md b/docs/apis/public_v2/ProjectsFlavours.md new file mode 100644 index 00000000..451aacd2 --- /dev/null +++ b/docs/apis/public_v2/ProjectsFlavours.md @@ -0,0 +1,31 @@ +# ProjectsFlavours + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**proj_key** | **str** | | +**name** | **str** | | +**flavours** | [**List[Flavour]**](Flavour.md) | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.projects_flavours import ProjectsFlavours + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectsFlavours from a JSON string +projects_flavours_instance = ProjectsFlavours.from_json(json) +# print the JSON string representation of the object +print(ProjectsFlavours.to_json()) + +# convert the object into a dict +projects_flavours_dict = projects_flavours_instance.to_dict() +# create an instance of ProjectsFlavours from a dict +projects_flavours_form_dict = projects_flavours.from_dict(projects_flavours_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/Properties.md b/docs/apis/public_v2/Properties.md new file mode 100644 index 00000000..db8ca3da --- /dev/null +++ b/docs/apis/public_v2/Properties.md @@ -0,0 +1,32 @@ +# Properties + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**properties** | [**Dict[str, Properties]**](Properties.md) | | +**type** | **object** | | +**enabled** | **object** | | [optional] +**ignore_above** | **object** | | [optional] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.properties import Properties + +# TODO update the JSON string below +json = "{}" +# create an instance of Properties from a JSON string +properties_instance = Properties.from_json(json) +# print the JSON string representation of the object +print(Properties.to_json()) + +# convert the object into a dict +properties_dict = properties_instance.to_dict() +# create an instance of Properties from a dict +properties_form_dict = properties.from_dict(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/ReferenceToModel.md b/docs/apis/public_v2/ReferenceToModel.md new file mode 100644 index 00000000..3c91d1ff --- /dev/null +++ b/docs/apis/public_v2/ReferenceToModel.md @@ -0,0 +1,33 @@ +# ReferenceToModel + +Reference to a model configuration. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**model_config_key** | **str** | | +**proj_key** | **str** | | +**name** | **str** | | [optional] [default to ''] +**description** | **str** | | [optional] [default to ''] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.reference_to_model import ReferenceToModel + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferenceToModel from a JSON string +reference_to_model_instance = ReferenceToModel.from_json(json) +# print the JSON string representation of the object +print(ReferenceToModel.to_json()) + +# convert the object into a dict +reference_to_model_dict = reference_to_model_instance.to_dict() +# create an instance of ReferenceToModel from a dict +reference_to_model_form_dict = reference_to_model.from_dict(reference_to_model_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ResponseGetProjectIntegrationConfig.md b/docs/apis/public_v2/ResponseGetProjectIntegrationConfig.md new file mode 100644 index 00000000..aef6888c --- /dev/null +++ b/docs/apis/public_v2/ResponseGetProjectIntegrationConfig.md @@ -0,0 +1,28 @@ +# ResponseGetProjectIntegrationConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.response_get_project_integration_config import ResponseGetProjectIntegrationConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of ResponseGetProjectIntegrationConfig from a JSON string +response_get_project_integration_config_instance = ResponseGetProjectIntegrationConfig.from_json(json) +# print the JSON string representation of the object +print(ResponseGetProjectIntegrationConfig.to_json()) + +# convert the object into a dict +response_get_project_integration_config_dict = response_get_project_integration_config_instance.to_dict() +# create an instance of ResponseGetProjectIntegrationConfig from a dict +response_get_project_integration_config_form_dict = response_get_project_integration_config.from_dict(response_get_project_integration_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/S3Coordinates.md b/docs/apis/public_v2/S3Coordinates.md new file mode 100644 index 00000000..4cf1d984 --- /dev/null +++ b/docs/apis/public_v2/S3Coordinates.md @@ -0,0 +1,37 @@ +# S3Coordinates + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**host** | **str** | | +**port** | **int** | | +**ssl** | **bool** | | +**verify_ssl** | **bool** | | +**access_key** | **str** | | +**secret_key** | **str** | | +**bucket** | **str** | | +**key_prefix** | **str** | | [optional] +**location** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.s3_coordinates import S3Coordinates + +# TODO update the JSON string below +json = "{}" +# create an instance of S3Coordinates from a JSON string +s3_coordinates_instance = S3Coordinates.from_json(json) +# print the JSON string representation of the object +print(S3Coordinates.to_json()) + +# convert the object into a dict +s3_coordinates_dict = s3_coordinates_instance.to_dict() +# create an instance of S3Coordinates from a dict +s3_coordinates_form_dict = s3_coordinates.from_dict(s3_coordinates_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/S3DocumentSource.md b/docs/apis/public_v2/S3DocumentSource.md new file mode 100644 index 00000000..ca01b694 --- /dev/null +++ b/docs/apis/public_v2/S3DocumentSource.md @@ -0,0 +1,31 @@ +# S3DocumentSource + +Specifies documents to import from an S3 bucket + +## Properties + +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] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.s3_document_source import S3DocumentSource + +# TODO update the JSON string below +json = "{}" +# create an instance of S3DocumentSource from a JSON string +s3_document_source_instance = S3DocumentSource.from_json(json) +# print the JSON string representation of the object +print(S3DocumentSource.to_json()) + +# convert the object into a dict +s3_document_source_dict = s3_document_source_instance.to_dict() +# create an instance of S3DocumentSource from a dict +s3_document_source_form_dict = s3_document_source.from_dict(s3_document_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/SemanticApi.md b/docs/apis/public_v2/SemanticApi.md new file mode 100644 index 00000000..388ed37c --- /dev/null +++ b/docs/apis/public_v2/SemanticApi.md @@ -0,0 +1,92 @@ +# deepsearch.cps.apis.public_v2.SemanticApi + +All URIs are relative to */api/cps/public/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ingest**](SemanticApi.md#ingest) | **POST** /project/{proj_key}/semantic/ingest | Ingest + + +# **ingest** +> CpsTask ingest(proj_key, semantic_ingest_request) + +Ingest + +Ingest documents and collections for RAG + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.cps_task import CpsTask +from deepsearch.cps.apis.public_v2.models.semantic_ingest_request import SemanticIngestRequest +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.SemanticApi(api_client) + proj_key = 'proj_key_example' # str | + semantic_ingest_request = deepsearch.cps.apis.public_v2.SemanticIngestRequest() # SemanticIngestRequest | + + try: + # Ingest + api_response = api_instance.ingest(proj_key, semantic_ingest_request) + print("The response of SemanticApi->ingest:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SemanticApi->ingest: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + **semantic_ingest_request** | [**SemanticIngestRequest**](SemanticIngestRequest.md)| | + +### Return type + +[**CpsTask**](CpsTask.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/SemanticIngestRequest.md b/docs/apis/public_v2/SemanticIngestRequest.md new file mode 100644 index 00000000..ca7f5dc2 --- /dev/null +++ b/docs/apis/public_v2/SemanticIngestRequest.md @@ -0,0 +1,29 @@ +# SemanticIngestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source** | [**Source1**](Source1.md) | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.semantic_ingest_request import SemanticIngestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SemanticIngestRequest from a JSON string +semantic_ingest_request_instance = SemanticIngestRequest.from_json(json) +# print the JSON string representation of the object +print(SemanticIngestRequest.to_json()) + +# convert the object into a dict +semantic_ingest_request_dict = semantic_ingest_request_instance.to_dict() +# create an instance of SemanticIngestRequest from a dict +semantic_ingest_request_form_dict = semantic_ingest_request.from_dict(semantic_ingest_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/SemanticIngestSourcePrivateDataCollection.md b/docs/apis/public_v2/SemanticIngestSourcePrivateDataCollection.md new file mode 100644 index 00000000..443b8558 --- /dev/null +++ b/docs/apis/public_v2/SemanticIngestSourcePrivateDataCollection.md @@ -0,0 +1,31 @@ +# SemanticIngestSourcePrivateDataCollection + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | +**proj_key** | **str** | | +**index_key** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_private_data_collection import SemanticIngestSourcePrivateDataCollection + +# TODO update the JSON string below +json = "{}" +# create an instance of SemanticIngestSourcePrivateDataCollection from a JSON string +semantic_ingest_source_private_data_collection_instance = SemanticIngestSourcePrivateDataCollection.from_json(json) +# print the JSON string representation of the object +print(SemanticIngestSourcePrivateDataCollection.to_json()) + +# convert the object into a dict +semantic_ingest_source_private_data_collection_dict = semantic_ingest_source_private_data_collection_instance.to_dict() +# create an instance of SemanticIngestSourcePrivateDataCollection from a dict +semantic_ingest_source_private_data_collection_form_dict = semantic_ingest_source_private_data_collection.from_dict(semantic_ingest_source_private_data_collection_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/SemanticIngestSourcePrivateDataDocument.md b/docs/apis/public_v2/SemanticIngestSourcePrivateDataDocument.md new file mode 100644 index 00000000..c3e47b95 --- /dev/null +++ b/docs/apis/public_v2/SemanticIngestSourcePrivateDataDocument.md @@ -0,0 +1,32 @@ +# SemanticIngestSourcePrivateDataDocument + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | +**proj_key** | **str** | | +**index_key** | **str** | | +**document_hash** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_private_data_document import SemanticIngestSourcePrivateDataDocument + +# TODO update the JSON string below +json = "{}" +# create an instance of SemanticIngestSourcePrivateDataDocument from a JSON string +semantic_ingest_source_private_data_document_instance = SemanticIngestSourcePrivateDataDocument.from_json(json) +# print the JSON string representation of the object +print(SemanticIngestSourcePrivateDataDocument.to_json()) + +# convert the object into a dict +semantic_ingest_source_private_data_document_dict = semantic_ingest_source_private_data_document_instance.to_dict() +# create an instance of SemanticIngestSourcePrivateDataDocument from a dict +semantic_ingest_source_private_data_document_form_dict = semantic_ingest_source_private_data_document.from_dict(semantic_ingest_source_private_data_document_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/SemanticIngestSourcePublicDataDocument.md b/docs/apis/public_v2/SemanticIngestSourcePublicDataDocument.md new file mode 100644 index 00000000..32288d4a --- /dev/null +++ b/docs/apis/public_v2/SemanticIngestSourcePublicDataDocument.md @@ -0,0 +1,32 @@ +# SemanticIngestSourcePublicDataDocument + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | +**elastic_id** | **str** | | +**index_key** | **str** | | +**document_hash** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_public_data_document import SemanticIngestSourcePublicDataDocument + +# TODO update the JSON string below +json = "{}" +# create an instance of SemanticIngestSourcePublicDataDocument from a JSON string +semantic_ingest_source_public_data_document_instance = SemanticIngestSourcePublicDataDocument.from_json(json) +# print the JSON string representation of the object +print(SemanticIngestSourcePublicDataDocument.to_json()) + +# convert the object into a dict +semantic_ingest_source_public_data_document_dict = semantic_ingest_source_public_data_document_instance.to_dict() +# create an instance of SemanticIngestSourcePublicDataDocument from a dict +semantic_ingest_source_public_data_document_form_dict = semantic_ingest_source_public_data_document.from_dict(semantic_ingest_source_public_data_document_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/SemanticIngestSourceUrl.md b/docs/apis/public_v2/SemanticIngestSourceUrl.md new file mode 100644 index 00000000..8f635870 --- /dev/null +++ b/docs/apis/public_v2/SemanticIngestSourceUrl.md @@ -0,0 +1,30 @@ +# SemanticIngestSourceUrl + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | +**url** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.semantic_ingest_source_url import SemanticIngestSourceUrl + +# TODO update the JSON string below +json = "{}" +# create an instance of SemanticIngestSourceUrl from a JSON string +semantic_ingest_source_url_instance = SemanticIngestSourceUrl.from_json(json) +# print the JSON string representation of the object +print(SemanticIngestSourceUrl.to_json()) + +# convert the object into a dict +semantic_ingest_source_url_dict = semantic_ingest_source_url_instance.to_dict() +# create an instance of SemanticIngestSourceUrl from a dict +semantic_ingest_source_url_form_dict = semantic_ingest_source_url.from_dict(semantic_ingest_source_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/Source.md b/docs/apis/public_v2/Source.md new file mode 100644 index 00000000..a52e72c3 --- /dev/null +++ b/docs/apis/public_v2/Source.md @@ -0,0 +1,31 @@ +# Source + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index_key** | **object** | | +**elastic_id** | **object** | | +**proj_key** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.source import Source + +# TODO update the JSON string below +json = "{}" +# create an instance of Source from a JSON string +source_instance = Source.from_json(json) +# print the JSON string representation of the object +print(Source.to_json()) + +# convert the object into a dict +source_dict = source_instance.to_dict() +# create an instance of Source from a dict +source_form_dict = source.from_dict(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/Source1.md b/docs/apis/public_v2/Source1.md new file mode 100644 index 00000000..f18efff5 --- /dev/null +++ b/docs/apis/public_v2/Source1.md @@ -0,0 +1,34 @@ +# Source1 + + +## 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.source1 import Source1 + +# TODO update the JSON string below +json = "{}" +# create an instance of Source1 from a JSON string +source1_instance = Source1.from_json(json) +# print the JSON string representation of the object +print(Source1.to_json()) + +# convert the object into a dict +source1_dict = source1_instance.to_dict() +# create an instance of Source1 from a dict +source1_form_dict = source1.from_dict(source1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/StorageSummaryTask.md b/docs/apis/public_v2/StorageSummaryTask.md new file mode 100644 index 00000000..1f924558 --- /dev/null +++ b/docs/apis/public_v2/StorageSummaryTask.md @@ -0,0 +1,33 @@ +# StorageSummaryTask + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dc_key** | **str** | | [optional] +**kg_key** | **str** | | [optional] +**kind** | **str** | | +**proj_key** | **str** | | +**task_id** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.storage_summary_task import StorageSummaryTask + +# TODO update the JSON string below +json = "{}" +# create an instance of StorageSummaryTask from a JSON string +storage_summary_task_instance = StorageSummaryTask.from_json(json) +# print the JSON string representation of the object +print(StorageSummaryTask.to_json()) + +# convert the object into a dict +storage_summary_task_dict = storage_summary_task_instance.to_dict() +# create an instance of StorageSummaryTask from a dict +storage_summary_task_form_dict = storage_summary_task.from_dict(storage_summary_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/SystemApi.md b/docs/apis/public_v2/SystemApi.md new file mode 100644 index 00000000..d9c01822 --- /dev/null +++ b/docs/apis/public_v2/SystemApi.md @@ -0,0 +1,510 @@ +# deepsearch.cps.apis.public_v2.SystemApi + +All URIs are relative to */api/cps/public/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_system_information**](SystemApi.md#get_system_information) | **GET** /system/info | Get System Information +[**get_system_modules_configuration**](SystemApi.md#get_system_modules_configuration) | **GET** /system/modules/configuration | Get System Modules Configuration +[**get_system_modules_tasks**](SystemApi.md#get_system_modules_tasks) | **GET** /system/modules/tasks | Get System Modules Tasks +[**list_packages**](SystemApi.md#list_packages) | **GET** /system/packages | List Packages +[**list_system_knowledge_graphs**](SystemApi.md#list_system_knowledge_graphs) | **GET** /system/kgs | List System Knowledge Graphs +[**system_get_all_dcs_admin**](SystemApi.md#system_get_all_dcs_admin) | **GET** /system/admin/get_all_dcs | System Get All Dcs Admin +[**system_get_all_kgs_admin**](SystemApi.md#system_get_all_kgs_admin) | **GET** /system/admin/get_all_kgs | System Get All Kgs Admin + + +# **get_system_information** +> SystemInfo get_system_information() + +Get System Information + +Get system info. + +### Example + + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.system_info import SystemInfo +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" +) + + +# 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.SystemApi(api_client) + + try: + # Get System Information + api_response = api_instance.get_system_information() + print("The response of SystemApi->get_system_information:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemApi->get_system_information: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**SystemInfo**](SystemInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | + +[[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_system_modules_configuration** +> ModulesConfig get_system_modules_configuration() + +Get System Modules Configuration + +Get modules configuration. + +### Example + + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.modules_config import ModulesConfig +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" +) + + +# 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.SystemApi(api_client) + + try: + # Get System Modules Configuration + api_response = api_instance.get_system_modules_configuration() + print("The response of SystemApi->get_system_modules_configuration:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemApi->get_system_modules_configuration: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**ModulesConfig**](ModulesConfig.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | + +[[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_system_modules_tasks** +> object get_system_modules_tasks() + +Get System Modules Tasks + +Get modules configuration. + +### Example + + +```python +import deepsearch.cps.apis.public_v2 +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" +) + + +# 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.SystemApi(api_client) + + try: + # Get System Modules Tasks + api_response = api_instance.get_system_modules_tasks() + print("The response of SystemApi->get_system_modules_tasks:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemApi->get_system_modules_tasks: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_packages** +> List[CPSPackage] list_packages() + +List Packages + +Get packages available in this CPS installation for installing in a project. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.cps_package import CPSPackage +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.SystemApi(api_client) + + try: + # List Packages + api_response = api_instance.list_packages() + print("The response of SystemApi->list_packages:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemApi->list_packages: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[CPSPackage]**](CPSPackage.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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_system_knowledge_graphs** +> List[object] list_system_knowledge_graphs(proj_key=proj_key, term=term) + +List System Knowledge Graphs + +List all Knowledge Graphs in the system. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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.SystemApi(api_client) + proj_key = 'proj_key_example' # str | (optional) + term = 'term_example' # str | (optional) + + try: + # List System Knowledge Graphs + api_response = api_instance.list_system_knowledge_graphs(proj_key=proj_key, term=term) + print("The response of SystemApi->list_system_knowledge_graphs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemApi->list_system_knowledge_graphs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | [optional] + **term** | **str**| | [optional] + +### Return type + +**List[object]** + +### 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) + +# **system_get_all_dcs_admin** +> List[str] system_get_all_dcs_admin() + +System Get All Dcs Admin + +Get all data catalogs (only dc_key) for admin use. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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.SystemApi(api_client) + + try: + # System Get All Dcs Admin + api_response = api_instance.system_get_all_dcs_admin() + print("The response of SystemApi->system_get_all_dcs_admin:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemApi->system_get_all_dcs_admin: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**List[str]** + +### 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 | - | + +[[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) + +# **system_get_all_kgs_admin** +> List[object] system_get_all_kgs_admin() + +System Get All Kgs Admin + +Get all kgs (only bag_key) for admin use. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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.SystemApi(api_client) + + try: + # System Get All Kgs Admin + api_response = api_instance.system_get_all_kgs_admin() + print("The response of SystemApi->system_get_all_kgs_admin:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemApi->system_get_all_kgs_admin: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**List[object]** + +### 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 | - | + +[[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/SystemFlavoursApi.md b/docs/apis/public_v2/SystemFlavoursApi.md new file mode 100644 index 00000000..457f1d55 --- /dev/null +++ b/docs/apis/public_v2/SystemFlavoursApi.md @@ -0,0 +1,566 @@ +# deepsearch.cps.apis.public_v2.SystemFlavoursApi + +All URIs are relative to */api/cps/public/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_flavour**](SystemFlavoursApi.md#delete_flavour) | **DELETE** /system/admin/delete_flavour/{flavour_name} | Delete Flavour +[**get_flavour**](SystemFlavoursApi.md#get_flavour) | **GET** /system/admin/get_flavour/{flavour_name} | Get Flavour +[**list_all_flavours**](SystemFlavoursApi.md#list_all_flavours) | **GET** /system/admin/list_all_flavours | List All Flavours +[**list_flavours_by_project**](SystemFlavoursApi.md#list_flavours_by_project) | **GET** /system/admin/get_project_flavours/{proj_key} | List Flavours By Project +[**list_projects_flavours**](SystemFlavoursApi.md#list_projects_flavours) | **GET** /system/admin/list_projects_flavours | List Projects Flavours +[**save_flavour**](SystemFlavoursApi.md#save_flavour) | **PUT** /system/admin/save_flavour | Save Flavour +[**save_project_flavours**](SystemFlavoursApi.md#save_project_flavours) | **PUT** /system/admin/save_project_flavours | Save Project Flavours + + +# **delete_flavour** +> object delete_flavour(flavour_name) + +Delete Flavour + +Delete flavour from db. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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.SystemFlavoursApi(api_client) + flavour_name = 'flavour_name_example' # str | + + try: + # Delete Flavour + api_response = api_instance.delete_flavour(flavour_name) + print("The response of SystemFlavoursApi->delete_flavour:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemFlavoursApi->delete_flavour: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flavour_name** | **str**| | + +### Return type + +**object** + +### 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_flavour** +> BagFlavourFullData get_flavour(flavour_name) + +Get Flavour + +Get flavour from db. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.bag_flavour_full_data import BagFlavourFullData +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.SystemFlavoursApi(api_client) + flavour_name = 'flavour_name_example' # str | + + try: + # Get Flavour + api_response = api_instance.get_flavour(flavour_name) + print("The response of SystemFlavoursApi->get_flavour:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemFlavoursApi->get_flavour: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flavour_name** | **str**| | + +### Return type + +[**BagFlavourFullData**](BagFlavourFullData.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) + +# **list_all_flavours** +> List[BagFlavourFullData] list_all_flavours() + +List All Flavours + +Get all KG flavours storage on db. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.bag_flavour_full_data import BagFlavourFullData +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.SystemFlavoursApi(api_client) + + try: + # List All Flavours + api_response = api_instance.list_all_flavours() + print("The response of SystemFlavoursApi->list_all_flavours:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemFlavoursApi->list_all_flavours: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[BagFlavourFullData]**](BagFlavourFullData.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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_flavours_by_project** +> ListProjectFlavours list_flavours_by_project(proj_key) + +List Flavours By Project + +Get project assignment flavours. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.list_project_flavours import ListProjectFlavours +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.SystemFlavoursApi(api_client) + proj_key = 'proj_key_example' # str | + + try: + # List Flavours By Project + api_response = api_instance.list_flavours_by_project(proj_key) + print("The response of SystemFlavoursApi->list_flavours_by_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemFlavoursApi->list_flavours_by_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + +### Return type + +[**ListProjectFlavours**](ListProjectFlavours.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) + +# **list_projects_flavours** +> List[ProjectsFlavours] list_projects_flavours() + +List Projects Flavours + +Get all projects and their flavours. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.projects_flavours import ProjectsFlavours +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.SystemFlavoursApi(api_client) + + try: + # List Projects Flavours + api_response = api_instance.list_projects_flavours() + print("The response of SystemFlavoursApi->list_projects_flavours:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemFlavoursApi->list_projects_flavours: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[ProjectsFlavours]**](ProjectsFlavours.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 | - | + +[[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) + +# **save_flavour** +> object save_flavour(new_flavour, bag_flavour_full_data) + +Save Flavour + +Save flavour on db. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.bag_flavour_full_data import BagFlavourFullData +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.SystemFlavoursApi(api_client) + new_flavour = True # bool | + bag_flavour_full_data = deepsearch.cps.apis.public_v2.BagFlavourFullData() # BagFlavourFullData | + + try: + # Save Flavour + api_response = api_instance.save_flavour(new_flavour, bag_flavour_full_data) + print("The response of SystemFlavoursApi->save_flavour:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemFlavoursApi->save_flavour: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **new_flavour** | **bool**| | + **bag_flavour_full_data** | [**BagFlavourFullData**](BagFlavourFullData.md)| | + +### Return type + +**object** + +### 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) + +# **save_project_flavours** +> object save_project_flavours(projects_flavours) + +Save Project Flavours + +Save project flavours assignment on db. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.projects_flavours import ProjectsFlavours +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.SystemFlavoursApi(api_client) + projects_flavours = deepsearch.cps.apis.public_v2.ProjectsFlavours() # ProjectsFlavours | + + try: + # Save Project Flavours + api_response = api_instance.save_project_flavours(projects_flavours) + print("The response of SystemFlavoursApi->save_project_flavours:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemFlavoursApi->save_project_flavours: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **projects_flavours** | [**ProjectsFlavours**](ProjectsFlavours.md)| | + +### Return type + +**object** + +### 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/SystemInfo.md b/docs/apis/public_v2/SystemInfo.md new file mode 100644 index 00000000..ad680d62 --- /dev/null +++ b/docs/apis/public_v2/SystemInfo.md @@ -0,0 +1,34 @@ +# SystemInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**notifications** | **List[object]** | | +**default_project** | **object** | | +**deployment** | [**Deployment**](Deployment.md) | | +**toolkit** | **object** | | +**allow_non_admins_to_make_resources_public** | **bool** | | +**api** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.system_info import SystemInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of SystemInfo from a JSON string +system_info_instance = SystemInfo.from_json(json) +# print the JSON string representation of the object +print(SystemInfo.to_json()) + +# convert the object into a dict +system_info_dict = system_info_instance.to_dict() +# create an instance of SystemInfo from a dict +system_info_form_dict = system_info.from_dict(system_info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/SystemQuotasApi.md b/docs/apis/public_v2/SystemQuotasApi.md new file mode 100644 index 00000000..f076053d --- /dev/null +++ b/docs/apis/public_v2/SystemQuotasApi.md @@ -0,0 +1,486 @@ +# deepsearch.cps.apis.public_v2.SystemQuotasApi + +All URIs are relative to */api/cps/public/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_flavours_default_quotas**](SystemQuotasApi.md#get_flavours_default_quotas) | **GET** /system/admin/get_flavours_default_quota | Get Flavours Default Quotas +[**get_project_flavour_total_kgs**](SystemQuotasApi.md#get_project_flavour_total_kgs) | **GET** /system/admin/get_project_flavour_total_kgs/{proj_key}/{flavour_name} | Get Project Flavour Total Kgs +[**get_project_flavours_quota**](SystemQuotasApi.md#get_project_flavours_quota) | **GET** /system/admin/get_project_flavours_quota/{proj_key} | Get Project Flavours Quota +[**get_projects_flavours_quota**](SystemQuotasApi.md#get_projects_flavours_quota) | **GET** /system/admin/get_projects_flavours_quota | Get Projects Flavours Quota +[**save_flavours_default_quotas**](SystemQuotasApi.md#save_flavours_default_quotas) | **PUT** /system/admin/save_flavours_default_quota | Save Flavours Default Quotas +[**save_project_flavours_quota**](SystemQuotasApi.md#save_project_flavours_quota) | **PUT** /system/admin/save_project_flavours_quota | Save Project Flavours Quota + + +# **get_flavours_default_quotas** +> List[FlavoursDefaultQuota] get_flavours_default_quotas() + +Get Flavours Default Quotas + +Get flavours default values. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.flavours_default_quota import FlavoursDefaultQuota +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.SystemQuotasApi(api_client) + + try: + # Get Flavours Default Quotas + api_response = api_instance.get_flavours_default_quotas() + print("The response of SystemQuotasApi->get_flavours_default_quotas:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemQuotasApi->get_flavours_default_quotas: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[FlavoursDefaultQuota]**](FlavoursDefaultQuota.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 | - | + +[[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_flavour_total_kgs** +> ProjectFlavourTotalKgs get_project_flavour_total_kgs(flavour_name, proj_key) + +Get Project Flavour Total Kgs + +Gets kg total number by proj_key and flavour_key. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.project_flavour_total_kgs import ProjectFlavourTotalKgs +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.SystemQuotasApi(api_client) + flavour_name = 'flavour_name_example' # str | + proj_key = 'proj_key_example' # str | + + try: + # Get Project Flavour Total Kgs + api_response = api_instance.get_project_flavour_total_kgs(flavour_name, proj_key) + print("The response of SystemQuotasApi->get_project_flavour_total_kgs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemQuotasApi->get_project_flavour_total_kgs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flavour_name** | **str**| | + **proj_key** | **str**| | + +### Return type + +[**ProjectFlavourTotalKgs**](ProjectFlavourTotalKgs.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_flavours_quota** +> List[FlavoursQuota] get_project_flavours_quota(proj_key) + +Get Project Flavours Quota + +Get project flavours quota. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.flavours_quota import FlavoursQuota +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.SystemQuotasApi(api_client) + proj_key = 'proj_key_example' # str | + + try: + # Get Project Flavours Quota + api_response = api_instance.get_project_flavours_quota(proj_key) + print("The response of SystemQuotasApi->get_project_flavours_quota:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemQuotasApi->get_project_flavours_quota: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + +### Return type + +[**List[FlavoursQuota]**](FlavoursQuota.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_projects_flavours_quota** +> List[ProjectFlavoursQuota] get_projects_flavours_quota() + +Get Projects Flavours Quota + +Get projects flavours quotas. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.project_flavours_quota import ProjectFlavoursQuota +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.SystemQuotasApi(api_client) + + try: + # Get Projects Flavours Quota + api_response = api_instance.get_projects_flavours_quota() + print("The response of SystemQuotasApi->get_projects_flavours_quota:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemQuotasApi->get_projects_flavours_quota: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[ProjectFlavoursQuota]**](ProjectFlavoursQuota.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 | - | + +[[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) + +# **save_flavours_default_quotas** +> List[FlavoursDefaultQuota] save_flavours_default_quotas(flavours_default_quota) + +Save Flavours Default Quotas + +Save flavours default quota. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.flavours_default_quota import FlavoursDefaultQuota +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.SystemQuotasApi(api_client) + flavours_default_quota = [deepsearch.cps.apis.public_v2.FlavoursDefaultQuota()] # List[FlavoursDefaultQuota] | + + try: + # Save Flavours Default Quotas + api_response = api_instance.save_flavours_default_quotas(flavours_default_quota) + print("The response of SystemQuotasApi->save_flavours_default_quotas:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemQuotasApi->save_flavours_default_quotas: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flavours_default_quota** | [**List[FlavoursDefaultQuota]**](FlavoursDefaultQuota.md)| | + +### Return type + +[**List[FlavoursDefaultQuota]**](FlavoursDefaultQuota.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) + +# **save_project_flavours_quota** +> object save_project_flavours_quota(project_flavours_quota) + +Save Project Flavours Quota + +Save project flavours quota. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.project_flavours_quota import ProjectFlavoursQuota +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.SystemQuotasApi(api_client) + project_flavours_quota = deepsearch.cps.apis.public_v2.ProjectFlavoursQuota() # ProjectFlavoursQuota | + + try: + # Save Project Flavours Quota + api_response = api_instance.save_project_flavours_quota(project_flavours_quota) + print("The response of SystemQuotasApi->save_project_flavours_quota:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemQuotasApi->save_project_flavours_quota: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_flavours_quota** | [**ProjectFlavoursQuota**](ProjectFlavoursQuota.md)| | + +### Return type + +**object** + +### 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/SystemSummaryApi.md b/docs/apis/public_v2/SystemSummaryApi.md new file mode 100644 index 00000000..dcd3f61a --- /dev/null +++ b/docs/apis/public_v2/SystemSummaryApi.md @@ -0,0 +1,246 @@ +# deepsearch.cps.apis.public_v2.SystemSummaryApi + +All URIs are relative to */api/cps/public/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**system_get_cps_summary**](SystemSummaryApi.md#system_get_cps_summary) | **GET** /system/admin/summary | System Get Cps Summary +[**system_get_dc_storage_summary_async**](SystemSummaryApi.md#system_get_dc_storage_summary_async) | **GET** /system/admin/dc_storage_summary/{dc_key} | System Get Dc Storage Summary Async +[**system_get_kg_storage_summary_async**](SystemSummaryApi.md#system_get_kg_storage_summary_async) | **GET** /system/admin/kg_storage_summary/{kg_key} | System Get Kg Storage Summary Async + + +# **system_get_cps_summary** +> List[CPSSummary] system_get_cps_summary() + +System Get Cps Summary + +Get cps summary data. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.cps_summary import CPSSummary +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.SystemSummaryApi(api_client) + + try: + # System Get Cps Summary + api_response = api_instance.system_get_cps_summary() + print("The response of SystemSummaryApi->system_get_cps_summary:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemSummaryApi->system_get_cps_summary: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[CPSSummary]**](CPSSummary.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 | - | + +[[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) + +# **system_get_dc_storage_summary_async** +> StorageSummaryTask system_get_dc_storage_summary_async(dc_key) + +System Get Dc Storage Summary Async + +Get data catalog storage summary. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.storage_summary_task import StorageSummaryTask +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.SystemSummaryApi(api_client) + dc_key = 'dc_key_example' # str | + + try: + # System Get Dc Storage Summary Async + api_response = api_instance.system_get_dc_storage_summary_async(dc_key) + print("The response of SystemSummaryApi->system_get_dc_storage_summary_async:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemSummaryApi->system_get_dc_storage_summary_async: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dc_key** | **str**| | + +### Return type + +[**StorageSummaryTask**](StorageSummaryTask.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) + +# **system_get_kg_storage_summary_async** +> StorageSummaryTask system_get_kg_storage_summary_async(kg_key) + +System Get Kg Storage Summary Async + +Get knowledge graph storage summary. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.storage_summary_task import StorageSummaryTask +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.SystemSummaryApi(api_client) + kg_key = 'kg_key_example' # str | + + try: + # System Get Kg Storage Summary Async + api_response = api_instance.system_get_kg_storage_summary_async(kg_key) + print("The response of SystemSummaryApi->system_get_kg_storage_summary_async:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SystemSummaryApi->system_get_kg_storage_summary_async: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **kg_key** | **str**| | + +### Return type + +[**StorageSummaryTask**](StorageSummaryTask.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) + diff --git a/docs/apis/public_v2/TaskContext.md b/docs/apis/public_v2/TaskContext.md new file mode 100644 index 00000000..63da20dd --- /dev/null +++ b/docs/apis/public_v2/TaskContext.md @@ -0,0 +1,42 @@ +# TaskContext + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**proj_key** | **str** | | +**user_key** | **str** | | +**task_type** | **str** | | +**task_id** | **str** | | +**task_status** | **str** | | +**execution_mode** | **str** | | +**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] + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.task_context import TaskContext + +# TODO update the JSON string below +json = "{}" +# create an instance of TaskContext from a JSON string +task_context_instance = TaskContext.from_json(json) +# print the JSON string representation of the object +print(TaskContext.to_json()) + +# convert the object into a dict +task_context_dict = task_context_instance.to_dict() +# create an instance of TaskContext from a dict +task_context_form_dict = task_context.from_dict(task_context_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/TaskResult.md b/docs/apis/public_v2/TaskResult.md new file mode 100644 index 00000000..4381febe --- /dev/null +++ b/docs/apis/public_v2/TaskResult.md @@ -0,0 +1,31 @@ +# TaskResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **object** | | [optional] +**task_id** | **str** | | +**task_status** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.task_result import TaskResult + +# TODO update the JSON string below +json = "{}" +# create an instance of TaskResult from a JSON string +task_result_instance = TaskResult.from_json(json) +# print the JSON string representation of the object +print(TaskResult.to_json()) + +# convert the object into a dict +task_result_dict = task_result_instance.to_dict() +# create an instance of TaskResult from a dict +task_result_form_dict = task_result.from_dict(task_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/TasksApi.md b/docs/apis/public_v2/TasksApi.md new file mode 100644 index 00000000..ef61f207 --- /dev/null +++ b/docs/apis/public_v2/TasksApi.md @@ -0,0 +1,345 @@ +# deepsearch.cps.apis.public_v2.TasksApi + +All URIs are relative to */api/cps/public/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**abort_project_task**](TasksApi.md#abort_project_task) | **POST** /project/{proj_key}/tasks/{task_id}/actions/abort | Abort Project Task +[**get_project_celery_task**](TasksApi.md#get_project_celery_task) | **GET** /project/{proj_key}/celery_tasks/{task_id} | Get Project Celery Task +[**get_project_task**](TasksApi.md#get_project_task) | **GET** /project/{proj_key}/tasks/{task_id} | Get Project Task +[**list_project_tasks**](TasksApi.md#list_project_tasks) | **GET** /project/{proj_key}/tasks | List Project Tasks + + +# **abort_project_task** +> abort_project_task(task_id, proj_key) + +Abort Project Task + +Abort a task. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +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.TasksApi(api_client) + task_id = 'task_id_example' # str | + proj_key = 'proj_key_example' # str | + + try: + # Abort Project Task + api_instance.abort_project_task(task_id, proj_key) + except Exception as e: + print("Exception when calling TasksApi->abort_project_task: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **task_id** | **str**| | + **proj_key** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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_project_celery_task** +> TaskResult get_project_celery_task(task_id, proj_key) + +Get Project Celery Task + +Get a celery task for a project. + +### Example + +* Api Key Authentication (Bearer): + +```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 + +# 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.TasksApi(api_client) + task_id = 'task_id_example' # str | + proj_key = 'proj_key_example' # str | + + try: + # Get Project Celery Task + api_response = api_instance.get_project_celery_task(task_id, proj_key) + print("The response of TasksApi->get_project_celery_task:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TasksApi->get_project_celery_task: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **task_id** | **str**| | + **proj_key** | **str**| | + +### Return type + +[**TaskResult**](TaskResult.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_task** +> TaskContext get_project_task(task_id, proj_key) + +Get Project Task + +Get a task for a project. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.task_context import TaskContext +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.TasksApi(api_client) + task_id = 'task_id_example' # str | + proj_key = 'proj_key_example' # str | + + try: + # Get Project Task + api_response = api_instance.get_project_task(task_id, proj_key) + print("The response of TasksApi->get_project_task:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TasksApi->get_project_task: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **task_id** | **str**| | + **proj_key** | **str**| | + +### Return type + +[**TaskContext**](TaskContext.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) + +# **list_project_tasks** +> List[TaskContext] list_project_tasks(proj_key, task_type=task_type, skip=skip, limit=limit, sort_by=sort_by, sort_order=sort_order) + +List Project Tasks + +List tasks for a project. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.task_context import TaskContext +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.TasksApi(api_client) + proj_key = 'proj_key_example' # str | + task_type = 'task_type_example' # str | (optional) + skip = 0 # int | (optional) (default to 0) + limit = 50 # int | (optional) (default to 50) + sort_by = '_id' # str | (optional) (default to '_id') + sort_order = 'desc' # str | (optional) (default to 'desc') + + try: + # List Project Tasks + api_response = api_instance.list_project_tasks(proj_key, task_type=task_type, skip=skip, limit=limit, sort_by=sort_by, sort_order=sort_order) + print("The response of TasksApi->list_project_tasks:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TasksApi->list_project_tasks: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + **task_type** | **str**| | [optional] + **skip** | **int**| | [optional] [default to 0] + **limit** | **int**| | [optional] [default to 50] + **sort_by** | **str**| | [optional] [default to '_id'] + **sort_order** | **str**| | [optional] [default to 'desc'] + +### Return type + +[**List[TaskContext]**](TaskContext.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) + diff --git a/docs/apis/public_v2/TemporaryUploadFileResult.md b/docs/apis/public_v2/TemporaryUploadFileResult.md new file mode 100644 index 00000000..dfb7a491 --- /dev/null +++ b/docs/apis/public_v2/TemporaryUploadFileResult.md @@ -0,0 +1,35 @@ +# TemporaryUploadFileResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**upload** | [**TemporaryUrlFields**](TemporaryUrlFields.md) | | +**download** | [**TemporaryUrl**](TemporaryUrl.md) | | +**metadata** | [**TemporaryUrl**](TemporaryUrl.md) | | +**upload_private** | [**TemporaryUrlFields**](TemporaryUrlFields.md) | | +**download_private** | [**TemporaryUrl**](TemporaryUrl.md) | | +**metadata_private** | [**TemporaryUrl**](TemporaryUrl.md) | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.temporary_upload_file_result import TemporaryUploadFileResult + +# TODO update the JSON string below +json = "{}" +# create an instance of TemporaryUploadFileResult from a JSON string +temporary_upload_file_result_instance = TemporaryUploadFileResult.from_json(json) +# print the JSON string representation of the object +print(TemporaryUploadFileResult.to_json()) + +# convert the object into a dict +temporary_upload_file_result_dict = temporary_upload_file_result_instance.to_dict() +# create an instance of TemporaryUploadFileResult from a dict +temporary_upload_file_result_form_dict = temporary_upload_file_result.from_dict(temporary_upload_file_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/TemporaryUrl.md b/docs/apis/public_v2/TemporaryUrl.md new file mode 100644 index 00000000..e535e873 --- /dev/null +++ b/docs/apis/public_v2/TemporaryUrl.md @@ -0,0 +1,29 @@ +# TemporaryUrl + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.temporary_url import TemporaryUrl + +# TODO update the JSON string below +json = "{}" +# create an instance of TemporaryUrl from a JSON string +temporary_url_instance = TemporaryUrl.from_json(json) +# print the JSON string representation of the object +print(TemporaryUrl.to_json()) + +# convert the object into a dict +temporary_url_dict = temporary_url_instance.to_dict() +# create an instance of TemporaryUrl from a dict +temporary_url_form_dict = temporary_url.from_dict(temporary_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/TemporaryUrlFields.md b/docs/apis/public_v2/TemporaryUrlFields.md new file mode 100644 index 00000000..45f6cb43 --- /dev/null +++ b/docs/apis/public_v2/TemporaryUrlFields.md @@ -0,0 +1,30 @@ +# TemporaryUrlFields + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | | +**fields** | **object** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.temporary_url_fields import TemporaryUrlFields + +# TODO update the JSON string below +json = "{}" +# create an instance of TemporaryUrlFields from a JSON string +temporary_url_fields_instance = TemporaryUrlFields.from_json(json) +# print the JSON string representation of the object +print(TemporaryUrlFields.to_json()) + +# convert the object into a dict +temporary_url_fields_dict = temporary_url_fields_instance.to_dict() +# create an instance of TemporaryUrlFields from a dict +temporary_url_fields_form_dict = temporary_url_fields.from_dict(temporary_url_fields_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/TokenResponse.md b/docs/apis/public_v2/TokenResponse.md new file mode 100644 index 00000000..1c162304 --- /dev/null +++ b/docs/apis/public_v2/TokenResponse.md @@ -0,0 +1,29 @@ +# TokenResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.token_response import TokenResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of TokenResponse from a JSON string +token_response_instance = TokenResponse.from_json(json) +# print the JSON string representation of the object +print(TokenResponse.to_json()) + +# convert the object into a dict +token_response_dict = token_response_instance.to_dict() +# create an instance of TokenResponse from a dict +token_response_form_dict = token_response.from_dict(token_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/UploadApi.md b/docs/apis/public_v2/UploadApi.md new file mode 100644 index 00000000..43694d6d --- /dev/null +++ b/docs/apis/public_v2/UploadApi.md @@ -0,0 +1,265 @@ +# deepsearch.cps.apis.public_v2.UploadApi + +All URIs are relative to */api/cps/public/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_project_scratch_file**](UploadApi.md#create_project_scratch_file) | **POST** /project/{proj_key}/scratch/files/upload/{filename} | Create Project Scratch File +[**list_project_scratch_files**](UploadApi.md#list_project_scratch_files) | **GET** /project/{proj_key}/scratch/files | List Project Scratch Files +[**list_project_scratch_files_paginated**](UploadApi.md#list_project_scratch_files_paginated) | **GET** /project/{proj_key}/scratch/files_paginated | List Project Scratch Files Paginated + + +# **create_project_scratch_file** +> TemporaryUploadFileResult create_project_scratch_file(filename, proj_key) + +Create Project Scratch File + +Create file pointers for temporary storage. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.temporary_upload_file_result import TemporaryUploadFileResult +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.UploadApi(api_client) + filename = 'filename_example' # str | + proj_key = 'proj_key_example' # str | + + try: + # Create Project Scratch File + api_response = api_instance.create_project_scratch_file(filename, proj_key) + print("The response of UploadApi->create_project_scratch_file:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UploadApi->create_project_scratch_file: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filename** | **str**| | + **proj_key** | **str**| | + +### Return type + +[**TemporaryUploadFileResult**](TemporaryUploadFileResult.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) + +# **list_project_scratch_files** +> List[ProjectScratchFiles] list_project_scratch_files(proj_key, scratch_ids=scratch_ids) + +List Project Scratch Files + +Get temporary files uploaded to a project. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.project_scratch_files import ProjectScratchFiles +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.UploadApi(api_client) + proj_key = 'proj_key_example' # str | + scratch_ids = 'scratch_ids_example' # str | (optional) + + try: + # List Project Scratch Files + api_response = api_instance.list_project_scratch_files(proj_key, scratch_ids=scratch_ids) + print("The response of UploadApi->list_project_scratch_files:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UploadApi->list_project_scratch_files: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + **scratch_ids** | **str**| | [optional] + +### Return type + +[**List[ProjectScratchFiles]**](ProjectScratchFiles.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) + +# **list_project_scratch_files_paginated** +> ProjectScratchFilesPaginated list_project_scratch_files_paginated(proj_key, page=page, items_per_page=items_per_page, search_string=search_string, begin_date=begin_date, end_date=end_date) + +List Project Scratch Files Paginated + +Get paginated list of temporary files uploaded to a project. + +### Example + +* Api Key Authentication (Bearer): + +```python +import deepsearch.cps.apis.public_v2 +from deepsearch.cps.apis.public_v2.models.project_scratch_files_paginated import ProjectScratchFilesPaginated +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.UploadApi(api_client) + proj_key = 'proj_key_example' # str | + page = 56 # int | (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) + + try: + # List Project Scratch Files Paginated + api_response = api_instance.list_project_scratch_files_paginated(proj_key, page=page, items_per_page=items_per_page, search_string=search_string, begin_date=begin_date, end_date=end_date) + print("The response of UploadApi->list_project_scratch_files_paginated:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UploadApi->list_project_scratch_files_paginated: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **proj_key** | **str**| | + **page** | **int**| | [optional] + **items_per_page** | **int**| | [optional] [default to 20] + **search_string** | **str**| | [optional] + **begin_date** | **int**| | [optional] + **end_date** | **int**| | [optional] + +### Return type + +[**ProjectScratchFilesPaginated**](ProjectScratchFilesPaginated.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) + diff --git a/docs/apis/public_v2/Urls.md b/docs/apis/public_v2/Urls.md new file mode 100644 index 00000000..2030c3f5 --- /dev/null +++ b/docs/apis/public_v2/Urls.md @@ -0,0 +1,29 @@ +# Urls + +List of URLs to be printed to PDF, converted and uploaded to the data index. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.urls import Urls + +# TODO update the JSON string below +json = "{}" +# create an instance of Urls from a JSON string +urls_instance = Urls.from_json(json) +# print the JSON string representation of the object +print(Urls.to_json()) + +# convert the object into a dict +urls_dict = urls_instance.to_dict() +# create an instance of Urls from a dict +urls_form_dict = urls.from_dict(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/ValidationError.md b/docs/apis/public_v2/ValidationError.md new file mode 100644 index 00000000..c78cb29b --- /dev/null +++ b/docs/apis/public_v2/ValidationError.md @@ -0,0 +1,31 @@ +# ValidationError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**loc** | [**List[ValidationErrorLocInner]**](ValidationErrorLocInner.md) | | +**msg** | **str** | | +**type** | **str** | | + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.validation_error import ValidationError + +# TODO update the JSON string below +json = "{}" +# create an instance of ValidationError from a JSON string +validation_error_instance = ValidationError.from_json(json) +# print the JSON string representation of the object +print(ValidationError.to_json()) + +# convert the object into a dict +validation_error_dict = validation_error_instance.to_dict() +# create an instance of ValidationError from a dict +validation_error_form_dict = validation_error.from_dict(validation_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ValidationErrorLocInner.md b/docs/apis/public_v2/ValidationErrorLocInner.md new file mode 100644 index 00000000..4631343a --- /dev/null +++ b/docs/apis/public_v2/ValidationErrorLocInner.md @@ -0,0 +1,28 @@ +# ValidationErrorLocInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from deepsearch.cps.apis.public_v2.models.validation_error_loc_inner import ValidationErrorLocInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ValidationErrorLocInner from a JSON string +validation_error_loc_inner_instance = ValidationErrorLocInner.from_json(json) +# print the JSON string representation of the object +print(ValidationErrorLocInner.to_json()) + +# convert the object into a dict +validation_error_loc_inner_dict = validation_error_loc_inner_instance.to_dict() +# create an instance of ValidationErrorLocInner from a dict +validation_error_loc_inner_form_dict = validation_error_loc_inner.from_dict(validation_error_loc_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/apis/public_v2/ViewOf.md b/docs/apis/public_v2/ViewOf.md new file mode 100644 index 00000000..d4a2a986 --- /dev/null +++ b/docs/apis/public_v2/ViewOf.md @@ -0,0 +1,32 @@ +# ViewOf + + +## 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_of import ViewOf + +# TODO update the JSON string below +json = "{}" +# create an instance of ViewOf from a JSON string +view_of_instance = ViewOf.from_json(json) +# print the JSON string representation of the object +print(ViewOf.to_json()) + +# convert the object into a dict +view_of_dict = view_of_instance.to_dict() +# create an instance of ViewOf from a dict +view_of_form_dict = view_of.from_dict(view_of_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tools/swagger-client-generator/README.md b/tools/swagger-client-generator/README.md index 13a6c420..0f46887a 100644 --- a/tools/swagger-client-generator/README.md +++ b/tools/swagger-client-generator/README.md @@ -20,3 +20,17 @@ If you don't want to download the Swagger Specification, and just want to use th ```bash ./tools/swagger-client-generator/generate-client.sh . ``` + +## Podman setup + +For mounting the user folder in Podman, make sure the machine was created with the option `-v $HOME:$HOME`. + +To re-initialize your default podman machine, you can run the following commands + +```sh +podman machine stop podman-machine-default +podman machine rm podman-machine-default + +podman machine init -v $HOME:$HOME +podman machine start +``` diff --git a/tools/swagger-client-generator/generate-client.sh b/tools/swagger-client-generator/generate-client.sh index 1bbe05ae..0ab87af4 100755 --- a/tools/swagger-client-generator/generate-client.sh +++ b/tools/swagger-client-generator/generate-client.sh @@ -8,8 +8,8 @@ rootdir=$curdir/../../ base_path=${1:?"Please specify a base path. For example https://your-host/api/cps"} generator_image="openapitools/openapi-generator-cli:v4.3.1" +generator_image_v2="openapitools/openapi-generator-cli:v7.4.0" -# generator_image="openapitools/openapi-generator-cli:v4.2.3" # generator_image="openapitools/openapi-generator-cli:v5.2.1" function download_swagger { @@ -23,6 +23,7 @@ function download_swagger { if [[ "${base_path}" == http* ]]; then download_swagger "${base_path}/public/v1/swagger.json" "${curdir}/swagger-cps.json" + download_swagger "${base_path}/public/v2/openapi.json" "${curdir}/openapi-ds-v2.json" download_swagger "${base_path}/user/v1/swagger.json" "${curdir}/swagger-user.json" download_swagger "${base_path}/kg/v1/swagger.json" "${curdir}/swagger-cps-kg.json" fi @@ -53,6 +54,17 @@ podman run --rm \ -o /local/.generated/cps-user \ -c /local/tools/swagger-client-generator/openapi-generator-config-user.json +echo "Generating client for DS API v2" + +podman run --rm \ + -v "$(pwd):/local" \ + --userns=keep-id:uid="$(id -u)",gid="$(id -g)" \ + ${generator_image_v2} generate \ + -i "/local/tools/swagger-client-generator/openapi-ds-v2.json" \ + -g python \ + -o /local/.generated/ds-public-v2 \ + -c /local/tools/swagger-client-generator/openapi-generator-config-ds-v2.json + # echo "Generating client for the CPS KG API" # echo "Currently disabled: TODO FIX API Specs" @@ -101,6 +113,7 @@ echo "Merging packages..." # Remove generated API client code rm -rf $rootdir/deepsearch/cps/apis/public || true rm -rf $rootdir/deepsearch/cps/apis/user || true +rm -rf $rootdir/deepsearch/cps/apis/public_v2 || true # rm -rf $rootdir/deepsearch/cps/apis/kg || true mkdir -p $rootdir/deepsearch/cps/apis @@ -108,6 +121,7 @@ touch $rootdir/deepsearch/cps/apis/__init__.py cp -R .generated/cps-public/deepsearch/cps/apis/ $rootdir/deepsearch/cps/apis/ cp -R .generated/cps-user/deepsearch/cps/apis/ $rootdir/deepsearch/cps/apis/ +cp -R .generated/ds-public-v2/deepsearch/cps/apis/ $rootdir/deepsearch/cps/apis/ # cp -R .generated/cps-kg-create/deepsearch/cps/apis/ $rootdir/deepsearch/cps/apis/ # cp -R .generated/cps-kg-query/deepsearch/cps/apis/ $rootdir/deepsearch/cps/apis/ @@ -117,14 +131,17 @@ echo "Copying documentation files..." rm -rf $rootdir/docs/apis/kg || true rm -rf $rootdir/docs/apis/public || true rm -rf $rootdir/docs/apis/user || true +rm -rf $rootdir/docs/apis/public_v2 || true mkdir -p $rootdir/docs/apis/public +mkdir -p $rootdir/docs/apis/public_v2 mkdir -p $rootdir/docs/apis/user mkdir -p $rootdir/docs/apis/kg/query mkdir -p $rootdir/docs/apis/kg/create cp -R .generated/cps-public/docs/* $rootdir/docs/apis/public cp -R .generated/cps-user/docs/* $rootdir/docs/apis/user +cp -R .generated/ds-public-v2/docs/* $rootdir/docs/apis/public_v2 # cp -R .generated/cps-kg-query/docs/* $rootdir/docs/apis/kg/create # cp -R .generated/cps-kg-create/docs/* $rootdir/docs/apis/kg/query diff --git a/tools/swagger-client-generator/openapi-ds-v2.json b/tools/swagger-client-generator/openapi-ds-v2.json new file mode 100644 index 00000000..7556c54a --- /dev/null +++ b/tools/swagger-client-generator/openapi-ds-v2.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"Deep Search (DS) API","description":"API for Deep Search.\n\n**WARNING**: This API is subject to change without warning!","version":"3.0.0"},"servers":[{"url":"/api/cps/public/v2"}],"paths":{"/project/{proj_key}/data_indices":{"get":{"tags":["Data Indices"],"summary":"Get Project Data Indices","description":"Get project data indices.","operationId":"get_project_data_indices","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"},"type":"array","title":"Response Get Project Data Indices"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"post":{"tags":["Data Indices"],"summary":"Create Project Data Index","description":"Create a project data index.","operationId":"create_project_data_index","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexView"},{"$ref":"#/components/schemas/ProjectDataIndexNonView"}],"title":"Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}":{"get":{"tags":["Data Indices"],"summary":"Get Project Data Index","description":"Get project data index.","operationId":"get_project_data_index","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"delete":{"tags":["Data Indices"],"summary":"Delete Project Data Index","description":"Delete a project index data.","operationId":"delete_project_data_index","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Confirmation Token"},"name":"confirmation_token","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"patch":{"tags":["Data Indices"],"summary":"Update Project Data Index","description":"Update a project data index.","operationId":"update_project_data_index","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectDataIndexView"},{"$ref":"#/components/schemas/ProjectDataIndexNonView"}],"title":"Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDataIndexWithStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/delete_token":{"post":{"tags":["Data Indices"],"summary":"Create Project Data Index Delete Token","description":"Get a token used to confirm the deletion of a project data index.","operationId":"create_project_data_index_delete_token","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/actions/upload":{"post":{"tags":["Data Indices Upload"],"summary":"Upload Project Data Index File","description":"Upload a file to a project data index.","operationId":"upload_project_data_index_file","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonUploadRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/actions/ccs_convert_upload":{"post":{"tags":["Data Indices Upload"],"summary":"Ccs Convert Upload File Project Data Index","description":"Convert files via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema).","operationId":"ccs_convert_upload_file_project_data_index","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertDocumentsRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/actions/html_print_convert_upload":{"post":{"tags":["Data Indices Upload"],"summary":"Html Print Convert Upload","description":"Convert a list of HTML pages to PDF, convert them via CCS and upload to a project data index (only for indices with 'deepsearch-doc' schema).","operationId":"html_print_convert_upload","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataIndexUploadFileSource"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment_url/{filename}":{"get":{"tags":["Data Indices Upload"],"summary":"Get Attachment Upload Data","description":"Get url and path to upload an attachment to a project data index.","operationId":"get_attachment_upload_data","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Index Item Id"},"name":"index_item_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Filename"},"name":"filename","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadData"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/data_indices/{index_key}/documents/{index_item_id}/attachment":{"post":{"tags":["Data Indices Upload"],"summary":"Register Attachment","description":"Notify upload completion of an attachment to a project data index.","operationId":"register_attachment","parameters":[{"required":true,"schema":{"type":"string","title":"Index Key"},"name":"index_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Index Item Id"},"name":"index_item_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadRequestBody"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/public/bags":{"get":{"tags":["Knowledge Graphs"],"summary":"List Public Knowledge Graphs","description":"List all public BAGs","operationId":"list_public_knowledge_graphs","parameters":[{"required":false,"schema":{"title":"Term"},"name":"term","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"object"},"type":"array","title":"Response List Public Knowledge Graphs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/backend/project/{proj_key}/bags":{"get":{"tags":["Knowledge Graphs"],"summary":"Backend List Project Kgs","description":"List all bags in the project, backend-aware","operationId":"backend_list_project_kgs","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"title":"Term"},"name":"term","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"object"},"type":"array","title":"Response Backend List Project Kgs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"post":{"tags":["Knowledge Graphs"],"summary":"Create Project Knowledge Graph","description":"Create new BAG, backend-aware","operationId":"create_project_knowledge_graph","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Project Knowledge Graph"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/backend/project/{proj_key}/bags/{bag_key}":{"patch":{"tags":["Knowledge Graphs"],"summary":"Update Project Knowledge Graph Metadata","description":"Update the metadata of a Knowledge graph","operationId":"update_project_knowledge_graph_metadata","parameters":[{"required":true,"schema":{"title":"Bag Key"},"name":"bag_key","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Update Project Knowledge Graph Metadata"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/default_values":{"get":{"tags":["Project"],"summary":"Get Project Default Values","description":"List project's default values.","operationId":"get_project_default_values","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultValues"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"post":{"tags":["Project"],"summary":"Update Project Default Values","description":"Update project's default values.","operationId":"update_project_default_values","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultValues"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/integrations/{integration_name}":{"get":{"tags":["Project"],"summary":"Get Project Integration Config","description":"Get the config for a given project integration.","operationId":"get_project_integration_config","parameters":[{"required":true,"schema":{"type":"string","title":"Integration Name"},"name":"integration_name","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Decode Secrets"},"name":"decode_secrets","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"type":"string"},{"type":"object"},{"items":{},"type":"array"},{}],"title":"Response Get Project Integration Config"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"post":{"tags":["Project"],"summary":"Update Project Integration Config","description":"Update the config for a given project integration.","operationId":"update_project_integration_config","parameters":[{"required":true,"schema":{"type":"string","title":"Integration Name"},"name":"integration_name","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Config"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]},"delete":{"tags":["Project"],"summary":"Delete Project Integration Config","description":"Delete the config for a given project integration.","operationId":"delete_project_integration_config","parameters":[{"required":true,"schema":{"type":"string","title":"Integration Name"},"name":"integration_name","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/packages":{"post":{"tags":["Project"],"summary":"Provision Project Packages","description":"Install packages on a project.","operationId":"provision_project_packages","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPackageInstalationManifest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskContext"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/semantic/ingest":{"post":{"tags":["Semantic"],"summary":"Ingest","description":"Ingest documents and collections for RAG","operationId":"ingest","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SemanticIngestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CpsTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/info":{"get":{"tags":["System"],"summary":"Get System Information","description":"Get system info.","operationId":"get_system_information","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemInfo"}}}}}}},"/system/modules/configuration":{"get":{"tags":["System"],"summary":"Get System Modules Configuration","description":"Get modules configuration.","operationId":"get_system_modules_configuration","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModulesConfig"}}}}}}},"/system/modules/tasks":{"get":{"tags":["System"],"summary":"Get System Modules Tasks","description":"Get modules configuration.","operationId":"get_system_modules_tasks","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get System Modules Tasks"}}}}}}},"/system/kgs":{"get":{"tags":["System"],"summary":"List System Knowledge Graphs","description":"List all Knowledge Graphs in the system.","operationId":"list_system_knowledge_graphs","parameters":[{"required":false,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"query"},{"required":false,"schema":{"type":"string","title":"Term"},"name":"term","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{},"type":"array","title":"Response List System Knowledge Graphs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_all_kgs":{"get":{"tags":["System"],"summary":"System Get All Kgs Admin","description":"Get all kgs (only bag_key) for admin use.","operationId":"system_get_all_kgs_admin","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{},"type":"array","title":"Response System Get All Kgs Admin"}}}}},"security":[{"Bearer":[]}]}},"/system/packages":{"get":{"tags":["System"],"summary":"List Packages","description":"Get packages available in this CPS installation for installing in a project.","operationId":"list_packages","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CPSPackage"},"type":"array","title":"Response List Packages"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_all_dcs":{"get":{"tags":["System"],"summary":"System Get All Dcs Admin","description":"Get all data catalogs (only dc_key) for admin use.","operationId":"system_get_all_dcs_admin","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response System Get All Dcs Admin"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/list_all_flavours":{"get":{"tags":["System Flavours"],"summary":"List All Flavours","description":"Get all KG flavours storage on db.","operationId":"list_all_flavours","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/BagFlavourFullData"},"type":"array","title":"Response List All Flavours"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_flavour/{flavour_name}":{"get":{"tags":["System Flavours"],"summary":"Get Flavour","description":"Get flavour from db.","operationId":"get_flavour","parameters":[{"required":true,"schema":{"type":"string","title":"Flavour Name"},"name":"flavour_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BagFlavourFullData"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/save_flavour":{"put":{"tags":["System Flavours"],"summary":"Save Flavour","description":"Save flavour on db.","operationId":"save_flavour","parameters":[{"required":true,"schema":{"type":"boolean","title":"New Flavour"},"name":"new_flavour","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BagFlavourFullData"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/delete_flavour/{flavour_name}":{"delete":{"tags":["System Flavours"],"summary":"Delete Flavour","description":"Delete flavour from db.","operationId":"delete_flavour","parameters":[{"required":true,"schema":{"type":"string","title":"Flavour Name"},"name":"flavour_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/list_projects_flavours":{"get":{"tags":["System Flavours"],"summary":"List Projects Flavours","description":"Get all projects and their flavours.","operationId":"list_projects_flavours","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectsFlavours"},"type":"array","title":"Response List Projects Flavours"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/save_project_flavours":{"put":{"tags":["System Flavours"],"summary":"Save Project Flavours","description":"Save project flavours assignment on db.","operationId":"save_project_flavours","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectsFlavours"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_project_flavours/{proj_key}":{"get":{"tags":["System Flavours"],"summary":"List Flavours By Project","description":"Get project assignment flavours.","operationId":"list_flavours_by_project","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProjectFlavours"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/kg_storage_summary/{kg_key}":{"get":{"tags":["System Summary"],"summary":"System Get Kg Storage Summary Async","description":"Get knowledge graph storage summary.","operationId":"system_get_kg_storage_summary_async","parameters":[{"required":true,"schema":{"type":"string","title":"Kg Key"},"name":"kg_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSummaryTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/dc_storage_summary/{dc_key}":{"get":{"tags":["System Summary"],"summary":"System Get Dc Storage Summary Async","description":"Get data catalog storage summary.","operationId":"system_get_dc_storage_summary_async","parameters":[{"required":true,"schema":{"type":"string","title":"Dc Key"},"name":"dc_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSummaryTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/summary":{"get":{"tags":["System Summary"],"summary":"System Get Cps Summary","description":"Get cps summary data.","operationId":"system_get_cps_summary","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CPSSummary"},"type":"array","title":"Response System Get Cps Summary"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_flavours_default_quota":{"get":{"tags":["System Quotas"],"summary":"Get Flavours Default Quotas","description":"Get flavours default values.","operationId":"get_flavours_default_quotas","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlavoursDefaultQuota"},"type":"array","title":"Response Get Flavours Default Quotas"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/save_flavours_default_quota":{"put":{"tags":["System Quotas"],"summary":"Save Flavours Default Quotas","description":"Save flavours default quota.","operationId":"save_flavours_default_quotas","requestBody":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlavoursDefaultQuota"},"type":"array","title":"Flavours"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlavoursDefaultQuota"},"type":"array","title":"Response Save Flavours Default Quotas"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_projects_flavours_quota":{"get":{"tags":["System Quotas"],"summary":"Get Projects Flavours Quota","description":"Get projects flavours quotas.","operationId":"get_projects_flavours_quota","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectFlavoursQuota"},"type":"array","title":"Response Get Projects Flavours Quota"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/save_project_flavours_quota":{"put":{"tags":["System Quotas"],"summary":"Save Project Flavours Quota","description":"Save project flavours quota.","operationId":"save_project_flavours_quota","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectFlavoursQuota"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_project_flavours_quota/{proj_key}":{"get":{"tags":["System Quotas"],"summary":"Get Project Flavours Quota","description":"Get project flavours quota.","operationId":"get_project_flavours_quota","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlavoursQuota"},"type":"array","title":"Response Get Project Flavours Quota"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/system/admin/get_project_flavour_total_kgs/{proj_key}/{flavour_name}":{"get":{"tags":["System Quotas"],"summary":"Get Project Flavour Total Kgs","description":"Gets kg total number by proj_key and flavour_key.","operationId":"get_project_flavour_total_kgs","parameters":[{"required":true,"schema":{"type":"string","title":"Flavour Name"},"name":"flavour_name","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectFlavourTotalKgs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/celery_tasks/{task_id}":{"get":{"tags":["Tasks"],"summary":"Get Project Celery Task","description":"Get a celery task for a project.","operationId":"get_project_celery_task","parameters":[{"required":true,"schema":{"type":"string","title":"Task Id"},"name":"task_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/tasks":{"get":{"tags":["Tasks"],"summary":"List Project Tasks","description":"List tasks for a project.","operationId":"list_project_tasks","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"string","title":"Task Type"},"name":"task_type","in":"query"},{"required":false,"schema":{"type":"integer","title":"Skip","default":0},"name":"skip","in":"query"},{"required":false,"schema":{"type":"integer","title":"Limit","default":50},"name":"limit","in":"query"},{"required":false,"schema":{"type":"string","title":"Sort By","default":"_id"},"name":"sort_by","in":"query"},{"required":false,"schema":{"type":"string","enum":["asc","desc"],"title":"Sort Order","default":"desc"},"name":"sort_order","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TaskContext"},"type":"array","title":"Response List Project Tasks"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/tasks/{task_id}":{"get":{"tags":["Tasks"],"summary":"Get Project Task","description":"Get a task for a project.","operationId":"get_project_task","parameters":[{"required":true,"schema":{"type":"string","title":"Task Id"},"name":"task_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskContext"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/tasks/{task_id}/actions/abort":{"post":{"tags":["Tasks"],"summary":"Abort Project Task","description":"Abort a task.","operationId":"abort_project_task","parameters":[{"required":true,"schema":{"type":"string","title":"Task Id"},"name":"task_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/scratch/files":{"get":{"tags":["Upload"],"summary":"List Project Scratch Files","description":"Get temporary files uploaded to a project.","operationId":"list_project_scratch_files","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"string","title":"Scratch Ids"},"name":"scratch_ids","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectScratchFiles"},"type":"array","title":"Response List Project Scratch Files"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/scratch/files_paginated":{"get":{"tags":["Upload"],"summary":"List Project Scratch Files Paginated","description":"Get paginated list of temporary files uploaded to a project.","operationId":"list_project_scratch_files_paginated","parameters":[{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"},{"required":false,"schema":{"type":"integer","title":"Page"},"name":"page","in":"query"},{"required":false,"schema":{"type":"integer","title":"Items Per Page","default":20},"name":"items_per_page","in":"query"},{"required":false,"schema":{"type":"string","title":"Search String"},"name":"search_string","in":"query"},{"required":false,"schema":{"type":"integer","title":"Begin Date"},"name":"begin_date","in":"query"},{"required":false,"schema":{"type":"integer","title":"End Date"},"name":"end_date","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectScratchFilesPaginated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}},"/project/{proj_key}/scratch/files/upload/{filename}":{"post":{"tags":["Upload"],"summary":"Create Project Scratch File","description":"Create file pointers for temporary storage.","operationId":"create_project_scratch_file","parameters":[{"required":true,"schema":{"type":"string","title":"Filename"},"name":"filename","in":"path"},{"required":true,"schema":{"type":"string","title":"Proj Key"},"name":"proj_key","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemporaryUploadFileResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Bearer":[]}]}}},"components":{"schemas":{"AssembleMode":{"properties":{"page_elements":{"items":{"type":"string","enum":["H","M","None"]},"type":"array","title":"Page Elements"},"tables":{"items":{"type":"string","enum":["H","M","None"]},"type":"array","title":"Tables"}},"type":"object","required":["page_elements","tables"],"title":"AssembleMode"},"AssembleSettings":{"properties":{"mode":{"$ref":"#/components/schemas/AssembleMode"},"include_incomplete_documents":{"type":"boolean","title":"Include Incomplete Documents"}},"type":"object","required":["mode","include_incomplete_documents"],"title":"AssembleSettings"},"AttachmentUploadData":{"properties":{"attachment_path":{"type":"string","title":"Attachment Path"},"upload_data":{"type":"string","title":"Upload Data"}},"type":"object","required":["attachment_path","upload_data"],"title":"AttachmentUploadData"},"AttachmentUploadRequestBody":{"properties":{"attachment_path":{"type":"string","title":"Attachment Path"},"attachment_key":{"type":"string","title":"Attachment Key","default":"usr_attachments"}},"type":"object","required":["attachment_path"],"title":"AttachmentUploadRequestBody"},"BagFlavourFullData":{"properties":{"backend":{"type":"string","title":"Backend"},"config":{"type":"object","title":"Config"},"default_quota":{"type":"integer","title":"Default Quota","default":0},"description":{"type":"string","title":"Description"},"display_name":{"type":"string","title":"Display Name"},"is_from_deployment":{"type":"boolean","title":"Is From Deployment","default":true},"name":{"type":"string","title":"Name"},"order":{"type":"integer","title":"Order","default":0},"project_specific":{"type":"boolean","title":"Project Specific"}},"type":"object","required":["backend","config","description","display_name","name","project_specific"],"title":"BagFlavourFullData"},"CCSProject":{"properties":{"name":{"type":"string","title":"Name"},"proj_key":{"type":"string","title":"Proj Key"},"collection_name":{"type":"string","title":"Collection Name"}},"type":"object","required":["name","proj_key","collection_name"],"title":"CCSProject"},"CPSPackage":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"package_id":{"type":"string","title":"Package Id"},"type":{"type":"string","enum":["model","dictionary","knowledge_graph","data_catalog","data_flow","bundle"],"title":"Type"}},"type":"object","required":["name","description","package_id","type"],"title":"CPSPackage"},"CPSSummary":{"properties":{"availCpuSlots":{"type":"integer","title":"Availcpuslots"},"availMemSlots":{"type":"integer","title":"Availmemslots"},"availSlots":{"type":"integer","title":"Availslots"},"name":{"type":"string","title":"Name"},"numNodes":{"type":"integer","title":"Numnodes"},"numberKgs":{"type":"integer","title":"Numberkgs"},"runningKgs":{"type":"integer","title":"Runningkgs"},"workersPool":{"type":"string","title":"Workerspool"}},"type":"object","required":["availCpuSlots","availMemSlots","availSlots","name","numNodes","numberKgs","runningKgs","workersPool"],"title":"CPSSummary"},"CollectionMetadataSettings":{"properties":{"description":{"type":"string","title":"Description"},"display_name":{"type":"string","title":"Display Name"},"license":{"type":"string","title":"License"},"source":{"type":"string","title":"Source"},"version":{"type":"string","title":"Version"}},"type":"object","title":"CollectionMetadataSettings"},"ConvertDocumentsRequestBody":{"properties":{"file_url":{"items":{"type":"string"},"type":"array","title":"File Url","description":"List of File's URL to be converted and uploaded to the data index."},"s3_source":{"allOf":[{"$ref":"#/components/schemas/S3DocumentSource"}],"title":"S3 Source","description":"Coordinates to object store to get files to convert. Can specify which files with object keys."},"scratch_files_id":{"items":{"type":"string"},"type":"array","title":"Scratch Files Id","description":"List of CCS's scratch files id to be converted and uploaded to the data index."},"conversion_settings":{"allOf":[{"$ref":"#/components/schemas/PartialDirectConversionParameters"}],"title":"Conversion Settings","description":"Specify the conversion settings to use."}},"type":"object","title":"ConvertDocumentsRequestBody"},"CpsTask":{"properties":{"task_id":{"type":"string","title":"Task Id"},"task_type":{"type":"string","title":"Task Type"},"task_status":{"type":"string","title":"Task Status"}},"type":"object","required":["task_id","task_type","task_status"],"title":"CpsTask"},"DataFlow":{"properties":{"df_tpl_key":{"type":"string","title":"Df Tpl Key"},"name":{"type":"string","title":"Name"}},"type":"object","required":["df_tpl_key","name"],"title":"DataFlow"},"DataIndexUploadFileSource":{"properties":{"urls":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Urls","description":"List of URLs to be printed to PDF, converted and uploaded to the data index."},"conversion_settings":{"allOf":[{"$ref":"#/components/schemas/PartialDirectConversionParameters"}],"title":"Conversion Settings","description":"Specify the conversion settings to use."}},"type":"object","required":["urls"],"title":"DataIndexUploadFileSource"},"DefaultValues":{"properties":{"ccs_project":{"$ref":"#/components/schemas/CCSProject"},"dataflow":{"$ref":"#/components/schemas/DataFlow"}},"type":"object","required":["ccs_project"],"title":"DefaultValues"},"Deployment":{"properties":{"name":{"type":"string","title":"Name"},"disclaimer":{"type":"string","title":"Disclaimer"},"should_show_warning":{"type":"boolean","title":"Should Show Warning"},"disable_kg_actions":{"type":"boolean","title":"Disable Kg Actions"},"linked_ccs_api":{"type":"object","title":"Linked Ccs Api"}},"type":"object","required":["name","disclaimer","should_show_warning","disable_kg_actions","linked_ccs_api"],"title":"Deployment"},"DirectModelConfig":{"properties":{"type":{"type":"string","title":"Type"},"config":{"type":"object","title":"Config"}},"type":"object","required":["type","config"],"title":"DirectModelConfig","description":"Direct configuration of a model."},"ElasticIndexPropertyObject":{"properties":{"type":{"type":"string","title":"Type"},"enabled":{"type":"boolean","title":"Enabled"},"ignore_above":{"type":"integer","title":"Ignore Above"}},"type":"object","required":["type"],"title":"ElasticIndexPropertyObject"},"ElasticIndexPropertyPrimitive":{"properties":{"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ElasticIndexPropertyPrimitive"},{"$ref":"#/components/schemas/ElasticIndexPropertyObject"}]},"type":"object","title":"Properties"}},"type":"object","required":["properties"],"title":"ElasticIndexPropertyPrimitive"},"ElasticIndexSearchQueryOptions":{"properties":{"_source":{"items":{"type":"string"},"type":"array","title":" Source"},"from_":{"type":"integer","title":"From "},"size":{"type":"integer","title":"Size"},"query":{"type":"object","title":"Query"},"aggs":{"type":"object","title":"Aggs"},"sort":{"items":{"type":"object"},"type":"array","title":"Sort"}},"type":"object","title":"ElasticIndexSearchQueryOptions"},"ElasticIndexSource":{"properties":{"index_key":{"type":"string","title":"Index Key"},"elastic_id":{"type":"string","title":"Elastic Id"}},"type":"object","required":["index_key","elastic_id"],"title":"ElasticIndexSource"},"ElasticInstanceDataIndex":{"properties":{"index_key":{"type":"string","title":"Index Key"},"query_options":{"$ref":"#/components/schemas/ElasticIndexSearchQueryOptions"},"elastic_id":{"type":"string","title":"Elastic Id"}},"type":"object","required":["index_key","query_options","elastic_id"],"title":"ElasticInstanceDataIndex"},"ElasticMetadata":{"properties":{"aliases":{"items":{"type":"string"},"type":"array","title":"Aliases"},"created":{"type":"string","title":"Created"},"description":{"type":"string","title":"Description"},"display_name":{"type":"string","title":"Display Name"},"source":{"type":"string","title":"Source"},"storage":{"type":"string","title":"Storage"},"version":{"type":"string","title":"Version"},"type":{"type":"string","title":"Type"},"domain":{"items":{"type":"string"},"type":"array","title":"Domain"},"classification":{"items":{"type":"string"},"type":"array","title":"Classification"}},"type":"object","required":["classification"],"title":"ElasticMetadata"},"Flavour":{"properties":{"name":{"type":"string","title":"Name"},"display_name":{"type":"string","title":"Display Name"}},"type":"object","required":["name"],"title":"Flavour"},"FlavoursDefaultQuota":{"properties":{"display_name":{"type":"string","title":"Display Name"},"name":{"type":"string","title":"Name"},"default_quota":{"type":"integer","title":"Default Quota"}},"type":"object","required":["display_name","name","default_quota"],"title":"FlavoursDefaultQuota"},"FlavoursQuota":{"properties":{"display_name":{"type":"string","title":"Display Name"},"name":{"type":"string","title":"Name"},"quota":{"type":"integer","title":"Quota"}},"type":"object","required":["display_name","name","quota"],"title":"FlavoursQuota"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JsonUploadRequestBody":{"properties":{"file_url":{"type":"string","title":"File Url"}},"type":"object","required":["file_url"],"title":"JsonUploadRequestBody"},"ListProjectFlavours":{"properties":{"flavours":{"items":{"$ref":"#/components/schemas/BagFlavourFullData"},"type":"array","title":"Flavours"},"proj_key":{"type":"string","title":"Proj Key"}},"type":"object","required":["flavours","proj_key"],"title":"ListProjectFlavours"},"ModelPipelineSettings":{"properties":{"clusters":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Clusters"},"page":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Page"},"tables":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Tables"},"normalization":{"items":{"anyOf":[{"$ref":"#/components/schemas/ReferenceToModel"},{"$ref":"#/components/schemas/DirectModelConfig"}]},"type":"array","title":"Normalization"}},"type":"object","required":["clusters","page","tables","normalization"],"title":"ModelPipelineSettings"},"ModulesConfig":{"properties":{"df_template_variables":{"items":{},"type":"array","title":"Df Template Variables"},"linked_ccs_instances":{"items":{},"type":"array","title":"Linked Ccs Instances"},"linked_elastic_instances":{"items":{},"type":"array","title":"Linked Elastic Instances"}},"type":"object","required":["df_template_variables","linked_ccs_instances","linked_elastic_instances"],"title":"ModulesConfig"},"OcrSettings":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"backend":{"type":"string","title":"Backend"},"backend_settings":{"type":"object","title":"Backend Settings"},"merge_mode":{"type":"string","title":"Merge Mode"}},"type":"object","title":"OcrSettings"},"Package":{"properties":{"overrides":{"type":"object","title":"Overrides"},"package_id":{"type":"string","title":"Package Id"}},"type":"object","required":["overrides","package_id"],"title":"Package"},"PartialDirectConversionParameters":{"properties":{"type":{"type":"string","enum":["direct"],"title":"Type","default":"direct"},"ocr":{"$ref":"#/components/schemas/OcrSettings"},"assemble":{"$ref":"#/components/schemas/AssembleSettings"},"metadata":{"$ref":"#/components/schemas/CollectionMetadataSettings"},"page_labels":{"additionalProperties":{"type":"object"},"type":"object","title":"Page Labels"},"model_pipeline":{"$ref":"#/components/schemas/ModelPipelineSettings"}},"type":"object","title":"PartialDirectConversionParameters","description":"Specify conversion settings (OCR, Assemble, ML Models) directly.\n\nFields left null are set to platform defaults."},"ProjectDataIndexNonView":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"schema_key":{"type":"string","enum":["deepsearch-doc","deepsearch-db","generic"],"title":"Schema Key","default":"generic"}},"type":"object","required":["name"],"title":"ProjectDataIndexNonView"},"ProjectDataIndexSource":{"properties":{"index_key":{"type":"string","title":"Index Key"},"proj_key":{"type":"string","title":"Proj Key"}},"type":"object","required":["index_key","proj_key"],"title":"ProjectDataIndexSource"},"ProjectDataIndexView":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"view_of":{"anyOf":[{"$ref":"#/components/schemas/ProjectSourceDataIndex"},{"$ref":"#/components/schemas/ElasticInstanceDataIndex"}],"title":"View Of"}},"type":"object","required":["name","view_of"],"title":"ProjectDataIndexView"},"ProjectDataIndexWithStatus":{"properties":{"source":{"anyOf":[{"$ref":"#/components/schemas/ElasticIndexSource"},{"$ref":"#/components/schemas/ProjectDataIndexSource"}],"title":"Source"},"name":{"type":"string","title":"Name"},"documents":{"type":"integer","title":"Documents"},"health":{"type":"string","title":"Health"},"status":{"type":"string","title":"Status"},"creation_date":{"type":"string","title":"Creation Date"},"metadata":{"$ref":"#/components/schemas/ElasticMetadata"},"description":{"type":"string","title":"Description"},"schema_key":{"type":"string","enum":["deepsearch-doc","deepsearch-db","generic"],"title":"Schema Key"},"type":{"type":"string","title":"Type"},"view_of":{"anyOf":[{"$ref":"#/components/schemas/ProjectSourceDataIndex"},{"$ref":"#/components/schemas/ElasticInstanceDataIndex"}],"title":"View Of"},"record_properties":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ElasticIndexPropertyPrimitive"},{"$ref":"#/components/schemas/ElasticIndexPropertyObject"}]},"type":"object","title":"Record Properties"}},"type":"object","required":["source","name","documents","health","status","creation_date","description","type"],"title":"ProjectDataIndexWithStatus"},"ProjectFlavourTotalKgs":{"properties":{"proj_key":{"type":"string","title":"Proj Key"},"flavour_name":{"type":"string","title":"Flavour Name"},"total_kgs":{"type":"integer","title":"Total Kgs"}},"type":"object","required":["proj_key","flavour_name","total_kgs"],"title":"ProjectFlavourTotalKgs"},"ProjectFlavoursQuota":{"properties":{"name":{"type":"string","title":"Name"},"proj_key":{"type":"string","title":"Proj Key"},"quotas":{"items":{"$ref":"#/components/schemas/FlavoursQuota"},"type":"array","title":"Quotas"}},"type":"object","required":["name","proj_key","quotas"],"title":"ProjectFlavoursQuota"},"ProjectPackageInstalationManifest":{"properties":{"packages":{"items":{"$ref":"#/components/schemas/Package"},"type":"array","title":"Packages"}},"type":"object","required":["packages"],"title":"ProjectPackageInstalationManifest"},"ProjectScratchFiles":{"properties":{"id":{"type":"string","title":"Id"},"proj_key":{"type":"string","title":"Proj Key"},"user_key":{"type":"string","title":"User Key"},"filename":{"type":"string","title":"Filename"},"timestamp":{"type":"string","title":"Timestamp"},"url":{"type":"string","title":"Url"}},"type":"object","required":["id","proj_key","user_key","filename","timestamp","url"],"title":"ProjectScratchFiles"},"ProjectScratchFilesPaginated":{"properties":{"files":{"items":{"$ref":"#/components/schemas/ProjectScratchFiles"},"type":"array","title":"Files"},"count":{"type":"integer","title":"Count"},"page":{"type":"integer","title":"Page"},"items_per_page":{"type":"integer","title":"Items Per Page"}},"type":"object","required":["files","count","page","items_per_page"],"title":"ProjectScratchFilesPaginated"},"ProjectSourceDataIndex":{"properties":{"index_key":{"type":"string","title":"Index Key"},"query_options":{"$ref":"#/components/schemas/ElasticIndexSearchQueryOptions"},"proj_key":{"type":"string","title":"Proj Key"}},"type":"object","required":["index_key","query_options","proj_key"],"title":"ProjectSourceDataIndex"},"ProjectsFlavours":{"properties":{"proj_key":{"type":"string","title":"Proj Key"},"name":{"type":"string","title":"Name"},"flavours":{"items":{"$ref":"#/components/schemas/Flavour"},"type":"array","title":"Flavours"}},"type":"object","required":["proj_key","name","flavours"],"title":"ProjectsFlavours"},"ReferenceToModel":{"properties":{"model_config_key":{"type":"string","title":"Model Config Key"},"proj_key":{"type":"string","title":"Proj Key"},"name":{"type":"string","title":"Name","default":""},"description":{"type":"string","title":"Description","default":""}},"type":"object","required":["model_config_key","proj_key"],"title":"ReferenceToModel","description":"Reference to a model configuration."},"S3Coordinates":{"properties":{"host":{"type":"string","title":"Host"},"port":{"type":"integer","title":"Port"},"ssl":{"type":"boolean","title":"Ssl"},"verifySSL":{"type":"boolean","title":"Verifyssl"},"access-key":{"type":"string","title":"Access-Key"},"secret-key":{"type":"string","title":"Secret-Key"},"bucket":{"type":"string","title":"Bucket"},"key_prefix":{"type":"string","title":"Key Prefix"},"location":{"type":"string","title":"Location"}},"type":"object","required":["host","port","ssl","verifySSL","access-key","secret-key","bucket","location"],"title":"S3Coordinates"},"S3DocumentSource":{"properties":{"coordinates":{"$ref":"#/components/schemas/S3Coordinates"},"object_keys":{"items":{"type":"string"},"type":"array","title":"Object Keys","description":"List of s3 object keys to retrieve from bucket to be converted and uploaded to the data index."}},"type":"object","required":["coordinates"],"title":"S3DocumentSource","description":"Specifies documents to import from an S3 bucket"},"SemanticIngestRequest":{"properties":{"source":{"anyOf":[{"$ref":"#/components/schemas/SemanticIngestSourceUrl"},{"$ref":"#/components/schemas/SemanticIngestSourcePublicDataDocument"},{"$ref":"#/components/schemas/SemanticIngestSourcePrivateDataDocument"},{"$ref":"#/components/schemas/SemanticIngestSourcePrivateDataCollection"}],"title":"Source"}},"type":"object","required":["source"],"title":"SemanticIngestRequest"},"SemanticIngestSourcePrivateDataCollection":{"properties":{"type":{"type":"string","enum":["private_data_collection"],"title":"Type"},"proj_key":{"type":"string","title":"Proj Key"},"index_key":{"type":"string","title":"Index Key"}},"type":"object","required":["type","proj_key","index_key"],"title":"SemanticIngestSourcePrivateDataCollection"},"SemanticIngestSourcePrivateDataDocument":{"properties":{"type":{"type":"string","enum":["private_data_document"],"title":"Type"},"proj_key":{"type":"string","title":"Proj Key"},"index_key":{"type":"string","title":"Index Key"},"document_hash":{"type":"string","title":"Document Hash"}},"type":"object","required":["type","proj_key","index_key","document_hash"],"title":"SemanticIngestSourcePrivateDataDocument"},"SemanticIngestSourcePublicDataDocument":{"properties":{"type":{"type":"string","enum":["public_data_document"],"title":"Type"},"elastic_id":{"type":"string","title":"Elastic Id"},"index_key":{"type":"string","title":"Index Key"},"document_hash":{"type":"string","title":"Document Hash"}},"type":"object","required":["type","elastic_id","index_key","document_hash"],"title":"SemanticIngestSourcePublicDataDocument"},"SemanticIngestSourceUrl":{"properties":{"type":{"type":"string","enum":["url"],"title":"Type"},"url":{"type":"string","title":"Url"}},"type":"object","required":["type","url"],"title":"SemanticIngestSourceUrl"},"StorageSummaryTask":{"properties":{"dc_key":{"type":"string","title":"Dc Key"},"kg_key":{"type":"string","title":"Kg Key"},"kind":{"type":"string","enum":["project_task","celery_task"],"title":"Kind"},"proj_key":{"type":"string","title":"Proj Key"},"task_id":{"type":"string","title":"Task Id"}},"type":"object","required":["kind","proj_key","task_id"],"title":"StorageSummaryTask"},"SystemInfo":{"properties":{"notifications":{"items":{},"type":"array","title":"Notifications"},"default_project":{"type":"object","title":"Default Project"},"deployment":{"$ref":"#/components/schemas/Deployment"},"toolkit":{"type":"object","title":"Toolkit"},"allow_non_admins_to_make_resources_public":{"type":"boolean","title":"Allow Non Admins To Make Resources Public"},"api":{"type":"object","title":"Api"}},"type":"object","required":["notifications","default_project","deployment","toolkit","allow_non_admins_to_make_resources_public","api"],"title":"SystemInfo"},"TaskContext":{"properties":{"proj_key":{"type":"string","title":"Proj Key"},"user_key":{"type":"string","title":"User Key"},"task_type":{"type":"string","title":"Task Type"},"task_id":{"type":"string","title":"Task Id"},"task_status":{"type":"string","title":"Task Status"},"execution_mode":{"type":"string","title":"Execution Mode"},"progress":{"type":"number","title":"Progress"},"meta":{"type":"object","title":"Meta"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"completed_at":{"type":"string","format":"date-time","title":"Completed At"},"start_count":{"type":"integer","title":"Start Count"},"error_reason":{"type":"string","title":"Error Reason"},"related_tasks":{"items":{},"type":"array","title":"Related Tasks"}},"type":"object","required":["proj_key","user_key","task_type","task_id","task_status","execution_mode","progress","meta","created_at"],"title":"TaskContext"},"TaskResult":{"properties":{"result":{"title":"Result"},"task_id":{"type":"string","title":"Task Id"},"task_status":{"type":"string","title":"Task Status"}},"type":"object","required":["task_id","task_status"],"title":"TaskResult"},"TemporaryUploadFileResult":{"properties":{"id":{"type":"string","title":"Id"},"upload":{"$ref":"#/components/schemas/TemporaryUrlFields"},"download":{"$ref":"#/components/schemas/TemporaryUrl"},"metadata":{"$ref":"#/components/schemas/TemporaryUrl"},"upload_private":{"$ref":"#/components/schemas/TemporaryUrlFields"},"download_private":{"$ref":"#/components/schemas/TemporaryUrl"},"metadata_private":{"$ref":"#/components/schemas/TemporaryUrl"}},"type":"object","required":["id","upload","download","metadata","upload_private","download_private","metadata_private"],"title":"TemporaryUploadFileResult"},"TemporaryUrl":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"TemporaryUrl"},"TemporaryUrlFields":{"properties":{"url":{"type":"string","title":"Url"},"fields":{"type":"object","title":"Fields"}},"type":"object","required":["url","fields"],"title":"TemporaryUrlFields"},"TokenResponse":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"TokenResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"Bearer":{"type":"apiKey","description":"Provide a Bearer token in the `Authorization` header","in":"header","name":"Authorization"}}}} \ No newline at end of file diff --git a/tools/swagger-client-generator/openapi-generator-config-ds-v2.json b/tools/swagger-client-generator/openapi-generator-config-ds-v2.json new file mode 100644 index 00000000..72a9f338 --- /dev/null +++ b/tools/swagger-client-generator/openapi-generator-config-ds-v2.json @@ -0,0 +1,5 @@ +{ + "packageName": "deepsearch.cps.apis.public_v2", + "projectName": "ds-public", + "packageVersion": "2.0.0" +} \ No newline at end of file