rapidata 2.28.5__py3-none-any.whl → 2.29.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 (90) hide show
  1. rapidata/__init__.py +1 -1
  2. rapidata/api_client/__init__.py +45 -8
  3. rapidata/api_client/api/__init__.py +1 -0
  4. rapidata/api_client/api/benchmark_api.py +3033 -0
  5. rapidata/api_client/api/customer_rapid_api.py +332 -1
  6. rapidata/api_client/api/dataset_api.py +16 -0
  7. rapidata/api_client/api/leaderboard_api.py +1392 -270
  8. rapidata/api_client/models/__init__.py +44 -8
  9. rapidata/api_client/models/add_campaign_model.py +3 -3
  10. rapidata/api_client/models/and_user_filter_model.py +106 -0
  11. rapidata/api_client/models/and_user_filter_model_filters_inner.py +282 -0
  12. rapidata/api_client/models/benchmark_query_result.py +94 -0
  13. rapidata/api_client/models/benchmark_query_result_paged_result.py +105 -0
  14. rapidata/api_client/models/boost_leaderboard_model.py +89 -0
  15. rapidata/api_client/models/create_benchmark_model.py +87 -0
  16. rapidata/api_client/models/create_benchmark_participant_model.py +87 -0
  17. rapidata/api_client/models/create_benchmark_participant_result.py +89 -0
  18. rapidata/api_client/models/create_benchmark_result.py +87 -0
  19. rapidata/api_client/models/create_datapoint_result.py +4 -16
  20. rapidata/api_client/models/create_leaderboard_model.py +20 -2
  21. rapidata/api_client/models/create_leaderboard_result.py +15 -3
  22. rapidata/api_client/models/create_order_model.py +3 -3
  23. rapidata/api_client/models/file_asset_input.py +104 -0
  24. rapidata/api_client/models/file_asset_input1.py +104 -0
  25. rapidata/api_client/models/file_asset_input1_file.py +168 -0
  26. rapidata/api_client/models/file_asset_input2.py +104 -0
  27. rapidata/api_client/models/file_asset_input3.py +104 -0
  28. rapidata/api_client/models/file_asset_input_file.py +182 -0
  29. rapidata/api_client/models/form_file_wrapper.py +120 -0
  30. rapidata/api_client/models/get_benchmark_by_id_query.py +96 -0
  31. rapidata/api_client/models/get_benchmark_by_id_query_result.py +94 -0
  32. rapidata/api_client/models/get_benchmark_by_id_query_result_paged_result.py +105 -0
  33. rapidata/api_client/models/get_benchmark_by_id_result.py +94 -0
  34. rapidata/api_client/models/get_leaderboard_by_id_result.py +11 -3
  35. rapidata/api_client/models/get_participant_by_id_result.py +6 -26
  36. rapidata/api_client/models/get_standing_by_id_result.py +113 -0
  37. rapidata/api_client/models/leaderboard_query_result.py +11 -3
  38. rapidata/api_client/models/local_file_wrapper.py +120 -0
  39. rapidata/api_client/models/multi_asset_input.py +110 -0
  40. rapidata/api_client/models/multi_asset_input1.py +110 -0
  41. rapidata/api_client/models/multi_asset_input1_assets_inner.py +170 -0
  42. rapidata/api_client/models/multi_asset_input2.py +110 -0
  43. rapidata/api_client/models/multi_asset_input3.py +110 -0
  44. rapidata/api_client/models/multi_asset_input3_assets_inner.py +170 -0
  45. rapidata/api_client/models/multi_asset_input_assets_inner.py +170 -0
  46. rapidata/api_client/models/not_user_filter_model.py +3 -3
  47. rapidata/api_client/models/or_user_filter_model.py +3 -3
  48. rapidata/api_client/models/participant_by_benchmark.py +102 -0
  49. rapidata/api_client/models/participant_by_benchmark_paged_result.py +105 -0
  50. rapidata/api_client/models/participant_status.py +1 -4
  51. rapidata/api_client/models/potential_validation_rapid.py +103 -0
  52. rapidata/api_client/models/potential_validation_rapid_paged_result.py +105 -0
  53. rapidata/api_client/models/potential_validation_rapid_truth.py +280 -0
  54. rapidata/api_client/models/prompt_asset_metadata_input.py +3 -3
  55. rapidata/api_client/models/prompt_asset_metadata_input_asset.py +170 -0
  56. rapidata/api_client/models/prompt_by_benchmark_result.py +92 -0
  57. rapidata/api_client/models/prompt_by_benchmark_result_paged_result.py +105 -0
  58. rapidata/api_client/models/prompt_metadata_input.py +5 -3
  59. rapidata/api_client/models/proxy_file_wrapper.py +114 -0
  60. rapidata/api_client/models/query_validation_model.py +97 -0
  61. rapidata/api_client/models/standing_by_leaderboard.py +113 -0
  62. rapidata/api_client/models/standing_by_leaderboard_paged_result.py +105 -0
  63. rapidata/api_client/models/standing_status.py +38 -0
  64. rapidata/api_client/models/stream_file_wrapper.py +116 -0
  65. rapidata/api_client/models/submit_prompt_model.py +105 -0
  66. rapidata/api_client/models/submit_prompt_model_prompt_asset.py +174 -0
  67. rapidata/api_client/models/text_asset_input.py +100 -0
  68. rapidata/api_client/models/transcription_metadata_input.py +5 -3
  69. rapidata/api_client/models/zip_entry_file_wrapper.py +120 -0
  70. rapidata/api_client_README.md +67 -16
  71. rapidata/rapidata_client/benchmark/leaderboard/__init__.py +0 -0
  72. rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py +115 -0
  73. rapidata/rapidata_client/benchmark/rapidata_benchmark.py +256 -0
  74. rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +83 -0
  75. rapidata/rapidata_client/filter/not_filter.py +2 -2
  76. rapidata/rapidata_client/filter/or_filter.py +2 -2
  77. rapidata/rapidata_client/metadata/__init__.py +1 -0
  78. rapidata/rapidata_client/metadata/_media_asset_metadata.py +8 -1
  79. rapidata/rapidata_client/metadata/_prompt_identifier_metadata.py +15 -0
  80. rapidata/rapidata_client/order/_rapidata_dataset.py +6 -6
  81. rapidata/rapidata_client/order/_rapidata_order_builder.py +4 -4
  82. rapidata/rapidata_client/rapidata_client.py +3 -3
  83. rapidata/service/openapi_service.py +5 -0
  84. {rapidata-2.28.5.dist-info → rapidata-2.29.1.dist-info}/METADATA +1 -1
  85. {rapidata-2.28.5.dist-info → rapidata-2.29.1.dist-info}/RECORD +88 -37
  86. rapidata/rapidata_client/leaderboard/rapidata_leaderboard.py +0 -127
  87. rapidata/rapidata_client/leaderboard/rapidata_leaderboard_manager.py +0 -92
  88. /rapidata/rapidata_client/{leaderboard → benchmark}/__init__.py +0 -0
  89. {rapidata-2.28.5.dist-info → rapidata-2.29.1.dist-info}/LICENSE +0 -0
  90. {rapidata-2.28.5.dist-info → rapidata-2.29.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,105 @@
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 rapidata.api_client.models.submit_prompt_model_prompt_asset import SubmitPromptModelPromptAsset
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class SubmitPromptModel(BaseModel):
27
+ """
28
+ The model user for submitting a prompt to a benchmark.
29
+ """ # noqa: E501
30
+ identifier: StrictStr = Field(description="An identifier associated to the prompt")
31
+ prompt: Optional[StrictStr] = Field(default=None, description="The prompt")
32
+ prompt_asset: Optional[SubmitPromptModelPromptAsset] = Field(default=None, alias="promptAsset")
33
+ __properties: ClassVar[List[str]] = ["identifier", "prompt", "promptAsset"]
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 SubmitPromptModel 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 prompt_asset
75
+ if self.prompt_asset:
76
+ _dict['promptAsset'] = self.prompt_asset.to_dict()
77
+ # set to None if prompt (nullable) is None
78
+ # and model_fields_set contains the field
79
+ if self.prompt is None and "prompt" in self.model_fields_set:
80
+ _dict['prompt'] = None
81
+
82
+ # set to None if prompt_asset (nullable) is None
83
+ # and model_fields_set contains the field
84
+ if self.prompt_asset is None and "prompt_asset" in self.model_fields_set:
85
+ _dict['promptAsset'] = None
86
+
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of SubmitPromptModel from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate({
99
+ "identifier": obj.get("identifier"),
100
+ "prompt": obj.get("prompt"),
101
+ "promptAsset": SubmitPromptModelPromptAsset.from_dict(obj["promptAsset"]) if obj.get("promptAsset") is not None else None
102
+ })
103
+ return _obj
104
+
105
+
@@ -0,0 +1,174 @@
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.file_asset_input3 import FileAssetInput3
21
+ from rapidata.api_client.models.multi_asset_input3 import MultiAssetInput3
22
+ from rapidata.api_client.models.text_asset_input import TextAssetInput
23
+ from rapidata.api_client.models.url_asset_input import UrlAssetInput
24
+ from pydantic import StrictStr, Field
25
+ from typing import Union, List, Set, Optional, Dict
26
+ from typing_extensions import Literal, Self
27
+
28
+ SUBMITPROMPTMODELPROMPTASSET_ONE_OF_SCHEMAS = ["FileAssetInput3", "MultiAssetInput3", "TextAssetInput", "UrlAssetInput"]
29
+
30
+ class SubmitPromptModelPromptAsset(BaseModel):
31
+ """
32
+
33
+ """
34
+ # data type: FileAssetInput3
35
+ oneof_schema_1_validator: Optional[FileAssetInput3] = None
36
+ # data type: MultiAssetInput3
37
+ oneof_schema_2_validator: Optional[MultiAssetInput3] = None
38
+ # data type: TextAssetInput
39
+ oneof_schema_3_validator: Optional[TextAssetInput] = None
40
+ # data type: UrlAssetInput
41
+ oneof_schema_4_validator: Optional[UrlAssetInput] = None
42
+ actual_instance: Optional[Union[FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput]] = None
43
+ one_of_schemas: Set[str] = { "FileAssetInput3", "MultiAssetInput3", "TextAssetInput", "UrlAssetInput" }
44
+
45
+ model_config = ConfigDict(
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ discriminator_value_class_map: Dict[str, str] = {
52
+ }
53
+
54
+ def __init__(self, *args, **kwargs) -> None:
55
+ if args:
56
+ if len(args) > 1:
57
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
58
+ if kwargs:
59
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
60
+ super().__init__(actual_instance=args[0])
61
+ else:
62
+ super().__init__(**kwargs)
63
+
64
+ @field_validator('actual_instance')
65
+ def actual_instance_must_validate_oneof(cls, v):
66
+ if v is None:
67
+ return v
68
+
69
+ instance = SubmitPromptModelPromptAsset.model_construct()
70
+ error_messages = []
71
+ match = 0
72
+ # validate data type: FileAssetInput3
73
+ if not isinstance(v, FileAssetInput3):
74
+ error_messages.append(f"Error! Input type `{type(v)}` is not `FileAssetInput3`")
75
+ else:
76
+ match += 1
77
+ # validate data type: MultiAssetInput3
78
+ if not isinstance(v, MultiAssetInput3):
79
+ error_messages.append(f"Error! Input type `{type(v)}` is not `MultiAssetInput3`")
80
+ else:
81
+ match += 1
82
+ # validate data type: TextAssetInput
83
+ if not isinstance(v, TextAssetInput):
84
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TextAssetInput`")
85
+ else:
86
+ match += 1
87
+ # validate data type: UrlAssetInput
88
+ if not isinstance(v, UrlAssetInput):
89
+ error_messages.append(f"Error! Input type `{type(v)}` is not `UrlAssetInput`")
90
+ else:
91
+ match += 1
92
+ if match > 1:
93
+ # more than 1 match
94
+ raise ValueError("Multiple matches found when setting `actual_instance` in SubmitPromptModelPromptAsset with oneOf schemas: FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
95
+ elif match == 0:
96
+ # no match
97
+ raise ValueError("No match found when setting `actual_instance` in SubmitPromptModelPromptAsset with oneOf schemas: FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
98
+ else:
99
+ return v
100
+
101
+ @classmethod
102
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
103
+ return cls.from_json(json.dumps(obj))
104
+
105
+ @classmethod
106
+ def from_json(cls, json_str: Optional[str]) -> Self:
107
+ """Returns the object represented by the json string"""
108
+ instance = cls.model_construct()
109
+ if json_str is None:
110
+ return instance
111
+
112
+ error_messages = []
113
+ match = 0
114
+
115
+ # deserialize data into FileAssetInput3
116
+ try:
117
+ instance.actual_instance = FileAssetInput3.from_json(json_str)
118
+ match += 1
119
+ except (ValidationError, ValueError) as e:
120
+ error_messages.append(str(e))
121
+ # deserialize data into MultiAssetInput3
122
+ try:
123
+ instance.actual_instance = MultiAssetInput3.from_json(json_str)
124
+ match += 1
125
+ except (ValidationError, ValueError) as e:
126
+ error_messages.append(str(e))
127
+ # deserialize data into TextAssetInput
128
+ try:
129
+ instance.actual_instance = TextAssetInput.from_json(json_str)
130
+ match += 1
131
+ except (ValidationError, ValueError) as e:
132
+ error_messages.append(str(e))
133
+ # deserialize data into UrlAssetInput
134
+ try:
135
+ instance.actual_instance = UrlAssetInput.from_json(json_str)
136
+ match += 1
137
+ except (ValidationError, ValueError) as e:
138
+ error_messages.append(str(e))
139
+
140
+ if match > 1:
141
+ # more than 1 match
142
+ raise ValueError("Multiple matches found when deserializing the JSON string into SubmitPromptModelPromptAsset with oneOf schemas: FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
143
+ elif match == 0:
144
+ # no match
145
+ raise ValueError("No match found when deserializing the JSON string into SubmitPromptModelPromptAsset with oneOf schemas: FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
146
+ else:
147
+ return instance
148
+
149
+ def to_json(self) -> str:
150
+ """Returns the JSON representation of the actual instance"""
151
+ if self.actual_instance is None:
152
+ return "null"
153
+
154
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
155
+ return self.actual_instance.to_json()
156
+ else:
157
+ return json.dumps(self.actual_instance)
158
+
159
+ def to_dict(self) -> Optional[Union[Dict[str, Any], FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput]]:
160
+ """Returns the dict representation of the actual instance"""
161
+ if self.actual_instance is None:
162
+ return None
163
+
164
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
165
+ return self.actual_instance.to_dict()
166
+ else:
167
+ # primitive type
168
+ return self.actual_instance
169
+
170
+ def to_str(self) -> str:
171
+ """Returns the string representation of the actual instance"""
172
+ return pprint.pformat(self.model_dump())
173
+
174
+
@@ -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,120 @@
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, 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 ZipEntryFileWrapper(BaseModel):
26
+ """
27
+ ZipEntryFileWrapper
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for ZipEntryFileWrapper", alias="_t")
30
+ name: Optional[StrictStr] = None
31
+ content_length: Optional[StrictInt] = Field(default=None, alias="contentLength")
32
+ content_type: Optional[StrictStr] = Field(default=None, alias="contentType")
33
+ is_in_memory: Optional[StrictBool] = Field(default=None, alias="isInMemory")
34
+ __properties: ClassVar[List[str]] = ["_t", "name", "contentLength", "contentType", "isInMemory"]
35
+
36
+ @field_validator('t')
37
+ def t_validate_enum(cls, value):
38
+ """Validates the enum"""
39
+ if value not in set(['ZipEntryFileWrapper']):
40
+ raise ValueError("must be one of enum values ('ZipEntryFileWrapper')")
41
+ return value
42
+
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
+ return json.dumps(self.to_dict())
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
61
+ """Create an instance of ZipEntryFileWrapper from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ * OpenAPI `readOnly` fields are excluded.
74
+ * OpenAPI `readOnly` fields are excluded.
75
+ * OpenAPI `readOnly` fields are excluded.
76
+ * OpenAPI `readOnly` fields are excluded.
77
+ """
78
+ excluded_fields: Set[str] = set([
79
+ "name",
80
+ "content_length",
81
+ "content_type",
82
+ "is_in_memory",
83
+ ])
84
+
85
+ _dict = self.model_dump(
86
+ by_alias=True,
87
+ exclude=excluded_fields,
88
+ exclude_none=True,
89
+ )
90
+ # set to None if content_length (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.content_length is None and "content_length" in self.model_fields_set:
93
+ _dict['contentLength'] = None
94
+
95
+ # set to None if content_type (nullable) is None
96
+ # and model_fields_set contains the field
97
+ if self.content_type is None and "content_type" in self.model_fields_set:
98
+ _dict['contentType'] = 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 ZipEntryFileWrapper 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
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'ZipEntryFileWrapper',
113
+ "name": obj.get("name"),
114
+ "contentLength": obj.get("contentLength"),
115
+ "contentType": obj.get("contentType"),
116
+ "isInMemory": obj.get("isInMemory")
117
+ })
118
+ return _obj
119
+
120
+