
    Ng                        d Z ddlmZ ddlZddlZddlmZmZ ddl	m
Z
  G d de          Z G d d	e          Z G d
 de          Z G d de          Z G d de          Z G d de          ZdZdZdZdZdZdS )zDomain-model objects.

This module should have no dependencies outside the domain model. In particular, any domain model
object should be importable anywhere in the package without risk of producing an import cycle.
    )annotationsN)IteratorProtocol)lazypropertyc                      e Zd ZdZdS )UnrecognizedCodePageErrorz:The specified code-page is not a known Microsoft encoding.N__name__
__module____qualname____doc__     N/var/www/html/ai-engine/env/lib/python3.11/site-packages/oxmsg/domain/model.pyr   r      s        DDDDr   r   c                      e Zd ZdZdS )UnsupportedEncodingErrorzCThe encoding used for this MSG object has no built-in Python codec.Nr	   r   r   r   r   r      s        MMMMr   r   c                  2    e Zd ZdZed
d            ZddZd	S )PropStorageTzUThe interface required of a storage object to extract the properties of that storage.returnbytesc                    dS zBytes of stream containing properties for the top-level object this storage represents.

        Every storage must have exactly one such stream.
        Nr   selfs    r   properties_stream_bytesz$PropStorageT.properties_stream_bytes$   	     	r   pidintptypc                    dS zIThe bytes of the stream for variable-length property identified by `pid`.Nr   r   r   r   s      r   property_stream_bytesz"PropStorageT.property_stream_bytes,       r   Nr   r   r   r   r   r   r   r   )r
   r   r   r   r   r   r#   r   r   r   r   r   !   sL        __   \     r   r   c                      e Zd ZdZedd            Zedd            Zedd            Zedd            Ze	dd
            Z
dS )	PropertyTzDThe interface required of a property object, regardless of its type.r   strc                    dS )z?The Microsft name for this property, like "PidTagMessageClass".Nr   r   s    r   namezPropertyT.name4   	     	r   r   c                    dS )zJThe property-id (PID) for this property, like 0x3701 for attachment bytes.Nr   r   s    r   r   zPropertyT.pid9   r,   r   c                    dS )zGThe property-type (PTYP) for this property, like 0x0102 for PtypBinary.Nr   r   s    r   r   zPropertyT.ptyp>   r,   r   c                    dS )zCThe Microsft name for the type of this property, like "PtypString".Nr   r   s    r   	ptyp_namezPropertyT.ptyp_nameC   r,   r   :bool | bytes | dt.datetime | float | int | str | uuid.UUIDc                    dS )z?The value of this property, its type depending on the property.Nr   r   s    r   valuezPropertyT.valueH   r,   r   Nr   r)   )r   r   )r   r1   )r
   r   r   r   propertyr+   r   r   r0   r   r3   r   r   r   r(   r(   1   s        NN   X    X    X    X    \  r   r(   c                  r    e Zd ZdZddZddZedd            Zedd            Z	edd
            Z
ddZdS )StorageTzInterface for a storage object.r   Iterator[StorageT]c                    dS )zGGenerate each storage object specific to an attachment to this message.Nr   r   s    r   iter_attachment_storagesz!StorageT.iter_attachment_storagesQ   r$   r   c                    dS )zEGenerate each storage object specific to a recipient of this message.Nr   r   s    r   iter_recipient_storagesz StorageT.iter_recipient_storagesU   r$   r   r)   c                    dS )a  The last segment of the storage path.

        This is the empty string for the root storage. Other storages are named is clearly specified
        ways depending on the type of top-level object they contain, e.g. attachment, recipient,
        etc.
        Nr   r   s    r   r+   zStorageT.nameY   	     	r   c                    dS )zString identifier for this storage; its location within the OXMSG CFB.

        - Suitable as a unique storage identifier within the MSG file.
        - The path of the root storage is the empty string ("").
        Nr   r   s    r   pathzStorageT.pathc   s	     	r   r   c                    dS r   r   r   s    r   r   z StorageT.properties_stream_bytesl   r   r   r   r   r   c                    dS r!   r   r"   s      r   r#   zStorageT.property_stream_bytest   r$   r   N)r   r8   r4   r%   r&   )r
   r   r   r   r:   r<   r   r+   r5   r@   r   r#   r   r   r   r7   r7   N   s        ))          \    X    \     r   r7   c                  Z    e Zd ZdZed	d            Zed	d            Zed
d            ZdS )StreamTzInterface for a stream object.r   r)   c                    dS )a#  The last segment of the stream path.

        Each stream contains the bytes for a property. The form of a stream name is clearly
        specified in the OXMSG standard and includes both the property-id (PID) and property
        data-type (PTYP) for the property data it contains.
        Nr   r   s    r   r+   zStreamT.name|   r>   r   c                    dS )zString identifier for this storage; its location within the OXMSG CFB.

        Suitable as a unique storage identifier within the MSG file.
        Nr   r   s    r   r@   zStreamT.path   r   r   r   c                    dS )z#The bytes contained in this stream.Nr   r   s    r   bytes_zStreamT.bytes_   r,   r   Nr4   r%   )	r
   r   r   r   r   r+   r5   r@   rH   r   r   r   rD   rD   y   sx        ((   \    X    X  r   rD      i          )r   
__future__r   datetimedtuuidtypingr   r   
oxmsg.utilr   	Exceptionr   r   r   r(   r7   rD   AF_BY_VALUESTORE_UNICODE_OKATTACH_HDR_OFFSETMSG_HDR_OFFSETRECIP_HDR_OFFSETr   r   r   <module>rX      s    # " " " " "      % % % % % % % % # # # # # #E E E E E	 E E EN N N N Ny N N N    8           :( ( ( ( (x ( ( (V    h   @       r   