rapidata 2.35.3__py3-none-any.whl → 2.36.1__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.

Potentially problematic release.


This version of rapidata might be problematic. Click here for more details.

Files changed (58) hide show
  1. rapidata/__init__.py +1 -1
  2. rapidata/api_client/__init__.py +25 -4
  3. rapidata/api_client/api/__init__.py +1 -0
  4. rapidata/api_client/api/benchmark_api.py +294 -0
  5. rapidata/api_client/api/campaign_api.py +268 -0
  6. rapidata/api_client/api/customer_rapid_api.py +247 -0
  7. rapidata/api_client/api/leaderboard_api.py +295 -6
  8. rapidata/api_client/api/pipeline_api.py +0 -873
  9. rapidata/api_client/api/sample_api.py +299 -0
  10. rapidata/api_client/api/validation_set_api.py +537 -312
  11. rapidata/api_client/models/__init__.py +24 -4
  12. rapidata/api_client/models/add_validation_rapid_model.py +12 -2
  13. rapidata/api_client/models/add_validation_rapid_model_truth.py +7 -1
  14. rapidata/api_client/models/and_filter.py +121 -0
  15. rapidata/api_client/models/and_filter_filters_inner.py +268 -0
  16. rapidata/api_client/models/asset_type.py +40 -0
  17. rapidata/api_client/models/boost_mode.py +37 -0
  18. rapidata/api_client/models/boost_query_result.py +10 -1
  19. rapidata/api_client/models/campaign_filter.py +98 -0
  20. rapidata/api_client/models/change_boost_model.py +89 -0
  21. rapidata/api_client/models/compare_rapid_blueprint.py +5 -3
  22. rapidata/api_client/models/compare_rapid_blueprint1.py +96 -0
  23. rapidata/api_client/models/country_filter.py +98 -0
  24. rapidata/api_client/models/create_leaderboard_model.py +32 -2
  25. rapidata/api_client/models/demographic_filter.py +100 -0
  26. rapidata/api_client/models/feature_flag_model.py +4 -4
  27. rapidata/api_client/models/free_text_payload.py +10 -3
  28. rapidata/api_client/models/free_text_rapid_blueprint.py +10 -3
  29. rapidata/api_client/models/get_compare_ab_summary_result.py +4 -2
  30. rapidata/api_client/models/get_leaderboard_by_id_result.py +29 -2
  31. rapidata/api_client/models/get_public_responses_result.py +95 -0
  32. rapidata/api_client/models/get_sample_by_id_result.py +126 -0
  33. rapidata/api_client/models/language_filter.py +98 -0
  34. rapidata/api_client/models/leaderboard_query_result.py +29 -2
  35. rapidata/api_client/models/new_user_filter.py +96 -0
  36. rapidata/api_client/models/not_filter.py +117 -0
  37. rapidata/api_client/models/or_filter.py +121 -0
  38. rapidata/api_client/models/prompt_type.py +38 -0
  39. rapidata/api_client/models/public_rapid_response.py +112 -0
  40. rapidata/api_client/models/rapid_modality.py +46 -0
  41. rapidata/api_client/models/response_count_filter.py +109 -0
  42. rapidata/api_client/models/sample_by_identifier.py +126 -0
  43. rapidata/api_client/models/sample_by_identifier_paged_result.py +105 -0
  44. rapidata/api_client/models/simple_workflow_config_blueprint.py +37 -23
  45. rapidata/api_client/models/update_leaderboard_model.py +91 -0
  46. rapidata/api_client/models/user_score_filter.py +102 -0
  47. rapidata/api_client/models/user_state.py +38 -0
  48. rapidata/api_client/models/user_state_filter.py +101 -0
  49. rapidata/api_client/models/validation_set_model.py +54 -3
  50. rapidata/api_client_README.md +33 -10
  51. rapidata/rapidata_client/benchmark/rapidata_benchmark.py +26 -2
  52. rapidata/rapidata_client/order/rapidata_order_manager.py +298 -219
  53. rapidata/rapidata_client/workflow/_compare_workflow.py +7 -2
  54. rapidata/rapidata_client/workflow/_free_text_workflow.py +9 -2
  55. {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/METADATA +1 -1
  56. {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/RECORD +58 -32
  57. {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/LICENSE +0 -0
  58. {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,117 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class NotFilter(BaseModel):
26
+ """
27
+ NotFilter
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for NotFilter", alias="_t")
30
+ filter: AndFilterFiltersInner
31
+ execution_order: Optional[StrictInt] = Field(default=None, alias="executionOrder")
32
+ inner_filters: Optional[List[AndFilterFiltersInner]] = Field(default=None, alias="innerFilters")
33
+ __properties: ClassVar[List[str]] = ["_t", "filter", "executionOrder", "innerFilters"]
34
+
35
+ @field_validator('t')
36
+ def t_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['NotFilter']):
39
+ raise ValueError("must be one of enum values ('NotFilter')")
40
+ return value
41
+
42
+ model_config = ConfigDict(
43
+ populate_by_name=True,
44
+ validate_assignment=True,
45
+ protected_namespaces=(),
46
+ )
47
+
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of NotFilter from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ * OpenAPI `readOnly` fields are excluded.
73
+ * OpenAPI `readOnly` fields are excluded.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ "execution_order",
77
+ "inner_filters",
78
+ ])
79
+
80
+ _dict = self.model_dump(
81
+ by_alias=True,
82
+ exclude=excluded_fields,
83
+ exclude_none=True,
84
+ )
85
+ # override the default output from pydantic by calling `to_dict()` of filter
86
+ if self.filter:
87
+ _dict['filter'] = self.filter.to_dict()
88
+ # override the default output from pydantic by calling `to_dict()` of each item in inner_filters (list)
89
+ _items = []
90
+ if self.inner_filters:
91
+ for _item_inner_filters in self.inner_filters:
92
+ if _item_inner_filters:
93
+ _items.append(_item_inner_filters.to_dict())
94
+ _dict['innerFilters'] = _items
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
+ """Create an instance of NotFilter from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return cls.model_validate(obj)
105
+
106
+ _obj = cls.model_validate({
107
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'NotFilter',
108
+ "filter": AndFilterFiltersInner.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
109
+ "executionOrder": obj.get("executionOrder"),
110
+ "innerFilters": [AndFilterFiltersInner.from_dict(_item) for _item in obj["innerFilters"]] if obj.get("innerFilters") is not None else None
111
+ })
112
+ return _obj
113
+
114
+ from rapidata.api_client.models.and_filter_filters_inner import AndFilterFiltersInner
115
+ # TODO: Rewrite to not use raise_errors
116
+ NotFilter.model_rebuild(raise_errors=False)
117
+
@@ -0,0 +1,121 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class OrFilter(BaseModel):
26
+ """
27
+ OrFilter
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for OrFilter", alias="_t")
30
+ filters: List[AndFilterFiltersInner]
31
+ execution_order: Optional[StrictInt] = Field(default=None, alias="executionOrder")
32
+ inner_filters: Optional[List[AndFilterFiltersInner]] = Field(default=None, alias="innerFilters")
33
+ __properties: ClassVar[List[str]] = ["_t", "filters", "executionOrder", "innerFilters"]
34
+
35
+ @field_validator('t')
36
+ def t_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['OrFilter']):
39
+ raise ValueError("must be one of enum values ('OrFilter')")
40
+ return value
41
+
42
+ model_config = ConfigDict(
43
+ populate_by_name=True,
44
+ validate_assignment=True,
45
+ protected_namespaces=(),
46
+ )
47
+
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of OrFilter from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ * OpenAPI `readOnly` fields are excluded.
73
+ * OpenAPI `readOnly` fields are excluded.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ "execution_order",
77
+ "inner_filters",
78
+ ])
79
+
80
+ _dict = self.model_dump(
81
+ by_alias=True,
82
+ exclude=excluded_fields,
83
+ exclude_none=True,
84
+ )
85
+ # override the default output from pydantic by calling `to_dict()` of each item in filters (list)
86
+ _items = []
87
+ if self.filters:
88
+ for _item_filters in self.filters:
89
+ if _item_filters:
90
+ _items.append(_item_filters.to_dict())
91
+ _dict['filters'] = _items
92
+ # override the default output from pydantic by calling `to_dict()` of each item in inner_filters (list)
93
+ _items = []
94
+ if self.inner_filters:
95
+ for _item_inner_filters in self.inner_filters:
96
+ if _item_inner_filters:
97
+ _items.append(_item_inner_filters.to_dict())
98
+ _dict['innerFilters'] = _items
99
+ return _dict
100
+
101
+ @classmethod
102
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
103
+ """Create an instance of OrFilter from a dict"""
104
+ if obj is None:
105
+ return None
106
+
107
+ if not isinstance(obj, dict):
108
+ return cls.model_validate(obj)
109
+
110
+ _obj = cls.model_validate({
111
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'OrFilter',
112
+ "filters": [AndFilterFiltersInner.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None,
113
+ "executionOrder": obj.get("executionOrder"),
114
+ "innerFilters": [AndFilterFiltersInner.from_dict(_item) for _item in obj["innerFilters"]] if obj.get("innerFilters") is not None else None
115
+ })
116
+ return _obj
117
+
118
+ from rapidata.api_client.models.and_filter_filters_inner import AndFilterFiltersInner
119
+ # TODO: Rewrite to not use raise_errors
120
+ OrFilter.model_rebuild(raise_errors=False)
121
+
@@ -0,0 +1,38 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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 PromptType(str, Enum):
22
+ """
23
+ PromptType
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ NONE = 'None'
30
+ TEXT = 'Text'
31
+ ASSET = 'Asset'
32
+
33
+ @classmethod
34
+ def from_json(cls, json_str: str) -> Self:
35
+ """Create an instance of PromptType from a JSON string"""
36
+ return cls(json.loads(json_str))
37
+
38
+
@@ -0,0 +1,112 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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 PublicRapidResponse(BaseModel):
26
+ """
27
+ PublicRapidResponse
28
+ """ # noqa: E501
29
+ id: StrictStr
30
+ user_id: StrictStr = Field(alias="userId")
31
+ country: StrictStr
32
+ age: Optional[StrictStr] = None
33
+ occupation: Optional[StrictStr] = None
34
+ gender: Optional[StrictStr] = None
35
+ __properties: ClassVar[List[str]] = ["id", "userId", "country", "age", "occupation", "gender"]
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 PublicRapidResponse 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 age (nullable) is None
77
+ # and model_fields_set contains the field
78
+ if self.age is None and "age" in self.model_fields_set:
79
+ _dict['age'] = None
80
+
81
+ # set to None if occupation (nullable) is None
82
+ # and model_fields_set contains the field
83
+ if self.occupation is None and "occupation" in self.model_fields_set:
84
+ _dict['occupation'] = None
85
+
86
+ # set to None if gender (nullable) is None
87
+ # and model_fields_set contains the field
88
+ if self.gender is None and "gender" in self.model_fields_set:
89
+ _dict['gender'] = None
90
+
91
+ return _dict
92
+
93
+ @classmethod
94
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95
+ """Create an instance of PublicRapidResponse from a dict"""
96
+ if obj is None:
97
+ return None
98
+
99
+ if not isinstance(obj, dict):
100
+ return cls.model_validate(obj)
101
+
102
+ _obj = cls.model_validate({
103
+ "id": obj.get("id"),
104
+ "userId": obj.get("userId"),
105
+ "country": obj.get("country"),
106
+ "age": obj.get("age"),
107
+ "occupation": obj.get("occupation"),
108
+ "gender": obj.get("gender")
109
+ })
110
+ return _obj
111
+
112
+
@@ -0,0 +1,46 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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 RapidModality(str, Enum):
22
+ """
23
+ RapidModality
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ NONE = 'None'
30
+ BOUNDINGBOX = 'BoundingBox'
31
+ CLASSIFY = 'Classify'
32
+ COMPARE = 'Compare'
33
+ FREETEXT = 'FreeText'
34
+ LINE = 'Line'
35
+ LOCATE = 'Locate'
36
+ NAMEDENTITY = 'NamedEntity'
37
+ POLYGON = 'Polygon'
38
+ SCRUB = 'Scrub'
39
+ TRANSCRIPTION = 'Transcription'
40
+
41
+ @classmethod
42
+ def from_json(cls, json_str: str) -> Self:
43
+ """Create an instance of RapidModality from a JSON string"""
44
+ return cls(json.loads(json_str))
45
+
46
+
@@ -0,0 +1,109 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ResponseCountFilter(BaseModel):
26
+ """
27
+ ResponseCountFilter
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for ResponseCountFilter", alias="_t")
30
+ response_count: StrictInt = Field(alias="responseCount")
31
+ dimension: StrictStr
32
+ operator: StrictStr
33
+ execution_order: Optional[StrictInt] = Field(default=None, alias="executionOrder")
34
+ __properties: ClassVar[List[str]] = ["_t", "responseCount", "dimension", "operator", "executionOrder"]
35
+
36
+ @field_validator('t')
37
+ def t_validate_enum(cls, value):
38
+ """Validates the enum"""
39
+ if value not in set(['ResponseCountFilter']):
40
+ raise ValueError("must be one of enum values ('ResponseCountFilter')")
41
+ return value
42
+
43
+ @field_validator('operator')
44
+ def operator_validate_enum(cls, value):
45
+ """Validates the enum"""
46
+ if value not in set(['Equal', 'NotEqual', 'LessThan', 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual']):
47
+ raise ValueError("must be one of enum values ('Equal', 'NotEqual', 'LessThan', 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual')")
48
+ return value
49
+
50
+ model_config = ConfigDict(
51
+ populate_by_name=True,
52
+ validate_assignment=True,
53
+ protected_namespaces=(),
54
+ )
55
+
56
+
57
+ def to_str(self) -> str:
58
+ """Returns the string representation of the model using alias"""
59
+ return pprint.pformat(self.model_dump(by_alias=True))
60
+
61
+ def to_json(self) -> str:
62
+ """Returns the JSON representation of the model using alias"""
63
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
64
+ return json.dumps(self.to_dict())
65
+
66
+ @classmethod
67
+ def from_json(cls, json_str: str) -> Optional[Self]:
68
+ """Create an instance of ResponseCountFilter from a JSON string"""
69
+ return cls.from_dict(json.loads(json_str))
70
+
71
+ def to_dict(self) -> Dict[str, Any]:
72
+ """Return the dictionary representation of the model using alias.
73
+
74
+ This has the following differences from calling pydantic's
75
+ `self.model_dump(by_alias=True)`:
76
+
77
+ * `None` is only added to the output dict for nullable fields that
78
+ were set at model initialization. Other fields with value `None`
79
+ are ignored.
80
+ """
81
+ excluded_fields: Set[str] = set([
82
+ ])
83
+
84
+ _dict = self.model_dump(
85
+ by_alias=True,
86
+ exclude=excluded_fields,
87
+ exclude_none=True,
88
+ )
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of ResponseCountFilter 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
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'ResponseCountFilter',
102
+ "responseCount": obj.get("responseCount"),
103
+ "dimension": obj.get("dimension"),
104
+ "operator": obj.get("operator"),
105
+ "executionOrder": obj.get("executionOrder")
106
+ })
107
+ return _obj
108
+
109
+
@@ -0,0 +1,126 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from rapidata.api_client.models.datapoint_asset import DatapointAsset
24
+ from rapidata.api_client.models.get_validation_rapids_result_asset import GetValidationRapidsResultAsset
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class SampleByIdentifier(BaseModel):
29
+ """
30
+ SampleByIdentifier
31
+ """ # noqa: E501
32
+ id: StrictStr
33
+ identifier: StrictStr
34
+ participant_id: StrictStr = Field(alias="participantId")
35
+ participant_name: StrictStr = Field(alias="participantName")
36
+ asset: DatapointAsset
37
+ prompt: Optional[StrictStr] = None
38
+ prompt_asset: Optional[GetValidationRapidsResultAsset] = Field(default=None, alias="promptAsset")
39
+ tags: List[StrictStr]
40
+ created_at: Optional[datetime] = Field(default=None, alias="createdAt")
41
+ owner_id: Optional[StrictStr] = Field(default=None, alias="ownerId")
42
+ owner_mail: StrictStr = Field(alias="ownerMail")
43
+ __properties: ClassVar[List[str]] = ["id", "identifier", "participantId", "participantName", "asset", "prompt", "promptAsset", "tags", "createdAt", "ownerId", "ownerMail"]
44
+
45
+ model_config = ConfigDict(
46
+ populate_by_name=True,
47
+ validate_assignment=True,
48
+ protected_namespaces=(),
49
+ )
50
+
51
+
52
+ def to_str(self) -> str:
53
+ """Returns the string representation of the model using alias"""
54
+ return pprint.pformat(self.model_dump(by_alias=True))
55
+
56
+ def to_json(self) -> str:
57
+ """Returns the JSON representation of the model using alias"""
58
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
+ return json.dumps(self.to_dict())
60
+
61
+ @classmethod
62
+ def from_json(cls, json_str: str) -> Optional[Self]:
63
+ """Create an instance of SampleByIdentifier from a JSON string"""
64
+ return cls.from_dict(json.loads(json_str))
65
+
66
+ def to_dict(self) -> Dict[str, Any]:
67
+ """Return the dictionary representation of the model using alias.
68
+
69
+ This has the following differences from calling pydantic's
70
+ `self.model_dump(by_alias=True)`:
71
+
72
+ * `None` is only added to the output dict for nullable fields that
73
+ were set at model initialization. Other fields with value `None`
74
+ are ignored.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
84
+ # override the default output from pydantic by calling `to_dict()` of asset
85
+ if self.asset:
86
+ _dict['asset'] = self.asset.to_dict()
87
+ # override the default output from pydantic by calling `to_dict()` of prompt_asset
88
+ if self.prompt_asset:
89
+ _dict['promptAsset'] = self.prompt_asset.to_dict()
90
+ # set to None if prompt (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.prompt is None and "prompt" in self.model_fields_set:
93
+ _dict['prompt'] = None
94
+
95
+ # set to None if prompt_asset (nullable) is None
96
+ # and model_fields_set contains the field
97
+ if self.prompt_asset is None and "prompt_asset" in self.model_fields_set:
98
+ _dict['promptAsset'] = None
99
+
100
+ return _dict
101
+
102
+ @classmethod
103
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
104
+ """Create an instance of SampleByIdentifier from a dict"""
105
+ if obj is None:
106
+ return None
107
+
108
+ if not isinstance(obj, dict):
109
+ return cls.model_validate(obj)
110
+
111
+ _obj = cls.model_validate({
112
+ "id": obj.get("id"),
113
+ "identifier": obj.get("identifier"),
114
+ "participantId": obj.get("participantId"),
115
+ "participantName": obj.get("participantName"),
116
+ "asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
117
+ "prompt": obj.get("prompt"),
118
+ "promptAsset": GetValidationRapidsResultAsset.from_dict(obj["promptAsset"]) if obj.get("promptAsset") is not None else None,
119
+ "tags": obj.get("tags"),
120
+ "createdAt": obj.get("createdAt"),
121
+ "ownerId": obj.get("ownerId"),
122
+ "ownerMail": obj.get("ownerMail")
123
+ })
124
+ return _obj
125
+
126
+