rapidata 0.1.2__py3-none-any.whl → 0.1.5__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.
- openapi/openapi-client/openapi_client/__init__.py +215 -0
- openapi/openapi-client/openapi_client/api/__init__.py +11 -0
- openapi/openapi-client/openapi_client/api/coco_api.py +619 -0
- openapi/openapi-client/openapi_client/api/datapoint_api.py +817 -0
- openapi/openapi-client/openapi_client/api/dataset_api.py +2290 -0
- openapi/openapi-client/openapi_client/api/identity_api.py +3181 -0
- openapi/openapi-client/openapi_client/api/newsletter_api.py +571 -0
- openapi/openapi-client/openapi_client/api/order_api.py +5390 -0
- openapi/openapi-client/openapi_client/api/validation_api.py +1670 -0
- openapi/openapi-client/openapi_client/api_client.py +797 -0
- openapi/openapi-client/openapi_client/api_response.py +21 -0
- openapi/openapi-client/openapi_client/configuration.py +479 -0
- openapi/openapi-client/openapi_client/exceptions.py +199 -0
- openapi/openapi-client/openapi_client/models/__init__.py +192 -0
- openapi/openapi-client/openapi_client/models/add_validation_rapid_model.py +116 -0
- openapi/openapi-client/openapi_client/models/add_validation_rapid_model_payload.py +238 -0
- openapi/openapi-client/openapi_client/models/add_validation_rapid_model_truth.py +238 -0
- openapi/openapi-client/openapi_client/models/admin_order_model.py +103 -0
- openapi/openapi-client/openapi_client/models/admin_order_model_paged_result.py +105 -0
- openapi/openapi-client/openapi_client/models/age_group.py +40 -0
- openapi/openapi-client/openapi_client/models/age_user_filter_model.py +97 -0
- openapi/openapi-client/openapi_client/models/aggregator_type.py +46 -0
- openapi/openapi-client/openapi_client/models/attach_category_rapid_blueprint.py +98 -0
- openapi/openapi-client/openapi_client/models/attach_category_truth.py +96 -0
- openapi/openapi-client/openapi_client/models/base_error.py +90 -0
- openapi/openapi-client/openapi_client/models/bounding_box_payload.py +96 -0
- openapi/openapi-client/openapi_client/models/bounding_box_rapid_blueprint.py +96 -0
- openapi/openapi-client/openapi_client/models/bounding_box_truth.py +102 -0
- openapi/openapi-client/openapi_client/models/box_shape.py +122 -0
- openapi/openapi-client/openapi_client/models/classification_metadata.py +110 -0
- openapi/openapi-client/openapi_client/models/classification_metadata_filter_config.py +96 -0
- openapi/openapi-client/openapi_client/models/classify_payload.py +98 -0
- openapi/openapi-client/openapi_client/models/clone_dataset_model.py +98 -0
- openapi/openapi-client/openapi_client/models/clone_order_model.py +89 -0
- openapi/openapi-client/openapi_client/models/clone_order_result.py +89 -0
- openapi/openapi-client/openapi_client/models/compare_payload.py +96 -0
- openapi/openapi-client/openapi_client/models/compare_rapid_blueprint.py +96 -0
- openapi/openapi-client/openapi_client/models/compare_truth.py +96 -0
- openapi/openapi-client/openapi_client/models/compare_workflow_config.py +143 -0
- openapi/openapi-client/openapi_client/models/compare_workflow_config_rapid_selection_configs_inner.py +210 -0
- openapi/openapi-client/openapi_client/models/compare_workflow_config_referee.py +154 -0
- openapi/openapi-client/openapi_client/models/compare_workflow_model.py +106 -0
- openapi/openapi-client/openapi_client/models/conditional_validation_rapid_selection_config.py +113 -0
- openapi/openapi-client/openapi_client/models/correlated_rapid_selection_config.py +98 -0
- openapi/openapi-client/openapi_client/models/count_classification_metadata_filter_config.py +94 -0
- openapi/openapi-client/openapi_client/models/count_metadata.py +110 -0
- openapi/openapi-client/openapi_client/models/country_user_filter_model.py +96 -0
- openapi/openapi-client/openapi_client/models/create_client_model.py +89 -0
- openapi/openapi-client/openapi_client/models/create_complex_order_model.py +95 -0
- openapi/openapi-client/openapi_client/models/create_complex_order_model_pipeline.py +126 -0
- openapi/openapi-client/openapi_client/models/create_complex_order_result.py +96 -0
- openapi/openapi-client/openapi_client/models/create_dataset_artifact_model.py +102 -0
- openapi/openapi-client/openapi_client/models/create_dataset_artifact_model_dataset.py +126 -0
- openapi/openapi-client/openapi_client/models/create_default_order_model.py +109 -0
- openapi/openapi-client/openapi_client/models/create_default_order_model_workflow_config.py +140 -0
- openapi/openapi-client/openapi_client/models/create_empty_validation_set_result.py +87 -0
- openapi/openapi-client/openapi_client/models/create_legacy_order_result.py +89 -0
- openapi/openapi-client/openapi_client/models/create_order_model.py +163 -0
- openapi/openapi-client/openapi_client/models/create_order_model_referee.py +126 -0
- openapi/openapi-client/openapi_client/models/create_order_model_selections_inner.py +154 -0
- openapi/openapi-client/openapi_client/models/create_order_model_user_filters_inner.py +154 -0
- openapi/openapi-client/openapi_client/models/create_order_model_workflow.py +140 -0
- openapi/openapi-client/openapi_client/models/create_order_result.py +96 -0
- openapi/openapi-client/openapi_client/models/create_simple_pipeline_model.py +116 -0
- openapi/openapi-client/openapi_client/models/create_simple_pipeline_model_artifacts_inner.py +126 -0
- openapi/openapi-client/openapi_client/models/create_simple_pipeline_model_pipeline_steps_inner.py +182 -0
- openapi/openapi-client/openapi_client/models/create_unsupported_order_model.py +91 -0
- openapi/openapi-client/openapi_client/models/customer_order_model.py +101 -0
- openapi/openapi-client/openapi_client/models/customer_order_model_paged_result.py +105 -0
- openapi/openapi-client/openapi_client/models/datapoint.py +121 -0
- openapi/openapi-client/openapi_client/models/datapoint_asset.py +170 -0
- openapi/openapi-client/openapi_client/models/datapoint_get_by_id_get200_response.py +126 -0
- openapi/openapi-client/openapi_client/models/datapoint_metadata_model.py +97 -0
- openapi/openapi-client/openapi_client/models/datapoint_metadata_model_metadata_inner.py +168 -0
- openapi/openapi-client/openapi_client/models/datapoint_model.py +95 -0
- openapi/openapi-client/openapi_client/models/datapoint_model_asset.py +170 -0
- openapi/openapi-client/openapi_client/models/dataset_evaluation_step_model.py +102 -0
- openapi/openapi-client/openapi_client/models/demographic_rapid_selection_config.py +96 -0
- openapi/openapi-client/openapi_client/models/demographic_selection.py +96 -0
- openapi/openapi-client/openapi_client/models/empty_validation_truth.py +94 -0
- openapi/openapi-client/openapi_client/models/error_type.py +40 -0
- openapi/openapi-client/openapi_client/models/feature_flag.py +89 -0
- openapi/openapi-client/openapi_client/models/feature_flag_model.py +89 -0
- openapi/openapi-client/openapi_client/models/feedback_model.py +94 -0
- openapi/openapi-client/openapi_client/models/file_asset.py +108 -0
- openapi/openapi-client/openapi_client/models/file_asset_metadata_inner.py +224 -0
- openapi/openapi-client/openapi_client/models/file_asset_model.py +108 -0
- openapi/openapi-client/openapi_client/models/filter.py +134 -0
- openapi/openapi-client/openapi_client/models/filter_operator.py +44 -0
- openapi/openapi-client/openapi_client/models/free_text_payload.py +96 -0
- openapi/openapi-client/openapi_client/models/free_text_rapid_blueprint.py +96 -0
- openapi/openapi-client/openapi_client/models/gender.py +38 -0
- openapi/openapi-client/openapi_client/models/gender_user_filter_model.py +97 -0
- openapi/openapi-client/openapi_client/models/get_available_validation_sets_result.py +95 -0
- openapi/openapi-client/openapi_client/models/get_datapoints_by_dataset_id_result.py +95 -0
- openapi/openapi-client/openapi_client/models/get_dataset_by_id_result.py +87 -0
- openapi/openapi-client/openapi_client/models/get_order_by_id_result.py +98 -0
- openapi/openapi-client/openapi_client/models/get_order_results_result.py +91 -0
- openapi/openapi-client/openapi_client/models/get_public_orders_result.py +95 -0
- openapi/openapi-client/openapi_client/models/get_workflow_config_result.py +91 -0
- openapi/openapi-client/openapi_client/models/get_workflow_config_result_workflow_config.py +140 -0
- openapi/openapi-client/openapi_client/models/image_dimension_metadata.py +112 -0
- openapi/openapi-client/openapi_client/models/import_from_file_result.py +87 -0
- openapi/openapi-client/openapi_client/models/import_validation_set_from_file_result.py +87 -0
- openapi/openapi-client/openapi_client/models/issue_auth_token_result.py +87 -0
- openapi/openapi-client/openapi_client/models/issue_client_auth_token_result.py +87 -0
- openapi/openapi-client/openapi_client/models/labeling_selection.py +96 -0
- openapi/openapi-client/openapi_client/models/line_payload.py +96 -0
- openapi/openapi-client/openapi_client/models/line_rapid_blueprint.py +96 -0
- openapi/openapi-client/openapi_client/models/line_truth.py +94 -0
- openapi/openapi-client/openapi_client/models/locate_box_truth.py +104 -0
- openapi/openapi-client/openapi_client/models/locate_payload.py +96 -0
- openapi/openapi-client/openapi_client/models/locate_rapid_blueprint.py +96 -0
- openapi/openapi-client/openapi_client/models/location_metadata.py +112 -0
- openapi/openapi-client/openapi_client/models/location_metadata_exists_filter_config.py +94 -0
- openapi/openapi-client/openapi_client/models/logic_operator.py +37 -0
- openapi/openapi-client/openapi_client/models/login_model.py +89 -0
- openapi/openapi-client/openapi_client/models/metadata_visibilities.py +40 -0
- openapi/openapi-client/openapi_client/models/multi_asset.py +116 -0
- openapi/openapi-client/openapi_client/models/multi_asset_model.py +118 -0
- openapi/openapi-client/openapi_client/models/naive_referee_config.py +96 -0
- openapi/openapi-client/openapi_client/models/naive_referee_model.py +96 -0
- openapi/openapi-client/openapi_client/models/named_classification.py +100 -0
- openapi/openapi-client/openapi_client/models/named_entity_payload.py +98 -0
- openapi/openapi-client/openapi_client/models/named_entity_rapid_blueprint.py +98 -0
- openapi/openapi-client/openapi_client/models/named_entity_truth.py +104 -0
- openapi/openapi-client/openapi_client/models/never_ending_referee_config.py +94 -0
- openapi/openapi-client/openapi_client/models/newsletter_model.py +89 -0
- openapi/openapi-client/openapi_client/models/no_validation_workflow_rapid_selection_config.py +101 -0
- openapi/openapi-client/openapi_client/models/null_asset.py +104 -0
- openapi/openapi-client/openapi_client/models/null_asset_model.py +106 -0
- openapi/openapi-client/openapi_client/models/only_validation_workflow_rapid_selection_config.py +96 -0
- openapi/openapi-client/openapi_client/models/order_model.py +91 -0
- openapi/openapi-client/openapi_client/models/order_query_get200_response.py +137 -0
- openapi/openapi-client/openapi_client/models/original_filename_metadata.py +110 -0
- openapi/openapi-client/openapi_client/models/page_info.py +94 -0
- openapi/openapi-client/openapi_client/models/polygon_payload.py +96 -0
- openapi/openapi-client/openapi_client/models/polygon_rapid_blueprint.py +96 -0
- openapi/openapi-client/openapi_client/models/polygon_truth.py +94 -0
- openapi/openapi-client/openapi_client/models/private_text_metadata_input.py +98 -0
- openapi/openapi-client/openapi_client/models/probabilistic_attach_category_referee_config.py +98 -0
- openapi/openapi-client/openapi_client/models/prompt_metadata.py +110 -0
- openapi/openapi-client/openapi_client/models/prompt_metadata_input.py +98 -0
- openapi/openapi-client/openapi_client/models/public_text_metadata_input.py +98 -0
- openapi/openapi-client/openapi_client/models/query_orders_model.py +112 -0
- openapi/openapi-client/openapi_client/models/query_validation_set_model.py +112 -0
- openapi/openapi-client/openapi_client/models/request_password_reset_command.py +98 -0
- openapi/openapi-client/openapi_client/models/root_filter.py +107 -0
- openapi/openapi-client/openapi_client/models/send_completion_mail_step_model.py +98 -0
- openapi/openapi-client/openapi_client/models/signup_customer_model.py +93 -0
- openapi/openapi-client/openapi_client/models/signup_shadow_customer_model.py +87 -0
- openapi/openapi-client/openapi_client/models/simple_workflow_config.py +137 -0
- openapi/openapi-client/openapi_client/models/simple_workflow_config_blueprint.py +238 -0
- openapi/openapi-client/openapi_client/models/simple_workflow_model.py +100 -0
- openapi/openapi-client/openapi_client/models/simple_workflow_model_blueprint.py +238 -0
- openapi/openapi-client/openapi_client/models/sort_criterion.py +96 -0
- openapi/openapi-client/openapi_client/models/sort_direction.py +37 -0
- openapi/openapi-client/openapi_client/models/static_rapid_selection_config.py +96 -0
- openapi/openapi-client/openapi_client/models/submit_coco_model.py +91 -0
- openapi/openapi-client/openapi_client/models/submit_coco_result.py +87 -0
- openapi/openapi-client/openapi_client/models/submit_password_reset_command.py +102 -0
- openapi/openapi-client/openapi_client/models/text_asset.py +106 -0
- openapi/openapi-client/openapi_client/models/text_asset_model.py +108 -0
- openapi/openapi-client/openapi_client/models/text_metadata.py +107 -0
- openapi/openapi-client/openapi_client/models/transcription_metadata.py +107 -0
- openapi/openapi-client/openapi_client/models/transcription_metadata_input.py +98 -0
- openapi/openapi-client/openapi_client/models/transcription_payload.py +106 -0
- openapi/openapi-client/openapi_client/models/transcription_rapid_blueprint.py +96 -0
- openapi/openapi-client/openapi_client/models/transcription_truth.py +106 -0
- openapi/openapi-client/openapi_client/models/transcription_word.py +89 -0
- openapi/openapi-client/openapi_client/models/unlock_order_result.py +87 -0
- openapi/openapi-client/openapi_client/models/update_access_model.py +87 -0
- openapi/openapi-client/openapi_client/models/update_order_model.py +87 -0
- openapi/openapi-client/openapi_client/models/update_workflow_config_model.py +100 -0
- openapi/openapi-client/openapi_client/models/update_workflow_config_model_workflow_config.py +140 -0
- openapi/openapi-client/openapi_client/models/upload_coco_result.py +91 -0
- openapi/openapi-client/openapi_client/models/upload_datapoints_result.py +97 -0
- openapi/openapi-client/openapi_client/models/upload_files_from_s3_bucket_model.py +116 -0
- openapi/openapi-client/openapi_client/models/upload_text_sources_to_dataset_model.py +89 -0
- openapi/openapi-client/openapi_client/models/validation_chance.py +91 -0
- openapi/openapi-client/openapi_client/models/validation_import_post_request_blueprint.py +238 -0
- openapi/openapi-client/openapi_client/models/validation_rapid_selection_config.py +98 -0
- openapi/openapi-client/openapi_client/models/validation_selection.py +98 -0
- openapi/openapi-client/openapi_client/models/validation_set.py +105 -0
- openapi/openapi-client/openapi_client/models/validation_set_overview_model.py +91 -0
- openapi/openapi-client/openapi_client/models/validation_set_paged_result.py +105 -0
- openapi/openapi-client/openapi_client/models/workflow_aggregation_step_model.py +112 -0
- openapi/openapi-client/openapi_client/models/workflow_labeling_step_model.py +96 -0
- openapi/openapi-client/openapi_client/models/workflow_split_model.py +110 -0
- openapi/openapi-client/openapi_client/models/workflow_split_model_filter_configs_inner.py +154 -0
- openapi/openapi-client/openapi_client/rest.py +257 -0
- rapidata/rapidata_client/{workflow/feature_flags → feature_flags}/feature_flags.py +5 -3
- rapidata/rapidata_client/metadata/__init__.py +0 -0
- rapidata/rapidata_client/metadata/base_metadata.py +12 -0
- rapidata/rapidata_client/metadata/transcription_metadata.py +19 -0
- rapidata/rapidata_client/order/dataset/rapidata_dataset.py +42 -16
- rapidata/rapidata_client/order/dataset/validation_set_builder.py +187 -0
- rapidata/rapidata_client/order/rapidata_order.py +49 -23
- rapidata/rapidata_client/order/rapidata_order_builder.py +126 -8
- rapidata/rapidata_client/rapidata_client.py +17 -5
- rapidata/rapidata_client/{workflow/referee → referee}/base_referee.py +8 -2
- rapidata/rapidata_client/{workflow/referee → referee}/classify_early_stopping_referee.py +1 -1
- rapidata/rapidata_client/{workflow/referee → referee}/naive_referee.py +5 -1
- rapidata/rapidata_client/workflow/__init__.py +0 -2
- rapidata/rapidata_client/workflow/base_workflow.py +9 -5
- rapidata/rapidata_client/workflow/classify_workflow.py +18 -3
- rapidata/rapidata_client/workflow/compare_workflow.py +13 -14
- rapidata/rapidata_client/workflow/free_text_workflow.py +14 -0
- rapidata/rapidata_client/workflow/transcription_workflow.py +22 -0
- rapidata/service/__init__.py +0 -1
- rapidata/service/openapi_service.py +43 -0
- {rapidata-0.1.2.dist-info → rapidata-0.1.5.dist-info}/METADATA +1 -1
- rapidata-0.1.5.dist-info/RECORD +227 -0
- rapidata/service/rapidata_api_services/base_service.py +0 -76
- rapidata/service/rapidata_api_services/dataset_service.py +0 -82
- rapidata/service/rapidata_api_services/order_service.py +0 -49
- rapidata/service/rapidata_api_services/rapidata_service.py +0 -18
- rapidata-0.1.2.dist-info/RECORD +0 -34
- /rapidata/service/rapidata_api_services/__init__.py → /openapi/openapi-client/openapi_client/py.typed +0 -0
- /rapidata/rapidata_client/{workflow/country_codes → country_codes}/__init__.py +0 -0
- /rapidata/rapidata_client/{workflow/country_codes → country_codes}/country_codes.py +0 -0
- /rapidata/rapidata_client/{workflow/feature_flags → feature_flags}/__init__.py +0 -0
- /rapidata/rapidata_client/{workflow/referee → referee}/__init__.py +0 -0
- {rapidata-0.1.2.dist-info → rapidata-0.1.5.dist-info}/LICENSE +0 -0
- {rapidata-0.1.2.dist-info → rapidata-0.1.5.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,210 @@
|
|
|
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 openapi_client.models.conditional_validation_rapid_selection_config import ConditionalValidationRapidSelectionConfig
|
|
21
|
+
from openapi_client.models.correlated_rapid_selection_config import CorrelatedRapidSelectionConfig
|
|
22
|
+
from openapi_client.models.demographic_rapid_selection_config import DemographicRapidSelectionConfig
|
|
23
|
+
from openapi_client.models.no_validation_workflow_rapid_selection_config import NoValidationWorkflowRapidSelectionConfig
|
|
24
|
+
from openapi_client.models.only_validation_workflow_rapid_selection_config import OnlyValidationWorkflowRapidSelectionConfig
|
|
25
|
+
from openapi_client.models.static_rapid_selection_config import StaticRapidSelectionConfig
|
|
26
|
+
from openapi_client.models.validation_rapid_selection_config import ValidationRapidSelectionConfig
|
|
27
|
+
from pydantic import StrictStr, Field
|
|
28
|
+
from typing import Union, List, Set, Optional, Dict
|
|
29
|
+
from typing_extensions import Literal, Self
|
|
30
|
+
|
|
31
|
+
COMPAREWORKFLOWCONFIGRAPIDSELECTIONCONFIGSINNER_ONE_OF_SCHEMAS = ["ConditionalValidationRapidSelectionConfig", "CorrelatedRapidSelectionConfig", "DemographicRapidSelectionConfig", "NoValidationWorkflowRapidSelectionConfig", "OnlyValidationWorkflowRapidSelectionConfig", "StaticRapidSelectionConfig", "ValidationRapidSelectionConfig"]
|
|
32
|
+
|
|
33
|
+
class CompareWorkflowConfigRapidSelectionConfigsInner(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
CompareWorkflowConfigRapidSelectionConfigsInner
|
|
36
|
+
"""
|
|
37
|
+
# data type: ConditionalValidationRapidSelectionConfig
|
|
38
|
+
oneof_schema_1_validator: Optional[ConditionalValidationRapidSelectionConfig] = None
|
|
39
|
+
# data type: CorrelatedRapidSelectionConfig
|
|
40
|
+
oneof_schema_2_validator: Optional[CorrelatedRapidSelectionConfig] = None
|
|
41
|
+
# data type: DemographicRapidSelectionConfig
|
|
42
|
+
oneof_schema_3_validator: Optional[DemographicRapidSelectionConfig] = None
|
|
43
|
+
# data type: NoValidationWorkflowRapidSelectionConfig
|
|
44
|
+
oneof_schema_4_validator: Optional[NoValidationWorkflowRapidSelectionConfig] = None
|
|
45
|
+
# data type: OnlyValidationWorkflowRapidSelectionConfig
|
|
46
|
+
oneof_schema_5_validator: Optional[OnlyValidationWorkflowRapidSelectionConfig] = None
|
|
47
|
+
# data type: StaticRapidSelectionConfig
|
|
48
|
+
oneof_schema_6_validator: Optional[StaticRapidSelectionConfig] = None
|
|
49
|
+
# data type: ValidationRapidSelectionConfig
|
|
50
|
+
oneof_schema_7_validator: Optional[ValidationRapidSelectionConfig] = None
|
|
51
|
+
actual_instance: Optional[Union[ConditionalValidationRapidSelectionConfig, CorrelatedRapidSelectionConfig, DemographicRapidSelectionConfig, NoValidationWorkflowRapidSelectionConfig, OnlyValidationWorkflowRapidSelectionConfig, StaticRapidSelectionConfig, ValidationRapidSelectionConfig]] = None
|
|
52
|
+
one_of_schemas: Set[str] = { "ConditionalValidationRapidSelectionConfig", "CorrelatedRapidSelectionConfig", "DemographicRapidSelectionConfig", "NoValidationWorkflowRapidSelectionConfig", "OnlyValidationWorkflowRapidSelectionConfig", "StaticRapidSelectionConfig", "ValidationRapidSelectionConfig" }
|
|
53
|
+
|
|
54
|
+
model_config = ConfigDict(
|
|
55
|
+
validate_assignment=True,
|
|
56
|
+
protected_namespaces=(),
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
64
|
+
if args:
|
|
65
|
+
if len(args) > 1:
|
|
66
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
67
|
+
if kwargs:
|
|
68
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
69
|
+
super().__init__(actual_instance=args[0])
|
|
70
|
+
else:
|
|
71
|
+
super().__init__(**kwargs)
|
|
72
|
+
|
|
73
|
+
@field_validator('actual_instance')
|
|
74
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
75
|
+
instance = CompareWorkflowConfigRapidSelectionConfigsInner.model_construct()
|
|
76
|
+
error_messages = []
|
|
77
|
+
match = 0
|
|
78
|
+
# validate data type: ConditionalValidationRapidSelectionConfig
|
|
79
|
+
if not isinstance(v, ConditionalValidationRapidSelectionConfig):
|
|
80
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ConditionalValidationRapidSelectionConfig`")
|
|
81
|
+
else:
|
|
82
|
+
match += 1
|
|
83
|
+
# validate data type: CorrelatedRapidSelectionConfig
|
|
84
|
+
if not isinstance(v, CorrelatedRapidSelectionConfig):
|
|
85
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CorrelatedRapidSelectionConfig`")
|
|
86
|
+
else:
|
|
87
|
+
match += 1
|
|
88
|
+
# validate data type: DemographicRapidSelectionConfig
|
|
89
|
+
if not isinstance(v, DemographicRapidSelectionConfig):
|
|
90
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `DemographicRapidSelectionConfig`")
|
|
91
|
+
else:
|
|
92
|
+
match += 1
|
|
93
|
+
# validate data type: NoValidationWorkflowRapidSelectionConfig
|
|
94
|
+
if not isinstance(v, NoValidationWorkflowRapidSelectionConfig):
|
|
95
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NoValidationWorkflowRapidSelectionConfig`")
|
|
96
|
+
else:
|
|
97
|
+
match += 1
|
|
98
|
+
# validate data type: OnlyValidationWorkflowRapidSelectionConfig
|
|
99
|
+
if not isinstance(v, OnlyValidationWorkflowRapidSelectionConfig):
|
|
100
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `OnlyValidationWorkflowRapidSelectionConfig`")
|
|
101
|
+
else:
|
|
102
|
+
match += 1
|
|
103
|
+
# validate data type: StaticRapidSelectionConfig
|
|
104
|
+
if not isinstance(v, StaticRapidSelectionConfig):
|
|
105
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `StaticRapidSelectionConfig`")
|
|
106
|
+
else:
|
|
107
|
+
match += 1
|
|
108
|
+
# validate data type: ValidationRapidSelectionConfig
|
|
109
|
+
if not isinstance(v, ValidationRapidSelectionConfig):
|
|
110
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ValidationRapidSelectionConfig`")
|
|
111
|
+
else:
|
|
112
|
+
match += 1
|
|
113
|
+
if match > 1:
|
|
114
|
+
# more than 1 match
|
|
115
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in CompareWorkflowConfigRapidSelectionConfigsInner with oneOf schemas: ConditionalValidationRapidSelectionConfig, CorrelatedRapidSelectionConfig, DemographicRapidSelectionConfig, NoValidationWorkflowRapidSelectionConfig, OnlyValidationWorkflowRapidSelectionConfig, StaticRapidSelectionConfig, ValidationRapidSelectionConfig. Details: " + ", ".join(error_messages))
|
|
116
|
+
elif match == 0:
|
|
117
|
+
# no match
|
|
118
|
+
raise ValueError("No match found when setting `actual_instance` in CompareWorkflowConfigRapidSelectionConfigsInner with oneOf schemas: ConditionalValidationRapidSelectionConfig, CorrelatedRapidSelectionConfig, DemographicRapidSelectionConfig, NoValidationWorkflowRapidSelectionConfig, OnlyValidationWorkflowRapidSelectionConfig, StaticRapidSelectionConfig, ValidationRapidSelectionConfig. Details: " + ", ".join(error_messages))
|
|
119
|
+
else:
|
|
120
|
+
return v
|
|
121
|
+
|
|
122
|
+
@classmethod
|
|
123
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
124
|
+
return cls.from_json(json.dumps(obj))
|
|
125
|
+
|
|
126
|
+
@classmethod
|
|
127
|
+
def from_json(cls, json_str: str) -> Self:
|
|
128
|
+
"""Returns the object represented by the json string"""
|
|
129
|
+
instance = cls.model_construct()
|
|
130
|
+
error_messages = []
|
|
131
|
+
match = 0
|
|
132
|
+
|
|
133
|
+
# deserialize data into ConditionalValidationRapidSelectionConfig
|
|
134
|
+
try:
|
|
135
|
+
instance.actual_instance = ConditionalValidationRapidSelectionConfig.from_json(json_str)
|
|
136
|
+
match += 1
|
|
137
|
+
except (ValidationError, ValueError) as e:
|
|
138
|
+
error_messages.append(str(e))
|
|
139
|
+
# deserialize data into CorrelatedRapidSelectionConfig
|
|
140
|
+
try:
|
|
141
|
+
instance.actual_instance = CorrelatedRapidSelectionConfig.from_json(json_str)
|
|
142
|
+
match += 1
|
|
143
|
+
except (ValidationError, ValueError) as e:
|
|
144
|
+
error_messages.append(str(e))
|
|
145
|
+
# deserialize data into DemographicRapidSelectionConfig
|
|
146
|
+
try:
|
|
147
|
+
instance.actual_instance = DemographicRapidSelectionConfig.from_json(json_str)
|
|
148
|
+
match += 1
|
|
149
|
+
except (ValidationError, ValueError) as e:
|
|
150
|
+
error_messages.append(str(e))
|
|
151
|
+
# deserialize data into NoValidationWorkflowRapidSelectionConfig
|
|
152
|
+
try:
|
|
153
|
+
instance.actual_instance = NoValidationWorkflowRapidSelectionConfig.from_json(json_str)
|
|
154
|
+
match += 1
|
|
155
|
+
except (ValidationError, ValueError) as e:
|
|
156
|
+
error_messages.append(str(e))
|
|
157
|
+
# deserialize data into OnlyValidationWorkflowRapidSelectionConfig
|
|
158
|
+
try:
|
|
159
|
+
instance.actual_instance = OnlyValidationWorkflowRapidSelectionConfig.from_json(json_str)
|
|
160
|
+
match += 1
|
|
161
|
+
except (ValidationError, ValueError) as e:
|
|
162
|
+
error_messages.append(str(e))
|
|
163
|
+
# deserialize data into StaticRapidSelectionConfig
|
|
164
|
+
try:
|
|
165
|
+
instance.actual_instance = StaticRapidSelectionConfig.from_json(json_str)
|
|
166
|
+
match += 1
|
|
167
|
+
except (ValidationError, ValueError) as e:
|
|
168
|
+
error_messages.append(str(e))
|
|
169
|
+
# deserialize data into ValidationRapidSelectionConfig
|
|
170
|
+
try:
|
|
171
|
+
instance.actual_instance = ValidationRapidSelectionConfig.from_json(json_str)
|
|
172
|
+
match += 1
|
|
173
|
+
except (ValidationError, ValueError) as e:
|
|
174
|
+
error_messages.append(str(e))
|
|
175
|
+
|
|
176
|
+
if match > 1:
|
|
177
|
+
# more than 1 match
|
|
178
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into CompareWorkflowConfigRapidSelectionConfigsInner with oneOf schemas: ConditionalValidationRapidSelectionConfig, CorrelatedRapidSelectionConfig, DemographicRapidSelectionConfig, NoValidationWorkflowRapidSelectionConfig, OnlyValidationWorkflowRapidSelectionConfig, StaticRapidSelectionConfig, ValidationRapidSelectionConfig. Details: " + ", ".join(error_messages))
|
|
179
|
+
elif match == 0:
|
|
180
|
+
# no match
|
|
181
|
+
raise ValueError("No match found when deserializing the JSON string into CompareWorkflowConfigRapidSelectionConfigsInner with oneOf schemas: ConditionalValidationRapidSelectionConfig, CorrelatedRapidSelectionConfig, DemographicRapidSelectionConfig, NoValidationWorkflowRapidSelectionConfig, OnlyValidationWorkflowRapidSelectionConfig, StaticRapidSelectionConfig, ValidationRapidSelectionConfig. Details: " + ", ".join(error_messages))
|
|
182
|
+
else:
|
|
183
|
+
return instance
|
|
184
|
+
|
|
185
|
+
def to_json(self) -> str:
|
|
186
|
+
"""Returns the JSON representation of the actual instance"""
|
|
187
|
+
if self.actual_instance is None:
|
|
188
|
+
return "null"
|
|
189
|
+
|
|
190
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
191
|
+
return self.actual_instance.to_json()
|
|
192
|
+
else:
|
|
193
|
+
return json.dumps(self.actual_instance)
|
|
194
|
+
|
|
195
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], ConditionalValidationRapidSelectionConfig, CorrelatedRapidSelectionConfig, DemographicRapidSelectionConfig, NoValidationWorkflowRapidSelectionConfig, OnlyValidationWorkflowRapidSelectionConfig, StaticRapidSelectionConfig, ValidationRapidSelectionConfig]]:
|
|
196
|
+
"""Returns the dict representation of the actual instance"""
|
|
197
|
+
if self.actual_instance is None:
|
|
198
|
+
return None
|
|
199
|
+
|
|
200
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
201
|
+
return self.actual_instance.to_dict()
|
|
202
|
+
else:
|
|
203
|
+
# primitive type
|
|
204
|
+
return self.actual_instance
|
|
205
|
+
|
|
206
|
+
def to_str(self) -> str:
|
|
207
|
+
"""Returns the string representation of the actual instance"""
|
|
208
|
+
return pprint.pformat(self.model_dump())
|
|
209
|
+
|
|
210
|
+
|
|
@@ -0,0 +1,154 @@
|
|
|
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 openapi_client.models.naive_referee_config import NaiveRefereeConfig
|
|
21
|
+
from openapi_client.models.never_ending_referee_config import NeverEndingRefereeConfig
|
|
22
|
+
from openapi_client.models.probabilistic_attach_category_referee_config import ProbabilisticAttachCategoryRefereeConfig
|
|
23
|
+
from pydantic import StrictStr, Field
|
|
24
|
+
from typing import Union, List, Set, Optional, Dict
|
|
25
|
+
from typing_extensions import Literal, Self
|
|
26
|
+
|
|
27
|
+
COMPAREWORKFLOWCONFIGREFEREE_ONE_OF_SCHEMAS = ["NaiveRefereeConfig", "NeverEndingRefereeConfig", "ProbabilisticAttachCategoryRefereeConfig"]
|
|
28
|
+
|
|
29
|
+
class CompareWorkflowConfigReferee(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
CompareWorkflowConfigReferee
|
|
32
|
+
"""
|
|
33
|
+
# data type: NaiveRefereeConfig
|
|
34
|
+
oneof_schema_1_validator: Optional[NaiveRefereeConfig] = None
|
|
35
|
+
# data type: NeverEndingRefereeConfig
|
|
36
|
+
oneof_schema_2_validator: Optional[NeverEndingRefereeConfig] = None
|
|
37
|
+
# data type: ProbabilisticAttachCategoryRefereeConfig
|
|
38
|
+
oneof_schema_3_validator: Optional[ProbabilisticAttachCategoryRefereeConfig] = None
|
|
39
|
+
actual_instance: Optional[Union[NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig]] = None
|
|
40
|
+
one_of_schemas: Set[str] = { "NaiveRefereeConfig", "NeverEndingRefereeConfig", "ProbabilisticAttachCategoryRefereeConfig" }
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
52
|
+
if args:
|
|
53
|
+
if len(args) > 1:
|
|
54
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
55
|
+
if kwargs:
|
|
56
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
57
|
+
super().__init__(actual_instance=args[0])
|
|
58
|
+
else:
|
|
59
|
+
super().__init__(**kwargs)
|
|
60
|
+
|
|
61
|
+
@field_validator('actual_instance')
|
|
62
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
63
|
+
instance = CompareWorkflowConfigReferee.model_construct()
|
|
64
|
+
error_messages = []
|
|
65
|
+
match = 0
|
|
66
|
+
# validate data type: NaiveRefereeConfig
|
|
67
|
+
if not isinstance(v, NaiveRefereeConfig):
|
|
68
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NaiveRefereeConfig`")
|
|
69
|
+
else:
|
|
70
|
+
match += 1
|
|
71
|
+
# validate data type: NeverEndingRefereeConfig
|
|
72
|
+
if not isinstance(v, NeverEndingRefereeConfig):
|
|
73
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NeverEndingRefereeConfig`")
|
|
74
|
+
else:
|
|
75
|
+
match += 1
|
|
76
|
+
# validate data type: ProbabilisticAttachCategoryRefereeConfig
|
|
77
|
+
if not isinstance(v, ProbabilisticAttachCategoryRefereeConfig):
|
|
78
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ProbabilisticAttachCategoryRefereeConfig`")
|
|
79
|
+
else:
|
|
80
|
+
match += 1
|
|
81
|
+
if match > 1:
|
|
82
|
+
# more than 1 match
|
|
83
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in CompareWorkflowConfigReferee with oneOf schemas: NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig. Details: " + ", ".join(error_messages))
|
|
84
|
+
elif match == 0:
|
|
85
|
+
# no match
|
|
86
|
+
raise ValueError("No match found when setting `actual_instance` in CompareWorkflowConfigReferee with oneOf schemas: NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig. Details: " + ", ".join(error_messages))
|
|
87
|
+
else:
|
|
88
|
+
return v
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
92
|
+
return cls.from_json(json.dumps(obj))
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_json(cls, json_str: str) -> Self:
|
|
96
|
+
"""Returns the object represented by the json string"""
|
|
97
|
+
instance = cls.model_construct()
|
|
98
|
+
error_messages = []
|
|
99
|
+
match = 0
|
|
100
|
+
|
|
101
|
+
# deserialize data into NaiveRefereeConfig
|
|
102
|
+
try:
|
|
103
|
+
instance.actual_instance = NaiveRefereeConfig.from_json(json_str)
|
|
104
|
+
match += 1
|
|
105
|
+
except (ValidationError, ValueError) as e:
|
|
106
|
+
error_messages.append(str(e))
|
|
107
|
+
# deserialize data into NeverEndingRefereeConfig
|
|
108
|
+
try:
|
|
109
|
+
instance.actual_instance = NeverEndingRefereeConfig.from_json(json_str)
|
|
110
|
+
match += 1
|
|
111
|
+
except (ValidationError, ValueError) as e:
|
|
112
|
+
error_messages.append(str(e))
|
|
113
|
+
# deserialize data into ProbabilisticAttachCategoryRefereeConfig
|
|
114
|
+
try:
|
|
115
|
+
instance.actual_instance = ProbabilisticAttachCategoryRefereeConfig.from_json(json_str)
|
|
116
|
+
match += 1
|
|
117
|
+
except (ValidationError, ValueError) as e:
|
|
118
|
+
error_messages.append(str(e))
|
|
119
|
+
|
|
120
|
+
if match > 1:
|
|
121
|
+
# more than 1 match
|
|
122
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into CompareWorkflowConfigReferee with oneOf schemas: NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig. Details: " + ", ".join(error_messages))
|
|
123
|
+
elif match == 0:
|
|
124
|
+
# no match
|
|
125
|
+
raise ValueError("No match found when deserializing the JSON string into CompareWorkflowConfigReferee with oneOf schemas: NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig. Details: " + ", ".join(error_messages))
|
|
126
|
+
else:
|
|
127
|
+
return instance
|
|
128
|
+
|
|
129
|
+
def to_json(self) -> str:
|
|
130
|
+
"""Returns the JSON representation of the actual instance"""
|
|
131
|
+
if self.actual_instance is None:
|
|
132
|
+
return "null"
|
|
133
|
+
|
|
134
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
135
|
+
return self.actual_instance.to_json()
|
|
136
|
+
else:
|
|
137
|
+
return json.dumps(self.actual_instance)
|
|
138
|
+
|
|
139
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig]]:
|
|
140
|
+
"""Returns the dict representation of the actual instance"""
|
|
141
|
+
if self.actual_instance is None:
|
|
142
|
+
return None
|
|
143
|
+
|
|
144
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
145
|
+
return self.actual_instance.to_dict()
|
|
146
|
+
else:
|
|
147
|
+
# primitive type
|
|
148
|
+
return self.actual_instance
|
|
149
|
+
|
|
150
|
+
def to_str(self) -> str:
|
|
151
|
+
"""Returns the string representation of the actual instance"""
|
|
152
|
+
return pprint.pformat(self.model_dump())
|
|
153
|
+
|
|
154
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
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 CompareWorkflowModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
If the SimpleWorkflow is chosen, each datapoint uploaded will correspond to a single task to be solved. This is the most commonly chosen workflow.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for CompareWorkflow", alias="_t")
|
|
30
|
+
criteria: StrictStr = Field(description="The criteria that the datapoints should be compared based on. No default value.")
|
|
31
|
+
starting_elo: Optional[StrictInt] = Field(default=None, description="The Starting Elo is the Elo that all datapoints will start with. Default is usually between 1200-1500.", alias="startingElo")
|
|
32
|
+
k_factor: Optional[StrictInt] = Field(default=None, description="The KFactor is used to calculate the Elo change after each match. Per default this is between 20 and 40.", alias="kFactor")
|
|
33
|
+
match_size: Optional[StrictInt] = Field(default=None, description="The MatchSize determines how many datapoints will be matched together once. Per default this is 2.", alias="matchSize")
|
|
34
|
+
scaling_factor: Optional[StrictInt] = Field(default=None, description="The ScalingFactor is used to calculate the expected outcome before a match. Per default this is 400.", alias="scalingFactor")
|
|
35
|
+
matches_until_completed: Optional[StrictInt] = Field(default=None, description="The amount of matches that a datapoint should have played until it completes. Per default this is 10.", alias="matchesUntilCompleted")
|
|
36
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria", "startingElo", "kFactor", "matchSize", "scalingFactor", "matchesUntilCompleted"]
|
|
37
|
+
|
|
38
|
+
@field_validator('t')
|
|
39
|
+
def t_validate_enum(cls, value):
|
|
40
|
+
"""Validates the enum"""
|
|
41
|
+
if value not in set(['CompareWorkflow']):
|
|
42
|
+
raise ValueError("must be one of enum values ('CompareWorkflow')")
|
|
43
|
+
return value
|
|
44
|
+
|
|
45
|
+
model_config = ConfigDict(
|
|
46
|
+
populate_by_name=True,
|
|
47
|
+
validate_assignment=True,
|
|
48
|
+
protected_namespaces=(),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def to_str(self) -> str:
|
|
53
|
+
"""Returns the string representation of the model using alias"""
|
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
55
|
+
|
|
56
|
+
def to_json(self) -> str:
|
|
57
|
+
"""Returns the JSON representation of the model using alias"""
|
|
58
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
59
|
+
return json.dumps(self.to_dict())
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
63
|
+
"""Create an instance of CompareWorkflowModel from a JSON string"""
|
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
|
65
|
+
|
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
|
68
|
+
|
|
69
|
+
This has the following differences from calling pydantic's
|
|
70
|
+
`self.model_dump(by_alias=True)`:
|
|
71
|
+
|
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
|
73
|
+
were set at model initialization. Other fields with value `None`
|
|
74
|
+
are ignored.
|
|
75
|
+
"""
|
|
76
|
+
excluded_fields: Set[str] = set([
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
_dict = self.model_dump(
|
|
80
|
+
by_alias=True,
|
|
81
|
+
exclude=excluded_fields,
|
|
82
|
+
exclude_none=True,
|
|
83
|
+
)
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of CompareWorkflowModel from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'CompareWorkflow',
|
|
97
|
+
"criteria": obj.get("criteria"),
|
|
98
|
+
"startingElo": obj.get("startingElo"),
|
|
99
|
+
"kFactor": obj.get("kFactor"),
|
|
100
|
+
"matchSize": obj.get("matchSize"),
|
|
101
|
+
"scalingFactor": obj.get("scalingFactor"),
|
|
102
|
+
"matchesUntilCompleted": obj.get("matchesUntilCompleted")
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from openapi_client.models.validation_chance import ValidationChance
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ConditionalValidationRapidSelectionConfig(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ConditionalValidationRapidSelectionConfig
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
t: StrictStr = Field(description="Discriminator value for ConditionalValidationRapidSelectionConfig", alias="_t")
|
|
31
|
+
validation_set_id: StrictStr = Field(alias="validationSetId")
|
|
32
|
+
validation_chances: List[ValidationChance] = Field(alias="validationChances")
|
|
33
|
+
amount: Optional[StrictInt] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["_t", "validationSetId", "validationChances", "amount"]
|
|
35
|
+
|
|
36
|
+
@field_validator('t')
|
|
37
|
+
def t_validate_enum(cls, value):
|
|
38
|
+
"""Validates the enum"""
|
|
39
|
+
if value not in set(['ConditionalValidationRapidSelectionConfig']):
|
|
40
|
+
raise ValueError("must be one of enum values ('ConditionalValidationRapidSelectionConfig')")
|
|
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 ConditionalValidationRapidSelectionConfig 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
|
+
# override the default output from pydantic by calling `to_dict()` of each item in validation_chances (list)
|
|
83
|
+
_items = []
|
|
84
|
+
if self.validation_chances:
|
|
85
|
+
for _item_validation_chances in self.validation_chances:
|
|
86
|
+
if _item_validation_chances:
|
|
87
|
+
_items.append(_item_validation_chances.to_dict())
|
|
88
|
+
_dict['validationChances'] = _items
|
|
89
|
+
# set to None if amount (nullable) is None
|
|
90
|
+
# and model_fields_set contains the field
|
|
91
|
+
if self.amount is None and "amount" in self.model_fields_set:
|
|
92
|
+
_dict['amount'] = None
|
|
93
|
+
|
|
94
|
+
return _dict
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
98
|
+
"""Create an instance of ConditionalValidationRapidSelectionConfig from a dict"""
|
|
99
|
+
if obj is None:
|
|
100
|
+
return None
|
|
101
|
+
|
|
102
|
+
if not isinstance(obj, dict):
|
|
103
|
+
return cls.model_validate(obj)
|
|
104
|
+
|
|
105
|
+
_obj = cls.model_validate({
|
|
106
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'ConditionalValidationRapidSelectionConfig',
|
|
107
|
+
"validationSetId": obj.get("validationSetId"),
|
|
108
|
+
"validationChances": [ValidationChance.from_dict(_item) for _item in obj["validationChances"]] if obj.get("validationChances") is not None else None,
|
|
109
|
+
"amount": obj.get("amount")
|
|
110
|
+
})
|
|
111
|
+
return _obj
|
|
112
|
+
|
|
113
|
+
|