
    =h                     >    d dl Z d dlZd dlmZ d Zd Zd Zd Zd Zy)    N)valuesc                    | t         j                  k(  r| S t        | t        j                        rt	        | j                               S t        | t        j
                        rt	        |       S t        | t              r| S y)
    Return a string representation of a date that the Twilio API understands
    Format is YYYY-MM-DD. Returns None if d is not a string, datetime, or date
    N)r   unset
isinstancedatetimestrdateds    e/var/www/html/phonemate/phone_mate_backend/venv/lib/python3.12/site-packages/twilio/base/serialize.pyiso8601_dater      s`    
 	FLL	Ax((	)1668}	Ax}}	%1v	As	 
    c                     | t         j                  k(  r| S t        | t        j                        st        | t        j                        r| j                  d      S t        | t              r| S y)r   z%Y-%m-%dT%H:%M:%SZN)r   r   r   r   r
   strftimer	   r   s    r   iso8601_datetimer      sV    
 	FLL	Ax((	)Z8==-Izz.//	As	 
r   c                     | t         j                  k(  ri S dfd	t        | t              r< |       }|j	                         D ci c]  \  }}dj                  ||      | c}}S i S c c}}w )zS
    Return a dict of params corresponding to those in m with the added prefix
    c                     |i }|g }| j                         D ]<  \  }}t        |t              r ||||gz          %||dj                  ||gz         <   > |S )N.)itemsr   dictjoin)r   resultprv_keyskvflatten_dicts        r   r   z.prefixed_collapsible_map.<locals>.flatten_dict*   sh    >FHGGIDAq!T"QA3734sxxA3/0	  r   z{}.{})NN)r   r   r   r   r   format)mprefix	flattenedr   r   r   s        @r   prefixed_collapsible_mapr"   #   sm     	FLL	 !T O	9B9JK9JAvq)1,9JKKI Ls   A+c                 p    t        | t              st        | t              rt        j                  |       S | S )zl
    Return a jsonified string represenation of obj if obj is jsonifiable else
    return obj untouched
    )r   r   listjsondumps)objs    r   objectr(   @   s*    
 #t
3 5zz#Jr   c                 \    t        | t              s| S | D cg c]
  } ||       c}S c c}w )z8
    Applies serialize_func to every element in lst
    )r   r$   )lstserialize_funces      r   mapr-   J   s0     c4 
'*+s!N1s+++s   ))	r   r%   twilio.baser   r   r   r"   r(   r-    r   r   <module>r0      s'      
:,r   