from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass, field
from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
from typing import Any, Optional, TYPE_CHECKING, Union

@dataclass
class WithCustomAttributePatchRequestBody_defaultValue(Parsable):
    """
    The default value for this custom attribute if no value is specified on asset creation. If this field is notspecified, the custom attribute does not have a default value. The default value it takes can be any one ofthree possible value types, defined below.
    """
    # An array of string values that are set for a ``multi_select`` custom attribute.
    one: Optional[list[str]] = None
    # A Boolean value
    two: Optional[bool] = None
    # A String value, maximum length: 250Max length: 250
    zero: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> WithCustomAttributePatchRequestBody_defaultValue:
        """
        Creates a new instance of the appropriate class based on discriminator value
        param parse_node: The parse node to use to read the discriminator value and create the object
        Returns: WithCustomAttributePatchRequestBody_defaultValue
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return WithCustomAttributePatchRequestBody_defaultValue()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        fields: dict[str, Callable[[Any], None]] = {
            "1": lambda n : setattr(self, 'one', n.get_collection_of_primitive_values(str)),
            "2": lambda n : setattr(self, 'two', n.get_bool_value()),
            "0": lambda n : setattr(self, 'zero', n.get_str_value()),
        }
        return fields
    
    def serialize(self,writer: SerializationWriter) -> None:
        """
        Serializes information the current object
        param writer: Serialization writer to use to serialize this model
        Returns: None
        """
        if writer is None:
            raise TypeError("writer cannot be null.")
        writer.write_collection_of_primitive_values("1", self.one)
        writer.write_bool_value("2", self.two)
        writer.write_str_value("0", self.zero)
    

