# coding: utf-8

"""
    The Jira Cloud platform REST API

    Jira Cloud platform REST API documentation

    The version of the OpenAPI document: 1001.0.0-SNAPSHOT-7ce0ee67a52d004425175cea962ad1c1c7200181
    Contact: ecosystem@atlassian.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import json
import pprint
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
from typing import Any, List, Optional
from jira_client.models.custom_field_context_default_value_cascading_option import CustomFieldContextDefaultValueCascadingOption
from jira_client.models.custom_field_context_default_value_date import CustomFieldContextDefaultValueDate
from jira_client.models.custom_field_context_default_value_date_time import CustomFieldContextDefaultValueDateTime
from jira_client.models.custom_field_context_default_value_float import CustomFieldContextDefaultValueFloat
from jira_client.models.custom_field_context_default_value_forge_date_time_field import CustomFieldContextDefaultValueForgeDateTimeField
from jira_client.models.custom_field_context_default_value_forge_group_field import CustomFieldContextDefaultValueForgeGroupField
from jira_client.models.custom_field_context_default_value_forge_multi_group_field import CustomFieldContextDefaultValueForgeMultiGroupField
from jira_client.models.custom_field_context_default_value_forge_multi_string_field import CustomFieldContextDefaultValueForgeMultiStringField
from jira_client.models.custom_field_context_default_value_forge_multi_user_field import CustomFieldContextDefaultValueForgeMultiUserField
from jira_client.models.custom_field_context_default_value_forge_number_field import CustomFieldContextDefaultValueForgeNumberField
from jira_client.models.custom_field_context_default_value_forge_object_field import CustomFieldContextDefaultValueForgeObjectField
from jira_client.models.custom_field_context_default_value_forge_string_field import CustomFieldContextDefaultValueForgeStringField
from jira_client.models.custom_field_context_default_value_forge_user_field import CustomFieldContextDefaultValueForgeUserField
from jira_client.models.custom_field_context_default_value_labels import CustomFieldContextDefaultValueLabels
from jira_client.models.custom_field_context_default_value_multi_user_picker import CustomFieldContextDefaultValueMultiUserPicker
from jira_client.models.custom_field_context_default_value_multiple_group_picker import CustomFieldContextDefaultValueMultipleGroupPicker
from jira_client.models.custom_field_context_default_value_multiple_option import CustomFieldContextDefaultValueMultipleOption
from jira_client.models.custom_field_context_default_value_multiple_version_picker import CustomFieldContextDefaultValueMultipleVersionPicker
from jira_client.models.custom_field_context_default_value_project import CustomFieldContextDefaultValueProject
from jira_client.models.custom_field_context_default_value_read_only import CustomFieldContextDefaultValueReadOnly
from jira_client.models.custom_field_context_default_value_single_group_picker import CustomFieldContextDefaultValueSingleGroupPicker
from jira_client.models.custom_field_context_default_value_single_option import CustomFieldContextDefaultValueSingleOption
from jira_client.models.custom_field_context_default_value_single_version_picker import CustomFieldContextDefaultValueSingleVersionPicker
from jira_client.models.custom_field_context_default_value_text_area import CustomFieldContextDefaultValueTextArea
from jira_client.models.custom_field_context_default_value_text_field import CustomFieldContextDefaultValueTextField
from jira_client.models.custom_field_context_default_value_url import CustomFieldContextDefaultValueURL
from jira_client.models.custom_field_context_single_user_picker_defaults import CustomFieldContextSingleUserPickerDefaults
from pydantic import StrictStr, Field
from typing import Union, List, Set, Optional, Dict
from typing_extensions import Literal, Self

CUSTOMFIELDCONTEXTDEFAULTVALUE_ONE_OF_SCHEMAS = ["CustomFieldContextDefaultValueCascadingOption", "CustomFieldContextDefaultValueDate", "CustomFieldContextDefaultValueDateTime", "CustomFieldContextDefaultValueFloat", "CustomFieldContextDefaultValueForgeDateTimeField", "CustomFieldContextDefaultValueForgeGroupField", "CustomFieldContextDefaultValueForgeMultiGroupField", "CustomFieldContextDefaultValueForgeMultiStringField", "CustomFieldContextDefaultValueForgeMultiUserField", "CustomFieldContextDefaultValueForgeNumberField", "CustomFieldContextDefaultValueForgeObjectField", "CustomFieldContextDefaultValueForgeStringField", "CustomFieldContextDefaultValueForgeUserField", "CustomFieldContextDefaultValueLabels", "CustomFieldContextDefaultValueMultiUserPicker", "CustomFieldContextDefaultValueMultipleGroupPicker", "CustomFieldContextDefaultValueMultipleOption", "CustomFieldContextDefaultValueMultipleVersionPicker", "CustomFieldContextDefaultValueProject", "CustomFieldContextDefaultValueReadOnly", "CustomFieldContextDefaultValueSingleGroupPicker", "CustomFieldContextDefaultValueSingleOption", "CustomFieldContextDefaultValueSingleVersionPicker", "CustomFieldContextDefaultValueTextArea", "CustomFieldContextDefaultValueTextField", "CustomFieldContextDefaultValueURL", "CustomFieldContextSingleUserPickerDefaults"]

class CustomFieldContextDefaultValue(BaseModel):
    """
    CustomFieldContextDefaultValue
    """
    # data type: CustomFieldContextDefaultValueCascadingOption
    oneof_schema_1_validator: Optional[CustomFieldContextDefaultValueCascadingOption] = None
    # data type: CustomFieldContextDefaultValueMultipleOption
    oneof_schema_2_validator: Optional[CustomFieldContextDefaultValueMultipleOption] = None
    # data type: CustomFieldContextDefaultValueSingleOption
    oneof_schema_3_validator: Optional[CustomFieldContextDefaultValueSingleOption] = None
    # data type: CustomFieldContextSingleUserPickerDefaults
    oneof_schema_4_validator: Optional[CustomFieldContextSingleUserPickerDefaults] = None
    # data type: CustomFieldContextDefaultValueMultiUserPicker
    oneof_schema_5_validator: Optional[CustomFieldContextDefaultValueMultiUserPicker] = None
    # data type: CustomFieldContextDefaultValueSingleGroupPicker
    oneof_schema_6_validator: Optional[CustomFieldContextDefaultValueSingleGroupPicker] = None
    # data type: CustomFieldContextDefaultValueMultipleGroupPicker
    oneof_schema_7_validator: Optional[CustomFieldContextDefaultValueMultipleGroupPicker] = None
    # data type: CustomFieldContextDefaultValueDate
    oneof_schema_8_validator: Optional[CustomFieldContextDefaultValueDate] = None
    # data type: CustomFieldContextDefaultValueDateTime
    oneof_schema_9_validator: Optional[CustomFieldContextDefaultValueDateTime] = None
    # data type: CustomFieldContextDefaultValueURL
    oneof_schema_10_validator: Optional[CustomFieldContextDefaultValueURL] = None
    # data type: CustomFieldContextDefaultValueProject
    oneof_schema_11_validator: Optional[CustomFieldContextDefaultValueProject] = None
    # data type: CustomFieldContextDefaultValueFloat
    oneof_schema_12_validator: Optional[CustomFieldContextDefaultValueFloat] = None
    # data type: CustomFieldContextDefaultValueLabels
    oneof_schema_13_validator: Optional[CustomFieldContextDefaultValueLabels] = None
    # data type: CustomFieldContextDefaultValueTextField
    oneof_schema_14_validator: Optional[CustomFieldContextDefaultValueTextField] = None
    # data type: CustomFieldContextDefaultValueTextArea
    oneof_schema_15_validator: Optional[CustomFieldContextDefaultValueTextArea] = None
    # data type: CustomFieldContextDefaultValueReadOnly
    oneof_schema_16_validator: Optional[CustomFieldContextDefaultValueReadOnly] = None
    # data type: CustomFieldContextDefaultValueSingleVersionPicker
    oneof_schema_17_validator: Optional[CustomFieldContextDefaultValueSingleVersionPicker] = None
    # data type: CustomFieldContextDefaultValueMultipleVersionPicker
    oneof_schema_18_validator: Optional[CustomFieldContextDefaultValueMultipleVersionPicker] = None
    # data type: CustomFieldContextDefaultValueForgeStringField
    oneof_schema_19_validator: Optional[CustomFieldContextDefaultValueForgeStringField] = None
    # data type: CustomFieldContextDefaultValueForgeMultiStringField
    oneof_schema_20_validator: Optional[CustomFieldContextDefaultValueForgeMultiStringField] = None
    # data type: CustomFieldContextDefaultValueForgeObjectField
    oneof_schema_21_validator: Optional[CustomFieldContextDefaultValueForgeObjectField] = None
    # data type: CustomFieldContextDefaultValueForgeDateTimeField
    oneof_schema_22_validator: Optional[CustomFieldContextDefaultValueForgeDateTimeField] = None
    # data type: CustomFieldContextDefaultValueForgeGroupField
    oneof_schema_23_validator: Optional[CustomFieldContextDefaultValueForgeGroupField] = None
    # data type: CustomFieldContextDefaultValueForgeMultiGroupField
    oneof_schema_24_validator: Optional[CustomFieldContextDefaultValueForgeMultiGroupField] = None
    # data type: CustomFieldContextDefaultValueForgeNumberField
    oneof_schema_25_validator: Optional[CustomFieldContextDefaultValueForgeNumberField] = None
    # data type: CustomFieldContextDefaultValueForgeUserField
    oneof_schema_26_validator: Optional[CustomFieldContextDefaultValueForgeUserField] = None
    # data type: CustomFieldContextDefaultValueForgeMultiUserField
    oneof_schema_27_validator: Optional[CustomFieldContextDefaultValueForgeMultiUserField] = None
    actual_instance: Optional[Union[CustomFieldContextDefaultValueCascadingOption, CustomFieldContextDefaultValueDate, CustomFieldContextDefaultValueDateTime, CustomFieldContextDefaultValueFloat, CustomFieldContextDefaultValueForgeDateTimeField, CustomFieldContextDefaultValueForgeGroupField, CustomFieldContextDefaultValueForgeMultiGroupField, CustomFieldContextDefaultValueForgeMultiStringField, CustomFieldContextDefaultValueForgeMultiUserField, CustomFieldContextDefaultValueForgeNumberField, CustomFieldContextDefaultValueForgeObjectField, CustomFieldContextDefaultValueForgeStringField, CustomFieldContextDefaultValueForgeUserField, CustomFieldContextDefaultValueLabels, CustomFieldContextDefaultValueMultiUserPicker, CustomFieldContextDefaultValueMultipleGroupPicker, CustomFieldContextDefaultValueMultipleOption, CustomFieldContextDefaultValueMultipleVersionPicker, CustomFieldContextDefaultValueProject, CustomFieldContextDefaultValueReadOnly, CustomFieldContextDefaultValueSingleGroupPicker, CustomFieldContextDefaultValueSingleOption, CustomFieldContextDefaultValueSingleVersionPicker, CustomFieldContextDefaultValueTextArea, CustomFieldContextDefaultValueTextField, CustomFieldContextDefaultValueURL, CustomFieldContextSingleUserPickerDefaults]] = None
    one_of_schemas: Set[str] = { "CustomFieldContextDefaultValueCascadingOption", "CustomFieldContextDefaultValueDate", "CustomFieldContextDefaultValueDateTime", "CustomFieldContextDefaultValueFloat", "CustomFieldContextDefaultValueForgeDateTimeField", "CustomFieldContextDefaultValueForgeGroupField", "CustomFieldContextDefaultValueForgeMultiGroupField", "CustomFieldContextDefaultValueForgeMultiStringField", "CustomFieldContextDefaultValueForgeMultiUserField", "CustomFieldContextDefaultValueForgeNumberField", "CustomFieldContextDefaultValueForgeObjectField", "CustomFieldContextDefaultValueForgeStringField", "CustomFieldContextDefaultValueForgeUserField", "CustomFieldContextDefaultValueLabels", "CustomFieldContextDefaultValueMultiUserPicker", "CustomFieldContextDefaultValueMultipleGroupPicker", "CustomFieldContextDefaultValueMultipleOption", "CustomFieldContextDefaultValueMultipleVersionPicker", "CustomFieldContextDefaultValueProject", "CustomFieldContextDefaultValueReadOnly", "CustomFieldContextDefaultValueSingleGroupPicker", "CustomFieldContextDefaultValueSingleOption", "CustomFieldContextDefaultValueSingleVersionPicker", "CustomFieldContextDefaultValueTextArea", "CustomFieldContextDefaultValueTextField", "CustomFieldContextDefaultValueURL", "CustomFieldContextSingleUserPickerDefaults" }

    model_config = ConfigDict(
        validate_assignment=True,
        protected_namespaces=(),
    )


    discriminator_value_class_map: Dict[str, str] = {
    }

    def __init__(self, *args, **kwargs) -> None:
        if args:
            if len(args) > 1:
                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
            if kwargs:
                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
            super().__init__(actual_instance=args[0])
        else:
            super().__init__(**kwargs)

    @field_validator('actual_instance')
    def actual_instance_must_validate_oneof(cls, v):
        instance = CustomFieldContextDefaultValue.model_construct()
        error_messages = []
        match = 0
        # validate data type: CustomFieldContextDefaultValueCascadingOption
        if not isinstance(v, CustomFieldContextDefaultValueCascadingOption):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueCascadingOption`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueMultipleOption
        if not isinstance(v, CustomFieldContextDefaultValueMultipleOption):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueMultipleOption`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueSingleOption
        if not isinstance(v, CustomFieldContextDefaultValueSingleOption):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueSingleOption`")
        else:
            match += 1
        # validate data type: CustomFieldContextSingleUserPickerDefaults
        if not isinstance(v, CustomFieldContextSingleUserPickerDefaults):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextSingleUserPickerDefaults`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueMultiUserPicker
        if not isinstance(v, CustomFieldContextDefaultValueMultiUserPicker):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueMultiUserPicker`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueSingleGroupPicker
        if not isinstance(v, CustomFieldContextDefaultValueSingleGroupPicker):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueSingleGroupPicker`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueMultipleGroupPicker
        if not isinstance(v, CustomFieldContextDefaultValueMultipleGroupPicker):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueMultipleGroupPicker`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueDate
        if not isinstance(v, CustomFieldContextDefaultValueDate):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueDate`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueDateTime
        if not isinstance(v, CustomFieldContextDefaultValueDateTime):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueDateTime`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueURL
        if not isinstance(v, CustomFieldContextDefaultValueURL):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueURL`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueProject
        if not isinstance(v, CustomFieldContextDefaultValueProject):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueProject`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueFloat
        if not isinstance(v, CustomFieldContextDefaultValueFloat):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueFloat`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueLabels
        if not isinstance(v, CustomFieldContextDefaultValueLabels):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueLabels`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueTextField
        if not isinstance(v, CustomFieldContextDefaultValueTextField):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueTextField`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueTextArea
        if not isinstance(v, CustomFieldContextDefaultValueTextArea):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueTextArea`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueReadOnly
        if not isinstance(v, CustomFieldContextDefaultValueReadOnly):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueReadOnly`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueSingleVersionPicker
        if not isinstance(v, CustomFieldContextDefaultValueSingleVersionPicker):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueSingleVersionPicker`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueMultipleVersionPicker
        if not isinstance(v, CustomFieldContextDefaultValueMultipleVersionPicker):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueMultipleVersionPicker`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueForgeStringField
        if not isinstance(v, CustomFieldContextDefaultValueForgeStringField):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueForgeStringField`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueForgeMultiStringField
        if not isinstance(v, CustomFieldContextDefaultValueForgeMultiStringField):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueForgeMultiStringField`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueForgeObjectField
        if not isinstance(v, CustomFieldContextDefaultValueForgeObjectField):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueForgeObjectField`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueForgeDateTimeField
        if not isinstance(v, CustomFieldContextDefaultValueForgeDateTimeField):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueForgeDateTimeField`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueForgeGroupField
        if not isinstance(v, CustomFieldContextDefaultValueForgeGroupField):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueForgeGroupField`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueForgeMultiGroupField
        if not isinstance(v, CustomFieldContextDefaultValueForgeMultiGroupField):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueForgeMultiGroupField`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueForgeNumberField
        if not isinstance(v, CustomFieldContextDefaultValueForgeNumberField):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueForgeNumberField`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueForgeUserField
        if not isinstance(v, CustomFieldContextDefaultValueForgeUserField):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueForgeUserField`")
        else:
            match += 1
        # validate data type: CustomFieldContextDefaultValueForgeMultiUserField
        if not isinstance(v, CustomFieldContextDefaultValueForgeMultiUserField):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CustomFieldContextDefaultValueForgeMultiUserField`")
        else:
            match += 1
        if match > 1:
            # more than 1 match
            raise ValueError("Multiple matches found when setting `actual_instance` in CustomFieldContextDefaultValue with oneOf schemas: CustomFieldContextDefaultValueCascadingOption, CustomFieldContextDefaultValueDate, CustomFieldContextDefaultValueDateTime, CustomFieldContextDefaultValueFloat, CustomFieldContextDefaultValueForgeDateTimeField, CustomFieldContextDefaultValueForgeGroupField, CustomFieldContextDefaultValueForgeMultiGroupField, CustomFieldContextDefaultValueForgeMultiStringField, CustomFieldContextDefaultValueForgeMultiUserField, CustomFieldContextDefaultValueForgeNumberField, CustomFieldContextDefaultValueForgeObjectField, CustomFieldContextDefaultValueForgeStringField, CustomFieldContextDefaultValueForgeUserField, CustomFieldContextDefaultValueLabels, CustomFieldContextDefaultValueMultiUserPicker, CustomFieldContextDefaultValueMultipleGroupPicker, CustomFieldContextDefaultValueMultipleOption, CustomFieldContextDefaultValueMultipleVersionPicker, CustomFieldContextDefaultValueProject, CustomFieldContextDefaultValueReadOnly, CustomFieldContextDefaultValueSingleGroupPicker, CustomFieldContextDefaultValueSingleOption, CustomFieldContextDefaultValueSingleVersionPicker, CustomFieldContextDefaultValueTextArea, CustomFieldContextDefaultValueTextField, CustomFieldContextDefaultValueURL, CustomFieldContextSingleUserPickerDefaults. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when setting `actual_instance` in CustomFieldContextDefaultValue with oneOf schemas: CustomFieldContextDefaultValueCascadingOption, CustomFieldContextDefaultValueDate, CustomFieldContextDefaultValueDateTime, CustomFieldContextDefaultValueFloat, CustomFieldContextDefaultValueForgeDateTimeField, CustomFieldContextDefaultValueForgeGroupField, CustomFieldContextDefaultValueForgeMultiGroupField, CustomFieldContextDefaultValueForgeMultiStringField, CustomFieldContextDefaultValueForgeMultiUserField, CustomFieldContextDefaultValueForgeNumberField, CustomFieldContextDefaultValueForgeObjectField, CustomFieldContextDefaultValueForgeStringField, CustomFieldContextDefaultValueForgeUserField, CustomFieldContextDefaultValueLabels, CustomFieldContextDefaultValueMultiUserPicker, CustomFieldContextDefaultValueMultipleGroupPicker, CustomFieldContextDefaultValueMultipleOption, CustomFieldContextDefaultValueMultipleVersionPicker, CustomFieldContextDefaultValueProject, CustomFieldContextDefaultValueReadOnly, CustomFieldContextDefaultValueSingleGroupPicker, CustomFieldContextDefaultValueSingleOption, CustomFieldContextDefaultValueSingleVersionPicker, CustomFieldContextDefaultValueTextArea, CustomFieldContextDefaultValueTextField, CustomFieldContextDefaultValueURL, CustomFieldContextSingleUserPickerDefaults. Details: " + ", ".join(error_messages))
        else:
            return v

    @classmethod
    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
        return cls.from_json(json.dumps(obj))

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Returns the object represented by the json string"""
        instance = cls.model_construct()
        error_messages = []
        match = 0

        # deserialize data into CustomFieldContextDefaultValueCascadingOption
        try:
            instance.actual_instance = CustomFieldContextDefaultValueCascadingOption.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueMultipleOption
        try:
            instance.actual_instance = CustomFieldContextDefaultValueMultipleOption.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueSingleOption
        try:
            instance.actual_instance = CustomFieldContextDefaultValueSingleOption.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextSingleUserPickerDefaults
        try:
            instance.actual_instance = CustomFieldContextSingleUserPickerDefaults.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueMultiUserPicker
        try:
            instance.actual_instance = CustomFieldContextDefaultValueMultiUserPicker.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueSingleGroupPicker
        try:
            instance.actual_instance = CustomFieldContextDefaultValueSingleGroupPicker.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueMultipleGroupPicker
        try:
            instance.actual_instance = CustomFieldContextDefaultValueMultipleGroupPicker.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueDate
        try:
            instance.actual_instance = CustomFieldContextDefaultValueDate.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueDateTime
        try:
            instance.actual_instance = CustomFieldContextDefaultValueDateTime.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueURL
        try:
            instance.actual_instance = CustomFieldContextDefaultValueURL.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueProject
        try:
            instance.actual_instance = CustomFieldContextDefaultValueProject.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueFloat
        try:
            instance.actual_instance = CustomFieldContextDefaultValueFloat.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueLabels
        try:
            instance.actual_instance = CustomFieldContextDefaultValueLabels.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueTextField
        try:
            instance.actual_instance = CustomFieldContextDefaultValueTextField.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueTextArea
        try:
            instance.actual_instance = CustomFieldContextDefaultValueTextArea.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueReadOnly
        try:
            instance.actual_instance = CustomFieldContextDefaultValueReadOnly.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueSingleVersionPicker
        try:
            instance.actual_instance = CustomFieldContextDefaultValueSingleVersionPicker.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueMultipleVersionPicker
        try:
            instance.actual_instance = CustomFieldContextDefaultValueMultipleVersionPicker.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueForgeStringField
        try:
            instance.actual_instance = CustomFieldContextDefaultValueForgeStringField.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueForgeMultiStringField
        try:
            instance.actual_instance = CustomFieldContextDefaultValueForgeMultiStringField.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueForgeObjectField
        try:
            instance.actual_instance = CustomFieldContextDefaultValueForgeObjectField.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueForgeDateTimeField
        try:
            instance.actual_instance = CustomFieldContextDefaultValueForgeDateTimeField.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueForgeGroupField
        try:
            instance.actual_instance = CustomFieldContextDefaultValueForgeGroupField.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueForgeMultiGroupField
        try:
            instance.actual_instance = CustomFieldContextDefaultValueForgeMultiGroupField.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueForgeNumberField
        try:
            instance.actual_instance = CustomFieldContextDefaultValueForgeNumberField.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueForgeUserField
        try:
            instance.actual_instance = CustomFieldContextDefaultValueForgeUserField.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CustomFieldContextDefaultValueForgeMultiUserField
        try:
            instance.actual_instance = CustomFieldContextDefaultValueForgeMultiUserField.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))

        if match > 1:
            # more than 1 match
            raise ValueError("Multiple matches found when deserializing the JSON string into CustomFieldContextDefaultValue with oneOf schemas: CustomFieldContextDefaultValueCascadingOption, CustomFieldContextDefaultValueDate, CustomFieldContextDefaultValueDateTime, CustomFieldContextDefaultValueFloat, CustomFieldContextDefaultValueForgeDateTimeField, CustomFieldContextDefaultValueForgeGroupField, CustomFieldContextDefaultValueForgeMultiGroupField, CustomFieldContextDefaultValueForgeMultiStringField, CustomFieldContextDefaultValueForgeMultiUserField, CustomFieldContextDefaultValueForgeNumberField, CustomFieldContextDefaultValueForgeObjectField, CustomFieldContextDefaultValueForgeStringField, CustomFieldContextDefaultValueForgeUserField, CustomFieldContextDefaultValueLabels, CustomFieldContextDefaultValueMultiUserPicker, CustomFieldContextDefaultValueMultipleGroupPicker, CustomFieldContextDefaultValueMultipleOption, CustomFieldContextDefaultValueMultipleVersionPicker, CustomFieldContextDefaultValueProject, CustomFieldContextDefaultValueReadOnly, CustomFieldContextDefaultValueSingleGroupPicker, CustomFieldContextDefaultValueSingleOption, CustomFieldContextDefaultValueSingleVersionPicker, CustomFieldContextDefaultValueTextArea, CustomFieldContextDefaultValueTextField, CustomFieldContextDefaultValueURL, CustomFieldContextSingleUserPickerDefaults. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when deserializing the JSON string into CustomFieldContextDefaultValue with oneOf schemas: CustomFieldContextDefaultValueCascadingOption, CustomFieldContextDefaultValueDate, CustomFieldContextDefaultValueDateTime, CustomFieldContextDefaultValueFloat, CustomFieldContextDefaultValueForgeDateTimeField, CustomFieldContextDefaultValueForgeGroupField, CustomFieldContextDefaultValueForgeMultiGroupField, CustomFieldContextDefaultValueForgeMultiStringField, CustomFieldContextDefaultValueForgeMultiUserField, CustomFieldContextDefaultValueForgeNumberField, CustomFieldContextDefaultValueForgeObjectField, CustomFieldContextDefaultValueForgeStringField, CustomFieldContextDefaultValueForgeUserField, CustomFieldContextDefaultValueLabels, CustomFieldContextDefaultValueMultiUserPicker, CustomFieldContextDefaultValueMultipleGroupPicker, CustomFieldContextDefaultValueMultipleOption, CustomFieldContextDefaultValueMultipleVersionPicker, CustomFieldContextDefaultValueProject, CustomFieldContextDefaultValueReadOnly, CustomFieldContextDefaultValueSingleGroupPicker, CustomFieldContextDefaultValueSingleOption, CustomFieldContextDefaultValueSingleVersionPicker, CustomFieldContextDefaultValueTextArea, CustomFieldContextDefaultValueTextField, CustomFieldContextDefaultValueURL, CustomFieldContextSingleUserPickerDefaults. Details: " + ", ".join(error_messages))
        else:
            return instance

    def to_json(self) -> str:
        """Returns the JSON representation of the actual instance"""
        if self.actual_instance is None:
            return "null"

        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
            return self.actual_instance.to_json()
        else:
            return json.dumps(self.actual_instance)

    def to_dict(self) -> Optional[Union[Dict[str, Any], CustomFieldContextDefaultValueCascadingOption, CustomFieldContextDefaultValueDate, CustomFieldContextDefaultValueDateTime, CustomFieldContextDefaultValueFloat, CustomFieldContextDefaultValueForgeDateTimeField, CustomFieldContextDefaultValueForgeGroupField, CustomFieldContextDefaultValueForgeMultiGroupField, CustomFieldContextDefaultValueForgeMultiStringField, CustomFieldContextDefaultValueForgeMultiUserField, CustomFieldContextDefaultValueForgeNumberField, CustomFieldContextDefaultValueForgeObjectField, CustomFieldContextDefaultValueForgeStringField, CustomFieldContextDefaultValueForgeUserField, CustomFieldContextDefaultValueLabels, CustomFieldContextDefaultValueMultiUserPicker, CustomFieldContextDefaultValueMultipleGroupPicker, CustomFieldContextDefaultValueMultipleOption, CustomFieldContextDefaultValueMultipleVersionPicker, CustomFieldContextDefaultValueProject, CustomFieldContextDefaultValueReadOnly, CustomFieldContextDefaultValueSingleGroupPicker, CustomFieldContextDefaultValueSingleOption, CustomFieldContextDefaultValueSingleVersionPicker, CustomFieldContextDefaultValueTextArea, CustomFieldContextDefaultValueTextField, CustomFieldContextDefaultValueURL, CustomFieldContextSingleUserPickerDefaults]]:
        """Returns the dict representation of the actual instance"""
        if self.actual_instance is None:
            return None

        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
            return self.actual_instance.to_dict()
        else:
            # primitive type
            return self.actual_instance

    def to_str(self) -> str:
        """Returns the string representation of the actual instance"""
        return pprint.pformat(self.model_dump())


