perceptic-core-client 0.39.0__py3-none-any.whl → 0.50.3__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.
Files changed (77) hide show
  1. perceptic_core_client/__init__.py +51 -0
  2. perceptic_core_client/api/__init__.py +1 -0
  3. perceptic_core_client/api/tag_resource_api.py +100 -836
  4. perceptic_core_client/api/uri_resource_api.py +818 -207
  5. perceptic_core_client/api/user_resource_api.py +308 -1
  6. perceptic_core_client/api/worker_resource_api.py +1100 -211
  7. perceptic_core_client/api/worker_resource_v3_api.py +1477 -0
  8. perceptic_core_client/api_client.py +8 -5
  9. perceptic_core_client/configuration.py +6 -2
  10. perceptic_core_client/models/__init__.py +25 -1
  11. perceptic_core_client/models/citation_metadata_api_dto.py +0 -15
  12. perceptic_core_client/models/connection_settings_api_dto.py +0 -10
  13. perceptic_core_client/models/create_folder_response_v2.py +89 -0
  14. perceptic_core_client/models/file_system_api_dto.py +0 -10
  15. perceptic_core_client/models/file_system_root_metadata_api_dto.py +0 -10
  16. perceptic_core_client/models/get_run_event_rating_response.py +91 -0
  17. perceptic_core_client/models/get_worker_events_v2_response.py +101 -0
  18. perceptic_core_client/models/get_worker_events_v3_response.py +89 -0
  19. perceptic_core_client/models/info_event1.py +94 -0
  20. perceptic_core_client/models/ingest_event_request.py +94 -0
  21. perceptic_core_client/models/ingest_event_response.py +89 -0
  22. perceptic_core_client/models/ingest_stream_event_request.py +89 -0
  23. perceptic_core_client/models/list_users_response.py +104 -0
  24. perceptic_core_client/models/persistence_mode.py +38 -0
  25. perceptic_core_client/models/post_rating_request.py +89 -0
  26. perceptic_core_client/models/post_run_event_rating_response.py +91 -0
  27. perceptic_core_client/models/post_worker_run_request1.py +87 -0
  28. perceptic_core_client/models/post_worker_run_response1.py +87 -0
  29. perceptic_core_client/models/progress_event1.py +94 -0
  30. perceptic_core_client/models/rating_dto_worker_run_event_rating_secondary_id.py +108 -0
  31. perceptic_core_client/models/run_status_dto.py +1 -0
  32. perceptic_core_client/models/schedule_trigger.py +0 -15
  33. perceptic_core_client/models/upload_resource_response_v2.py +91 -0
  34. perceptic_core_client/models/user_input_event.py +101 -0
  35. perceptic_core_client/models/user_request_for_input_event.py +108 -0
  36. perceptic_core_client/models/worker_event.py +0 -15
  37. perceptic_core_client/models/worker_event_v2.py +193 -0
  38. perceptic_core_client/models/worker_run_event_rating_secondary_id.py +89 -0
  39. perceptic_core_client/models/worker_stream_event_v2.py +90 -0
  40. perceptic_core_client/models/worker_v2_next_page_token.py +89 -0
  41. perceptic_core_client/models/workflow_status_response.py +89 -0
  42. perceptic_core_client/test/test_create_folder_response_v2.py +52 -0
  43. perceptic_core_client/test/test_get_run_event_rating_response.py +57 -0
  44. perceptic_core_client/test/test_get_worker_events_v2_response.py +56 -0
  45. perceptic_core_client/test/test_get_worker_events_v3_response.py +54 -0
  46. perceptic_core_client/test/test_info_event1.py +54 -0
  47. perceptic_core_client/test/test_ingest_event_request.py +56 -0
  48. perceptic_core_client/test/test_ingest_event_response.py +52 -0
  49. perceptic_core_client/test/test_ingest_stream_event_request.py +52 -0
  50. perceptic_core_client/test/test_list_users_response.py +60 -0
  51. perceptic_core_client/test/test_persistence_mode.py +33 -0
  52. perceptic_core_client/test/test_post_rating_request.py +52 -0
  53. perceptic_core_client/test/test_post_run_event_rating_response.py +57 -0
  54. perceptic_core_client/test/test_post_worker_run_request1.py +51 -0
  55. perceptic_core_client/test/test_post_worker_run_response1.py +51 -0
  56. perceptic_core_client/test/test_progress_event.py +1 -1
  57. perceptic_core_client/test/test_progress_event1.py +54 -0
  58. perceptic_core_client/test/test_rating_dto_worker_run_event_rating_secondary_id.py +56 -0
  59. perceptic_core_client/test/test_request_for_input_event.py +1 -1
  60. perceptic_core_client/test/test_tag_resource_api.py +0 -21
  61. perceptic_core_client/test/test_upload_resource_response_v2.py +53 -0
  62. perceptic_core_client/test/test_uri_resource_api.py +14 -0
  63. perceptic_core_client/test/test_user_input_event.py +55 -0
  64. perceptic_core_client/test/test_user_request_for_input_event.py +56 -0
  65. perceptic_core_client/test/test_user_resource_api.py +7 -0
  66. perceptic_core_client/test/test_worker_event.py +2 -2
  67. perceptic_core_client/test/test_worker_event_v2.py +59 -0
  68. perceptic_core_client/test/test_worker_resource_api.py +21 -0
  69. perceptic_core_client/test/test_worker_resource_v3_api.py +66 -0
  70. perceptic_core_client/test/test_worker_run_event_rating_secondary_id.py +53 -0
  71. perceptic_core_client/test/test_worker_stream_event_v2.py +52 -0
  72. perceptic_core_client/test/test_worker_v2_next_page_token.py +52 -0
  73. perceptic_core_client/test/test_workflow_status_response.py +52 -0
  74. {perceptic_core_client-0.39.0.dist-info → perceptic_core_client-0.50.3.dist-info}/METADATA +1 -1
  75. {perceptic_core_client-0.39.0.dist-info → perceptic_core_client-0.50.3.dist-info}/RECORD +77 -27
  76. {perceptic_core_client-0.39.0.dist-info → perceptic_core_client-0.50.3.dist-info}/WHEEL +0 -0
  77. {perceptic_core_client-0.39.0.dist-info → perceptic_core_client-0.50.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
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
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class PostWorkerRunRequest1(BaseModel):
26
+ """
27
+ PostWorkerRunRequest1
28
+ """ # noqa: E501
29
+ inputs: Optional[Dict[str, Any]] = None
30
+ __properties: ClassVar[List[str]] = ["inputs"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of PostWorkerRunRequest1 from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of PostWorkerRunRequest1 from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "inputs": obj.get("inputs")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
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, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class PostWorkerRunResponse1(BaseModel):
26
+ """
27
+ PostWorkerRunResponse1
28
+ """ # noqa: E501
29
+ run_rid: Optional[StrictStr] = Field(default=None, alias="runRid")
30
+ __properties: ClassVar[List[str]] = ["runRid"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of PostWorkerRunResponse1 from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of PostWorkerRunResponse1 from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "runRid": obj.get("runRid")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,94 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
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 datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ProgressEvent1(BaseModel):
27
+ """
28
+ ProgressEvent1
29
+ """ # noqa: E501
30
+ sequence: Optional[StrictInt] = None
31
+ payload: Optional[Dict[str, Any]] = None
32
+ created_at: Optional[datetime] = Field(default=None, alias="createdAt")
33
+ type: Optional[StrictStr] = None
34
+ __properties: ClassVar[List[str]] = ["sequence", "payload", "createdAt", "type"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of ProgressEvent1 from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of ProgressEvent1 from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate({
87
+ "sequence": obj.get("sequence"),
88
+ "payload": obj.get("payload"),
89
+ "createdAt": obj.get("createdAt"),
90
+ "type": obj.get("type")
91
+ })
92
+ return _obj
93
+
94
+
@@ -0,0 +1,108 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
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, Field, StrictFloat, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from uuid import UUID
23
+ from perceptic_core_client.models.worker_run_event_rating_secondary_id import WorkerRunEventRatingSecondaryId
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class RatingDtoWorkerRunEventRatingSecondaryId(BaseModel):
28
+ """
29
+ RatingDtoWorkerRunEventRatingSecondaryId
30
+ """ # noqa: E501
31
+ id: Optional[UUID] = None
32
+ grade: Optional[Union[StrictFloat, StrictInt]] = None
33
+ written_feedback: Optional[StrictStr] = Field(default=None, alias="writtenFeedback")
34
+ secondary_id: Optional[WorkerRunEventRatingSecondaryId] = Field(default=None, alias="secondaryId")
35
+ __properties: ClassVar[List[str]] = ["id", "grade", "writtenFeedback", "secondaryId"]
36
+
37
+ @field_validator('id')
38
+ def id_validate_regular_expression(cls, value):
39
+ """Validates the regular expression"""
40
+ if value is None:
41
+ return value
42
+
43
+ if not re.match(r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", value):
44
+ raise ValueError(r"must validate the regular expression /[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/")
45
+ return value
46
+
47
+ model_config = ConfigDict(
48
+ populate_by_name=True,
49
+ validate_assignment=True,
50
+ protected_namespaces=(),
51
+ )
52
+
53
+
54
+ def to_str(self) -> str:
55
+ """Returns the string representation of the model using alias"""
56
+ return pprint.pformat(self.model_dump(by_alias=True))
57
+
58
+ def to_json(self) -> str:
59
+ """Returns the JSON representation of the model using alias"""
60
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
61
+ return json.dumps(self.to_dict())
62
+
63
+ @classmethod
64
+ def from_json(cls, json_str: str) -> Optional[Self]:
65
+ """Create an instance of RatingDtoWorkerRunEventRatingSecondaryId from a JSON string"""
66
+ return cls.from_dict(json.loads(json_str))
67
+
68
+ def to_dict(self) -> Dict[str, Any]:
69
+ """Return the dictionary representation of the model using alias.
70
+
71
+ This has the following differences from calling pydantic's
72
+ `self.model_dump(by_alias=True)`:
73
+
74
+ * `None` is only added to the output dict for nullable fields that
75
+ were set at model initialization. Other fields with value `None`
76
+ are ignored.
77
+ """
78
+ excluded_fields: Set[str] = set([
79
+ ])
80
+
81
+ _dict = self.model_dump(
82
+ by_alias=True,
83
+ exclude=excluded_fields,
84
+ exclude_none=True,
85
+ )
86
+ # override the default output from pydantic by calling `to_dict()` of secondary_id
87
+ if self.secondary_id:
88
+ _dict['secondaryId'] = self.secondary_id.to_dict()
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of RatingDtoWorkerRunEventRatingSecondaryId from a dict"""
94
+ if obj is None:
95
+ return None
96
+
97
+ if not isinstance(obj, dict):
98
+ return cls.model_validate(obj)
99
+
100
+ _obj = cls.model_validate({
101
+ "id": obj.get("id"),
102
+ "grade": obj.get("grade"),
103
+ "writtenFeedback": obj.get("writtenFeedback"),
104
+ "secondaryId": WorkerRunEventRatingSecondaryId.from_dict(obj["secondaryId"]) if obj.get("secondaryId") is not None else None
105
+ })
106
+ return _obj
107
+
108
+
@@ -35,6 +35,7 @@ class RunStatusDto(str, Enum):
35
35
  ERROR_TIMEOUT = 'ERROR_TIMEOUT'
36
36
  ERROR_CLIENT = 'ERROR_CLIENT'
37
37
  ERROR_SERVER = 'ERROR_SERVER'
38
+ ERROR_RETRY_LIMIT_EXCEEDED = 'ERROR_RETRY_LIMIT_EXCEEDED'
38
39
 
39
40
  @classmethod
40
41
  def from_json(cls, json_str: str) -> Self:
@@ -118,21 +118,6 @@ class ScheduleTrigger(BaseModel):
118
118
  instance.actual_instance = OnUploadTrigger.from_json(json_str)
119
119
  return instance
120
120
 
121
- # check if data type is `CronTrigger`
122
- if _data_type == "CronTrigger":
123
- instance.actual_instance = CronTrigger.from_json(json_str)
124
- return instance
125
-
126
- # check if data type is `IntervalTrigger`
127
- if _data_type == "IntervalTrigger":
128
- instance.actual_instance = IntervalTrigger.from_json(json_str)
129
- return instance
130
-
131
- # check if data type is `OnUploadTrigger`
132
- if _data_type == "OnUploadTrigger":
133
- instance.actual_instance = OnUploadTrigger.from_json(json_str)
134
- return instance
135
-
136
121
  # deserialize data into OnUploadTrigger
137
122
  try:
138
123
  instance.actual_instance = OnUploadTrigger.from_json(json_str)
@@ -0,0 +1,91 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
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, Field, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class UploadResourceResponseV2(BaseModel):
26
+ """
27
+ UploadResourceResponseV2
28
+ """ # noqa: E501
29
+ resource_id: Optional[StrictStr] = Field(default=None, alias="resourceId")
30
+ uri: Optional[StrictStr] = None
31
+ size_in_bytes: Optional[StrictInt] = Field(default=None, alias="sizeInBytes")
32
+ __properties: ClassVar[List[str]] = ["resourceId", "uri", "sizeInBytes"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of UploadResourceResponseV2 from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of UploadResourceResponseV2 from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "resourceId": obj.get("resourceId"),
86
+ "uri": obj.get("uri"),
87
+ "sizeInBytes": obj.get("sizeInBytes")
88
+ })
89
+ return _obj
90
+
91
+
@@ -0,0 +1,101 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
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 datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class UserInputEvent(BaseModel):
27
+ """
28
+ UserInputEvent
29
+ """ # noqa: E501
30
+ sequence: Optional[StrictInt] = None
31
+ input: Optional[Dict[str, Any]] = None
32
+ attribution: Optional[StrictStr] = None
33
+ created_at: Optional[datetime] = Field(default=None, alias="createdAt")
34
+ type: Optional[StrictStr] = None
35
+ __properties: ClassVar[List[str]] = ["sequence", "input", "attribution", "createdAt", "type"]
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 UserInputEvent 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
+ # set to None if attribution (nullable) is None
77
+ # and model_fields_set contains the field
78
+ if self.attribution is None and "attribution" in self.model_fields_set:
79
+ _dict['attribution'] = None
80
+
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of UserInputEvent from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "sequence": obj.get("sequence"),
94
+ "input": obj.get("input"),
95
+ "attribution": obj.get("attribution"),
96
+ "createdAt": obj.get("createdAt"),
97
+ "type": obj.get("type")
98
+ })
99
+ return _obj
100
+
101
+