o
    Q?h                     @   sZ   d dl Z d dl mZmZmZ d dlmZ eddG dd dZdefd	d
Zdd ZdS )    N)Fieldasdict	dataclass)DatetimeWithNanosecondsT)kw_onlyc                   @   sn   e Zd ZU dZeed< dZeed< e Z	eed< e Z
eed< dZeed< edd Zd	d
 Zdd ZdS )DocumentData uidenterpriseId	createdAt	updatedAtidc                    s8   t  | r S i   | di  fddt| D S )Nc                    s"   i | ]}|j t| |j qS  )nameconvertget).0fielddatar   F/var/www/html/riverr-enterprise-integrations-main/V2/functions/main.py
<dictcomp>   s    z*DocumentData.from_dict.<locals>.<dictcomp>r   )
isinstancedataclassesfields)clsr   r   r   r   	from_dict   s
   
zDocumentData.from_dictc                 C   s   t |  d S N)validateselfr   r   r   __post_init__   s   zDocumentData.__post_init__c                 C   s   t | S r   )r   r   r   r   r   to_dict   s   zDocumentData.to_dictN)__name__
__module____qualname__r	   str__annotations__r
   r   nowr   r   r   classmethodr   r!   r"   r   r   r   r   r   	   s   
 
r   r   c                 C   sF   |dv rd S | j tkrt|S | j tkrt|S | j tkr!t|S |S )Nr   )typeintr&   float)r   valuer   r   r   r      s
   r   c                 C   sT   t | D ]"}t| |j}|jtttd tfv r't	||js't
| |jt|| qd S r   )r   r   getattrr   r*   r&   r+   r,   boolr   setattrr   )r   r   r-   r   r   r   r   &   s    r   )	r   r   r   r    google.api_core.datetime_helpersr   r   r   r   r   r   r   r   <module>   s   