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

if TYPE_CHECKING:
    from .metadata_get_response_default_values_watchers import MetadataGetResponse_defaultValues_watchers

@dataclass
class MetadataGetResponse_defaultValues(Parsable):
    # The Autodesk ID of the user who is assigned as the manager.
    manager: Optional[str] = None
    # The number of days remaining until the review due date.
    review_time: Optional[int] = None
    # The date and time when the response was last updated, in ISO 8601 format.
    updated_at: Optional[datetime.datetime] = None
    # The Autodesk ID of the user that last updated the response.
    updated_by: Optional[str] = None
    # A list of project watchers, who can be individual users, roles, or companies.
    watchers: Optional[list[MetadataGetResponse_defaultValues_watchers]] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> MetadataGetResponse_defaultValues:
        """
        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: MetadataGetResponse_defaultValues
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return MetadataGetResponse_defaultValues()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .metadata_get_response_default_values_watchers import MetadataGetResponse_defaultValues_watchers

        from .metadata_get_response_default_values_watchers import MetadataGetResponse_defaultValues_watchers

        fields: dict[str, Callable[[Any], None]] = {
            "manager": lambda n : setattr(self, 'manager', n.get_str_value()),
            "reviewTime": lambda n : setattr(self, 'review_time', n.get_int_value()),
            "updatedAt": lambda n : setattr(self, 'updated_at', n.get_datetime_value()),
            "updatedBy": lambda n : setattr(self, 'updated_by', n.get_str_value()),
            "watchers": lambda n : setattr(self, 'watchers', n.get_collection_of_object_values(MetadataGetResponse_defaultValues_watchers)),
        }
        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("manager", self.manager)
        writer.write_int_value("reviewTime", self.review_time)
        writer.write_datetime_value("updatedAt", self.updated_at)
        writer.write_str_value("updatedBy", self.updated_by)
        writer.write_collection_of_object_values("watchers", self.watchers)
    

