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 ThumbnailsBatchGetPostResponse_results(Parsable):
    # The ID of the review sheet the thumbnail belongs to.
    review_sheet_id: Optional[str] = None
    # The URL of the thumbnail. It is an AWS S3 signed URL and will expire in 1 hour.
    signed_url: Optional[str] = None
    # The width and height of the thumbnail.
    size: Optional[list[int]] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ThumbnailsBatchGetPostResponse_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: ThumbnailsBatchGetPostResponse_results
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ThumbnailsBatchGetPostResponse_results()
    
    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]] = {
            "reviewSheetId": lambda n : setattr(self, 'review_sheet_id', n.get_str_value()),
            "signedUrl": lambda n : setattr(self, 'signed_url', n.get_str_value()),
            "size": lambda n : setattr(self, 'size', n.get_collection_of_primitive_values(int)),
        }
        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_str_value("reviewSheetId", self.review_sheet_id)
        writer.write_str_value("signedUrl", self.signed_url)
        writer.write_collection_of_primitive_values("size", self.size)
    

