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 .approval_statuses_get_response_results_review_status import ApprovalStatusesGetResponse_results_review_status

@dataclass
class ApprovalStatusesGetResponse_results_review(Parsable):
    """
    Metadata about the review in which this file version was included.
    """
    # The ID of the review.
    id: Optional[UUID] = None
    # A unique, auto-incrementing number assigned to the review when it is first submitted.This ID does not change, even if the review is sent back to the initiator and goes through multiple rounds.It identifies the review within the project and reflects the order in which reviews were created.
    sequence_id: Optional[int] = None
    # The current status of the review.Possible values: ``OPEN``, ``CLOSED``, ``VOID``, ``FAILED``.
    status: Optional[ApprovalStatusesGetResponse_results_review_status] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ApprovalStatusesGetResponse_results_review:
        """
        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: ApprovalStatusesGetResponse_results_review
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ApprovalStatusesGetResponse_results_review()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .approval_statuses_get_response_results_review_status import ApprovalStatusesGetResponse_results_review_status

        from .approval_statuses_get_response_results_review_status import ApprovalStatusesGetResponse_results_review_status

        fields: dict[str, Callable[[Any], None]] = {
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "sequenceId": lambda n : setattr(self, 'sequence_id', n.get_int_value()),
            "status": lambda n : setattr(self, 'status', n.get_enum_value(ApprovalStatusesGetResponse_results_review_status)),
        }
        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_uuid_value("id", self.id)
        writer.write_int_value("sequenceId", self.sequence_id)
        writer.write_enum_value("status", self.status)
    

