o
    wÔ+fû  ã                   @   sP   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 G dd„ de
ƒZdS )	é   )ÚFileContent)ÚFileType)ÚFileName)ÚDisposition)Ú	ContentIdc                   @   s®   e Zd ZdZ					ddd„Zedd„ ƒZejdd„ ƒZedd	„ ƒZejd
d	„ ƒZedd„ ƒZ	e	jdd„ ƒZ	edd„ ƒZ
e
jdd„ ƒZ
edd„ ƒZejdd„ ƒZdd„ ZdS )Ú
Attachmentz+An attachment to be included with an email.Nc                 C   sl   d| _ d| _d| _d| _d| _|dur|| _|dur|| _|dur$|| _|dur+|| _|dur4|| _	dS dS )a¸  Create an Attachment

        :param file_content: The Base64 encoded content of the attachment
        :type file_content: FileContent, string
        :param file_name: The filename of the attachment
        :type file_name: FileName, string
        :param file_type: The MIME type of the content you are attaching
        :type file_type FileType, string, optional
        :param disposition: The content-disposition of the attachment,
                            specifying display style. Specifies how you
                            would like the attachment to be displayed.
                            - "inline" results in the attached file being
                              displayed automatically within the message.
                            - "attachment" results in the attached file
                              requiring some action to display (e.g. opening
                              or downloading the file).
                            If unspecified, "attachment" is used. Must be one
                            of the two choices.
        :type disposition: Disposition, string, optional
        :param content_id: The content id for the attachment.
                           This is used when the Disposition is set to
                           "inline" and the attachment is an image, allowing
                           the file to be displayed within the email body.
        :type content_id: ContentId, string, optional
        N)
Ú_file_contentÚ
_file_typeÚ
_file_nameÚ_dispositionÚ_content_idÚfile_contentÚ	file_typeÚ	file_nameÚdispositionÚ
content_id)Úselfr   r   r   r   r   © r   úS/var/www/html/venv/lib/python3.10/site-packages/sendgrid/helpers/mail/attachment.pyÚ__init__   s     
ÿzAttachment.__init__c                 C   ó   | j S )zSThe Base64 encoded content of the attachment.

        :rtype: FileContent
        )r   ©r   r   r   r   r   @   ó   zAttachment.file_contentc                 C   ó"   t |tƒr
|| _dS t|ƒ| _dS )z¢The Base64 encoded content of the attachment

        :param value: The Base64 encoded content of the attachment
        :type value: FileContent, string
        N)Ú
isinstancer   r   ©r   Úvaluer   r   r   r   H   ó   

c                 C   r   )zCThe file name of the attachment.

        :rtype: FileName
        )r
   r   r   r   r   r   T   r   zAttachment.file_namec                 C   r   )z‹The filename of the attachment

        :param file_name: The filename of the attachment
        :type file_name: FileName, string
        N)r   r   r
   r   r   r   r   r   \   r   c                 C   r   )zRThe MIME type of the content you are attaching.

        :rtype: FileType
        )r	   r   r   r   r   r   h   r   zAttachment.file_typec                 C   r   )z´The MIME type of the content you are attaching

        :param file_type: The MIME type of the content you are attaching
        :type file_type FileType, string, optional
        N)r   r   r	   r   r   r   r   r   p   r   c                 C   r   )a÷  The content-disposition of the attachment, specifying display style.

        Specifies how you would like the attachment to be displayed.
         - "inline" results in the attached file being displayed automatically
            within the message.
         - "attachment" results in the attached file requiring some action to
            display (e.g. opening or downloading the file).
        If unspecified, "attachment" is used. Must be one of the two choices.

        :rtype: Disposition
        )r   r   r   r   r   r   |   s   zAttachment.dispositionc                 C   r   )aÉ  The content-disposition of the attachment, specifying display style.

        Specifies how you would like the attachment to be displayed.
         - "inline" results in the attached file being displayed automatically
            within the message.
         - "attachment" results in the attached file requiring some action to
            display (e.g. opening or downloading the file).
        If unspecified, "attachment" is used. Must be one of the two choices.

        :param disposition: The content-disposition of the attachment,
                            specifying display style. Specifies how you would
                            like the attachment to be displayed.
                            - "inline" results in the attached file being
                              displayed automatically within the message.
                            - "attachment" results in the attached file
                              requiring some action to display (e.g. opening
                              or downloading the file).
                            If unspecified, "attachment" is used. Must be one
                            of the two choices.
        :type disposition: Disposition, string, optional
        N)r   r   r   r   r   r   r   r   ‹   s   

c                 C   r   )zâThe content id for the attachment.

        This is used when the disposition is set to "inline" and the attachment
        is an image, allowing the file to be displayed within the email body.

        :rtype: string
        )r   r   r   r   r   r   §   s   	zAttachment.content_idc                 C   r   )a  The content id for the attachment.

        This is used when the disposition is set to "inline" and the attachment
        is an image, allowing the file to be displayed within the email body.

        :param content_id: The content id for the attachment.
                           This is used when the Disposition is set to "inline"
                           and the attachment is an image, allowing the file to
                           be displayed within the email body.
        :type content_id: ContentId, string, optional
        N)r   r   r   r   r   r   r   r   ²   s   

c                 C   s€   i }| j dur| j  ¡ |d< | jdur| j ¡ |d< | jdur&| j ¡ |d< | jdur2| j ¡ |d< | jdur>| j ¡ |d< |S )zŸ
        Get a JSON-ready representation of this Attachment.

        :returns: This Attachment, ready for use in a request body.
        :rtype: dict
        NÚcontentÚtypeÚfilenamer   r   )r   Úgetr   r   r   r   )r   Ú
attachmentr   r   r   r!   Ä   s   




zAttachment.get)NNNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   Úsetterr   r   r   r   r!   r   r   r   r   r      s:    
ú5










r   N)r   r   r   r   r   r   r   r   r   r   Úobjectr   r   r   r   r   Ú<module>   s    