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,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 InfoEvent1(BaseModel):
27
+ """
28
+ InfoEvent1
29
+ """ # noqa: E501
30
+ sequence: Optional[StrictInt] = None
31
+ type_of: Optional[StrictStr] = Field(default=None, alias="typeOf")
32
+ created_at: Optional[datetime] = Field(default=None, alias="createdAt")
33
+ type: Optional[StrictStr] = None
34
+ __properties: ClassVar[List[str]] = ["sequence", "typeOf", "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 InfoEvent1 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 InfoEvent1 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
+ "typeOf": obj.get("typeOf"),
89
+ "createdAt": obj.get("createdAt"),
90
+ "type": obj.get("type")
91
+ })
92
+ return _obj
93
+
94
+
@@ -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 pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from perceptic_core_client.models.persistence_mode import PersistenceMode
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class IngestEventRequest(BaseModel):
27
+ """
28
+ Request to ingest a worker event
29
+ """ # noqa: E501
30
+ event_type: StrictStr = Field(description="The type of event (worker-defined)", alias="eventType")
31
+ payload: Dict[str, Any] = Field(description="The event payload")
32
+ persistence_mode: Optional[StrictStr] = Field(default='PERSISTENT', description="How the event should be persisted", alias="persistenceMode")
33
+ persistence_mode_or_default: Optional[PersistenceMode] = Field(default=None, alias="persistenceModeOrDefault")
34
+ __properties: ClassVar[List[str]] = ["eventType", "payload", "persistenceMode", "persistenceModeOrDefault"]
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 IngestEventRequest 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 IngestEventRequest 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
+ "eventType": obj.get("eventType"),
88
+ "payload": obj.get("payload"),
89
+ "persistenceMode": obj.get("persistenceMode") if obj.get("persistenceMode") is not None else 'PERSISTENT',
90
+ "persistenceModeOrDefault": obj.get("persistenceModeOrDefault")
91
+ })
92
+ return _obj
93
+
94
+
@@ -0,0 +1,89 @@
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 IngestEventResponse(BaseModel):
26
+ """
27
+ Response from ingesting a worker event
28
+ """ # noqa: E501
29
+ run_rid: Optional[StrictStr] = Field(default=None, description="The run resource identifier", alias="runRid")
30
+ sequence: Optional[StrictInt] = Field(default=None, description="The sequence number assigned to this event (null if not persisted)")
31
+ __properties: ClassVar[List[str]] = ["runRid", "sequence"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of IngestEventResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of IngestEventResponse from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "runRid": obj.get("runRid"),
85
+ "sequence": obj.get("sequence")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,89 @@
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 IngestStreamEventRequest(BaseModel):
26
+ """
27
+ IngestStreamEventRequest
28
+ """ # noqa: E501
29
+ event_type: Optional[StrictStr] = Field(default=None, alias="eventType")
30
+ payload: Optional[Dict[str, Any]] = None
31
+ __properties: ClassVar[List[str]] = ["eventType", "payload"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of IngestStreamEventRequest from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of IngestStreamEventRequest from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "eventType": obj.get("eventType"),
85
+ "payload": obj.get("payload")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,104 @@
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
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from perceptic_core_client.models.user_info_response import UserInfoResponse
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ListUsersResponse(BaseModel):
27
+ """
28
+ Paginated list of users response
29
+ """ # noqa: E501
30
+ users: Optional[List[UserInfoResponse]] = Field(default=None, description="List of users")
31
+ total_count: Optional[StrictInt] = Field(default=None, description="Total count of users matching the query", alias="totalCount")
32
+ next_offset: Optional[StrictInt] = Field(default=None, description="Next offset for pagination, empty if no more results", alias="nextOffset")
33
+ __properties: ClassVar[List[str]] = ["users", "totalCount", "nextOffset"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of ListUsersResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of each item in users (list)
75
+ _items = []
76
+ if self.users:
77
+ for _item_users in self.users:
78
+ if _item_users:
79
+ _items.append(_item_users.to_dict())
80
+ _dict['users'] = _items
81
+ # set to None if next_offset (nullable) is None
82
+ # and model_fields_set contains the field
83
+ if self.next_offset is None and "next_offset" in self.model_fields_set:
84
+ _dict['nextOffset'] = None
85
+
86
+ return _dict
87
+
88
+ @classmethod
89
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
+ """Create an instance of ListUsersResponse from a dict"""
91
+ if obj is None:
92
+ return None
93
+
94
+ if not isinstance(obj, dict):
95
+ return cls.model_validate(obj)
96
+
97
+ _obj = cls.model_validate({
98
+ "users": [UserInfoResponse.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None,
99
+ "totalCount": obj.get("totalCount"),
100
+ "nextOffset": obj.get("nextOffset")
101
+ })
102
+ return _obj
103
+
104
+
@@ -0,0 +1,38 @@
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 json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class PersistenceMode(str, Enum):
22
+ """
23
+ PersistenceMode
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ PERSISTENT = 'PERSISTENT'
30
+ EPHEMERAL = 'EPHEMERAL'
31
+ LOG_ONLY = 'LOG_ONLY'
32
+
33
+ @classmethod
34
+ def from_json(cls, json_str: str) -> Self:
35
+ """Create an instance of PersistenceMode from a JSON string"""
36
+ return cls(json.loads(json_str))
37
+
38
+
@@ -0,0 +1,89 @@
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 typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class PostRatingRequest(BaseModel):
26
+ """
27
+ PostRatingRequest
28
+ """ # noqa: E501
29
+ grade: Optional[Union[StrictFloat, StrictInt]] = None
30
+ written_feedback: Optional[StrictStr] = Field(default=None, alias="writtenFeedback")
31
+ __properties: ClassVar[List[str]] = ["grade", "writtenFeedback"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of PostRatingRequest from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of PostRatingRequest from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "grade": obj.get("grade"),
85
+ "writtenFeedback": obj.get("writtenFeedback")
86
+ })
87
+ return _obj
88
+
89
+
@@ -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
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from perceptic_core_client.models.rating_dto_worker_run_event_rating_secondary_id import RatingDtoWorkerRunEventRatingSecondaryId
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class PostRunEventRatingResponse(BaseModel):
27
+ """
28
+ PostRunEventRatingResponse
29
+ """ # noqa: E501
30
+ rating: Optional[RatingDtoWorkerRunEventRatingSecondaryId] = None
31
+ __properties: ClassVar[List[str]] = ["rating"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of PostRunEventRatingResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of rating
73
+ if self.rating:
74
+ _dict['rating'] = self.rating.to_dict()
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of PostRunEventRatingResponse 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
+ "rating": RatingDtoWorkerRunEventRatingSecondaryId.from_dict(obj["rating"]) if obj.get("rating") is not None else None
88
+ })
89
+ return _obj
90
+
91
+