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

@dataclass
class ResponsesGetResponse(Parsable):
    # The type of response. Possible values: ``1`` (Approved), ``2`` (Revise and submit), ``3`` (Rejected).
    category_id: Optional[str] = None
    # The time and date when the response was created.
    created_at: Optional[datetime.datetime] = None
    # The Autodesk ID of the user who created the response.
    created_by: Optional[str] = None
    # The internal, globally unique identifier (UUID) for the response.
    id: Optional[UUID] = None
    # ``true``: if the response was not deleted.``false``: if the response was deleted.
    is_active: Optional[bool] = None
    # ``true``: settings this response for a submittal item means an approval.``false``: settings this response for a submittal item means dis-approval.This attribute is taken from the related categoryId
    is_approval: Optional[bool] = None
    # ``true``: if the response is currently associated with a submittal item.``false``: if the response is not currently associated with a submittal item.
    is_in_use: Optional[bool] = None
    # Not relevant
    key: Optional[str] = None
    # Not relevant
    platform_id: Optional[str] = None
    # The time and date when the response was last updated.
    updated_at: Optional[datetime.datetime] = None
    # The Autodesk ID of the user who last updated the response.
    updated_by: Optional[str] = None
    # The content of the response.
    value: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ResponsesGetResponse:
        """
        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: ResponsesGetResponse
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ResponsesGetResponse()
    
    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]] = {
            "categoryId": lambda n : setattr(self, 'category_id', 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()),
            "isActive": lambda n : setattr(self, 'is_active', n.get_bool_value()),
            "isApproval": lambda n : setattr(self, 'is_approval', n.get_bool_value()),
            "isInUse": lambda n : setattr(self, 'is_in_use', n.get_bool_value()),
            "key": lambda n : setattr(self, 'key', n.get_str_value()),
            "platformId": lambda n : setattr(self, 'platform_id', 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()),
            "value": lambda n : setattr(self, 'value', 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("categoryId", self.category_id)
        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("isActive", self.is_active)
        writer.write_bool_value("isApproval", self.is_approval)
        writer.write_bool_value("isInUse", self.is_in_use)
        writer.write_str_value("key", self.key)
        writer.write_str_value("platformId", self.platform_id)
        writer.write_datetime_value("updatedAt", self.updated_at)
        writer.write_str_value("updatedBy", self.updated_by)
        writer.write_str_value("value", self.value)
    

