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
from uuid import UUID

if TYPE_CHECKING:
    from .workflows_get_response_results_approval_status_options_value import WorkflowsGetResponse_results_approvalStatusOptions_value

@dataclass
class WorkflowsGetResponse_results_approvalStatusOptions(Parsable):
    # Indicates whether the approval status is a built-in option.``true``: the status is built in (e.g., ``APPROVED``, ``REJECTED``).``false``: the status is a custom option created by a user.
    built_in: Optional[bool] = None
    # The unique identifier of this approval status entry in the workflow.
    id: Optional[UUID] = None
    # The display name shown in the UI. It m ust be unique across all status options (built-in and custom).Maximum length: 255 characters.Max length: 255
    label: Optional[str] = None
    # The value representing the approval outcome. Possible values: ``APPROVED``, ``REJECTED``.
    value: Optional[WorkflowsGetResponse_results_approvalStatusOptions_value] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> WorkflowsGetResponse_results_approvalStatusOptions:
        """
        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: WorkflowsGetResponse_results_approvalStatusOptions
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return WorkflowsGetResponse_results_approvalStatusOptions()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .workflows_get_response_results_approval_status_options_value import WorkflowsGetResponse_results_approvalStatusOptions_value

        from .workflows_get_response_results_approval_status_options_value import WorkflowsGetResponse_results_approvalStatusOptions_value

        fields: dict[str, Callable[[Any], None]] = {
            "builtIn": lambda n : setattr(self, 'built_in', n.get_bool_value()),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "label": lambda n : setattr(self, 'label', n.get_str_value()),
            "value": lambda n : setattr(self, 'value', n.get_enum_value(WorkflowsGetResponse_results_approvalStatusOptions_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_bool_value("builtIn", self.built_in)
        writer.write_uuid_value("id", self.id)
        writer.write_str_value("label", self.label)
        writer.write_enum_value("value", self.value)
    

