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 PhotosFilterPostRequestBody_filter(Parsable):
    # The createdAt property
    created_at: Optional[str] = None
    # The createdBy property
    created_by: Optional[list[str]] = None
    # The id property
    id: Optional[list[str]] = None
    # The mediaType property
    media_type: Optional[list[str]] = None
    # The takenAt property
    taken_at: Optional[str] = None
    # The title property
    title: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> PhotosFilterPostRequestBody_filter:
        """
        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: PhotosFilterPostRequestBody_filter
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return PhotosFilterPostRequestBody_filter()
    
    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]] = {
            "createdAt": lambda n : setattr(self, 'created_at', n.get_str_value()),
            "createdBy": lambda n : setattr(self, 'created_by', n.get_collection_of_primitive_values(str)),
            "id": lambda n : setattr(self, 'id', n.get_collection_of_primitive_values(str)),
            "mediaType": lambda n : setattr(self, 'media_type', n.get_collection_of_primitive_values(str)),
            "takenAt": lambda n : setattr(self, 'taken_at', n.get_str_value()),
            "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_str_value("createdAt", self.created_at)
        writer.write_collection_of_primitive_values("createdBy", self.created_by)
        writer.write_collection_of_primitive_values("id", self.id)
        writer.write_collection_of_primitive_values("mediaType", self.media_type)
        writer.write_str_value("takenAt", self.taken_at)
        writer.write_str_value("title", self.title)
    

