from __future__ import annotations
import datetime
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 .photos_filter_post_response_results_signed_urls import PhotosFilterPostResponse_results_signedUrls
    from .photos_filter_post_response_results_urls import PhotosFilterPostResponse_results_urls

@dataclass
class PhotosFilterPostResponse_results(Parsable):
    # The createdAt property
    created_at: Optional[datetime.datetime] = None
    # The createdBy property
    created_by: Optional[str] = None
    # The deletedAt property
    deleted_at: Optional[datetime.datetime] = None
    # The deletedBy property
    deleted_by: Optional[str] = None
    # The description property
    description: Optional[str] = None
    # The id property
    id: Optional[UUID] = None
    # The isPublic property
    is_public: Optional[bool] = None
    # The latitude property
    latitude: Optional[float] = None
    # The locked property
    locked: Optional[bool] = None
    # The longitude property
    longitude: Optional[float] = None
    # The mediaType property
    media_type: Optional[str] = None
    # The projectId property
    project_id: Optional[UUID] = None
    # The signedUrls property
    signed_urls: Optional[PhotosFilterPostResponse_results_signedUrls] = None
    # The size property
    size: Optional[float] = None
    # The takenAt property
    taken_at: Optional[datetime.datetime] = None
    # The title property
    title: Optional[str] = None
    # The type property
    type: Optional[str] = None
    # The updatedAt property
    updated_at: Optional[datetime.datetime] = None
    # The updatedBy property
    updated_by: Optional[str] = None
    # The urls property
    urls: Optional[PhotosFilterPostResponse_results_urls] = None
    # The userCreatedAt property
    user_created_at: Optional[datetime.datetime] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> PhotosFilterPostResponse_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: PhotosFilterPostResponse_results
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return PhotosFilterPostResponse_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 .photos_filter_post_response_results_signed_urls import PhotosFilterPostResponse_results_signedUrls
        from .photos_filter_post_response_results_urls import PhotosFilterPostResponse_results_urls

        from .photos_filter_post_response_results_signed_urls import PhotosFilterPostResponse_results_signedUrls
        from .photos_filter_post_response_results_urls import PhotosFilterPostResponse_results_urls

        fields: dict[str, Callable[[Any], None]] = {
            "createdAt": lambda n : setattr(self, 'created_at', n.get_datetime_value()),
            "createdBy": lambda n : setattr(self, 'created_by', n.get_str_value()),
            "deletedAt": lambda n : setattr(self, 'deleted_at', n.get_datetime_value()),
            "deletedBy": lambda n : setattr(self, 'deleted_by', n.get_str_value()),
            "description": lambda n : setattr(self, 'description', n.get_str_value()),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "isPublic": lambda n : setattr(self, 'is_public', n.get_bool_value()),
            "latitude": lambda n : setattr(self, 'latitude', n.get_float_value()),
            "locked": lambda n : setattr(self, 'locked', n.get_bool_value()),
            "longitude": lambda n : setattr(self, 'longitude', n.get_float_value()),
            "mediaType": lambda n : setattr(self, 'media_type', n.get_str_value()),
            "projectId": lambda n : setattr(self, 'project_id', n.get_uuid_value()),
            "signedUrls": lambda n : setattr(self, 'signed_urls', n.get_object_value(PhotosFilterPostResponse_results_signedUrls)),
            "size": lambda n : setattr(self, 'size', n.get_float_value()),
            "takenAt": lambda n : setattr(self, 'taken_at', n.get_datetime_value()),
            "title": lambda n : setattr(self, 'title', n.get_str_value()),
            "type": lambda n : setattr(self, 'type', n.get_str_value()),
            "updatedAt": lambda n : setattr(self, 'updated_at', n.get_datetime_value()),
            "updatedBy": lambda n : setattr(self, 'updated_by', n.get_str_value()),
            "urls": lambda n : setattr(self, 'urls', n.get_object_value(PhotosFilterPostResponse_results_urls)),
            "userCreatedAt": lambda n : setattr(self, 'user_created_at', n.get_datetime_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_datetime_value("createdAt", self.created_at)
        writer.write_str_value("createdBy", self.created_by)
        writer.write_datetime_value("deletedAt", self.deleted_at)
        writer.write_str_value("deletedBy", self.deleted_by)
        writer.write_str_value("description", self.description)
        writer.write_uuid_value("id", self.id)
        writer.write_bool_value("isPublic", self.is_public)
        writer.write_float_value("latitude", self.latitude)
        writer.write_bool_value("locked", self.locked)
        writer.write_float_value("longitude", self.longitude)
        writer.write_str_value("mediaType", self.media_type)
        writer.write_uuid_value("projectId", self.project_id)
        writer.write_object_value("signedUrls", self.signed_urls)
        writer.write_float_value("size", self.size)
        writer.write_datetime_value("takenAt", self.taken_at)
        writer.write_str_value("title", self.title)
        writer.write_str_value("type", self.type)
        writer.write_datetime_value("updatedAt", self.updated_at)
        writer.write_str_value("updatedBy", self.updated_by)
        writer.write_object_value("urls", self.urls)
        writer.write_datetime_value("userCreatedAt", self.user_created_at)
    

