
    xh                     ^    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e
          ZdS )	   )FileContent)FileType)FileName)Disposition)	ContentIdc                   8   e Zd ZdZ	 	 	 	 	 ddZed             Zej        d             Zed             Zej        d             Zed             Z	e	j        d	             Z	ed
             Z
e
j        d             Z
ed             Zej        d             Zd ZdS )
Attachmentz+An attachment to be included with an email.Nc                     d| _         d| _        d| _        d| _        d| _        ||| _        ||| _        ||| _        ||| _        |	|| _	        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   s         S/var/www/html/what/lib/python3.11/site-packages/sendgrid/helpers/mail/attachment.py__init__zAttachment.__init__   sz    @ " # ,D &DN &DN"*D!(DOOO "!    c                     | j         S )zSThe Base64 encoded content of the attachment.

        :rtype: FileContent
        )r   r   s    r   r   zAttachment.file_content@   s     !!r   c                 j    t          |t                    r	|| _        dS t          |          | _        dS )zThe Base64 encoded content of the attachment

        :param value: The Base64 encoded content of the attachment
        :type value: FileContent, string
        N)
isinstancer   r   r   values     r   r   zAttachment.file_contentH   s:     e[)) 	4!&D!,U!3!3Dr   c                     | j         S )zCThe file name of the attachment.

        :rtype: FileName
        )r   r   s    r   r   zAttachment.file_nameT        r   c                 j    t          |t                    r	|| _        dS t          |          | _        dS )zThe filename of the attachment

        :param file_name: The filename of the attachment
        :type file_name: FileName, string
        N)r   r   r   r   s     r   r   zAttachment.file_name\   2     eX&& 	.#DOOO&uooDOOOr   c                     | j         S )zRThe MIME type of the content you are attaching.

        :rtype: FileType
        )r   r   s    r   r   zAttachment.file_typeh   r    r   c                 j    t          |t                    r	|| _        dS t          |          | _        dS )zThe 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   s     r   r   zAttachment.file_typep   r"   r   c                     | j         S )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   s    r   r   zAttachment.disposition|   s       r   c                 j    t          |t                    r	|| _        dS t          |          | _        dS )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   s     r   r   zAttachment.disposition   s:    . e[)) 	3 %D +E 2 2Dr   c                     | j         S )zThe 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   s    r   r   zAttachment.content_id   s     r   c                 j    t          |t                    r	|| _        dS t          |          | _        dS )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   s     r   r   zAttachment.content_id   s:     eY'' 	0$D(//Dr   c                 h   i }| j         | j                                         |d<   | j        | j                                        |d<   | j        | j                                        |d<   | j        | j                                        |d<   | j        | 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   
attachments     r   r-   zAttachment.get   s     
($($5$9$9$;$;Jy!>%!%!3!3!5!5Jv>%%)^%7%7%9%9Jz"'(,(8(<(<(>(>J}%?&'+':':'<'<J|$r   )NNNNN)__name__
__module____qualname____doc__r   propertyr   setterr   r   r   r   r-    r   r   r	   r	      sq       55 3) 3) 3) 3)j " " X" 	4 	4 	4   X 	. 	. 	.   X 	. 	. 	. ! ! X! 3 3 36     X  0 0 0"    r   r	   N)r   r   r   r   r   r   r   r   r   r   objectr	   r5   r   r   <module>r7      s    % % % % % %             $ $ $ $ $ $ ! ! ! ! ! !R R R R R R R R R Rr   