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 .with_response_patch_response_rfi_draft_responses_state import WithResponsePatchResponse_rfi_draftResponses_state
    from .with_response_patch_response_rfi_draft_responses_status import WithResponsePatchResponse_rfi_draftResponses_status

@dataclass
class WithResponsePatchResponse_rfi_draftResponses(Parsable):
    # The date and time the response was created, in the following format: ``YYYY-MM-DDThh:mm:ss.sz``.
    created_at: Optional[datetime.datetime] = None
    # The Autodesk ID of the assigned user.To find details about the user, call `GET users </en/docs/acc/v1/reference/http/admin-projectsprojectId-users-GET>`_.To retrieve the list of available assignees, call `GET rfi-types </en/docs/acc/v1/reference/http/rfis-rfi-types-GET>`_ and check the ``manager`` and ``projectReviewer`` fields.
    created_by: Optional[str] = None
    # The date and time the response was deleted, in the following format: ``YYYY-MM-DDThh:mm:ss.sz``.
    deleted_at: Optional[datetime.datetime] = None
    # The unique identifier of the response.
    id: Optional[UUID] = None
    # Indicates whether the response can be edited.``true``: The response is editable.``false`` (default): The response cannot be edited.
    is_editable: Optional[bool] = None
    # The Autodesk ID of the assigned user.To find details about the user, call `GET users </en/docs/acc/v1/reference/http/admin-projectsprojectId-users-GET>`_.To retrieve the list of available assignees, call `GET rfi-types </en/docs/acc/v1/reference/http/rfis-rfi-types-GET>`_ and check the ``manager`` and ``projectReviewer`` fields.
    on_behalf: Optional[str] = None
    # The ID of the RFI associated with this response.
    rfi_id: Optional[str] = None
    # The state of the response. Possible values:- ``draft``: The response was returned to the reviewer for changes.- ``submitted``: The reviewer submitted a finalized response.
    state: Optional[WithResponsePatchResponse_rfi_draftResponses_state] = None
    # Indicates whether the response was accepted (``answered``) or declined (``rejected``).Possible values: ``answered``, ``rejected``
    status: Optional[WithResponsePatchResponse_rfi_draftResponses_status] = None
    # The body of the response.
    text: Optional[str] = None
    # The date and time the response was updated, in the following format: ``YYYY-MM-DDThh:mm:ss.sz``.
    updated_at: Optional[datetime.datetime] = None
    # The Autodesk ID of the user who updated the response. To find the name of the user, call `GET users </en/docs/acc/v1/reference/http/admin-projectsprojectId-users-GET>`_.
    updated_by: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> WithResponsePatchResponse_rfi_draftResponses:
        """
        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: WithResponsePatchResponse_rfi_draftResponses
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return WithResponsePatchResponse_rfi_draftResponses()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .with_response_patch_response_rfi_draft_responses_state import WithResponsePatchResponse_rfi_draftResponses_state
        from .with_response_patch_response_rfi_draft_responses_status import WithResponsePatchResponse_rfi_draftResponses_status

        from .with_response_patch_response_rfi_draft_responses_state import WithResponsePatchResponse_rfi_draftResponses_state
        from .with_response_patch_response_rfi_draft_responses_status import WithResponsePatchResponse_rfi_draftResponses_status

        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()),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "isEditable": lambda n : setattr(self, 'is_editable', n.get_bool_value()),
            "onBehalf": lambda n : setattr(self, 'on_behalf', n.get_str_value()),
            "rfiId": lambda n : setattr(self, 'rfi_id', n.get_str_value()),
            "state": lambda n : setattr(self, 'state', n.get_enum_value(WithResponsePatchResponse_rfi_draftResponses_state)),
            "status": lambda n : setattr(self, 'status', n.get_enum_value(WithResponsePatchResponse_rfi_draftResponses_status)),
            "text": lambda n : setattr(self, 'text', 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()),
        }
        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_uuid_value("id", self.id)
        writer.write_bool_value("isEditable", self.is_editable)
        writer.write_str_value("onBehalf", self.on_behalf)
        writer.write_str_value("rfiId", self.rfi_id)
        writer.write_enum_value("state", self.state)
        writer.write_enum_value("status", self.status)
        writer.write_str_value("text", self.text)
        writer.write_datetime_value("updatedAt", self.updated_at)
        writer.write_str_value("updatedBy", self.updated_by)
    

