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 .responses_post_response_response_attachments_attachments_attachment_type import ResponsesPostResponse_responseAttachments_attachments_attachmentType

@dataclass
class ResponsesPostResponse_responseAttachments_attachments(Parsable):
    # The unique ID of the attachment.
    attachment_id: Optional[UUID] = None
    # The type of the attachment.Possible values: ``rfiResponse``, ``rfiOfficialResponse``, ``bridgeFiles``, ``rfiWebHiddenFiles``.
    attachment_type: Optional[ResponsesPostResponse_responseAttachments_attachments_attachmentType] = None
    # Not relevant
    bubble_urn: Optional[str] = None
    # The ID of the container associated with the attachment.
    container_id: Optional[str] = None
    # The Autodesk ID of the user who added the attachment.
    created_by: Optional[str] = None
    # The name of the user who added the attachment.
    created_by_name: Optional[str] = None
    # The timestamp of the date and time the attachment was created, in the following format: ``YYYY-MM-DDThh:mm:ss.sz``.
    created_on: Optional[datetime.datetime] = None
    # The Autodesk ID of the user who deleted the attachment.
    deleted_by: Optional[str] = None
    # The timestamp of the date and time the attachment was deleted, in the following format: ``YYYY-MM-DDThh:mm:ss.sz``.
    deleted_on: Optional[datetime.datetime] = None
    # The name of the attachment file as it appears in the UI.
    display_name: Optional[str] = None
    # Not relevant
    docs_id: Optional[UUID] = None
    # The ID of the related entity.
    domain_entity_id: Optional[UUID] = None
    # The original name of the uploaded file, including its extension.
    file_name: Optional[str] = None
    # The size of the attachment file in bytes.
    file_size: Optional[int] = None
    # The file extension type for the attachment.
    file_type: Optional[str] = None
    # Not relevant
    is_deleted: Optional[bool] = None
    # Not relevant
    lineage_urn: Optional[str] = None
    # The Autodesk ID of the user who has modified the attachment.
    modified_by: Optional[str] = None
    # The timestamp of the date and time the attachment was modified, in the following format: ``YYYY-MM-DDThh:mm:ss.sz``.
    modified_on: Optional[datetime.datetime] = None
    # The ID of the RFI associated with the attachment.
    rfi_id: Optional[str] = None
    # The storage URN of the attachment file.Use this value to generate a signed URL and download the file via the Data Management API.For more details, see the `Submit RFI Response </en/docs/acc/v1/tutorials/create-rfi-response/>`_ tutorial.
    storage_urn: Optional[str] = None
    # Not relevant
    tip_version_urn: Optional[str] = None
    # The version number of the uploaded file.
    version: Optional[int] = None
    # Not relevant
    version_urn: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ResponsesPostResponse_responseAttachments_attachments:
        """
        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: ResponsesPostResponse_responseAttachments_attachments
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ResponsesPostResponse_responseAttachments_attachments()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .responses_post_response_response_attachments_attachments_attachment_type import ResponsesPostResponse_responseAttachments_attachments_attachmentType

        from .responses_post_response_response_attachments_attachments_attachment_type import ResponsesPostResponse_responseAttachments_attachments_attachmentType

        fields: dict[str, Callable[[Any], None]] = {
            "attachmentId": lambda n : setattr(self, 'attachment_id', n.get_uuid_value()),
            "attachmentType": lambda n : setattr(self, 'attachment_type', n.get_enum_value(ResponsesPostResponse_responseAttachments_attachments_attachmentType)),
            "bubbleUrn": lambda n : setattr(self, 'bubble_urn', n.get_str_value()),
            "containerId": lambda n : setattr(self, 'container_id', n.get_str_value()),
            "createdBy": lambda n : setattr(self, 'created_by', n.get_str_value()),
            "createdByName": lambda n : setattr(self, 'created_by_name', n.get_str_value()),
            "createdOn": lambda n : setattr(self, 'created_on', n.get_datetime_value()),
            "deletedBy": lambda n : setattr(self, 'deleted_by', n.get_str_value()),
            "deletedOn": lambda n : setattr(self, 'deleted_on', n.get_datetime_value()),
            "displayName": lambda n : setattr(self, 'display_name', n.get_str_value()),
            "docsId": lambda n : setattr(self, 'docs_id', n.get_uuid_value()),
            "domainEntityId": lambda n : setattr(self, 'domain_entity_id', n.get_uuid_value()),
            "fileName": lambda n : setattr(self, 'file_name', n.get_str_value()),
            "fileSize": lambda n : setattr(self, 'file_size', n.get_int_value()),
            "fileType": lambda n : setattr(self, 'file_type', n.get_str_value()),
            "isDeleted": lambda n : setattr(self, 'is_deleted', n.get_bool_value()),
            "lineageUrn": lambda n : setattr(self, 'lineage_urn', n.get_str_value()),
            "modifiedBy": lambda n : setattr(self, 'modified_by', n.get_str_value()),
            "modifiedOn": lambda n : setattr(self, 'modified_on', n.get_datetime_value()),
            "rfiId": lambda n : setattr(self, 'rfi_id', n.get_str_value()),
            "storageUrn": lambda n : setattr(self, 'storage_urn', n.get_str_value()),
            "tipVersionUrn": lambda n : setattr(self, 'tip_version_urn', n.get_str_value()),
            "version": lambda n : setattr(self, 'version', n.get_int_value()),
            "versionUrn": lambda n : setattr(self, 'version_urn', 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("attachmentId", self.attachment_id)
        writer.write_enum_value("attachmentType", self.attachment_type)
        writer.write_str_value("bubbleUrn", self.bubble_urn)
        writer.write_str_value("containerId", self.container_id)
        writer.write_str_value("createdBy", self.created_by)
        writer.write_str_value("createdByName", self.created_by_name)
        writer.write_datetime_value("createdOn", self.created_on)
        writer.write_str_value("deletedBy", self.deleted_by)
        writer.write_datetime_value("deletedOn", self.deleted_on)
        writer.write_str_value("displayName", self.display_name)
        writer.write_uuid_value("docsId", self.docs_id)
        writer.write_uuid_value("domainEntityId", self.domain_entity_id)
        writer.write_str_value("fileName", self.file_name)
        writer.write_int_value("fileSize", self.file_size)
        writer.write_str_value("fileType", self.file_type)
        writer.write_bool_value("isDeleted", self.is_deleted)
        writer.write_str_value("lineageUrn", self.lineage_urn)
        writer.write_str_value("modifiedBy", self.modified_by)
        writer.write_datetime_value("modifiedOn", self.modified_on)
        writer.write_str_value("rfiId", self.rfi_id)
        writer.write_str_value("storageUrn", self.storage_urn)
        writer.write_str_value("tipVersionUrn", self.tip_version_urn)
        writer.write_int_value("version", self.version)
        writer.write_str_value("versionUrn", self.version_urn)
    

