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_task_get_response_assigned_to_type import WithTaskGetResponse_assignedToType
    from .with_task_get_response_permitted_actions import WithTaskGetResponse_permittedActions
    from .with_task_get_response_status import WithTaskGetResponse_status

@dataclass
class WithTaskGetResponse(Parsable):
    # The Autodesk ID or member group ID of the ``user``, ``company``, or ``role`` assigned to the task.
    assigned_to: Optional[str] = None
    # Specifies whether the task is assigned to a user, company, or role.Possible values: ``1`` (user), ``2`` (company), ``3`` (role).
    assigned_to_type: Optional[WithTaskGetResponse_assignedToType] = None
    # The date and time when the task was completed, formatted as YYYY-MM-DDTHH:mm:ss.SSSSSSZ (ISO 8601) in UTC. For example, ``2025-01-20T12:00:00.198466Z``.
    completed_at: Optional[datetime.datetime] = None
    # The Autodesk ID of the user who completed the task.
    completed_by: Optional[str] = None
    # The date and time when the task was originally created, formatted as YYYY-MM-DDTHH:mm:ss.SSSSSSZ (ISO 8601) in UTC. For example, ``2025-01-20T12:00:00.198466Z``.
    created_at: Optional[datetime.datetime] = None
    # The Autodesk ID of the user who created the task.
    created_by: Optional[str] = None
    # The internal, globally unique identifier (UUID) for the task.
    id: Optional[UUID] = None
    # ``true``: the task is required to complete the step.``false``: (default) the task is not required to complete the step.
    is_required: Optional[bool] = None
    # A list of actions that the user is allowed to perform on the task within the submittal workflow.
    permitted_actions: Optional[list[WithTaskGetResponse_permittedActions]] = None
    # The date and time when the response was added, formatted as YYYY-MM-DDTHH:mm:ss.SSSSSSZ (ISO 8601) in UTC. For example, ``2025-01-20T12:00:00.198466Z``.
    responded_at: Optional[datetime.datetime] = None
    # The Autodesk ID of the user who provided the response to the task.
    responded_by: Optional[str] = None
    # The content of the response comment, providing feedback or instructions related to the task.
    response_comment: Optional[str] = None
    # The ID of the response associated with the task, linking to the specific feedback or action taken.
    response_id: Optional[UUID] = None
    # The date and time when the related step was marked as started (``In Progress``), formatted as YYYY-MM-DDTHH:mm:ss.SSSSSSZ (ISO 8601) in UTC. For example, ``2025-01-20T12:00:00.198466Z``.
    started_at: Optional[datetime.datetime] = None
    # The current status of the task. Possible values: ``not-started``, ``in-progress``, ``completed``.
    status: Optional[WithTaskGetResponse_status] = None
    # The due date of the related step, formatted as YYYY-MM-DD (ISO 8601) in UTC. For example, ``2025-01-20``.
    step_due_date: Optional[str] = None
    # The ID of the review step associated with the task.
    step_id: Optional[UUID] = None
    # The date and time when the task was last updated, formatted as YYYY-MM-DDTHH:mm:ss.SSSSSSZ (ISO 8601) in UTC. For example, ``2025-01-20T12:00:00.198466Z``.
    updated_at: Optional[datetime.datetime] = None
    # The Autodesk ID of the user who last updated the task.
    updated_by: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> WithTaskGetResponse:
        """
        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: WithTaskGetResponse
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return WithTaskGetResponse()
    
    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_task_get_response_assigned_to_type import WithTaskGetResponse_assignedToType
        from .with_task_get_response_permitted_actions import WithTaskGetResponse_permittedActions
        from .with_task_get_response_status import WithTaskGetResponse_status

        from .with_task_get_response_assigned_to_type import WithTaskGetResponse_assignedToType
        from .with_task_get_response_permitted_actions import WithTaskGetResponse_permittedActions
        from .with_task_get_response_status import WithTaskGetResponse_status

        fields: dict[str, Callable[[Any], None]] = {
            "assignedTo": lambda n : setattr(self, 'assigned_to', n.get_str_value()),
            "assignedToType": lambda n : setattr(self, 'assigned_to_type', n.get_enum_value(WithTaskGetResponse_assignedToType)),
            "completedAt": lambda n : setattr(self, 'completed_at', n.get_datetime_value()),
            "completedBy": lambda n : setattr(self, 'completed_by', n.get_str_value()),
            "createdAt": lambda n : setattr(self, 'created_at', n.get_datetime_value()),
            "createdBy": lambda n : setattr(self, 'created_by', n.get_str_value()),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "isRequired": lambda n : setattr(self, 'is_required', n.get_bool_value()),
            "permittedActions": lambda n : setattr(self, 'permitted_actions', n.get_collection_of_object_values(WithTaskGetResponse_permittedActions)),
            "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()),
            "startedAt": lambda n : setattr(self, 'started_at', n.get_datetime_value()),
            "status": lambda n : setattr(self, 'status', n.get_enum_value(WithTaskGetResponse_status)),
            "stepDueDate": lambda n : setattr(self, 'step_due_date', n.get_str_value()),
            "stepId": lambda n : setattr(self, 'step_id', n.get_uuid_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_str_value("assignedTo", self.assigned_to)
        writer.write_enum_value("assignedToType", self.assigned_to_type)
        writer.write_datetime_value("completedAt", self.completed_at)
        writer.write_str_value("completedBy", self.completed_by)
        writer.write_datetime_value("createdAt", self.created_at)
        writer.write_str_value("createdBy", self.created_by)
        writer.write_uuid_value("id", self.id)
        writer.write_bool_value("isRequired", self.is_required)
        writer.write_collection_of_object_values("permittedActions", self.permitted_actions)
        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("startedAt", self.started_at)
        writer.write_enum_value("status", self.status)
        writer.write_str_value("stepDueDate", self.step_due_date)
        writer.write_uuid_value("stepId", self.step_id)
        writer.write_datetime_value("updatedAt", self.updated_at)
        writer.write_str_value("updatedBy", self.updated_by)
    

