rapidata 1.10.0__py3-none-any.whl → 2.0.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 (138) hide show
  1. rapidata/__init__.py +21 -17
  2. rapidata/api_client/__init__.py +15 -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 +15 -5
  10. rapidata/api_client/models/add_campaign_model.py +1 -3
  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/file_asset_model_metadata_inner.py +8 -22
  23. rapidata/api_client/models/get_classify_workflow_result_overview_result.py +144 -0
  24. rapidata/api_client/models/get_pipeline_by_id_result.py +13 -3
  25. rapidata/api_client/models/identity_read_bridge_token_get202_response.py +140 -0
  26. rapidata/api_client/models/not_available_yet_result.py +96 -0
  27. rapidata/api_client/models/online_pair_maker_config.py +98 -0
  28. rapidata/api_client/models/online_pair_maker_config_model.py +98 -0
  29. rapidata/api_client/models/online_pair_maker_information.py +100 -0
  30. rapidata/api_client/models/pipeline_id_workflow_put_request.py +140 -0
  31. rapidata/api_client/models/pre_arranged_pair_maker_config.py +100 -0
  32. rapidata/api_client/models/pre_arranged_pair_maker_config_model.py +96 -0
  33. rapidata/api_client/models/pre_arranged_pair_maker_information.py +102 -0
  34. rapidata/api_client/models/read_bridge_token_keys_result.py +11 -2
  35. rapidata/api_client/models/simple_workflow_config.py +7 -26
  36. rapidata/api_client/models/simple_workflow_config_model.py +4 -28
  37. rapidata/api_client/models/simple_workflow_get_result_overview_get200_response.py +16 -16
  38. rapidata/api_client/models/simple_workflow_model1.py +3 -3
  39. rapidata/api_client/models/update_campaign_model.py +99 -0
  40. rapidata/api_client/models/validation_import_post_request_blueprint.py +1 -1
  41. rapidata/api_client_README.md +20 -7
  42. rapidata/rapidata_client/__init__.py +18 -9
  43. rapidata/rapidata_client/assets/__init__.py +5 -4
  44. rapidata/rapidata_client/assets/{media_asset.py → _media_asset.py} +32 -11
  45. rapidata/rapidata_client/assets/{multi_asset.py → _multi_asset.py} +1 -1
  46. rapidata/rapidata_client/assets/{text_asset.py → _text_asset.py} +1 -1
  47. rapidata/rapidata_client/assets/data_type_enum.py +7 -0
  48. rapidata/rapidata_client/filter/__init__.py +1 -1
  49. rapidata/rapidata_client/filter/_base_filter.py +10 -0
  50. rapidata/rapidata_client/filter/age_filter.py +12 -5
  51. rapidata/rapidata_client/filter/campaign_filter.py +12 -3
  52. rapidata/rapidata_client/filter/country_filter.py +10 -3
  53. rapidata/rapidata_client/filter/gender_filter.py +12 -5
  54. rapidata/rapidata_client/filter/language_filter.py +14 -3
  55. rapidata/rapidata_client/filter/models/age_group.py +26 -0
  56. rapidata/rapidata_client/filter/models/gender.py +19 -0
  57. rapidata/rapidata_client/filter/rapidata_filters.py +31 -0
  58. rapidata/rapidata_client/filter/user_score_filter.py +20 -4
  59. rapidata/rapidata_client/metadata/__init__.py +5 -5
  60. rapidata/rapidata_client/metadata/{base_metadata.py → _base_metadata.py} +2 -1
  61. rapidata/rapidata_client/metadata/{private_text_metadata.py → _private_text_metadata.py} +2 -2
  62. rapidata/rapidata_client/metadata/{prompt_metadata.py → _prompt_metadata.py} +3 -2
  63. rapidata/rapidata_client/metadata/{public_text_metadata.py → _public_text_metadata.py} +2 -2
  64. rapidata/rapidata_client/metadata/{select_words_metadata.py → _select_words_metadata.py} +3 -2
  65. rapidata/rapidata_client/{dataset/rapidata_dataset.py → order/_rapidata_dataset.py} +7 -8
  66. rapidata/rapidata_client/order/_rapidata_order_builder.py +365 -0
  67. rapidata/rapidata_client/order/rapidata_order.py +49 -31
  68. rapidata/rapidata_client/order/rapidata_order_manager.py +461 -0
  69. rapidata/rapidata_client/rapidata_client.py +12 -201
  70. rapidata/rapidata_client/referee/__init__.py +3 -3
  71. rapidata/rapidata_client/referee/{base_referee.py → _base_referee.py} +3 -3
  72. rapidata/rapidata_client/referee/{early_stopping_referee.py → _early_stopping_referee.py} +14 -11
  73. rapidata/rapidata_client/referee/{naive_referee.py → _naive_referee.py} +9 -9
  74. rapidata/rapidata_client/selection/__init__.py +1 -1
  75. rapidata/rapidata_client/{filter/base_filter.py → selection/_base_selection.py} +2 -2
  76. rapidata/rapidata_client/selection/capped_selection.py +15 -5
  77. rapidata/rapidata_client/selection/conditional_validation_selection.py +17 -4
  78. rapidata/rapidata_client/selection/demographic_selection.py +18 -7
  79. rapidata/rapidata_client/selection/labeling_selection.py +10 -3
  80. rapidata/rapidata_client/selection/rapidata_selections.py +21 -0
  81. rapidata/rapidata_client/selection/validation_selection.py +11 -4
  82. rapidata/rapidata_client/settings/__init__.py +9 -2
  83. rapidata/rapidata_client/settings/_rapidata_setting.py +11 -0
  84. rapidata/rapidata_client/settings/alert_on_fast_response.py +21 -0
  85. rapidata/rapidata_client/settings/custom_setting.py +16 -0
  86. rapidata/rapidata_client/settings/free_text_minimum_characters.py +16 -0
  87. rapidata/rapidata_client/settings/models/__init__.py +1 -0
  88. rapidata/rapidata_client/settings/models/translation_behaviour_options.py +14 -0
  89. rapidata/rapidata_client/settings/no_shuffle.py +16 -0
  90. rapidata/rapidata_client/settings/play_video_until_the_end.py +16 -0
  91. rapidata/rapidata_client/settings/rapidata_settings.py +31 -0
  92. rapidata/rapidata_client/settings/translation_behaviour.py +18 -0
  93. rapidata/rapidata_client/validation/__init__.py +1 -0
  94. rapidata/rapidata_client/{dataset/validation_rapid_parts.py → validation/_validation_rapid_parts.py} +7 -6
  95. rapidata/rapidata_client/validation/_validation_set_builder.py +371 -0
  96. rapidata/rapidata_client/{dataset → validation}/rapidata_validation_set.py +54 -50
  97. rapidata/rapidata_client/validation/rapids/__init__.py +1 -0
  98. rapidata/rapidata_client/validation/rapids/box.py +17 -0
  99. rapidata/rapidata_client/validation/rapids/rapids.py +94 -0
  100. rapidata/rapidata_client/validation/rapids/rapids_manager.py +163 -0
  101. rapidata/rapidata_client/validation/validation_set_manager.py +335 -0
  102. rapidata/rapidata_client/workflow/__init__.py +8 -6
  103. rapidata/rapidata_client/workflow/_base_workflow.py +25 -0
  104. rapidata/rapidata_client/workflow/{classify_workflow.py → _classify_workflow.py} +6 -6
  105. rapidata/rapidata_client/workflow/{compare_workflow.py → _compare_workflow.py} +10 -16
  106. rapidata/rapidata_client/workflow/_draw_workflow.py +22 -0
  107. rapidata/rapidata_client/workflow/_evaluation_workflow.py +26 -0
  108. rapidata/rapidata_client/workflow/{free_text_workflow.py → _free_text_workflow.py} +10 -16
  109. rapidata/rapidata_client/workflow/_locate_workflow.py +22 -0
  110. rapidata/rapidata_client/workflow/{select_words_workflow.py → _select_words_workflow.py} +2 -8
  111. rapidata/service/credential_manager.py +11 -1
  112. rapidata/service/openapi_service.py +23 -4
  113. {rapidata-1.10.0.dist-info → rapidata-2.0.0.dist-info}/METADATA +2 -1
  114. {rapidata-1.10.0.dist-info → rapidata-2.0.0.dist-info}/RECORD +118 -94
  115. rapidata/constants.py +0 -1
  116. rapidata/rapidata_client/dataset/rapid_builders/__init__.py +0 -4
  117. rapidata/rapidata_client/dataset/rapid_builders/base_rapid_builder.py +0 -33
  118. rapidata/rapidata_client/dataset/rapid_builders/classify_rapid_builders.py +0 -166
  119. rapidata/rapidata_client/dataset/rapid_builders/compare_rapid_builders.py +0 -145
  120. rapidata/rapidata_client/dataset/rapid_builders/rapids.py +0 -33
  121. rapidata/rapidata_client/dataset/rapid_builders/select_words_rapid_builders.py +0 -124
  122. rapidata/rapidata_client/dataset/validation_set_builder.py +0 -336
  123. rapidata/rapidata_client/order/order_builder.py +0 -25
  124. rapidata/rapidata_client/order/rapidata_order_builder.py +0 -463
  125. rapidata/rapidata_client/selection/base_selection.py +0 -9
  126. rapidata/rapidata_client/settings/feature_flags.py +0 -125
  127. rapidata/rapidata_client/settings/settings.py +0 -124
  128. rapidata/rapidata_client/simple_builders/__init__.py +0 -0
  129. rapidata/rapidata_client/simple_builders/simple_classification_builders.py +0 -271
  130. rapidata/rapidata_client/simple_builders/simple_compare_builders.py +0 -267
  131. rapidata/rapidata_client/simple_builders/simple_free_text_builders.py +0 -192
  132. rapidata/rapidata_client/simple_builders/simple_select_words_builders.py +0 -196
  133. rapidata/rapidata_client/workflow/base_workflow.py +0 -42
  134. rapidata/rapidata_client/workflow/evaluation_workflow.py +0 -15
  135. /rapidata/rapidata_client/assets/{base_asset.py → _base_asset.py} +0 -0
  136. /rapidata/rapidata_client/{dataset → filter/models}/__init__.py +0 -0
  137. {rapidata-1.10.0.dist-info → rapidata-2.0.0.dist-info}/LICENSE +0 -0
  138. {rapidata-1.10.0.dist-info → rapidata-2.0.0.dist-info}/WHEEL +0 -0
@@ -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
+
@@ -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, 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 PreArrangedPairMakerConfigModel(BaseModel):
26
+ """
27
+ The PreArrangedPairMaker is used for completely random pairmaking from the beginning
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for PreArrangedPairMaker", alias="_t")
30
+ pair_size: Optional[StrictInt] = Field(default=None, description="The pair size in comparisons.", alias="pairSize")
31
+ __properties: ClassVar[List[str]] = ["_t", "pairSize"]
32
+
33
+ @field_validator('t')
34
+ def t_validate_enum(cls, value):
35
+ """Validates the enum"""
36
+ if value not in set(['PreArrangedPairMaker']):
37
+ raise ValueError("must be one of enum values ('PreArrangedPairMaker')")
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 PreArrangedPairMakerConfigModel 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 PreArrangedPairMakerConfigModel 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 'PreArrangedPairMaker',
92
+ "pairSize": obj.get("pairSize")
93
+ })
94
+ return _obj
95
+
96
+
@@ -0,0 +1,102 @@
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 PreArrangedPairMakerInformation(BaseModel):
26
+ """
27
+ PreArrangedPairMakerInformation
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for PreArrangedPairMakerInformation", 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
+ matches_already_made: Optional[StrictBool] = Field(default=None, alias="matchesAlreadyMade")
34
+ __properties: ClassVar[List[str]] = ["_t", "pairSize", "randomize", "wrapAround", "matchesAlreadyMade"]
35
+
36
+ @field_validator('t')
37
+ def t_validate_enum(cls, value):
38
+ """Validates the enum"""
39
+ if value not in set(['PreArrangedPairMakerInformation']):
40
+ raise ValueError("must be one of enum values ('PreArrangedPairMakerInformation')")
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 PreArrangedPairMakerInformation 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
+ """
74
+ excluded_fields: Set[str] = set([
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 PreArrangedPairMakerInformation 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 'PreArrangedPairMakerInformation',
95
+ "pairSize": obj.get("pairSize"),
96
+ "randomize": obj.get("randomize"),
97
+ "wrapAround": obj.get("wrapAround"),
98
+ "matchesAlreadyMade": obj.get("matchesAlreadyMade")
99
+ })
100
+ return _obj
101
+
102
+
@@ -17,7 +17,7 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
@@ -26,13 +26,21 @@ class ReadBridgeTokenKeysResult(BaseModel):
26
26
  """
27
27
  ReadBridgeTokenKeysResult
28
28
  """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for ReadBridgeTokenKeysResult", alias="_t")
29
30
  access_token: Optional[StrictStr] = Field(alias="accessToken")
30
31
  expires_in: Optional[StrictInt] = Field(alias="expiresIn")
31
32
  refresh_token: Optional[StrictStr] = Field(alias="refreshToken")
32
33
  id_token: Optional[StrictStr] = Field(alias="idToken")
33
34
  token_type: Optional[StrictStr] = Field(alias="tokenType")
34
35
  scope: Optional[StrictStr]
35
- __properties: ClassVar[List[str]] = ["accessToken", "expiresIn", "refreshToken", "idToken", "tokenType", "scope"]
36
+ __properties: ClassVar[List[str]] = ["_t", "accessToken", "expiresIn", "refreshToken", "idToken", "tokenType", "scope"]
37
+
38
+ @field_validator('t')
39
+ def t_validate_enum(cls, value):
40
+ """Validates the enum"""
41
+ if value not in set(['ReadBridgeTokenKeysResult']):
42
+ raise ValueError("must be one of enum values ('ReadBridgeTokenKeysResult')")
43
+ return value
36
44
 
37
45
  model_config = ConfigDict(
38
46
  populate_by_name=True,
@@ -115,6 +123,7 @@ class ReadBridgeTokenKeysResult(BaseModel):
115
123
  return cls.model_validate(obj)
116
124
 
117
125
  _obj = cls.model_validate({
126
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'ReadBridgeTokenKeysResult',
118
127
  "accessToken": obj.get("accessToken"),
119
128
  "expiresIn": obj.get("expiresIn"),
120
129
  "refreshToken": obj.get("refreshToken"),