
    pi                     x    S SK Jr  S SK7  S SK7   " S S\R                  5      r " S S\R                  5      rg)    )serializers)*c                   V    \ rS rSr\R
                  " 5       r " S S5      rS rS r	Sr
g)UserDeviceSerializer   c                        \ rS rSr\r/ SQrSrg)UserDeviceSerializer.Meta   )idtokencreatedDateupdatedDateparentProfileIddeviceOSTypeIdisAuthorized N)__name__
__module____qualname____firstlineno__
UserDevicemodelfields__static_attributes__r       چ/Users/waleedhassanin/Documents/snowflake_co_dev_github/snow_flake_back_end_deploy/mama_care_api/mama_care_notification/serializers.pyMetar	      s    
r   r   c                 b    [        XR                  R                  R                  5      (       a  gg NT)isValidDatar   childIdr   selfinstances     r   get_isAuthorized%UserDeviceSerializer.get_isAuthorized   s(    t44<<??@@ Ar   c                     SnSnSU;   a-  [        XS   R                  R                  R                  5      nOSnUS:X  a  U$ [	        U5      S:  a  [
        R                  " SU/05      eg )N Fr   parentIdzParent Id does not exitTr   error)validateParentIdr!   r*   r   lenr   ValidationErrorr#   dataerrorMessageisChecks       r   validateUserDeviceSerializer.validate   sq    $&t1B,C,K,K,T,T,W,WXG@Ld?K"--w~.FGG #r   r   Nr   r   r   r   r   SerializerMethodFieldr   r   r%   r3   r   r   r   r   r   r      s%    446L

 

Hr   r   c                   V    \ rS rSr\R
                  " 5       r " S S5      rS rS r	Sr
g)NotificationSerializer$   c                        \ rS rSr\r/ SQrSrg)NotificationSerializer.Meta&   )r   titlebodyr   r   userDeviceIdr   r   N)r   r   r   r   Notificationr   r   r   r   r   r   r   r;   &   s    
r   r   c                 v    [        XR                  R                  R                  R                  5      (       a  gg r   )r    r?   r   r!   r   r"   s     r   r%   'NotificationSerializer.get_isAuthorized2   s.    t11AAIILLMM Nr   c                     SnSnSU;   a7  [        XS   R                  R                  R                  R                  5      nOSnUS:X  a  U$ [        U5      S:  a  [        R                  " SU/05      eg )	Nr(   FkickTrackerGroupIdr?   r)   Tr   r+   )r,   r   r!   r*   r   r-   r   r.   r/   s       r   r3   NotificationSerializer.validate6   sv    4'&t,@,P,P,X,X,a,a,d,deG@Ld?K"--w~.FGG #r   r   Nr5   r   r   r   r8   r8   $   s%    446L

 

Hr   r8   N)rest_frameworkr   mama_care_notification.modelsmama_care.serializersModelSerializerr   r8   r   r   r   <module>rJ      s6    & + #H;66 H>H[88 Hr   