qanswer_sdk 3.1213.0__py3-none-any.whl → 3.1244.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qanswer_sdk/__init__.py +66 -43
- qanswer_sdk/api/__init__.py +7 -4
- qanswer_sdk/api/admin_api.py +590 -7695
- qanswer_sdk/api/ai_assistant_access_rights_api.py +72 -73
- qanswer_sdk/api/ai_assistant_api.py +567 -46
- qanswer_sdk/api/branding_api.py +4578 -0
- qanswer_sdk/api/chatbot_api.py +72 -87
- qanswer_sdk/api/{tag_api.py → connector_imap_connector_api.py} +415 -997
- qanswer_sdk/api/connector_rdf_api.py +30 -31
- qanswer_sdk/api/connectors_api.py +183 -166
- qanswer_sdk/api/connectors_data_api.py +345 -1
- qanswer_sdk/api/dataset_config_api.py +0 -245
- qanswer_sdk/api/llm_api.py +30 -30
- qanswer_sdk/api/payment_api.py +17 -16
- qanswer_sdk/api/speech_to_text_api.py +2 -2
- qanswer_sdk/api/task_chat_api.py +8 -7
- qanswer_sdk/api/task_rdf_linker_api.py +35 -36
- qanswer_sdk/api/task_rdf_sparql_endpoint_api.py +16 -16
- qanswer_sdk/api/task_report_copilot_api.py +895 -281
- qanswer_sdk/api/task_search_api.py +8 -7
- qanswer_sdk/api/tool_embedder_api.py +4040 -0
- qanswer_sdk/api/{user_api.py → tool_llm_api.py} +735 -2749
- qanswer_sdk/api/unit_organizations_api.py +4547 -0
- qanswer_sdk/api/unit_teams_api.py +3906 -0
- qanswer_sdk/api/{organizations_teams_api.py → unit_user_api.py} +1345 -1394
- qanswer_sdk/api_client.py +1 -1
- qanswer_sdk/configuration.py +1 -1
- qanswer_sdk/models/__init__.py +58 -38
- qanswer_sdk/models/aggregation.py +2 -2
- qanswer_sdk/models/ai_assistant_filter_dto.py +105 -0
- qanswer_sdk/models/{user_profile_paginated.py → ai_assistant_list.py} +18 -18
- qanswer_sdk/models/{embedding_model.py → available_aggregation.py} +13 -11
- qanswer_sdk/models/available_connectors_response.py +2 -2
- qanswer_sdk/models/{branding_data.py → branding_app_title.py} +4 -4
- qanswer_sdk/models/{api_response.py → branding_system_message.py} +8 -8
- qanswer_sdk/models/chat_task_settings.py +12 -12
- qanswer_sdk/models/chat_task_update.py +13 -5
- qanswer_sdk/models/chatbot_chat_payload.py +19 -2
- qanswer_sdk/models/chatbot_conversation_model.py +10 -0
- qanswer_sdk/models/chatbot_response.py +22 -2
- qanswer_sdk/models/{user_chatbot_setting_payload.py → chatbot_setting_dto.py} +12 -13
- qanswer_sdk/models/chatbot_setting_request.py +96 -0
- qanswer_sdk/models/{question_completion.py → clip_connector_file_structure.py} +9 -9
- qanswer_sdk/models/clip_connector_structure.py +97 -0
- qanswer_sdk/models/connector_model.py +2 -2
- qanswer_sdk/models/conversation_message.py +4 -12
- qanswer_sdk/models/{cost_summary.py → cost_summary_dto.py} +4 -4
- qanswer_sdk/models/create_connector_request.py +4 -2
- qanswer_sdk/models/create_imap_connector_request.py +105 -0
- qanswer_sdk/models/create_pinecone_connector_request.py +3 -1
- qanswer_sdk/models/create_sharepoint_connector_from_certificate_request.py +3 -1
- qanswer_sdk/models/create_sharepoint_connector_request.py +3 -1
- qanswer_sdk/models/dataset_detail_kg.py +27 -1
- qanswer_sdk/models/dataset_schema.py +4 -2
- qanswer_sdk/models/dataset_update_object.py +3 -1
- qanswer_sdk/models/delete_connector_model.py +2 -2
- qanswer_sdk/models/delete_connectors_response.py +2 -4
- qanswer_sdk/models/{json_nullable_source_metadata.py → duplicate_report_template_response.py} +11 -9
- qanswer_sdk/models/{json_nullable_file_failure_reason.py → email_folder.py} +12 -8
- qanswer_sdk/models/{embedding_endpoint.py → embedder_detailed_dto.py} +16 -8
- qanswer_sdk/models/{tag_payload.py → embedder_dto.py} +11 -7
- qanswer_sdk/models/{pageable_object.py → embedder_list_dto.py} +20 -20
- qanswer_sdk/models/embedding_endpoint_create.py +3 -1
- qanswer_sdk/models/embedding_endpoint_update.py +4 -2
- qanswer_sdk/models/{sort_object.py → entity_description.py} +16 -12
- qanswer_sdk/models/{dataset_description.py → entity_description_dto.py} +9 -7
- qanswer_sdk/models/file_model.py +2 -2
- qanswer_sdk/models/imap_add_payload.py +103 -0
- qanswer_sdk/models/imap_additional_fields.py +101 -0
- qanswer_sdk/models/imap_file_metadata.py +114 -0
- qanswer_sdk/models/imap_search_response.py +113 -0
- qanswer_sdk/models/llm.py +129 -0
- qanswer_sdk/models/llm_consumption.py +118 -0
- qanswer_sdk/models/{pageable.py → llm_context_ranges.py} +14 -13
- qanswer_sdk/models/{llm_cost.py → llm_cost_filter.py} +11 -7
- qanswer_sdk/models/llm_cost_list.py +101 -0
- qanswer_sdk/models/llm_detailed_dto.py +179 -0
- qanswer_sdk/models/{llm_details.py → llm_dto.py} +14 -18
- qanswer_sdk/models/llm_endpoint.py +8 -2
- qanswer_sdk/models/llm_endpoint_read_input.py +173 -0
- qanswer_sdk/models/llm_endpoint_read_output.py +173 -0
- qanswer_sdk/models/llm_filter_dto.py +99 -0
- qanswer_sdk/models/llm_list_detailed_dto.py +101 -0
- qanswer_sdk/models/llm_list_dto.py +101 -0
- qanswer_sdk/models/modify_connector_request.py +5 -11
- qanswer_sdk/models/{o_auth_service.py → o_auth_service_dto.py} +4 -4
- qanswer_sdk/models/organization_admin.py +95 -0
- qanswer_sdk/models/organization_filter_dto.py +97 -0
- qanswer_sdk/models/organization_list_dto.py +101 -0
- qanswer_sdk/models/organization_llm.py +103 -0
- qanswer_sdk/models/{plan.py → plan_dto.py} +4 -4
- qanswer_sdk/models/prompt_token_count_details.py +3 -3
- qanswer_sdk/models/rag_payload.py +4 -4
- qanswer_sdk/models/rag_response.py +4 -2
- qanswer_sdk/models/relation_extraction_task_settings.py +12 -10
- qanswer_sdk/models/relation_extraction_task_update.py +14 -4
- qanswer_sdk/models/report_copilot_slot_task_settings.py +12 -10
- qanswer_sdk/models/report_copilot_slot_task_update.py +13 -3
- qanswer_sdk/models/report_copilot_task_settings.py +12 -10
- qanswer_sdk/models/report_copilot_task_update.py +14 -4
- qanswer_sdk/models/{report_copilot_template.py → report_template.py} +17 -7
- qanswer_sdk/models/{report_copilot_create_payload.py → report_template_create_payload.py} +4 -4
- qanswer_sdk/models/{report_copilot_template_simplified.py → report_template_simplified.py} +11 -7
- qanswer_sdk/models/{report_copilot_export_template_as_docx_payload_simplified.py → report_template_simplified_payload.py} +4 -4
- qanswer_sdk/models/{report_copilot_update_payload.py → report_template_update_payload.py} +15 -9
- qanswer_sdk/models/search_task_settings.py +12 -12
- qanswer_sdk/models/search_task_update.py +13 -3
- qanswer_sdk/models/{set_logo1_request.py → set_logo2_request.py} +4 -4
- qanswer_sdk/models/shared_organization_access.py +7 -3
- qanswer_sdk/models/shared_team_access.py +10 -4
- qanswer_sdk/models/slot.py +5 -1
- qanswer_sdk/models/slot_update.py +5 -1
- qanswer_sdk/models/socket_conversation_message.py +3 -11
- qanswer_sdk/models/socket_file_metadata.py +17 -11
- qanswer_sdk/models/source_metadata.py +109 -0
- qanswer_sdk/models/{tag_qa_list_payload.py → subscription_response.py} +22 -21
- qanswer_sdk/models/{team_with_count.py → team_admin.py} +8 -8
- qanswer_sdk/models/{team_filter.py → team_filter_dto.py} +16 -6
- qanswer_sdk/models/team_list_dto.py +101 -0
- qanswer_sdk/models/{available_endpoints_response.py → template_clip_structure_input.py} +14 -14
- qanswer_sdk/models/{available_embedding_models_response.py → template_clip_structure_output.py} +14 -14
- qanswer_sdk/models/test_imap_connection_payload.py +95 -0
- qanswer_sdk/models/text2_sparql_payload.py +4 -4
- qanswer_sdk/models/text2_sparql_task_settings.py +12 -10
- qanswer_sdk/models/text2_sparql_task_update.py +14 -4
- qanswer_sdk/models/{user_chatbot_setting_response.py → user_chatbot_setting.py} +24 -24
- qanswer_sdk/models/user_dataset.py +38 -2
- qanswer_sdk/models/{qa_metadata_payload.py → user_dataset_shared.py} +27 -37
- qanswer_sdk/models/{user_filter.py → user_filter_dto.py} +4 -4
- qanswer_sdk/models/{user_profile.py → user_profile_dto.py} +10 -10
- qanswer_sdk/models/user_profile_list_dto.py +3 -3
- qanswer_sdk/models/widget_configs.py +4 -2
- {qanswer_sdk-3.1213.0.dist-info → qanswer_sdk-3.1244.0.dist-info}/METADATA +2 -2
- {qanswer_sdk-3.1213.0.dist-info → qanswer_sdk-3.1244.0.dist-info}/RECORD +135 -112
- qanswer_sdk/api/llm_consumption_controller_api.py +0 -310
- qanswer_sdk/models/organization_filter.py +0 -87
- qanswer_sdk/models/page_organization.py +0 -123
- qanswer_sdk/models/page_team_with_count.py +0 -123
- qanswer_sdk/models/tag_qa_payload.py +0 -91
- {qanswer_sdk-3.1213.0.dist-info → qanswer_sdk-3.1244.0.dist-info}/WHEEL +0 -0
@@ -17,23 +17,21 @@ import pprint
|
|
17
17
|
import re # noqa: F401
|
18
18
|
import json
|
19
19
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field,
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from qanswer_sdk.models.
|
22
|
+
from qanswer_sdk.models.embedder_dto import EmbedderDto
|
23
23
|
from typing import Optional, Set
|
24
24
|
from typing_extensions import Self
|
25
25
|
|
26
|
-
class
|
26
|
+
class EmbedderListDto(BaseModel):
|
27
27
|
"""
|
28
|
-
|
28
|
+
EmbedderListDto
|
29
29
|
""" # noqa: E501
|
30
|
-
|
31
|
-
|
32
|
-
page_number: Optional[StrictInt] = Field(default=None, alias="pageNumber")
|
30
|
+
embedders: Optional[List[EmbedderDto]] = None
|
31
|
+
page: Optional[StrictInt] = None
|
33
32
|
page_size: Optional[StrictInt] = Field(default=None, alias="pageSize")
|
34
|
-
|
35
|
-
|
36
|
-
__properties: ClassVar[List[str]] = ["unpaged", "paged", "pageNumber", "pageSize", "sort", "offset"]
|
33
|
+
total: Optional[StrictInt] = None
|
34
|
+
__properties: ClassVar[List[str]] = ["embedders", "page", "pageSize", "total"]
|
37
35
|
|
38
36
|
model_config = ConfigDict(
|
39
37
|
populate_by_name=True,
|
@@ -53,7 +51,7 @@ class PageableObject(BaseModel):
|
|
53
51
|
|
54
52
|
@classmethod
|
55
53
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
56
|
-
"""Create an instance of
|
54
|
+
"""Create an instance of EmbedderListDto from a JSON string"""
|
57
55
|
return cls.from_dict(json.loads(json_str))
|
58
56
|
|
59
57
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -74,14 +72,18 @@ class PageableObject(BaseModel):
|
|
74
72
|
exclude=excluded_fields,
|
75
73
|
exclude_none=True,
|
76
74
|
)
|
77
|
-
# override the default output from pydantic by calling `to_dict()` of
|
78
|
-
|
79
|
-
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of each item in embedders (list)
|
76
|
+
_items = []
|
77
|
+
if self.embedders:
|
78
|
+
for _item_embedders in self.embedders:
|
79
|
+
if _item_embedders:
|
80
|
+
_items.append(_item_embedders.to_dict())
|
81
|
+
_dict['embedders'] = _items
|
80
82
|
return _dict
|
81
83
|
|
82
84
|
@classmethod
|
83
85
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
84
|
-
"""Create an instance of
|
86
|
+
"""Create an instance of EmbedderListDto from a dict"""
|
85
87
|
if obj is None:
|
86
88
|
return None
|
87
89
|
|
@@ -89,12 +91,10 @@ class PageableObject(BaseModel):
|
|
89
91
|
return cls.model_validate(obj)
|
90
92
|
|
91
93
|
_obj = cls.model_validate({
|
92
|
-
"
|
93
|
-
"
|
94
|
-
"pageNumber": obj.get("pageNumber"),
|
94
|
+
"embedders": [EmbedderDto.from_dict(_item) for _item in obj["embedders"]] if obj.get("embedders") is not None else None,
|
95
|
+
"page": obj.get("page"),
|
95
96
|
"pageSize": obj.get("pageSize"),
|
96
|
-
"
|
97
|
-
"offset": obj.get("offset")
|
97
|
+
"total": obj.get("total")
|
98
98
|
})
|
99
99
|
return _obj
|
100
100
|
|
@@ -36,13 +36,14 @@ class EmbeddingEndpointCreate(BaseModel):
|
|
36
36
|
aws_access_key_id: Optional[StrictStr] = None
|
37
37
|
aws_secret_access_key: Optional[StrictStr] = None
|
38
38
|
aws_region_name: Optional[StrictStr] = None
|
39
|
+
batch_size: Optional[StrictInt] = None
|
39
40
|
display_name: StrictStr
|
40
41
|
engine: StrictStr
|
41
42
|
api_key: Optional[StrictStr] = None
|
42
43
|
name: StrictStr
|
43
44
|
embedding_size: StrictInt
|
44
45
|
context_window: StrictInt
|
45
|
-
__properties: ClassVar[List[str]] = ["modality", "provider", "endpoint_url", "description", "onpremise", "sensitivity_label", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "display_name", "engine", "api_key", "name", "embedding_size", "context_window"]
|
46
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "endpoint_url", "description", "onpremise", "sensitivity_label", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "batch_size", "display_name", "engine", "api_key", "name", "embedding_size", "context_window"]
|
46
47
|
|
47
48
|
@field_validator('modality')
|
48
49
|
def modality_validate_enum(cls, value):
|
@@ -125,6 +126,7 @@ class EmbeddingEndpointCreate(BaseModel):
|
|
125
126
|
"aws_access_key_id": obj.get("aws_access_key_id"),
|
126
127
|
"aws_secret_access_key": obj.get("aws_secret_access_key"),
|
127
128
|
"aws_region_name": obj.get("aws_region_name"),
|
129
|
+
"batch_size": obj.get("batch_size"),
|
128
130
|
"display_name": obj.get("display_name"),
|
129
131
|
"engine": obj.get("engine"),
|
130
132
|
"api_key": obj.get("api_key"),
|
@@ -17,7 +17,7 @@ import pprint
|
|
17
17
|
import re # noqa: F401
|
18
18
|
import json
|
19
19
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
22
|
from typing import Optional, Set
|
23
23
|
from typing_extensions import Self
|
@@ -36,10 +36,11 @@ class EmbeddingEndpointUpdate(BaseModel):
|
|
36
36
|
aws_access_key_id: Optional[StrictStr] = None
|
37
37
|
aws_secret_access_key: Optional[StrictStr] = None
|
38
38
|
aws_region_name: Optional[StrictStr] = None
|
39
|
+
batch_size: Optional[StrictInt] = None
|
39
40
|
display_name: Optional[StrictStr] = None
|
40
41
|
engine: Optional[StrictStr] = None
|
41
42
|
api_key: Optional[StrictStr] = None
|
42
|
-
__properties: ClassVar[List[str]] = ["modality", "provider", "endpoint_url", "description", "onpremise", "sensitivity_label", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "display_name", "engine", "api_key"]
|
43
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "endpoint_url", "description", "onpremise", "sensitivity_label", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "batch_size", "display_name", "engine", "api_key"]
|
43
44
|
|
44
45
|
@field_validator('modality')
|
45
46
|
def modality_validate_enum(cls, value):
|
@@ -122,6 +123,7 @@ class EmbeddingEndpointUpdate(BaseModel):
|
|
122
123
|
"aws_access_key_id": obj.get("aws_access_key_id"),
|
123
124
|
"aws_secret_access_key": obj.get("aws_secret_access_key"),
|
124
125
|
"aws_region_name": obj.get("aws_region_name"),
|
126
|
+
"batch_size": obj.get("batch_size"),
|
125
127
|
"display_name": obj.get("display_name"),
|
126
128
|
"engine": obj.get("engine"),
|
127
129
|
"api_key": obj.get("api_key")
|
@@ -17,19 +17,21 @@ import pprint
|
|
17
17
|
import re # noqa: F401
|
18
18
|
import json
|
19
19
|
|
20
|
-
from pydantic import BaseModel, ConfigDict,
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
22
|
from typing import Optional, Set
|
23
23
|
from typing_extensions import Self
|
24
24
|
|
25
|
-
class
|
25
|
+
class EntityDescription(BaseModel):
|
26
26
|
"""
|
27
|
-
|
27
|
+
EntityDescription
|
28
28
|
""" # noqa: E501
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
id: Optional[StrictInt] = None
|
30
|
+
title: Optional[StrictStr] = None
|
31
|
+
author: Optional[StrictStr] = None
|
32
|
+
content: Optional[StrictStr] = None
|
33
|
+
button_name: Optional[StrictStr] = Field(default=None, alias="buttonName")
|
34
|
+
__properties: ClassVar[List[str]] = ["id", "title", "author", "content", "buttonName"]
|
33
35
|
|
34
36
|
model_config = ConfigDict(
|
35
37
|
populate_by_name=True,
|
@@ -49,7 +51,7 @@ class SortObject(BaseModel):
|
|
49
51
|
|
50
52
|
@classmethod
|
51
53
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
52
|
-
"""Create an instance of
|
54
|
+
"""Create an instance of EntityDescription from a JSON string"""
|
53
55
|
return cls.from_dict(json.loads(json_str))
|
54
56
|
|
55
57
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -74,7 +76,7 @@ class SortObject(BaseModel):
|
|
74
76
|
|
75
77
|
@classmethod
|
76
78
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
77
|
-
"""Create an instance of
|
79
|
+
"""Create an instance of EntityDescription from a dict"""
|
78
80
|
if obj is None:
|
79
81
|
return None
|
80
82
|
|
@@ -82,9 +84,11 @@ class SortObject(BaseModel):
|
|
82
84
|
return cls.model_validate(obj)
|
83
85
|
|
84
86
|
_obj = cls.model_validate({
|
85
|
-
"
|
86
|
-
"
|
87
|
-
"
|
87
|
+
"id": obj.get("id"),
|
88
|
+
"title": obj.get("title"),
|
89
|
+
"author": obj.get("author"),
|
90
|
+
"content": obj.get("content"),
|
91
|
+
"buttonName": obj.get("buttonName")
|
88
92
|
})
|
89
93
|
return _obj
|
90
94
|
|
@@ -17,19 +17,20 @@ import pprint
|
|
17
17
|
import re # noqa: F401
|
18
18
|
import json
|
19
19
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictStr
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
22
|
from typing import Optional, Set
|
23
23
|
from typing_extensions import Self
|
24
24
|
|
25
|
-
class
|
25
|
+
class EntityDescriptionDto(BaseModel):
|
26
26
|
"""
|
27
|
-
|
27
|
+
EntityDescriptionDto
|
28
28
|
""" # noqa: E501
|
29
29
|
title: Optional[StrictStr] = None
|
30
30
|
author: Optional[StrictStr] = None
|
31
31
|
content: Optional[StrictStr] = None
|
32
|
-
|
32
|
+
button_name: Optional[StrictStr] = Field(default=None, alias="buttonName")
|
33
|
+
__properties: ClassVar[List[str]] = ["title", "author", "content", "buttonName"]
|
33
34
|
|
34
35
|
model_config = ConfigDict(
|
35
36
|
populate_by_name=True,
|
@@ -49,7 +50,7 @@ class DatasetDescription(BaseModel):
|
|
49
50
|
|
50
51
|
@classmethod
|
51
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
52
|
-
"""Create an instance of
|
53
|
+
"""Create an instance of EntityDescriptionDto from a JSON string"""
|
53
54
|
return cls.from_dict(json.loads(json_str))
|
54
55
|
|
55
56
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -74,7 +75,7 @@ class DatasetDescription(BaseModel):
|
|
74
75
|
|
75
76
|
@classmethod
|
76
77
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
77
|
-
"""Create an instance of
|
78
|
+
"""Create an instance of EntityDescriptionDto from a dict"""
|
78
79
|
if obj is None:
|
79
80
|
return None
|
80
81
|
|
@@ -84,7 +85,8 @@ class DatasetDescription(BaseModel):
|
|
84
85
|
_obj = cls.model_validate({
|
85
86
|
"title": obj.get("title"),
|
86
87
|
"author": obj.get("author"),
|
87
|
-
"content": obj.get("content")
|
88
|
+
"content": obj.get("content"),
|
89
|
+
"buttonName": obj.get("buttonName")
|
88
90
|
})
|
89
91
|
return _obj
|
90
92
|
|
qanswer_sdk/models/file_model.py
CHANGED
@@ -52,8 +52,8 @@ class FileModel(BaseModel):
|
|
52
52
|
@field_validator('status')
|
53
53
|
def status_validate_enum(cls, value):
|
54
54
|
"""Validates the enum"""
|
55
|
-
if value not in set(['Submitted', 'Uploaded', 'Converted', 'Indexed', 'QuotaExceeded', 'Failed', 'MalwareDetected']):
|
56
|
-
raise ValueError("must be one of enum values ('Submitted', 'Uploaded', 'Converted', 'Indexed', 'QuotaExceeded', 'Failed', 'MalwareDetected')")
|
55
|
+
if value not in set(['Submitted', 'Uploaded', 'Converted', 'Indexed', 'QuotaExceeded', 'Failed', 'MalwareDetected', 'NeedsToBeUploaded']):
|
56
|
+
raise ValueError("must be one of enum values ('Submitted', 'Uploaded', 'Converted', 'Indexed', 'QuotaExceeded', 'Failed', 'MalwareDetected', 'NeedsToBeUploaded')")
|
57
57
|
return value
|
58
58
|
|
59
59
|
model_config = ConfigDict(
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
QAnswer: Api Documentation
|
5
|
+
|
6
|
+
APIs provided by QAnswer
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from qanswer_sdk.models.imap_file_metadata import ImapFileMetadata
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class ImapAddPayload(BaseModel):
|
27
|
+
"""
|
28
|
+
ImapAddPayload
|
29
|
+
""" # noqa: E501
|
30
|
+
username: StrictStr
|
31
|
+
dataset: StrictStr
|
32
|
+
connector_id: StrictInt
|
33
|
+
quota: StrictInt
|
34
|
+
files: List[ImapFileMetadata]
|
35
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "connector_id", "quota", "files"]
|
36
|
+
|
37
|
+
model_config = ConfigDict(
|
38
|
+
populate_by_name=True,
|
39
|
+
validate_assignment=True,
|
40
|
+
protected_namespaces=(),
|
41
|
+
)
|
42
|
+
|
43
|
+
|
44
|
+
def to_str(self) -> str:
|
45
|
+
"""Returns the string representation of the model using alias"""
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
47
|
+
|
48
|
+
def to_json(self) -> str:
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
51
|
+
return json.dumps(self.to_dict())
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
55
|
+
"""Create an instance of ImapAddPayload from a JSON string"""
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
57
|
+
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
60
|
+
|
61
|
+
This has the following differences from calling pydantic's
|
62
|
+
`self.model_dump(by_alias=True)`:
|
63
|
+
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
65
|
+
were set at model initialization. Other fields with value `None`
|
66
|
+
are ignored.
|
67
|
+
"""
|
68
|
+
excluded_fields: Set[str] = set([
|
69
|
+
])
|
70
|
+
|
71
|
+
_dict = self.model_dump(
|
72
|
+
by_alias=True,
|
73
|
+
exclude=excluded_fields,
|
74
|
+
exclude_none=True,
|
75
|
+
)
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of each item in files (list)
|
77
|
+
_items = []
|
78
|
+
if self.files:
|
79
|
+
for _item_files in self.files:
|
80
|
+
if _item_files:
|
81
|
+
_items.append(_item_files.to_dict())
|
82
|
+
_dict['files'] = _items
|
83
|
+
return _dict
|
84
|
+
|
85
|
+
@classmethod
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
87
|
+
"""Create an instance of ImapAddPayload from a dict"""
|
88
|
+
if obj is None:
|
89
|
+
return None
|
90
|
+
|
91
|
+
if not isinstance(obj, dict):
|
92
|
+
return cls.model_validate(obj)
|
93
|
+
|
94
|
+
_obj = cls.model_validate({
|
95
|
+
"username": obj.get("username"),
|
96
|
+
"dataset": obj.get("dataset"),
|
97
|
+
"connector_id": obj.get("connector_id"),
|
98
|
+
"quota": obj.get("quota"),
|
99
|
+
"files": [ImapFileMetadata.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None
|
100
|
+
})
|
101
|
+
return _obj
|
102
|
+
|
103
|
+
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
QAnswer: Api Documentation
|
5
|
+
|
6
|
+
APIs provided by QAnswer
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class ImapAdditionalFields(BaseModel):
|
26
|
+
"""
|
27
|
+
ImapAdditionalFields
|
28
|
+
""" # noqa: E501
|
29
|
+
file_id: StrictStr
|
30
|
+
folder: StrictStr
|
31
|
+
uid: StrictStr
|
32
|
+
created_at: StrictStr
|
33
|
+
from_address: StrictStr
|
34
|
+
email: StrictStr
|
35
|
+
imap_server: StrictStr
|
36
|
+
imap_port: StrictInt
|
37
|
+
__properties: ClassVar[List[str]] = ["file_id", "folder", "uid", "created_at", "from_address", "email", "imap_server", "imap_port"]
|
38
|
+
|
39
|
+
model_config = ConfigDict(
|
40
|
+
populate_by_name=True,
|
41
|
+
validate_assignment=True,
|
42
|
+
protected_namespaces=(),
|
43
|
+
)
|
44
|
+
|
45
|
+
|
46
|
+
def to_str(self) -> str:
|
47
|
+
"""Returns the string representation of the model using alias"""
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
49
|
+
|
50
|
+
def to_json(self) -> str:
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
53
|
+
return json.dumps(self.to_dict())
|
54
|
+
|
55
|
+
@classmethod
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
57
|
+
"""Create an instance of ImapAdditionalFields from a JSON string"""
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
59
|
+
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
62
|
+
|
63
|
+
This has the following differences from calling pydantic's
|
64
|
+
`self.model_dump(by_alias=True)`:
|
65
|
+
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
67
|
+
were set at model initialization. Other fields with value `None`
|
68
|
+
are ignored.
|
69
|
+
"""
|
70
|
+
excluded_fields: Set[str] = set([
|
71
|
+
])
|
72
|
+
|
73
|
+
_dict = self.model_dump(
|
74
|
+
by_alias=True,
|
75
|
+
exclude=excluded_fields,
|
76
|
+
exclude_none=True,
|
77
|
+
)
|
78
|
+
return _dict
|
79
|
+
|
80
|
+
@classmethod
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
82
|
+
"""Create an instance of ImapAdditionalFields from a dict"""
|
83
|
+
if obj is None:
|
84
|
+
return None
|
85
|
+
|
86
|
+
if not isinstance(obj, dict):
|
87
|
+
return cls.model_validate(obj)
|
88
|
+
|
89
|
+
_obj = cls.model_validate({
|
90
|
+
"file_id": obj.get("file_id"),
|
91
|
+
"folder": obj.get("folder"),
|
92
|
+
"uid": obj.get("uid"),
|
93
|
+
"created_at": obj.get("created_at"),
|
94
|
+
"from_address": obj.get("from_address"),
|
95
|
+
"email": obj.get("email"),
|
96
|
+
"imap_server": obj.get("imap_server"),
|
97
|
+
"imap_port": obj.get("imap_port")
|
98
|
+
})
|
99
|
+
return _obj
|
100
|
+
|
101
|
+
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
QAnswer: Api Documentation
|
5
|
+
|
6
|
+
APIs provided by QAnswer
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from qanswer_sdk.models.imap_additional_fields import ImapAdditionalFields
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class ImapFileMetadata(BaseModel):
|
27
|
+
"""
|
28
|
+
ImapFileMetadata
|
29
|
+
""" # noqa: E501
|
30
|
+
file_id: StrictStr
|
31
|
+
title: Optional[StrictStr] = None
|
32
|
+
name: Optional[StrictStr] = None
|
33
|
+
file_name: StrictStr
|
34
|
+
display_name: Optional[StrictStr] = None
|
35
|
+
original_file_name: StrictStr
|
36
|
+
file_extension: StrictStr
|
37
|
+
type: StrictStr
|
38
|
+
additional_fields: ImapAdditionalFields
|
39
|
+
__properties: ClassVar[List[str]] = ["file_id", "title", "name", "file_name", "display_name", "original_file_name", "file_extension", "type", "additional_fields"]
|
40
|
+
|
41
|
+
@field_validator('type')
|
42
|
+
def type_validate_enum(cls, value):
|
43
|
+
"""Validates the enum"""
|
44
|
+
if value not in set(['folder', 'email']):
|
45
|
+
raise ValueError("must be one of enum values ('folder', 'email')")
|
46
|
+
return value
|
47
|
+
|
48
|
+
model_config = ConfigDict(
|
49
|
+
populate_by_name=True,
|
50
|
+
validate_assignment=True,
|
51
|
+
protected_namespaces=(),
|
52
|
+
)
|
53
|
+
|
54
|
+
|
55
|
+
def to_str(self) -> str:
|
56
|
+
"""Returns the string representation of the model using alias"""
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
58
|
+
|
59
|
+
def to_json(self) -> str:
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
62
|
+
return json.dumps(self.to_dict())
|
63
|
+
|
64
|
+
@classmethod
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
66
|
+
"""Create an instance of ImapFileMetadata from a JSON string"""
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
68
|
+
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
71
|
+
|
72
|
+
This has the following differences from calling pydantic's
|
73
|
+
`self.model_dump(by_alias=True)`:
|
74
|
+
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
76
|
+
were set at model initialization. Other fields with value `None`
|
77
|
+
are ignored.
|
78
|
+
"""
|
79
|
+
excluded_fields: Set[str] = set([
|
80
|
+
])
|
81
|
+
|
82
|
+
_dict = self.model_dump(
|
83
|
+
by_alias=True,
|
84
|
+
exclude=excluded_fields,
|
85
|
+
exclude_none=True,
|
86
|
+
)
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of additional_fields
|
88
|
+
if self.additional_fields:
|
89
|
+
_dict['additional_fields'] = self.additional_fields.to_dict()
|
90
|
+
return _dict
|
91
|
+
|
92
|
+
@classmethod
|
93
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
94
|
+
"""Create an instance of ImapFileMetadata from a dict"""
|
95
|
+
if obj is None:
|
96
|
+
return None
|
97
|
+
|
98
|
+
if not isinstance(obj, dict):
|
99
|
+
return cls.model_validate(obj)
|
100
|
+
|
101
|
+
_obj = cls.model_validate({
|
102
|
+
"file_id": obj.get("file_id"),
|
103
|
+
"title": obj.get("title"),
|
104
|
+
"name": obj.get("name"),
|
105
|
+
"file_name": obj.get("file_name"),
|
106
|
+
"display_name": obj.get("display_name"),
|
107
|
+
"original_file_name": obj.get("original_file_name"),
|
108
|
+
"file_extension": obj.get("file_extension"),
|
109
|
+
"type": obj.get("type"),
|
110
|
+
"additional_fields": ImapAdditionalFields.from_dict(obj["additional_fields"]) if obj.get("additional_fields") is not None else None
|
111
|
+
})
|
112
|
+
return _obj
|
113
|
+
|
114
|
+
|