
    Mir
                    `    S r SSKJr  SSKrSSKJr  SSKJr	  SSK
Jr  SSKJr   " S S	5      rg)
a  Provides access to the properties of an attachment in an Outlook MSG file.

These properies include the attached file's original file-name, its last-modified date, size, and
content-type (MIME-type).

```python
>>> from oxmsg import Message

>>> msg = Message.load("message.msg")
>>> msg.attachment_count
1
>>> attachment = msg.attachments[0]
>>> attachment.file_name
'financial-forecast.xlsx'
>>> with open(attachment.file_name, "wb") as f:
...     f.write()
```
    )annotationsN)	constants)model)
Properties)lazypropertyc                      \ rS rSrSrSS jr\SS j5       r\SS j5       r\SS j5       r	\SS j5       r
\SS j5       r\SS	 j5       r\SS
 j5       rSrg)
Attachment   z,A file attached to an Outlook email message.c                    Xl         g )N_storage)selfstorages     j/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/oxmsg/attachment.py__init__Attachment.__init__!   s        c                    U R                   R                  [        R                  5      nUc   e[	        U[
        R                  -  5      $ )zTrue when the `PidTagAttachDataBinary` property contains the attachment data.

This is as opposed to "by-reference" where only a path or URL is stored.
)
propertiesint_prop_valuecPID_ATTACH_METHODboolmAF_BY_VALUE)r   attach_methods     r   attached_by_valueAttachment.attached_by_value$   s>     66q7J7JK(((MAMM122r   c                T    U R                   R                  [        R                  5      $ )zDThe attachment binary, suitable for saving to a file when detaching.)r   binary_prop_valuer   PID_ATTACH_DATA_BINARYr   s    r   
file_bytesAttachment.file_bytes.   s     001I1IJJr   c                T    U R                   R                  [        R                  5      $ )z|The full name of this file as it was originally attached.

Like "FY24-quarterly-projections.xlsx". Does not include a path.
)r   str_prop_valuer   PID_ATTACH_LONG_FILENAMEr"   s    r   	file_nameAttachment.file_name3   s     --a.H.HIIr   c                T    U R                   R                  [        R                  5      $ )zTimezone-aware UTC datetime when this attachment was last modified.

`None` if this property is not present on the attachment.
)r   date_prop_valuer   PID_LAST_MODIFICATION_TIMEr"   s    r   last_modifiedAttachment.last_modified;   s     ..q/K/KLLr   c                f    U R                   R                  [        R                  5      =(       d    S$ )zFISO 8601 str representation of time this attachment was last modified.zapplication/octet-stream)r   r&   r   PID_ATTACH_MIME_TAGr"   s    r   	mime_typeAttachment.mime_typeC   s%     --a.C.CDbHbbr   c                F    [        U R                  [        R                  S9$ )z7Provides access to the properties of this OXMSG object.)properties_header_offset)r   r   r   ATTACH_HDR_OFFSETr"   s    r   r   Attachment.propertiesH   s     $--!BUBUVVr   c                R    U R                   (       a  [        U R                   5      $ S$ )z#Length in bytes of this attachment.r   )r#   lenr"   s    r   sizeAttachment.sizeM   s     (,s4??#=A=r   r   N)r   z
m.StorageT)returnr   )r;   zbytes | None)r;   z
str | None)r;   zdt.datetime | None)r;   r   )r;   int)__name__
__module____qualname____firstlineno____doc__r   r   r   r#   r(   r-   r1   r   r9   __static_attributes__ r   r   r	   r	      s    6  3 3 K K J J M M c c W W > >r   r	   )rA   
__future__r   datetimedtoxmsg.domainr   r   r   r   oxmsg.propertiesr   
oxmsg.utilr   r	   rC   r   r   <module>rJ      s(   & #  ' # ' #2> 2>r   