rapidata 1.10.1__py3-none-any.whl → 2.1.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 (142) hide show
  1. rapidata/__init__.py +22 -17
  2. rapidata/api_client/__init__.py +16 -5
  3. rapidata/api_client/api/coco_api.py +14 -29
  4. rapidata/api_client/api/dataset_api.py +6 -6
  5. rapidata/api_client/api/identity_api.py +3 -3
  6. rapidata/api_client/api/pipeline_api.py +1008 -95
  7. rapidata/api_client/api/rapid_api.py +6 -6
  8. rapidata/api_client/api/validation_api.py +12 -42
  9. rapidata/api_client/models/__init__.py +16 -5
  10. rapidata/api_client/models/add_campaign_model.py +5 -5
  11. rapidata/api_client/models/add_validation_text_rapid_model.py +1 -1
  12. rapidata/api_client/models/age_group.py +5 -4
  13. rapidata/api_client/models/base_error.py +1 -4
  14. rapidata/api_client/models/compare_workflow_config.py +9 -24
  15. rapidata/api_client/models/compare_workflow_config_model.py +9 -29
  16. rapidata/api_client/models/compare_workflow_config_model_pair_maker_config.py +140 -0
  17. rapidata/api_client/models/compare_workflow_config_pair_maker_config.py +140 -0
  18. rapidata/api_client/models/compare_workflow_model.py +7 -3
  19. rapidata/api_client/models/compare_workflow_model1.py +7 -3
  20. rapidata/api_client/models/compare_workflow_model1_pair_maker_information.py +140 -0
  21. rapidata/api_client/models/compare_workflow_model_pair_maker_config.py +140 -0
  22. rapidata/api_client/models/create_order_model.py +4 -2
  23. rapidata/api_client/models/create_order_model_user_filters_inner.py +25 -11
  24. rapidata/api_client/models/custom_user_filter_model.py +98 -0
  25. rapidata/api_client/models/file_asset_model_metadata_inner.py +8 -22
  26. rapidata/api_client/models/get_classify_workflow_result_overview_result.py +144 -0
  27. rapidata/api_client/models/get_pipeline_by_id_result.py +13 -3
  28. rapidata/api_client/models/identity_read_bridge_token_get202_response.py +140 -0
  29. rapidata/api_client/models/not_available_yet_result.py +96 -0
  30. rapidata/api_client/models/online_pair_maker_config.py +98 -0
  31. rapidata/api_client/models/online_pair_maker_config_model.py +98 -0
  32. rapidata/api_client/models/online_pair_maker_information.py +100 -0
  33. rapidata/api_client/models/pipeline_id_workflow_put_request.py +140 -0
  34. rapidata/api_client/models/pre_arranged_pair_maker_config.py +100 -0
  35. rapidata/api_client/models/pre_arranged_pair_maker_config_model.py +96 -0
  36. rapidata/api_client/models/pre_arranged_pair_maker_information.py +102 -0
  37. rapidata/api_client/models/read_bridge_token_keys_result.py +11 -2
  38. rapidata/api_client/models/simple_workflow_config.py +7 -26
  39. rapidata/api_client/models/simple_workflow_config_model.py +4 -28
  40. rapidata/api_client/models/simple_workflow_get_result_overview_get200_response.py +16 -16
  41. rapidata/api_client/models/simple_workflow_model1.py +3 -3
  42. rapidata/api_client/models/update_campaign_model.py +99 -0
  43. rapidata/api_client/models/validation_import_post_request_blueprint.py +1 -1
  44. rapidata/api_client_README.md +21 -7
  45. rapidata/rapidata_client/__init__.py +20 -10
  46. rapidata/rapidata_client/assets/__init__.py +5 -4
  47. rapidata/rapidata_client/assets/{media_asset.py → _media_asset.py} +32 -11
  48. rapidata/rapidata_client/assets/{multi_asset.py → _multi_asset.py} +1 -1
  49. rapidata/rapidata_client/assets/{text_asset.py → _text_asset.py} +1 -1
  50. rapidata/rapidata_client/assets/data_type_enum.py +7 -0
  51. rapidata/rapidata_client/filter/__init__.py +2 -1
  52. rapidata/rapidata_client/filter/_base_filter.py +10 -0
  53. rapidata/rapidata_client/filter/age_filter.py +12 -5
  54. rapidata/rapidata_client/filter/campaign_filter.py +12 -3
  55. rapidata/rapidata_client/filter/country_filter.py +10 -3
  56. rapidata/rapidata_client/filter/custom_filter.py +29 -0
  57. rapidata/rapidata_client/filter/gender_filter.py +12 -5
  58. rapidata/rapidata_client/filter/language_filter.py +14 -3
  59. rapidata/rapidata_client/filter/models/age_group.py +26 -0
  60. rapidata/rapidata_client/filter/models/gender.py +19 -0
  61. rapidata/rapidata_client/filter/rapidata_filters.py +35 -0
  62. rapidata/rapidata_client/filter/user_score_filter.py +20 -4
  63. rapidata/rapidata_client/metadata/__init__.py +5 -5
  64. rapidata/rapidata_client/metadata/{base_metadata.py → _base_metadata.py} +2 -1
  65. rapidata/rapidata_client/metadata/{private_text_metadata.py → _private_text_metadata.py} +2 -2
  66. rapidata/rapidata_client/metadata/{prompt_metadata.py → _prompt_metadata.py} +3 -2
  67. rapidata/rapidata_client/metadata/{public_text_metadata.py → _public_text_metadata.py} +2 -2
  68. rapidata/rapidata_client/metadata/{select_words_metadata.py → _select_words_metadata.py} +3 -2
  69. rapidata/rapidata_client/{dataset/rapidata_dataset.py → order/_rapidata_dataset.py} +7 -8
  70. rapidata/rapidata_client/order/_rapidata_order_builder.py +365 -0
  71. rapidata/rapidata_client/order/rapidata_order.py +50 -32
  72. rapidata/rapidata_client/order/rapidata_order_manager.py +461 -0
  73. rapidata/rapidata_client/rapidata_client.py +12 -201
  74. rapidata/rapidata_client/referee/__init__.py +3 -3
  75. rapidata/rapidata_client/referee/{base_referee.py → _base_referee.py} +3 -3
  76. rapidata/rapidata_client/referee/{early_stopping_referee.py → _early_stopping_referee.py} +14 -11
  77. rapidata/rapidata_client/referee/{naive_referee.py → _naive_referee.py} +9 -9
  78. rapidata/rapidata_client/selection/__init__.py +1 -1
  79. rapidata/rapidata_client/{filter/base_filter.py → selection/_base_selection.py} +2 -2
  80. rapidata/rapidata_client/selection/capped_selection.py +15 -5
  81. rapidata/rapidata_client/selection/conditional_validation_selection.py +17 -4
  82. rapidata/rapidata_client/selection/demographic_selection.py +18 -7
  83. rapidata/rapidata_client/selection/labeling_selection.py +10 -3
  84. rapidata/rapidata_client/selection/rapidata_selections.py +21 -0
  85. rapidata/rapidata_client/selection/validation_selection.py +11 -4
  86. rapidata/rapidata_client/settings/__init__.py +9 -2
  87. rapidata/rapidata_client/settings/_rapidata_setting.py +11 -0
  88. rapidata/rapidata_client/settings/alert_on_fast_response.py +21 -0
  89. rapidata/rapidata_client/settings/custom_setting.py +16 -0
  90. rapidata/rapidata_client/settings/free_text_minimum_characters.py +16 -0
  91. rapidata/rapidata_client/settings/models/__init__.py +1 -0
  92. rapidata/rapidata_client/settings/models/translation_behaviour_options.py +14 -0
  93. rapidata/rapidata_client/settings/no_shuffle.py +16 -0
  94. rapidata/rapidata_client/settings/play_video_until_the_end.py +16 -0
  95. rapidata/rapidata_client/settings/rapidata_settings.py +31 -0
  96. rapidata/rapidata_client/settings/translation_behaviour.py +18 -0
  97. rapidata/rapidata_client/validation/__init__.py +1 -0
  98. rapidata/rapidata_client/{dataset/validation_rapid_parts.py → validation/_validation_rapid_parts.py} +7 -6
  99. rapidata/rapidata_client/validation/_validation_set_builder.py +371 -0
  100. rapidata/rapidata_client/{dataset → validation}/rapidata_validation_set.py +54 -50
  101. rapidata/rapidata_client/validation/rapids/__init__.py +1 -0
  102. rapidata/rapidata_client/validation/rapids/box.py +17 -0
  103. rapidata/rapidata_client/validation/rapids/rapids.py +94 -0
  104. rapidata/rapidata_client/validation/rapids/rapids_manager.py +163 -0
  105. rapidata/rapidata_client/validation/validation_set_manager.py +338 -0
  106. rapidata/rapidata_client/workflow/__init__.py +8 -6
  107. rapidata/rapidata_client/workflow/_base_workflow.py +25 -0
  108. rapidata/rapidata_client/workflow/{classify_workflow.py → _classify_workflow.py} +6 -6
  109. rapidata/rapidata_client/workflow/{compare_workflow.py → _compare_workflow.py} +10 -16
  110. rapidata/rapidata_client/workflow/_draw_workflow.py +22 -0
  111. rapidata/rapidata_client/workflow/_evaluation_workflow.py +26 -0
  112. rapidata/rapidata_client/workflow/{free_text_workflow.py → _free_text_workflow.py} +10 -16
  113. rapidata/rapidata_client/workflow/_locate_workflow.py +22 -0
  114. rapidata/rapidata_client/workflow/{select_words_workflow.py → _select_words_workflow.py} +2 -8
  115. rapidata/service/credential_manager.py +11 -1
  116. rapidata/service/openapi_service.py +23 -4
  117. {rapidata-1.10.1.dist-info → rapidata-2.1.0.dist-info}/METADATA +2 -1
  118. {rapidata-1.10.1.dist-info → rapidata-2.1.0.dist-info}/RECORD +122 -96
  119. rapidata/constants.py +0 -1
  120. rapidata/rapidata_client/dataset/rapid_builders/__init__.py +0 -4
  121. rapidata/rapidata_client/dataset/rapid_builders/base_rapid_builder.py +0 -33
  122. rapidata/rapidata_client/dataset/rapid_builders/classify_rapid_builders.py +0 -166
  123. rapidata/rapidata_client/dataset/rapid_builders/compare_rapid_builders.py +0 -145
  124. rapidata/rapidata_client/dataset/rapid_builders/rapids.py +0 -33
  125. rapidata/rapidata_client/dataset/rapid_builders/select_words_rapid_builders.py +0 -124
  126. rapidata/rapidata_client/dataset/validation_set_builder.py +0 -336
  127. rapidata/rapidata_client/order/order_builder.py +0 -25
  128. rapidata/rapidata_client/order/rapidata_order_builder.py +0 -463
  129. rapidata/rapidata_client/selection/base_selection.py +0 -9
  130. rapidata/rapidata_client/settings/feature_flags.py +0 -125
  131. rapidata/rapidata_client/settings/settings.py +0 -124
  132. rapidata/rapidata_client/simple_builders/__init__.py +0 -0
  133. rapidata/rapidata_client/simple_builders/simple_classification_builders.py +0 -271
  134. rapidata/rapidata_client/simple_builders/simple_compare_builders.py +0 -267
  135. rapidata/rapidata_client/simple_builders/simple_free_text_builders.py +0 -192
  136. rapidata/rapidata_client/simple_builders/simple_select_words_builders.py +0 -196
  137. rapidata/rapidata_client/workflow/base_workflow.py +0 -42
  138. rapidata/rapidata_client/workflow/evaluation_workflow.py +0 -15
  139. /rapidata/rapidata_client/assets/{base_asset.py → _base_asset.py} +0 -0
  140. /rapidata/rapidata_client/{dataset → filter/models}/__init__.py +0 -0
  141. {rapidata-1.10.1.dist-info → rapidata-2.1.0.dist-info}/LICENSE +0 -0
  142. {rapidata-1.10.1.dist-info → rapidata-2.1.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,96 @@
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
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class NotAvailableYetResult(BaseModel):
26
+ """
27
+ NotAvailableYetResult
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for NotAvailableYetResult", alias="_t")
30
+ message: StrictStr
31
+ __properties: ClassVar[List[str]] = ["_t", "message"]
32
+
33
+ @field_validator('t')
34
+ def t_validate_enum(cls, value):
35
+ """Validates the enum"""
36
+ if value not in set(['NotAvailableYetResult']):
37
+ raise ValueError("must be one of enum values ('NotAvailableYetResult')")
38
+ return value
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
45
+
46
+
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
50
+
51
+ def to_json(self) -> str:
52
+ """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
+ return json.dumps(self.to_dict())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of NotAvailableYetResult from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of NotAvailableYetResult from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'NotAvailableYetResult',
92
+ "message": obj.get("message")
93
+ })
94
+ return _obj
95
+
96
+
@@ -0,0 +1,98 @@
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 OnlinePairMakerConfig(BaseModel):
26
+ """
27
+ OnlinePairMakerConfig
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for OnlinePairMakerConfig", alias="_t")
30
+ random_matches_ratio: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="randomMatchesRatio")
31
+ total_comparison_budget: Optional[StrictInt] = Field(default=None, alias="totalComparisonBudget")
32
+ __properties: ClassVar[List[str]] = ["_t", "randomMatchesRatio", "totalComparisonBudget"]
33
+
34
+ @field_validator('t')
35
+ def t_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value not in set(['OnlinePairMakerConfig']):
38
+ raise ValueError("must be one of enum values ('OnlinePairMakerConfig')")
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 OnlinePairMakerConfig 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
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of OnlinePairMakerConfig 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
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'OnlinePairMakerConfig',
93
+ "randomMatchesRatio": obj.get("randomMatchesRatio"),
94
+ "totalComparisonBudget": obj.get("totalComparisonBudget")
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,98 @@
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 OnlinePairMakerConfigModel(BaseModel):
26
+ """
27
+ The OnlinePairMaker creates random pairs in the beginning and then continues to create pairs that are close in ranking.
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for OnlinePairMaker", alias="_t")
30
+ random_matches_ratio: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The ratio of random matches for the algorithm to burn-in.", alias="randomMatchesRatio")
31
+ total_comparison_budget: StrictInt = Field(description="Total number of comparisons to carry out.", alias="totalComparisonBudget")
32
+ __properties: ClassVar[List[str]] = ["_t", "randomMatchesRatio", "totalComparisonBudget"]
33
+
34
+ @field_validator('t')
35
+ def t_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value not in set(['OnlinePairMaker']):
38
+ raise ValueError("must be one of enum values ('OnlinePairMaker')")
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 OnlinePairMakerConfigModel 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
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of OnlinePairMakerConfigModel 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
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'OnlinePairMaker',
93
+ "randomMatchesRatio": obj.get("randomMatchesRatio"),
94
+ "totalComparisonBudget": obj.get("totalComparisonBudget")
95
+ })
96
+ return _obj
97
+
98
+
@@ -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, 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 OnlinePairMakerInformation(BaseModel):
26
+ """
27
+ OnlinePairMakerInformation
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for OnlinePairMakerInformation", alias="_t")
30
+ random_matches_ratio: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="randomMatchesRatio")
31
+ total_comparison_budget: Optional[StrictInt] = Field(default=None, alias="totalComparisonBudget")
32
+ current_comparison_budget: Optional[StrictInt] = Field(default=None, alias="currentComparisonBudget")
33
+ __properties: ClassVar[List[str]] = ["_t", "randomMatchesRatio", "totalComparisonBudget", "currentComparisonBudget"]
34
+
35
+ @field_validator('t')
36
+ def t_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['OnlinePairMakerInformation']):
39
+ raise ValueError("must be one of enum values ('OnlinePairMakerInformation')")
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 OnlinePairMakerInformation 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
+ """
73
+ excluded_fields: Set[str] = set([
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of OnlinePairMakerInformation from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'OnlinePairMakerInformation',
94
+ "randomMatchesRatio": obj.get("randomMatchesRatio"),
95
+ "totalComparisonBudget": obj.get("totalComparisonBudget"),
96
+ "currentComparisonBudget": obj.get("currentComparisonBudget")
97
+ })
98
+ return _obj
99
+
100
+
@@ -0,0 +1,140 @@
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.compare_workflow_config_model import CompareWorkflowConfigModel
21
+ from rapidata.api_client.models.simple_workflow_config_model import SimpleWorkflowConfigModel
22
+ from pydantic import StrictStr, Field
23
+ from typing import Union, List, Set, Optional, Dict
24
+ from typing_extensions import Literal, Self
25
+
26
+ PIPELINEIDWORKFLOWPUTREQUEST_ONE_OF_SCHEMAS = ["CompareWorkflowConfigModel", "SimpleWorkflowConfigModel"]
27
+
28
+ class PipelineIdWorkflowPutRequest(BaseModel):
29
+ """
30
+ The base configuration for a workflow.
31
+ """
32
+ # data type: CompareWorkflowConfigModel
33
+ oneof_schema_1_validator: Optional[CompareWorkflowConfigModel] = None
34
+ # data type: SimpleWorkflowConfigModel
35
+ oneof_schema_2_validator: Optional[SimpleWorkflowConfigModel] = None
36
+ actual_instance: Optional[Union[CompareWorkflowConfigModel, SimpleWorkflowConfigModel]] = None
37
+ one_of_schemas: Set[str] = { "CompareWorkflowConfigModel", "SimpleWorkflowConfigModel" }
38
+
39
+ model_config = ConfigDict(
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ discriminator_value_class_map: Dict[str, str] = {
46
+ }
47
+
48
+ def __init__(self, *args, **kwargs) -> None:
49
+ if args:
50
+ if len(args) > 1:
51
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
52
+ if kwargs:
53
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
54
+ super().__init__(actual_instance=args[0])
55
+ else:
56
+ super().__init__(**kwargs)
57
+
58
+ @field_validator('actual_instance')
59
+ def actual_instance_must_validate_oneof(cls, v):
60
+ instance = PipelineIdWorkflowPutRequest.model_construct()
61
+ error_messages = []
62
+ match = 0
63
+ # validate data type: CompareWorkflowConfigModel
64
+ if not isinstance(v, CompareWorkflowConfigModel):
65
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CompareWorkflowConfigModel`")
66
+ else:
67
+ match += 1
68
+ # validate data type: SimpleWorkflowConfigModel
69
+ if not isinstance(v, SimpleWorkflowConfigModel):
70
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SimpleWorkflowConfigModel`")
71
+ else:
72
+ match += 1
73
+ if match > 1:
74
+ # more than 1 match
75
+ raise ValueError("Multiple matches found when setting `actual_instance` in PipelineIdWorkflowPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
76
+ elif match == 0:
77
+ # no match
78
+ raise ValueError("No match found when setting `actual_instance` in PipelineIdWorkflowPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
79
+ else:
80
+ return v
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
84
+ return cls.from_json(json.dumps(obj))
85
+
86
+ @classmethod
87
+ def from_json(cls, json_str: str) -> Self:
88
+ """Returns the object represented by the json string"""
89
+ instance = cls.model_construct()
90
+ error_messages = []
91
+ match = 0
92
+
93
+ # deserialize data into CompareWorkflowConfigModel
94
+ try:
95
+ instance.actual_instance = CompareWorkflowConfigModel.from_json(json_str)
96
+ match += 1
97
+ except (ValidationError, ValueError) as e:
98
+ error_messages.append(str(e))
99
+ # deserialize data into SimpleWorkflowConfigModel
100
+ try:
101
+ instance.actual_instance = SimpleWorkflowConfigModel.from_json(json_str)
102
+ match += 1
103
+ except (ValidationError, ValueError) as e:
104
+ error_messages.append(str(e))
105
+
106
+ if match > 1:
107
+ # more than 1 match
108
+ raise ValueError("Multiple matches found when deserializing the JSON string into PipelineIdWorkflowPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
109
+ elif match == 0:
110
+ # no match
111
+ raise ValueError("No match found when deserializing the JSON string into PipelineIdWorkflowPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
112
+ else:
113
+ return instance
114
+
115
+ def to_json(self) -> str:
116
+ """Returns the JSON representation of the actual instance"""
117
+ if self.actual_instance is None:
118
+ return "null"
119
+
120
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
121
+ return self.actual_instance.to_json()
122
+ else:
123
+ return json.dumps(self.actual_instance)
124
+
125
+ def to_dict(self) -> Optional[Union[Dict[str, Any], CompareWorkflowConfigModel, SimpleWorkflowConfigModel]]:
126
+ """Returns the dict representation of the actual instance"""
127
+ if self.actual_instance is None:
128
+ return None
129
+
130
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
131
+ return self.actual_instance.to_dict()
132
+ else:
133
+ # primitive type
134
+ return self.actual_instance
135
+
136
+ def to_str(self) -> str:
137
+ """Returns the string representation of the actual instance"""
138
+ return pprint.pformat(self.model_dump())
139
+
140
+
@@ -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, 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 PreArrangedPairMakerConfig(BaseModel):
26
+ """
27
+ PreArrangedPairMakerConfig
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for PreArrangedPairMakerConfig", alias="_t")
30
+ pair_size: Optional[StrictInt] = Field(default=None, alias="pairSize")
31
+ randomize: Optional[StrictBool] = None
32
+ wrap_around: Optional[StrictBool] = Field(default=None, alias="wrapAround")
33
+ __properties: ClassVar[List[str]] = ["_t", "pairSize", "randomize", "wrapAround"]
34
+
35
+ @field_validator('t')
36
+ def t_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['PreArrangedPairMakerConfig']):
39
+ raise ValueError("must be one of enum values ('PreArrangedPairMakerConfig')")
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 PreArrangedPairMakerConfig 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
+ """
73
+ excluded_fields: Set[str] = set([
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of PreArrangedPairMakerConfig from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'PreArrangedPairMakerConfig',
94
+ "pairSize": obj.get("pairSize"),
95
+ "randomize": obj.get("randomize"),
96
+ "wrapAround": obj.get("wrapAround")
97
+ })
98
+ return _obj
99
+
100
+