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

@dataclass
class FoldersGetResponse_results(Parsable):
    # The description of the folder.
    description: Optional[str] = None
    # Indicates whether the folder is deleted.``true`` – The folder is deleted, either directly or because its parent folder was deleted.``false`` – The folder is not deleted.
    is_deleted: Optional[bool] = None
    # The date and time when the folder was last modified, in ISO 8601 format.
    last_updated_at: Optional[datetime.datetime] = None
    # The name of the folder.
    name: Optional[str] = None
    # The Autodesk ID of the user who last modified the folder. For details about the user, call `GET user </en/docs/acc/v1/reference/http/admin-projectsprojectId-users-userId-GET/>`_.
    updated_by: Optional[str] = None
    # The Autodesk ID of the user who last modified the folder.
    updated_by_name: Optional[str] = None
    # The URN of the folder.
    urn: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> FoldersGetResponse_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: FoldersGetResponse_results
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return FoldersGetResponse_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]] = {
            "description": lambda n : setattr(self, 'description', n.get_str_value()),
            "isDeleted": lambda n : setattr(self, 'is_deleted', n.get_bool_value()),
            "lastUpdatedAt": lambda n : setattr(self, 'last_updated_at', n.get_datetime_value()),
            "name": lambda n : setattr(self, 'name', n.get_str_value()),
            "updatedBy": lambda n : setattr(self, 'updated_by', n.get_str_value()),
            "updatedByName": lambda n : setattr(self, 'updated_by_name', n.get_str_value()),
            "urn": lambda n : setattr(self, 'urn', 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("description", self.description)
        writer.write_bool_value("isDeleted", self.is_deleted)
        writer.write_datetime_value("lastUpdatedAt", self.last_updated_at)
        writer.write_str_value("name", self.name)
        writer.write_str_value("updatedBy", self.updated_by)
        writer.write_str_value("updatedByName", self.updated_by_name)
        writer.write_str_value("urn", self.urn)
    

