rapidata 2.28.4__py3-none-any.whl → 2.29.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.

Potentially problematic release.


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

Files changed (108) hide show
  1. rapidata/__init__.py +1 -1
  2. rapidata/api_client/__init__.py +44 -17
  3. rapidata/api_client/api/__init__.py +1 -0
  4. rapidata/api_client/api/benchmark_api.py +2766 -0
  5. rapidata/api_client/api/campaign_api.py +0 -780
  6. rapidata/api_client/api/coco_api.py +0 -571
  7. rapidata/api_client/api/customer_rapid_api.py +332 -1
  8. rapidata/api_client/api/datapoint_api.py +0 -524
  9. rapidata/api_client/api/dataset_api.py +595 -2276
  10. rapidata/api_client/api/feedback_api.py +0 -270
  11. rapidata/api_client/api/identity_api.py +74 -888
  12. rapidata/api_client/api/leaderboard_api.py +1642 -259
  13. rapidata/api_client/api/order_api.py +617 -5692
  14. rapidata/api_client/api/pipeline_api.py +31 -334
  15. rapidata/api_client/api/validation_set_api.py +469 -3356
  16. rapidata/api_client/api/workflow_api.py +0 -799
  17. rapidata/api_client/models/__init__.py +43 -17
  18. rapidata/api_client/models/add_campaign_model.py +3 -3
  19. rapidata/api_client/models/add_validation_rapid_model.py +1 -3
  20. rapidata/api_client/models/add_validation_text_rapid_model.py +1 -3
  21. rapidata/api_client/models/and_user_filter_model.py +106 -0
  22. rapidata/api_client/models/and_user_filter_model_filters_inner.py +282 -0
  23. rapidata/api_client/models/benchmark_query_result.py +94 -0
  24. rapidata/api_client/models/benchmark_query_result_paged_result.py +105 -0
  25. rapidata/api_client/models/boost_leaderboard_model.py +89 -0
  26. rapidata/api_client/models/clone_order_model.py +2 -4
  27. rapidata/api_client/models/create_benchmark_model.py +87 -0
  28. rapidata/api_client/models/create_benchmark_participant_model.py +87 -0
  29. rapidata/api_client/models/create_benchmark_participant_result.py +89 -0
  30. rapidata/api_client/models/create_benchmark_result.py +87 -0
  31. rapidata/api_client/models/create_datapoint_result.py +4 -16
  32. rapidata/api_client/models/create_leaderboard_model.py +18 -2
  33. rapidata/api_client/models/create_leaderboard_result.py +5 -3
  34. rapidata/api_client/models/create_order_model.py +3 -3
  35. rapidata/api_client/models/file_asset_input.py +104 -0
  36. rapidata/api_client/models/file_asset_input1.py +104 -0
  37. rapidata/api_client/models/file_asset_input1_file.py +168 -0
  38. rapidata/api_client/models/file_asset_input2.py +104 -0
  39. rapidata/api_client/models/file_asset_input_file.py +182 -0
  40. rapidata/api_client/models/form_file_wrapper.py +120 -0
  41. rapidata/api_client/models/get_benchmark_by_id_query.py +96 -0
  42. rapidata/api_client/models/get_benchmark_by_id_query_result.py +94 -0
  43. rapidata/api_client/models/get_benchmark_by_id_query_result_paged_result.py +105 -0
  44. rapidata/api_client/models/get_benchmark_by_id_result.py +94 -0
  45. rapidata/api_client/models/get_participant_by_id_result.py +6 -22
  46. rapidata/api_client/models/get_standing_by_id_result.py +113 -0
  47. rapidata/api_client/models/get_validation_rapids_result.py +3 -3
  48. rapidata/api_client/models/get_workflow_results_result.py +3 -3
  49. rapidata/api_client/models/local_file_wrapper.py +120 -0
  50. rapidata/api_client/models/multi_asset_input.py +110 -0
  51. rapidata/api_client/models/multi_asset_input1.py +110 -0
  52. rapidata/api_client/models/multi_asset_input1_assets_inner.py +170 -0
  53. rapidata/api_client/models/multi_asset_input2.py +110 -0
  54. rapidata/api_client/models/multi_asset_input_assets_inner.py +170 -0
  55. rapidata/api_client/models/not_user_filter_model.py +3 -3
  56. rapidata/api_client/models/or_user_filter_model.py +3 -3
  57. rapidata/api_client/models/participant_by_benchmark.py +102 -0
  58. rapidata/api_client/models/participant_by_benchmark_paged_result.py +105 -0
  59. rapidata/api_client/models/participant_by_leaderboard.py +6 -2
  60. rapidata/api_client/models/participant_status.py +1 -4
  61. rapidata/api_client/models/pipeline_id_workflow_config_put_request.py +140 -0
  62. rapidata/api_client/models/potential_validation_rapid.py +103 -0
  63. rapidata/api_client/models/potential_validation_rapid_paged_result.py +105 -0
  64. rapidata/api_client/models/potential_validation_rapid_truth.py +280 -0
  65. rapidata/api_client/models/prompt_asset_metadata_input.py +3 -3
  66. rapidata/api_client/models/prompt_asset_metadata_input_asset.py +170 -0
  67. rapidata/api_client/models/prompt_by_benchmark_result.py +92 -0
  68. rapidata/api_client/models/prompt_by_benchmark_result_paged_result.py +105 -0
  69. rapidata/api_client/models/prompt_metadata_input.py +5 -3
  70. rapidata/api_client/models/proxy_file_wrapper.py +114 -0
  71. rapidata/api_client/models/query_validation_model.py +97 -0
  72. rapidata/api_client/models/rapid_model.py +3 -3
  73. rapidata/api_client/models/simple_workflow_config.py +3 -3
  74. rapidata/api_client/models/simple_workflow_model1.py +3 -3
  75. rapidata/api_client/models/standing_by_leaderboard.py +113 -0
  76. rapidata/api_client/models/standing_by_leaderboard_paged_result.py +105 -0
  77. rapidata/api_client/models/standing_status.py +38 -0
  78. rapidata/api_client/models/stream_file_wrapper.py +116 -0
  79. rapidata/api_client/models/submit_coco_model.py +1 -3
  80. rapidata/api_client/models/submit_prompt_model.py +89 -0
  81. rapidata/api_client/models/text_asset_input.py +100 -0
  82. rapidata/api_client/models/transcription_metadata_input.py +5 -3
  83. rapidata/api_client/models/validation_set_zip_post_request_blueprint.py +252 -0
  84. rapidata/api_client/models/zip_entry_file_wrapper.py +120 -0
  85. rapidata/api_client_README.md +67 -76
  86. rapidata/rapidata_client/benchmark/leaderboard/__init__.py +0 -0
  87. rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py +62 -0
  88. rapidata/rapidata_client/benchmark/rapidata_benchmark.py +227 -0
  89. rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +83 -0
  90. rapidata/rapidata_client/filter/not_filter.py +2 -2
  91. rapidata/rapidata_client/filter/or_filter.py +2 -2
  92. rapidata/rapidata_client/metadata/__init__.py +1 -0
  93. rapidata/rapidata_client/metadata/_media_asset_metadata.py +8 -1
  94. rapidata/rapidata_client/metadata/_prompt_identifier_metadata.py +15 -0
  95. rapidata/rapidata_client/order/_rapidata_dataset.py +6 -6
  96. rapidata/rapidata_client/order/_rapidata_order_builder.py +4 -4
  97. rapidata/rapidata_client/order/rapidata_order.py +1 -1
  98. rapidata/rapidata_client/rapidata_client.py +3 -3
  99. rapidata/rapidata_client/validation/rapidata_validation_set.py +1 -1
  100. rapidata/rapidata_client/validation/rapids/rapids.py +4 -6
  101. rapidata/service/openapi_service.py +5 -0
  102. {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/METADATA +1 -1
  103. {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/RECORD +106 -57
  104. rapidata/rapidata_client/leaderboard/rapidata_leaderboard.py +0 -127
  105. rapidata/rapidata_client/leaderboard/rapidata_leaderboard_manager.py +0 -92
  106. /rapidata/rapidata_client/{leaderboard → benchmark}/__init__.py +0 -0
  107. {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/LICENSE +0 -0
  108. {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,116 @@
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, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class StreamFileWrapper(BaseModel):
26
+ """
27
+ StreamFileWrapper
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for StreamFileWrapper", alias="_t")
30
+ stream: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]
31
+ name: StrictStr
32
+ content_length: Optional[StrictInt] = Field(default=None, alias="contentLength")
33
+ content_type: Optional[StrictStr] = Field(default=None, alias="contentType")
34
+ is_in_memory: Optional[StrictBool] = Field(default=None, alias="isInMemory")
35
+ __properties: ClassVar[List[str]] = ["_t", "stream", "name", "contentLength", "contentType", "isInMemory"]
36
+
37
+ @field_validator('t')
38
+ def t_validate_enum(cls, value):
39
+ """Validates the enum"""
40
+ if value not in set(['StreamFileWrapper']):
41
+ raise ValueError("must be one of enum values ('StreamFileWrapper')")
42
+ return value
43
+
44
+ model_config = ConfigDict(
45
+ populate_by_name=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.model_dump(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
+ return json.dumps(self.to_dict())
59
+
60
+ @classmethod
61
+ def from_json(cls, json_str: str) -> Optional[Self]:
62
+ """Create an instance of StreamFileWrapper from a JSON string"""
63
+ return cls.from_dict(json.loads(json_str))
64
+
65
+ def to_dict(self) -> Dict[str, Any]:
66
+ """Return the dictionary representation of the model using alias.
67
+
68
+ This has the following differences from calling pydantic's
69
+ `self.model_dump(by_alias=True)`:
70
+
71
+ * `None` is only added to the output dict for nullable fields that
72
+ were set at model initialization. Other fields with value `None`
73
+ are ignored.
74
+ * OpenAPI `readOnly` fields are excluded.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ "is_in_memory",
78
+ ])
79
+
80
+ _dict = self.model_dump(
81
+ by_alias=True,
82
+ exclude=excluded_fields,
83
+ exclude_none=True,
84
+ )
85
+ # set to None if content_length (nullable) is None
86
+ # and model_fields_set contains the field
87
+ if self.content_length is None and "content_length" in self.model_fields_set:
88
+ _dict['contentLength'] = None
89
+
90
+ # set to None if content_type (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.content_type is None and "content_type" in self.model_fields_set:
93
+ _dict['contentType'] = None
94
+
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
+ """Create an instance of StreamFileWrapper 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 'StreamFileWrapper',
108
+ "stream": obj.get("stream"),
109
+ "name": obj.get("name"),
110
+ "contentLength": obj.get("contentLength"),
111
+ "contentType": obj.get("contentType"),
112
+ "isInMemory": obj.get("isInMemory")
113
+ })
114
+ return _obj
115
+
116
+
@@ -27,9 +27,8 @@ class SubmitCocoModel(BaseModel):
27
27
  The model for submitting a CoCo set.
28
28
  """ # noqa: E501
29
29
  name: StrictStr = Field(description="The name of the validation set.")
30
- coco_set_id: StrictStr = Field(description="The ID of the CoCo set to use for validation.", alias="cocoSetId")
31
30
  categories: List[StrictStr] = Field(description="A subset of the categories from the CoCo set to use in the rapids.")
32
- __properties: ClassVar[List[str]] = ["name", "cocoSetId", "categories"]
31
+ __properties: ClassVar[List[str]] = ["name", "categories"]
33
32
 
34
33
  model_config = ConfigDict(
35
34
  populate_by_name=True,
@@ -83,7 +82,6 @@ class SubmitCocoModel(BaseModel):
83
82
 
84
83
  _obj = cls.model_validate({
85
84
  "name": obj.get("name"),
86
- "cocoSetId": obj.get("cocoSetId"),
87
85
  "categories": obj.get("categories")
88
86
  })
89
87
  return _obj
@@ -0,0 +1,89 @@
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
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class SubmitPromptModel(BaseModel):
26
+ """
27
+ The model user for submitting a prompt to a benchmark.
28
+ """ # noqa: E501
29
+ prompt: StrictStr = Field(description="The prompt")
30
+ identifier: StrictStr = Field(description="An identifier associated to the prompt")
31
+ __properties: ClassVar[List[str]] = ["prompt", "identifier"]
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 SubmitPromptModel 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 SubmitPromptModel 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
+ "prompt": obj.get("prompt"),
85
+ "identifier": obj.get("identifier")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,100 @@
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, 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 TextAssetInput(BaseModel):
26
+ """
27
+ TextAssetInput
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for TextAssetInput", alias="_t")
30
+ text: StrictStr
31
+ identifier: Optional[StrictStr] = None
32
+ __properties: ClassVar[List[str]] = ["_t", "text", "identifier"]
33
+
34
+ @field_validator('t')
35
+ def t_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value not in set(['TextAssetInput']):
38
+ raise ValueError("must be one of enum values ('TextAssetInput')")
39
+ return value
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of TextAssetInput from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ * OpenAPI `readOnly` fields are excluded.
72
+ """
73
+ excluded_fields: Set[str] = set([
74
+ "identifier",
75
+ ])
76
+
77
+ _dict = self.model_dump(
78
+ by_alias=True,
79
+ exclude=excluded_fields,
80
+ exclude_none=True,
81
+ )
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of TextAssetInput from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'TextAssetInput',
95
+ "text": obj.get("text"),
96
+ "identifier": obj.get("identifier")
97
+ })
98
+ return _obj
99
+
100
+
@@ -18,7 +18,7 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List
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
 
@@ -28,7 +28,8 @@ class TranscriptionMetadataInput(BaseModel):
28
28
  """ # noqa: E501
29
29
  t: StrictStr = Field(description="Discriminator value for TranscriptionMetadataInput", alias="_t")
30
30
  transcription: StrictStr
31
- __properties: ClassVar[List[str]] = ["_t", "transcription"]
31
+ identifier: Optional[StrictStr] = None
32
+ __properties: ClassVar[List[str]] = ["_t", "transcription", "identifier"]
32
33
 
33
34
  @field_validator('t')
34
35
  def t_validate_enum(cls, value):
@@ -89,7 +90,8 @@ class TranscriptionMetadataInput(BaseModel):
89
90
 
90
91
  _obj = cls.model_validate({
91
92
  "_t": obj.get("_t") if obj.get("_t") is not None else 'TranscriptionMetadataInput',
92
- "transcription": obj.get("transcription")
93
+ "transcription": obj.get("transcription"),
94
+ "identifier": obj.get("identifier")
93
95
  })
94
96
  return _obj
95
97
 
@@ -0,0 +1,252 @@
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
+ import pprint
18
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
19
+ from typing import Any, List, Optional
20
+ from rapidata.api_client.models.attach_category_rapid_blueprint import AttachCategoryRapidBlueprint
21
+ from rapidata.api_client.models.bounding_box_rapid_blueprint import BoundingBoxRapidBlueprint
22
+ from rapidata.api_client.models.compare_rapid_blueprint import CompareRapidBlueprint
23
+ from rapidata.api_client.models.free_text_rapid_blueprint import FreeTextRapidBlueprint
24
+ from rapidata.api_client.models.line_rapid_blueprint import LineRapidBlueprint
25
+ from rapidata.api_client.models.locate_rapid_blueprint import LocateRapidBlueprint
26
+ from rapidata.api_client.models.named_entity_rapid_blueprint import NamedEntityRapidBlueprint
27
+ from rapidata.api_client.models.polygon_rapid_blueprint import PolygonRapidBlueprint
28
+ from rapidata.api_client.models.scrub_rapid_blueprint import ScrubRapidBlueprint
29
+ from rapidata.api_client.models.transcription_rapid_blueprint import TranscriptionRapidBlueprint
30
+ from pydantic import StrictStr, Field
31
+ from typing import Union, List, Set, Optional, Dict
32
+ from typing_extensions import Literal, Self
33
+
34
+ VALIDATIONSETZIPPOSTREQUESTBLUEPRINT_ONE_OF_SCHEMAS = ["AttachCategoryRapidBlueprint", "BoundingBoxRapidBlueprint", "CompareRapidBlueprint", "FreeTextRapidBlueprint", "LineRapidBlueprint", "LocateRapidBlueprint", "NamedEntityRapidBlueprint", "PolygonRapidBlueprint", "ScrubRapidBlueprint", "TranscriptionRapidBlueprint"]
35
+
36
+ class ValidationSetZipPostRequestBlueprint(BaseModel):
37
+ """
38
+ ValidationSetZipPostRequestBlueprint
39
+ """
40
+ # data type: TranscriptionRapidBlueprint
41
+ oneof_schema_1_validator: Optional[TranscriptionRapidBlueprint] = None
42
+ # data type: ScrubRapidBlueprint
43
+ oneof_schema_2_validator: Optional[ScrubRapidBlueprint] = None
44
+ # data type: PolygonRapidBlueprint
45
+ oneof_schema_3_validator: Optional[PolygonRapidBlueprint] = None
46
+ # data type: NamedEntityRapidBlueprint
47
+ oneof_schema_4_validator: Optional[NamedEntityRapidBlueprint] = None
48
+ # data type: LocateRapidBlueprint
49
+ oneof_schema_5_validator: Optional[LocateRapidBlueprint] = None
50
+ # data type: LineRapidBlueprint
51
+ oneof_schema_6_validator: Optional[LineRapidBlueprint] = None
52
+ # data type: FreeTextRapidBlueprint
53
+ oneof_schema_7_validator: Optional[FreeTextRapidBlueprint] = None
54
+ # data type: CompareRapidBlueprint
55
+ oneof_schema_8_validator: Optional[CompareRapidBlueprint] = None
56
+ # data type: AttachCategoryRapidBlueprint
57
+ oneof_schema_9_validator: Optional[AttachCategoryRapidBlueprint] = None
58
+ # data type: BoundingBoxRapidBlueprint
59
+ oneof_schema_10_validator: Optional[BoundingBoxRapidBlueprint] = None
60
+ actual_instance: Optional[Union[AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint]] = None
61
+ one_of_schemas: Set[str] = { "AttachCategoryRapidBlueprint", "BoundingBoxRapidBlueprint", "CompareRapidBlueprint", "FreeTextRapidBlueprint", "LineRapidBlueprint", "LocateRapidBlueprint", "NamedEntityRapidBlueprint", "PolygonRapidBlueprint", "ScrubRapidBlueprint", "TranscriptionRapidBlueprint" }
62
+
63
+ model_config = ConfigDict(
64
+ validate_assignment=True,
65
+ protected_namespaces=(),
66
+ )
67
+
68
+
69
+ discriminator_value_class_map: Dict[str, str] = {
70
+ }
71
+
72
+ def __init__(self, *args, **kwargs) -> None:
73
+ if args:
74
+ if len(args) > 1:
75
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
76
+ if kwargs:
77
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
78
+ super().__init__(actual_instance=args[0])
79
+ else:
80
+ super().__init__(**kwargs)
81
+
82
+ @field_validator('actual_instance')
83
+ def actual_instance_must_validate_oneof(cls, v):
84
+ instance = ValidationSetZipPostRequestBlueprint.model_construct()
85
+ error_messages = []
86
+ match = 0
87
+ # validate data type: TranscriptionRapidBlueprint
88
+ if not isinstance(v, TranscriptionRapidBlueprint):
89
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionRapidBlueprint`")
90
+ else:
91
+ match += 1
92
+ # validate data type: ScrubRapidBlueprint
93
+ if not isinstance(v, ScrubRapidBlueprint):
94
+ error_messages.append(f"Error! Input type `{type(v)}` is not `ScrubRapidBlueprint`")
95
+ else:
96
+ match += 1
97
+ # validate data type: PolygonRapidBlueprint
98
+ if not isinstance(v, PolygonRapidBlueprint):
99
+ error_messages.append(f"Error! Input type `{type(v)}` is not `PolygonRapidBlueprint`")
100
+ else:
101
+ match += 1
102
+ # validate data type: NamedEntityRapidBlueprint
103
+ if not isinstance(v, NamedEntityRapidBlueprint):
104
+ error_messages.append(f"Error! Input type `{type(v)}` is not `NamedEntityRapidBlueprint`")
105
+ else:
106
+ match += 1
107
+ # validate data type: LocateRapidBlueprint
108
+ if not isinstance(v, LocateRapidBlueprint):
109
+ error_messages.append(f"Error! Input type `{type(v)}` is not `LocateRapidBlueprint`")
110
+ else:
111
+ match += 1
112
+ # validate data type: LineRapidBlueprint
113
+ if not isinstance(v, LineRapidBlueprint):
114
+ error_messages.append(f"Error! Input type `{type(v)}` is not `LineRapidBlueprint`")
115
+ else:
116
+ match += 1
117
+ # validate data type: FreeTextRapidBlueprint
118
+ if not isinstance(v, FreeTextRapidBlueprint):
119
+ error_messages.append(f"Error! Input type `{type(v)}` is not `FreeTextRapidBlueprint`")
120
+ else:
121
+ match += 1
122
+ # validate data type: CompareRapidBlueprint
123
+ if not isinstance(v, CompareRapidBlueprint):
124
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CompareRapidBlueprint`")
125
+ else:
126
+ match += 1
127
+ # validate data type: AttachCategoryRapidBlueprint
128
+ if not isinstance(v, AttachCategoryRapidBlueprint):
129
+ error_messages.append(f"Error! Input type `{type(v)}` is not `AttachCategoryRapidBlueprint`")
130
+ else:
131
+ match += 1
132
+ # validate data type: BoundingBoxRapidBlueprint
133
+ if not isinstance(v, BoundingBoxRapidBlueprint):
134
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BoundingBoxRapidBlueprint`")
135
+ else:
136
+ match += 1
137
+ if match > 1:
138
+ # more than 1 match
139
+ raise ValueError("Multiple matches found when setting `actual_instance` in ValidationSetZipPostRequestBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
140
+ elif match == 0:
141
+ # no match
142
+ raise ValueError("No match found when setting `actual_instance` in ValidationSetZipPostRequestBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
143
+ else:
144
+ return v
145
+
146
+ @classmethod
147
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
148
+ return cls.from_json(json.dumps(obj))
149
+
150
+ @classmethod
151
+ def from_json(cls, json_str: str) -> Self:
152
+ """Returns the object represented by the json string"""
153
+ instance = cls.model_construct()
154
+ error_messages = []
155
+ match = 0
156
+
157
+ # deserialize data into TranscriptionRapidBlueprint
158
+ try:
159
+ instance.actual_instance = TranscriptionRapidBlueprint.from_json(json_str)
160
+ match += 1
161
+ except (ValidationError, ValueError) as e:
162
+ error_messages.append(str(e))
163
+ # deserialize data into ScrubRapidBlueprint
164
+ try:
165
+ instance.actual_instance = ScrubRapidBlueprint.from_json(json_str)
166
+ match += 1
167
+ except (ValidationError, ValueError) as e:
168
+ error_messages.append(str(e))
169
+ # deserialize data into PolygonRapidBlueprint
170
+ try:
171
+ instance.actual_instance = PolygonRapidBlueprint.from_json(json_str)
172
+ match += 1
173
+ except (ValidationError, ValueError) as e:
174
+ error_messages.append(str(e))
175
+ # deserialize data into NamedEntityRapidBlueprint
176
+ try:
177
+ instance.actual_instance = NamedEntityRapidBlueprint.from_json(json_str)
178
+ match += 1
179
+ except (ValidationError, ValueError) as e:
180
+ error_messages.append(str(e))
181
+ # deserialize data into LocateRapidBlueprint
182
+ try:
183
+ instance.actual_instance = LocateRapidBlueprint.from_json(json_str)
184
+ match += 1
185
+ except (ValidationError, ValueError) as e:
186
+ error_messages.append(str(e))
187
+ # deserialize data into LineRapidBlueprint
188
+ try:
189
+ instance.actual_instance = LineRapidBlueprint.from_json(json_str)
190
+ match += 1
191
+ except (ValidationError, ValueError) as e:
192
+ error_messages.append(str(e))
193
+ # deserialize data into FreeTextRapidBlueprint
194
+ try:
195
+ instance.actual_instance = FreeTextRapidBlueprint.from_json(json_str)
196
+ match += 1
197
+ except (ValidationError, ValueError) as e:
198
+ error_messages.append(str(e))
199
+ # deserialize data into CompareRapidBlueprint
200
+ try:
201
+ instance.actual_instance = CompareRapidBlueprint.from_json(json_str)
202
+ match += 1
203
+ except (ValidationError, ValueError) as e:
204
+ error_messages.append(str(e))
205
+ # deserialize data into AttachCategoryRapidBlueprint
206
+ try:
207
+ instance.actual_instance = AttachCategoryRapidBlueprint.from_json(json_str)
208
+ match += 1
209
+ except (ValidationError, ValueError) as e:
210
+ error_messages.append(str(e))
211
+ # deserialize data into BoundingBoxRapidBlueprint
212
+ try:
213
+ instance.actual_instance = BoundingBoxRapidBlueprint.from_json(json_str)
214
+ match += 1
215
+ except (ValidationError, ValueError) as e:
216
+ error_messages.append(str(e))
217
+
218
+ if match > 1:
219
+ # more than 1 match
220
+ raise ValueError("Multiple matches found when deserializing the JSON string into ValidationSetZipPostRequestBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
221
+ elif match == 0:
222
+ # no match
223
+ raise ValueError("No match found when deserializing the JSON string into ValidationSetZipPostRequestBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
224
+ else:
225
+ return instance
226
+
227
+ def to_json(self) -> str:
228
+ """Returns the JSON representation of the actual instance"""
229
+ if self.actual_instance is None:
230
+ return "null"
231
+
232
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
233
+ return self.actual_instance.to_json()
234
+ else:
235
+ return json.dumps(self.actual_instance)
236
+
237
+ def to_dict(self) -> Optional[Union[Dict[str, Any], AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint]]:
238
+ """Returns the dict representation of the actual instance"""
239
+ if self.actual_instance is None:
240
+ return None
241
+
242
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
243
+ return self.actual_instance.to_dict()
244
+ else:
245
+ # primitive type
246
+ return self.actual_instance
247
+
248
+ def to_str(self) -> str:
249
+ """Returns the string representation of the actual instance"""
250
+ return pprint.pformat(self.model_dump())
251
+
252
+