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
@@ -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 PromptMetadataInput(BaseModel):
28
28
  """ # noqa: E501
29
29
  t: StrictStr = Field(description="Discriminator value for PromptMetadataInput", alias="_t")
30
30
  prompt: StrictStr
31
- __properties: ClassVar[List[str]] = ["_t", "prompt"]
31
+ identifier: Optional[StrictStr] = None
32
+ __properties: ClassVar[List[str]] = ["_t", "prompt", "identifier"]
32
33
 
33
34
  @field_validator('t')
34
35
  def t_validate_enum(cls, value):
@@ -89,7 +90,8 @@ class PromptMetadataInput(BaseModel):
89
90
 
90
91
  _obj = cls.model_validate({
91
92
  "_t": obj.get("_t") if obj.get("_t") is not None else 'PromptMetadataInput',
92
- "prompt": obj.get("prompt")
93
+ "prompt": obj.get("prompt"),
94
+ "identifier": obj.get("identifier")
93
95
  })
94
96
  return _obj
95
97
 
@@ -0,0 +1,114 @@
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 ProxyFileWrapper(BaseModel):
26
+ """
27
+ ProxyFileWrapper
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for ProxyFileWrapper", 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(['ProxyFileWrapper']):
40
+ raise ValueError("must be one of enum values ('ProxyFileWrapper')")
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 ProxyFileWrapper 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
+ """
75
+ excluded_fields: Set[str] = set([
76
+ "is_in_memory",
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
84
+ # set to None if content_length (nullable) is None
85
+ # and model_fields_set contains the field
86
+ if self.content_length is None and "content_length" in self.model_fields_set:
87
+ _dict['contentLength'] = None
88
+
89
+ # set to None if content_type (nullable) is None
90
+ # and model_fields_set contains the field
91
+ if self.content_type is None and "content_type" in self.model_fields_set:
92
+ _dict['contentType'] = None
93
+
94
+ return _dict
95
+
96
+ @classmethod
97
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
+ """Create an instance of ProxyFileWrapper from a dict"""
99
+ if obj is None:
100
+ return None
101
+
102
+ if not isinstance(obj, dict):
103
+ return cls.model_validate(obj)
104
+
105
+ _obj = cls.model_validate({
106
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'ProxyFileWrapper',
107
+ "name": obj.get("name"),
108
+ "contentLength": obj.get("contentLength"),
109
+ "contentType": obj.get("contentType"),
110
+ "isInMemory": obj.get("isInMemory")
111
+ })
112
+ return _obj
113
+
114
+
@@ -0,0 +1,97 @@
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
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.page_info import PageInfo
23
+ from rapidata.api_client.models.root_filter import RootFilter
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class QueryValidationModel(BaseModel):
28
+ """
29
+ The Query Model specific to the validation rapid eligibility query.
30
+ """ # noqa: E501
31
+ page: Optional[PageInfo] = None
32
+ filter: Optional[RootFilter] = None
33
+ __properties: ClassVar[List[str]] = ["page", "filter"]
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 QueryValidationModel 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 page
75
+ if self.page:
76
+ _dict['page'] = self.page.to_dict()
77
+ # override the default output from pydantic by calling `to_dict()` of filter
78
+ if self.filter:
79
+ _dict['filter'] = self.filter.to_dict()
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of QueryValidationModel from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "page": PageInfo.from_dict(obj["page"]) if obj.get("page") is not None else None,
93
+ "filter": RootFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None
94
+ })
95
+ return _obj
96
+
97
+
@@ -22,9 +22,9 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, Stri
22
22
  from typing import Any, ClassVar, Dict, List, Optional, Union
23
23
  from rapidata.api_client.models.datapoint_asset import DatapointAsset
24
24
  from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
25
+ from rapidata.api_client.models.get_validation_rapids_result_payload import GetValidationRapidsResultPayload
25
26
  from rapidata.api_client.models.get_validation_rapids_result_truth import GetValidationRapidsResultTruth
26
27
  from rapidata.api_client.models.rapid_model_referee import RapidModelReferee
27
- from rapidata.api_client.models.validation_set_validation_set_id_rapid_post_payload_parameter import ValidationSetValidationSetIdRapidPostPayloadParameter
28
28
  from typing import Optional, Set
29
29
  from typing_extensions import Self
30
30
 
@@ -33,7 +33,7 @@ class RapidModel(BaseModel):
33
33
  RapidModel
34
34
  """ # noqa: E501
35
35
  id: StrictStr
36
- payload: ValidationSetValidationSetIdRapidPostPayloadParameter
36
+ payload: GetValidationRapidsResultPayload
37
37
  referee: RapidModelReferee
38
38
  asset: DatapointAsset
39
39
  metadata: Dict[str, FileAssetModelMetadataValue]
@@ -150,7 +150,7 @@ class RapidModel(BaseModel):
150
150
 
151
151
  _obj = cls.model_validate({
152
152
  "id": obj.get("id"),
153
- "payload": ValidationSetValidationSetIdRapidPostPayloadParameter.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
153
+ "payload": GetValidationRapidsResultPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
154
154
  "referee": RapidModelReferee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
155
155
  "asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
156
156
  "metadata": dict(
@@ -20,7 +20,7 @@ import json
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List
22
22
  from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
23
- from rapidata.api_client.models.validation_import_post_request_blueprint import ValidationImportPostRequestBlueprint
23
+ from rapidata.api_client.models.validation_set_zip_post_request_blueprint import ValidationSetZipPostRequestBlueprint
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
@@ -30,7 +30,7 @@ class SimpleWorkflowConfig(BaseModel):
30
30
  """ # noqa: E501
31
31
  t: StrictStr = Field(description="Discriminator value for SimpleWorkflowConfig", alias="_t")
32
32
  referee: CompareWorkflowModel1Referee
33
- blueprint: ValidationImportPostRequestBlueprint
33
+ blueprint: ValidationSetZipPostRequestBlueprint
34
34
  __properties: ClassVar[List[str]] = ["_t", "referee", "blueprint"]
35
35
 
36
36
  @field_validator('t')
@@ -99,7 +99,7 @@ class SimpleWorkflowConfig(BaseModel):
99
99
  _obj = cls.model_validate({
100
100
  "_t": obj.get("_t") if obj.get("_t") is not None else 'SimpleWorkflowConfig',
101
101
  "referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
102
- "blueprint": ValidationImportPostRequestBlueprint.from_dict(obj["blueprint"]) if obj.get("blueprint") is not None else None
102
+ "blueprint": ValidationSetZipPostRequestBlueprint.from_dict(obj["blueprint"]) if obj.get("blueprint") is not None else None
103
103
  })
104
104
  return _obj
105
105
 
@@ -20,7 +20,7 @@ import json
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
23
- from rapidata.api_client.models.validation_import_post_request_blueprint import ValidationImportPostRequestBlueprint
23
+ from rapidata.api_client.models.validation_set_zip_post_request_blueprint import ValidationSetZipPostRequestBlueprint
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
@@ -32,7 +32,7 @@ class SimpleWorkflowModel1(BaseModel):
32
32
  id: StrictStr
33
33
  dataset_id: Optional[StrictStr] = Field(default=None, alias="datasetId")
34
34
  state: StrictStr
35
- blueprint: ValidationImportPostRequestBlueprint
35
+ blueprint: ValidationSetZipPostRequestBlueprint
36
36
  referee: CompareWorkflowModel1Referee
37
37
  name: StrictStr
38
38
  owner_mail: Optional[StrictStr] = Field(default=None, alias="ownerMail")
@@ -116,7 +116,7 @@ class SimpleWorkflowModel1(BaseModel):
116
116
  "id": obj.get("id"),
117
117
  "datasetId": obj.get("datasetId"),
118
118
  "state": obj.get("state"),
119
- "blueprint": ValidationImportPostRequestBlueprint.from_dict(obj["blueprint"]) if obj.get("blueprint") is not None else None,
119
+ "blueprint": ValidationSetZipPostRequestBlueprint.from_dict(obj["blueprint"]) if obj.get("blueprint") is not None else None,
120
120
  "referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
121
121
  "name": obj.get("name"),
122
122
  "ownerMail": obj.get("ownerMail")
@@ -0,0 +1,113 @@
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, StrictFloat, StrictInt, StrictStr, field_validator
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 StandingByLeaderboard(BaseModel):
26
+ """
27
+ StandingByLeaderboard
28
+ """ # noqa: E501
29
+ id: StrictStr
30
+ name: StrictStr
31
+ leaderboard_id: StrictStr = Field(alias="leaderboardId")
32
+ dataset_id: StrictStr = Field(alias="datasetId")
33
+ status: StrictStr
34
+ score: Optional[Union[StrictFloat, StrictInt]] = None
35
+ wins: StrictInt
36
+ total_matches: StrictInt = Field(alias="totalMatches")
37
+ __properties: ClassVar[List[str]] = ["id", "name", "leaderboardId", "datasetId", "status", "score", "wins", "totalMatches"]
38
+
39
+ @field_validator('status')
40
+ def status_validate_enum(cls, value):
41
+ """Validates the enum"""
42
+ if value not in set(['Created', 'Active', 'Idle']):
43
+ raise ValueError("must be one of enum values ('Created', 'Active', 'Idle')")
44
+ return value
45
+
46
+ model_config = ConfigDict(
47
+ populate_by_name=True,
48
+ validate_assignment=True,
49
+ protected_namespaces=(),
50
+ )
51
+
52
+
53
+ def to_str(self) -> str:
54
+ """Returns the string representation of the model using alias"""
55
+ return pprint.pformat(self.model_dump(by_alias=True))
56
+
57
+ def to_json(self) -> str:
58
+ """Returns the JSON representation of the model using alias"""
59
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
60
+ return json.dumps(self.to_dict())
61
+
62
+ @classmethod
63
+ def from_json(cls, json_str: str) -> Optional[Self]:
64
+ """Create an instance of StandingByLeaderboard from a JSON string"""
65
+ return cls.from_dict(json.loads(json_str))
66
+
67
+ def to_dict(self) -> Dict[str, Any]:
68
+ """Return the dictionary representation of the model using alias.
69
+
70
+ This has the following differences from calling pydantic's
71
+ `self.model_dump(by_alias=True)`:
72
+
73
+ * `None` is only added to the output dict for nullable fields that
74
+ were set at model initialization. Other fields with value `None`
75
+ are ignored.
76
+ """
77
+ excluded_fields: Set[str] = set([
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 score (nullable) is None
86
+ # and model_fields_set contains the field
87
+ if self.score is None and "score" in self.model_fields_set:
88
+ _dict['score'] = None
89
+
90
+ return _dict
91
+
92
+ @classmethod
93
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94
+ """Create an instance of StandingByLeaderboard from a dict"""
95
+ if obj is None:
96
+ return None
97
+
98
+ if not isinstance(obj, dict):
99
+ return cls.model_validate(obj)
100
+
101
+ _obj = cls.model_validate({
102
+ "id": obj.get("id"),
103
+ "name": obj.get("name"),
104
+ "leaderboardId": obj.get("leaderboardId"),
105
+ "datasetId": obj.get("datasetId"),
106
+ "status": obj.get("status"),
107
+ "score": obj.get("score"),
108
+ "wins": obj.get("wins"),
109
+ "totalMatches": obj.get("totalMatches")
110
+ })
111
+ return _obj
112
+
113
+
@@ -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, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.standing_by_leaderboard import StandingByLeaderboard
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class StandingByLeaderboardPagedResult(BaseModel):
27
+ """
28
+ StandingByLeaderboardPagedResult
29
+ """ # noqa: E501
30
+ total: StrictInt
31
+ page: StrictInt
32
+ page_size: StrictInt = Field(alias="pageSize")
33
+ items: List[StandingByLeaderboard]
34
+ total_pages: Optional[StrictInt] = Field(default=None, alias="totalPages")
35
+ __properties: ClassVar[List[str]] = ["total", "page", "pageSize", "items", "totalPages"]
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 StandingByLeaderboardPagedResult 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
+ * OpenAPI `readOnly` fields are excluded.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ "total_pages",
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # override the default output from pydantic by calling `to_dict()` of each item in items (list)
79
+ _items = []
80
+ if self.items:
81
+ for _item_items in self.items:
82
+ if _item_items:
83
+ _items.append(_item_items.to_dict())
84
+ _dict['items'] = _items
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of StandingByLeaderboardPagedResult from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "total": obj.get("total"),
98
+ "page": obj.get("page"),
99
+ "pageSize": obj.get("pageSize"),
100
+ "items": [StandingByLeaderboard.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
101
+ "totalPages": obj.get("totalPages")
102
+ })
103
+ return _obj
104
+
105
+
@@ -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 StandingStatus(str, Enum):
22
+ """
23
+ StandingStatus
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ CREATED = 'Created'
30
+ ACTIVE = 'Active'
31
+ IDLE = 'Idle'
32
+
33
+ @classmethod
34
+ def from_json(cls, json_str: str) -> Self:
35
+ """Create an instance of StandingStatus from a JSON string"""
36
+ return cls(json.loads(json_str))
37
+
38
+