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 .revisions_get_response_results_manager_type import RevisionsGetResponse_results_managerType
    from .revisions_get_response_results_steps import RevisionsGetResponse_results_steps
    from .revisions_get_response_results_subcontractor_type import RevisionsGetResponse_results_subcontractorType

@dataclass
class RevisionsGetResponse_results(Parsable):
    # The unique identifier of the submittal item whose revision history is being retrieved. It remains the same across all revisions of the item. Use this ID to track changes and access previous versions. To get the most recent version of a submittal item, call `GET items/:itemId </en/docs/acc/v1/reference/http/submittals-items-itemId-GET/>`_.
    item_id: Optional[UUID] = None
    # The Autodesk ID of the user, company, or role assigned as the manager of the submittal item.In order to get more info about the manager, use:- `GET projects/users </en/docs/acc/v1/reference/http/admin-projectsprojectId-users-GET>`_ to verify the actual name of the user in case the typs is a ``user`` (1).- `GET companies </en/docs/acc/v1/reference/http/projects-:project_id-companies-GET/>`_ to determine the name of the company in case the typs is a ``company`` (2).Note that we do not currently support verifying names of roles.
    manager: Optional[str] = None
    # The date by which the manager is expected to prepare the submittal item for review, formatted as YYYY-MM-DD in UTC (ISO 8601). For example, ``2018-02-15``. This corresponds to the ``mgr-1`` state ``Open (Submitted)``.
    manager_due_date: Optional[str] = None
    # The type of entity assigned as the manager of the submittal item.Possible values: ``1`` (user), ``2`` (company), ``3`` (role).
    manager_type: Optional[RevisionsGetResponse_results_managerType] = None
    # The Autodesk ID of the user who published the submittal item.
    published_by: Optional[str] = None
    # The date when the manager closed and distributed the submittal item,  formatted as YYYY-MM-DDTHH:mm:ss.SSSSSSZ (ISO 8601) in UTC. For example, ``2018-02-15T12:09:24.198466Z``.
    published_date: Optional[datetime.datetime] = None
    # The date and time when the submittal item transitioned from the ``rev`` state (``Open - In Review``) to the ``mgr-2`` state ``(Close and distribute)``, formatted as YYYY-MM-DDTHH:mm:ss.SSSSSSZ (ISO 8601) in UTC. For example, ``2018-02-15T12:09:24.198466Z``.
    received_from_review: Optional[datetime.datetime] = None
    # The date when the subcontractor submitted the submittal item back to the manager, formatted as YYYY-MM-DDTHH:mm:ss.SSSSSSZ (ISO 8601) in UTC. For example, ``2018-02-15T12:09:24.198466Z``. This corresponds to transition to the ``mgr-1`` state.
    received_from_submitter: Optional[datetime.datetime] = None
    # The date and time when the response was added, formatted as YYYY-MM-DDTHH:mm:ss.SSSSSSZ (ISO 8601) in UTC. For example, ``2018-02-15T12:09:24.198466Z``.
    responded_at: Optional[datetime.datetime] = None
    # The Autodesk ID of the user that gave the response to the submittal item.
    responded_by: Optional[str] = None
    # The body of the response comment, containing feedback or instructions related to the submittal item.
    response_comment: Optional[str] = None
    # The ID of the response associated with the submittal item, linking to the specific feedback or action taken. For information about the response, call `GET responses </en/docs/acc/v1/reference/http/submittals-responses-GET/>`_.
    response_id: Optional[UUID] = None
    # Not relevant
    reviewer_due_date: Optional[datetime.datetime] = None
    # The version number of the submittal item, representing its revision history.
    revision: Optional[int] = None
    # The date and time when the submittal item was transitioned to the ``rev`` state ``(Open - In review)``, formatted as ISO 8601.
    sent_to_review: Optional[datetime.datetime] = None
    # The Autodesk ID of the user who transitioned the submittal item to the ``rev`` state (``Open - In review``).
    sent_to_review_by: Optional[str] = None
    # The date when the submittal item transitioned to the subcontractor for review, formatted as YYYY-MM-DDTHH:mm:ss.SSSSSSZ (ISO 8601) in UTC. For example, ``2018-02-15T12:09:24.198466Z``. This corresponds to transition to the ``sbc-1`` state.
    sent_to_submitter: Optional[datetime.datetime] = None
    # A list of workflow steps for the submittal item at a specific revision.
    steps: Optional[list[RevisionsGetResponse_results_steps]] = None
    # The Autodesk ID of the user, company, or role assigned as the subcontractor for the submittal item.In order to get more info about the subcontractor, use:- `GET projects/users </en/docs/acc/v1/reference/http/admin-projectsprojectId-users-GET>`_ to verify the actual name of the user in case the typs is a ``user`` (1).- `GET companies </en/docs/acc/v1/reference/http/projects-:project_id-companies-GET/>`_ to determine the name of the company in case the typs is a ``company`` (2).Note that we do not currently support verifying names of roles.
    subcontractor: Optional[str] = None
    # The type of manager.Possible values: ``1`` (user), ``2`` (company), ``3`` (role).
    subcontractor_type: Optional[RevisionsGetResponse_results_subcontractorType] = None
    # The Autodesk ID of the user who transitioned the submittal item to the manager.
    submitted_by: Optional[str] = None
    # The date when the subcontractor is expected to submit the submittal to the manager, in the following format: YYYY-MM-DD in UTC (ISO 8601). For example, ``2017-02-15``. This corresponds to the ``sbc-1`` state ``Waiting for submission``.
    submitter_due_date: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> RevisionsGetResponse_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: RevisionsGetResponse_results
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return RevisionsGetResponse_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 .revisions_get_response_results_manager_type import RevisionsGetResponse_results_managerType
        from .revisions_get_response_results_steps import RevisionsGetResponse_results_steps
        from .revisions_get_response_results_subcontractor_type import RevisionsGetResponse_results_subcontractorType

        from .revisions_get_response_results_manager_type import RevisionsGetResponse_results_managerType
        from .revisions_get_response_results_steps import RevisionsGetResponse_results_steps
        from .revisions_get_response_results_subcontractor_type import RevisionsGetResponse_results_subcontractorType

        fields: dict[str, Callable[[Any], None]] = {
            "itemId": lambda n : setattr(self, 'item_id', n.get_uuid_value()),
            "manager": lambda n : setattr(self, 'manager', n.get_str_value()),
            "managerDueDate": lambda n : setattr(self, 'manager_due_date', n.get_str_value()),
            "managerType": lambda n : setattr(self, 'manager_type', n.get_enum_value(RevisionsGetResponse_results_managerType)),
            "publishedBy": lambda n : setattr(self, 'published_by', n.get_str_value()),
            "publishedDate": lambda n : setattr(self, 'published_date', n.get_datetime_value()),
            "receivedFromReview": lambda n : setattr(self, 'received_from_review', n.get_datetime_value()),
            "receivedFromSubmitter": lambda n : setattr(self, 'received_from_submitter', n.get_datetime_value()),
            "respondedAt": lambda n : setattr(self, 'responded_at', n.get_datetime_value()),
            "respondedBy": lambda n : setattr(self, 'responded_by', n.get_str_value()),
            "responseComment": lambda n : setattr(self, 'response_comment', n.get_str_value()),
            "responseId": lambda n : setattr(self, 'response_id', n.get_uuid_value()),
            "reviewerDueDate": lambda n : setattr(self, 'reviewer_due_date', n.get_datetime_value()),
            "revision": lambda n : setattr(self, 'revision', n.get_int_value()),
            "sentToReview": lambda n : setattr(self, 'sent_to_review', n.get_datetime_value()),
            "sentToReviewBy": lambda n : setattr(self, 'sent_to_review_by', n.get_str_value()),
            "sentToSubmitter": lambda n : setattr(self, 'sent_to_submitter', n.get_datetime_value()),
            "steps": lambda n : setattr(self, 'steps', n.get_collection_of_object_values(RevisionsGetResponse_results_steps)),
            "subcontractor": lambda n : setattr(self, 'subcontractor', n.get_str_value()),
            "subcontractorType": lambda n : setattr(self, 'subcontractor_type', n.get_enum_value(RevisionsGetResponse_results_subcontractorType)),
            "submittedBy": lambda n : setattr(self, 'submitted_by', n.get_str_value()),
            "submitterDueDate": lambda n : setattr(self, 'submitter_due_date', 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_uuid_value("itemId", self.item_id)
        writer.write_str_value("manager", self.manager)
        writer.write_str_value("managerDueDate", self.manager_due_date)
        writer.write_enum_value("managerType", self.manager_type)
        writer.write_str_value("publishedBy", self.published_by)
        writer.write_datetime_value("publishedDate", self.published_date)
        writer.write_datetime_value("receivedFromReview", self.received_from_review)
        writer.write_datetime_value("receivedFromSubmitter", self.received_from_submitter)
        writer.write_datetime_value("respondedAt", self.responded_at)
        writer.write_str_value("respondedBy", self.responded_by)
        writer.write_str_value("responseComment", self.response_comment)
        writer.write_uuid_value("responseId", self.response_id)
        writer.write_datetime_value("reviewerDueDate", self.reviewer_due_date)
        writer.write_int_value("revision", self.revision)
        writer.write_datetime_value("sentToReview", self.sent_to_review)
        writer.write_str_value("sentToReviewBy", self.sent_to_review_by)
        writer.write_datetime_value("sentToSubmitter", self.sent_to_submitter)
        writer.write_collection_of_object_values("steps", self.steps)
        writer.write_str_value("subcontractor", self.subcontractor)
        writer.write_enum_value("subcontractorType", self.subcontractor_type)
        writer.write_str_value("submittedBy", self.submitted_by)
        writer.write_str_value("submitterDueDate", self.submitter_due_date)
    

