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, 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"),
@@ -17,11 +17,10 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List, Optional
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
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.feature_flag import FeatureFlag
24
- from rapidata.api_client.models.simple_workflow_model1_blueprint import SimpleWorkflowModel1Blueprint
23
+ from rapidata.api_client.models.validation_import_post_request_blueprint import ValidationImportPostRequestBlueprint
25
24
  from typing import Optional, Set
26
25
  from typing_extensions import Self
27
26
 
@@ -31,12 +30,9 @@ class SimpleWorkflowConfig(BaseModel):
31
30
  """ # noqa: E501
32
31
  t: StrictStr = Field(description="Discriminator value for SimpleWorkflowConfig", alias="_t")
33
32
  referee: CompareWorkflowModel1Referee
34
- blueprint: SimpleWorkflowModel1Blueprint
33
+ blueprint: ValidationImportPostRequestBlueprint
35
34
  target_country_codes: List[StrictStr] = Field(alias="targetCountryCodes")
36
- feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
37
- priority: Optional[StrictStr] = None
38
- is_fallback: Optional[StrictBool] = Field(default=None, alias="isFallback")
39
- __properties: ClassVar[List[str]] = ["_t", "referee", "blueprint", "targetCountryCodes", "featureFlags", "priority", "isFallback"]
35
+ __properties: ClassVar[List[str]] = ["_t", "referee", "blueprint", "targetCountryCodes"]
40
36
 
41
37
  @field_validator('t')
42
38
  def t_validate_enum(cls, value):
@@ -90,18 +86,6 @@ class SimpleWorkflowConfig(BaseModel):
90
86
  # override the default output from pydantic by calling `to_dict()` of blueprint
91
87
  if self.blueprint:
92
88
  _dict['blueprint'] = self.blueprint.to_dict()
93
- # override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
94
- _items = []
95
- if self.feature_flags:
96
- for _item_feature_flags in self.feature_flags:
97
- if _item_feature_flags:
98
- _items.append(_item_feature_flags.to_dict())
99
- _dict['featureFlags'] = _items
100
- # set to None if priority (nullable) is None
101
- # and model_fields_set contains the field
102
- if self.priority is None and "priority" in self.model_fields_set:
103
- _dict['priority'] = None
104
-
105
89
  return _dict
106
90
 
107
91
  @classmethod
@@ -116,11 +100,8 @@ class SimpleWorkflowConfig(BaseModel):
116
100
  _obj = cls.model_validate({
117
101
  "_t": obj.get("_t") if obj.get("_t") is not None else 'SimpleWorkflowConfig',
118
102
  "referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
119
- "blueprint": SimpleWorkflowModel1Blueprint.from_dict(obj["blueprint"]) if obj.get("blueprint") is not None else None,
120
- "targetCountryCodes": obj.get("targetCountryCodes"),
121
- "featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
122
- "priority": obj.get("priority"),
123
- "isFallback": obj.get("isFallback")
103
+ "blueprint": ValidationImportPostRequestBlueprint.from_dict(obj["blueprint"]) if obj.get("blueprint") is not None else None,
104
+ "targetCountryCodes": obj.get("targetCountryCodes")
124
105
  })
125
106
  return _obj
126
107
 
@@ -17,10 +17,9 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List, Optional
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
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.feature_flag import FeatureFlag
24
23
  from rapidata.api_client.models.simple_workflow_config_model_blueprint import SimpleWorkflowConfigModelBlueprint
25
24
  from typing import Optional, Set
26
25
  from typing_extensions import Self
@@ -33,10 +32,7 @@ class SimpleWorkflowConfigModel(BaseModel):
33
32
  referee: CompareWorkflowModel1Referee
34
33
  blueprint: SimpleWorkflowConfigModelBlueprint
35
34
  target_country_codes: List[StrictStr] = Field(description="A list of country codes that this workflow is targeting.", alias="targetCountryCodes")
36
- feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
37
- priority: Optional[StrictStr] = None
38
- is_fallback: Optional[StrictBool] = Field(default=None, alias="isFallback")
39
- __properties: ClassVar[List[str]] = ["_t", "referee", "blueprint", "targetCountryCodes", "featureFlags", "priority", "isFallback"]
35
+ __properties: ClassVar[List[str]] = ["_t", "referee", "blueprint", "targetCountryCodes"]
40
36
 
41
37
  @field_validator('t')
42
38
  def t_validate_enum(cls, value):
@@ -90,23 +86,6 @@ class SimpleWorkflowConfigModel(BaseModel):
90
86
  # override the default output from pydantic by calling `to_dict()` of blueprint
91
87
  if self.blueprint:
92
88
  _dict['blueprint'] = self.blueprint.to_dict()
93
- # override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
94
- _items = []
95
- if self.feature_flags:
96
- for _item_feature_flags in self.feature_flags:
97
- if _item_feature_flags:
98
- _items.append(_item_feature_flags.to_dict())
99
- _dict['featureFlags'] = _items
100
- # set to None if priority (nullable) is None
101
- # and model_fields_set contains the field
102
- if self.priority is None and "priority" in self.model_fields_set:
103
- _dict['priority'] = None
104
-
105
- # set to None if is_fallback (nullable) is None
106
- # and model_fields_set contains the field
107
- if self.is_fallback is None and "is_fallback" in self.model_fields_set:
108
- _dict['isFallback'] = None
109
-
110
89
  return _dict
111
90
 
112
91
  @classmethod
@@ -122,10 +101,7 @@ class SimpleWorkflowConfigModel(BaseModel):
122
101
  "_t": obj.get("_t") if obj.get("_t") is not None else 'SimpleWorkflowConfig',
123
102
  "referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
124
103
  "blueprint": SimpleWorkflowConfigModelBlueprint.from_dict(obj["blueprint"]) if obj.get("blueprint") is not None else None,
125
- "targetCountryCodes": obj.get("targetCountryCodes"),
126
- "featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
127
- "priority": obj.get("priority"),
128
- "isFallback": obj.get("isFallback")
104
+ "targetCountryCodes": obj.get("targetCountryCodes")
129
105
  })
130
106
  return _obj
131
107
 
@@ -17,24 +17,24 @@ import json
17
17
  import pprint
18
18
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
19
19
  from typing import Any, List, Optional
20
- from rapidata.api_client.models.get_attach_category_workflow_result_overview_result import GetAttachCategoryWorkflowResultOverviewResult
20
+ from rapidata.api_client.models.get_classify_workflow_result_overview_result import GetClassifyWorkflowResultOverviewResult
21
21
  from rapidata.api_client.models.get_simple_workflow_result_overview_result import GetSimpleWorkflowResultOverviewResult
22
22
  from pydantic import StrictStr, Field
23
23
  from typing import Union, List, Set, Optional, Dict
24
24
  from typing_extensions import Literal, Self
25
25
 
26
- SIMPLEWORKFLOWGETRESULTOVERVIEWGET200RESPONSE_ONE_OF_SCHEMAS = ["GetAttachCategoryWorkflowResultOverviewResult", "GetSimpleWorkflowResultOverviewResult"]
26
+ SIMPLEWORKFLOWGETRESULTOVERVIEWGET200RESPONSE_ONE_OF_SCHEMAS = ["GetClassifyWorkflowResultOverviewResult", "GetSimpleWorkflowResultOverviewResult"]
27
27
 
28
28
  class SimpleWorkflowGetResultOverviewGet200Response(BaseModel):
29
29
  """
30
30
  SimpleWorkflowGetResultOverviewGet200Response
31
31
  """
32
- # data type: GetAttachCategoryWorkflowResultOverviewResult
33
- oneof_schema_1_validator: Optional[GetAttachCategoryWorkflowResultOverviewResult] = None
32
+ # data type: GetClassifyWorkflowResultOverviewResult
33
+ oneof_schema_1_validator: Optional[GetClassifyWorkflowResultOverviewResult] = None
34
34
  # data type: GetSimpleWorkflowResultOverviewResult
35
35
  oneof_schema_2_validator: Optional[GetSimpleWorkflowResultOverviewResult] = None
36
- actual_instance: Optional[Union[GetAttachCategoryWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult]] = None
37
- one_of_schemas: Set[str] = { "GetAttachCategoryWorkflowResultOverviewResult", "GetSimpleWorkflowResultOverviewResult" }
36
+ actual_instance: Optional[Union[GetClassifyWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult]] = None
37
+ one_of_schemas: Set[str] = { "GetClassifyWorkflowResultOverviewResult", "GetSimpleWorkflowResultOverviewResult" }
38
38
 
39
39
  model_config = ConfigDict(
40
40
  validate_assignment=True,
@@ -57,9 +57,9 @@ class SimpleWorkflowGetResultOverviewGet200Response(BaseModel):
57
57
  instance = SimpleWorkflowGetResultOverviewGet200Response.model_construct()
58
58
  error_messages = []
59
59
  match = 0
60
- # validate data type: GetAttachCategoryWorkflowResultOverviewResult
61
- if not isinstance(v, GetAttachCategoryWorkflowResultOverviewResult):
62
- error_messages.append(f"Error! Input type `{type(v)}` is not `GetAttachCategoryWorkflowResultOverviewResult`")
60
+ # validate data type: GetClassifyWorkflowResultOverviewResult
61
+ if not isinstance(v, GetClassifyWorkflowResultOverviewResult):
62
+ error_messages.append(f"Error! Input type `{type(v)}` is not `GetClassifyWorkflowResultOverviewResult`")
63
63
  else:
64
64
  match += 1
65
65
  # validate data type: GetSimpleWorkflowResultOverviewResult
@@ -69,10 +69,10 @@ class SimpleWorkflowGetResultOverviewGet200Response(BaseModel):
69
69
  match += 1
70
70
  if match > 1:
71
71
  # more than 1 match
72
- raise ValueError("Multiple matches found when setting `actual_instance` in SimpleWorkflowGetResultOverviewGet200Response with oneOf schemas: GetAttachCategoryWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult. Details: " + ", ".join(error_messages))
72
+ raise ValueError("Multiple matches found when setting `actual_instance` in SimpleWorkflowGetResultOverviewGet200Response with oneOf schemas: GetClassifyWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult. Details: " + ", ".join(error_messages))
73
73
  elif match == 0:
74
74
  # no match
75
- raise ValueError("No match found when setting `actual_instance` in SimpleWorkflowGetResultOverviewGet200Response with oneOf schemas: GetAttachCategoryWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult. Details: " + ", ".join(error_messages))
75
+ raise ValueError("No match found when setting `actual_instance` in SimpleWorkflowGetResultOverviewGet200Response with oneOf schemas: GetClassifyWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult. Details: " + ", ".join(error_messages))
76
76
  else:
77
77
  return v
78
78
 
@@ -87,9 +87,9 @@ class SimpleWorkflowGetResultOverviewGet200Response(BaseModel):
87
87
  error_messages = []
88
88
  match = 0
89
89
 
90
- # deserialize data into GetAttachCategoryWorkflowResultOverviewResult
90
+ # deserialize data into GetClassifyWorkflowResultOverviewResult
91
91
  try:
92
- instance.actual_instance = GetAttachCategoryWorkflowResultOverviewResult.from_json(json_str)
92
+ instance.actual_instance = GetClassifyWorkflowResultOverviewResult.from_json(json_str)
93
93
  match += 1
94
94
  except (ValidationError, ValueError) as e:
95
95
  error_messages.append(str(e))
@@ -102,10 +102,10 @@ class SimpleWorkflowGetResultOverviewGet200Response(BaseModel):
102
102
 
103
103
  if match > 1:
104
104
  # more than 1 match
105
- raise ValueError("Multiple matches found when deserializing the JSON string into SimpleWorkflowGetResultOverviewGet200Response with oneOf schemas: GetAttachCategoryWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult. Details: " + ", ".join(error_messages))
105
+ raise ValueError("Multiple matches found when deserializing the JSON string into SimpleWorkflowGetResultOverviewGet200Response with oneOf schemas: GetClassifyWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult. Details: " + ", ".join(error_messages))
106
106
  elif match == 0:
107
107
  # no match
108
- raise ValueError("No match found when deserializing the JSON string into SimpleWorkflowGetResultOverviewGet200Response with oneOf schemas: GetAttachCategoryWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult. Details: " + ", ".join(error_messages))
108
+ raise ValueError("No match found when deserializing the JSON string into SimpleWorkflowGetResultOverviewGet200Response with oneOf schemas: GetClassifyWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult. Details: " + ", ".join(error_messages))
109
109
  else:
110
110
  return instance
111
111
 
@@ -119,7 +119,7 @@ class SimpleWorkflowGetResultOverviewGet200Response(BaseModel):
119
119
  else:
120
120
  return json.dumps(self.actual_instance)
121
121
 
122
- def to_dict(self) -> Optional[Union[Dict[str, Any], GetAttachCategoryWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult]]:
122
+ def to_dict(self) -> Optional[Union[Dict[str, Any], GetClassifyWorkflowResultOverviewResult, GetSimpleWorkflowResultOverviewResult]]:
123
123
  """Returns the dict representation of the actual instance"""
124
124
  if self.actual_instance is None:
125
125
  return None
@@ -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.simple_workflow_model1_blueprint import SimpleWorkflowModel1Blueprint
23
+ from rapidata.api_client.models.validation_import_post_request_blueprint import ValidationImportPostRequestBlueprint
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(alias="datasetId")
34
34
  state: StrictStr
35
- blueprint: SimpleWorkflowModel1Blueprint
35
+ blueprint: ValidationImportPostRequestBlueprint
36
36
  referee: CompareWorkflowModel1Referee
37
37
  name: StrictStr
38
38
  owner_mail: Optional[StrictStr] = Field(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": SimpleWorkflowModel1Blueprint.from_dict(obj["blueprint"]) if obj.get("blueprint") is not None else None,
119
+ "blueprint": ValidationImportPostRequestBlueprint.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,99 @@
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
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class UpdateCampaignModel(BaseModel):
26
+ """
27
+ The model containing the new configuration for a campaign.
28
+ """ # noqa: E501
29
+ priority: Optional[StrictInt] = Field(description="A value above 0 indicating how much the campaign should be prioritized. The higher the value the more weight it will be given during campaign selection.")
30
+ feature_flags: Optional[Dict[str, StrictStr]] = Field(description="The feature flags to assign this campaign.", alias="featureFlags")
31
+ __properties: ClassVar[List[str]] = ["priority", "featureFlags"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of UpdateCampaignModel from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # set to None if priority (nullable) is None
73
+ # and model_fields_set contains the field
74
+ if self.priority is None and "priority" in self.model_fields_set:
75
+ _dict['priority'] = None
76
+
77
+ # set to None if feature_flags (nullable) is None
78
+ # and model_fields_set contains the field
79
+ if self.feature_flags is None and "feature_flags" in self.model_fields_set:
80
+ _dict['featureFlags'] = None
81
+
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of UpdateCampaignModel 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
+ "priority": obj.get("priority"),
95
+ "featureFlags": obj.get("featureFlags")
96
+ })
97
+ return _obj
98
+
99
+
@@ -34,7 +34,7 @@ VALIDATIONIMPORTPOSTREQUESTBLUEPRINT_ONE_OF_SCHEMAS = ["AttachCategoryRapidBluep
34
34
 
35
35
  class ValidationImportPostRequestBlueprint(BaseModel):
36
36
  """
37
- The blueprint for the rapid to be created.
37
+ ValidationImportPostRequestBlueprint
38
38
  """
39
39
  # data type: TranscriptionRapidBlueprint
40
40
  oneof_schema_1_validator: Optional[TranscriptionRapidBlueprint] = None