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

if TYPE_CHECKING:
    from .review_sheets_get_response_results_processing_state import ReviewSheetsGetResponse_results_processingState

@dataclass
class ReviewSheetsGetResponse_results(Parsable):
    # - ``true`` if the review sheet has been deleted.- ``false`` if the review sheet has not been deleted.Note that if the review sheet has been deleted, it will not be published.
    deleted: Optional[bool] = None
    # The source file name of the review sheet.
    file_name: Optional[str] = None
    # The ID of the review sheet.
    id: Optional[str] = None
    # The number of the review sheet.
    number: Optional[str] = None
    # The page number of the source file from which the review sheet was generated.
    page: Optional[float] = None
    # The processing state of the review sheet. Possible values:- ``PROCESSING``: the review sheet is being processed.- ``AUDITING``: the review sheet is being audited.- ``ROTATING``: the review sheet is being rotated.- ``READY``: the review sheet is ready for updating or publishing.- ``FAILED``: the processing of the review sheet failed.- ``PUBLISHING`` the review sheet is publishing.
    processing_state: Optional[ReviewSheetsGetResponse_results_processingState] = None
    # The rotation of the review sheet. Possible values: ``0``, ``90``, ``180``, ``270``.
    rotation: Optional[float] = None
    # The tags of the review sheet.
    tags: Optional[list[str]] = None
    # The title of the review sheet.
    title: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ReviewSheetsGetResponse_results:
        """
        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: ReviewSheetsGetResponse_results
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ReviewSheetsGetResponse_results()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .review_sheets_get_response_results_processing_state import ReviewSheetsGetResponse_results_processingState

        from .review_sheets_get_response_results_processing_state import ReviewSheetsGetResponse_results_processingState

        fields: dict[str, Callable[[Any], None]] = {
            "deleted": lambda n : setattr(self, 'deleted', n.get_bool_value()),
            "fileName": lambda n : setattr(self, 'file_name', n.get_str_value()),
            "id": lambda n : setattr(self, 'id', n.get_str_value()),
            "number": lambda n : setattr(self, 'number', n.get_str_value()),
            "page": lambda n : setattr(self, 'page', n.get_float_value()),
            "processingState": lambda n : setattr(self, 'processing_state', n.get_enum_value(ReviewSheetsGetResponse_results_processingState)),
            "rotation": lambda n : setattr(self, 'rotation', n.get_float_value()),
            "tags": lambda n : setattr(self, 'tags', n.get_collection_of_primitive_values(str)),
            "title": lambda n : setattr(self, 'title', 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_bool_value("deleted", self.deleted)
        writer.write_str_value("fileName", self.file_name)
        writer.write_str_value("id", self.id)
        writer.write_str_value("number", self.number)
        writer.write_float_value("page", self.page)
        writer.write_enum_value("processingState", self.processing_state)
        writer.write_float_value("rotation", self.rotation)
        writer.write_collection_of_primitive_values("tags", self.tags)
        writer.write_str_value("title", self.title)
    

