
    m>hY                         d Z ddlmZ ddlmZmZmZmZmZmZm	Z	 ddl
mZmZmZ ddlmZ ddlmZ ddlmZ ddl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y)a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Ip_messaging
    This is the public Twilio REST API.

    NOTE: This class is auto generated by OpenAPI Generator.
    https://openapi-generator.tech
    Do not edit the class manually.
    )datetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                   j    e Zd Z G d de      Z	 	 ddedeeef   de	e   f fdZ
edd       Zdefd	Zdefd
ZddZddZej&                  ej&                  ej&                  ej&                  ej&                  ej&                  fdeeef   deeef   deeef   deeef   deeef   deeef   dd fdZej&                  ej&                  ej&                  ej&                  ej&                  ej&                  fdeeef   deeef   deeef   deeef   deeef   deeef   dd fdZdefdZ xZS )CredentialInstancec                       e Zd ZdZdZdZy)CredentialInstance.PushServicegcmapnfcmN)__name__
__module____qualname__GCMAPNFCM     j/var/www/html/DP/alpha_backend/venv/lib/python3.12/site-packages/twilio/rest/ip_messaging/v2/credential.pyPushServicer      s    r!   r#   versionpayloadsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _
        t        j                  |j                  d            | _        |j                  d      | _        d|xs | j                  i| _        d | _        y )	Nr&   account_sidfriendly_nametypesandboxdate_createddate_updatedurl)super__init__getr&   r(   r)   r*   r+   r   iso8601_datetimer,   r-   r.   	_solution_context)selfr$   r%   r&   	__class__s       r"   r0   zCredentialInstance.__init__+   s     	!")++e"4*1++m*D,3KK,H@GF@S	&-kk)&<0;0L0LKK'1
 1<0L0LKK'1
 #*++e"4 3?$((
 6:r!   returnc                     | j                   )t        | j                  | j                  d         | _         | j                   S )z
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: CredentialContext for this CredentialInstance
        r&   r&   )r4   CredentialContext_versionr3   r5   s    r"   _proxyzCredentialInstance._proxyB   s9     == -NN5)DM }}r!   c                 6    | j                   j                         S )m
        Deletes the CredentialInstance


        :returns: True if delete succeeds, False otherwise
        )r=   deleter<   s    r"   r@   zCredentialInstance.deleteQ   s     {{!!##r!   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the CredentialInstance


        :returns: True if delete succeeds, False otherwise
        N)r=   delete_asyncr<   s    r"   rC   zCredentialInstance.delete_asyncZ   s!      [[--////   '%'c                 6    | j                   j                         S )a
        Fetch the CredentialInstance


        :returns: The fetched CredentialInstance
        )r=   fetchr<   s    r"   rG   zCredentialInstance.fetchc   s     {{  ""r!   c                 R   K   | j                   j                          d{   S 7 w){
        Asynchronous coroutine to fetch the CredentialInstance


        :returns: The fetched CredentialInstance
        N)r=   fetch_asyncr<   s    r"   rJ   zCredentialInstance.fetch_asyncl   s!      [[,,....rD   r)   certificateprivate_keyr+   api_keysecretc                 D    | j                   j                  ||||||      S )
        Update the CredentialInstance

        :param friendly_name:
        :param certificate:
        :param private_key:
        :param sandbox:
        :param api_key:
        :param secret:

        :returns: The updated CredentialInstance
        r)   rK   rL   r+   rM   rN   )r=   updater5   r)   rK   rL   r+   rM   rN   s          r"   rR   zCredentialInstance.updateu   s2    * {{!!'## " 
 	
r!   c                 `   K   | j                   j                  ||||||       d{   S 7 w)  
        Asynchronous coroutine to update the CredentialInstance

        :param friendly_name:
        :param certificate:
        :param private_key:
        :param sandbox:
        :param api_key:
        :param secret:

        :returns: The updated CredentialInstance
        rQ   N)r=   update_asyncrS   s          r"   rV   zCredentialInstance.update_async   s@     * [[--'## . 
 
 	
 
s   %.,.c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r"   	<genexpr>z.CredentialInstance.__repr__.<locals>.<genexpr>   "     S<RDAq7>>!Q/<R   !z-<Twilio.IpMessaging.V2.CredentialInstance {}>joinr3   itemsr]   r5   contexts     r"   __repr__zCredentialInstance.__repr__   s6     ((SDNN<P<P<RSS>EEgNNr!   )N)r7   r:   )r7   r   )r   r   r   objectr#   r   r   strr   r   r0   propertyr=   boolr@   rC   rG   rJ   r   unsetr   rR   rV   rj   __classcell__r6   s   @r"   r   r      s   f 
	 OS::)-c3h:>Fsm:.  $ $0D 0#/ -3LL*0,,*0,,'-||&,ll%+\\
S&[)
 3;'
 3;'	

 tV|$
 sF{#
 c6k"
 

@ -3LL*0,,*0,,'-||&,ll%+\\
S&[)
 3;'
 3;'	

 tV|$
 sF{#
 c6k"
 

<O# Or!   r   c                   0    e Zd Zdedef fdZdefdZdefdZde	fdZ
de	fdZej                  ej                  ej                  ej                  ej                  ej                  fd	eeef   d
eeef   deeef   deeef   deeef   deeef   de	fdZej                  ej                  ej                  ej                  ej                  ej                  fd	eeef   d
eeef   deeef   deeef   deeef   deeef   de	fdZdefdZ xZS )r:   r$   r&   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the CredentialContext

        :param version: Version that contains the resource
        :param sid:
        r&   z/Credentials/{sid}Nr    )r/   r0   r3   r]   _uri)r5   r$   r&   r6   s      r"   r0   zCredentialContext.__init__   s@     	! 3
 0(//A$..A	r!   r7   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )r?   DELETEmethoduriheaders)r   ofr;   r@   rt   r5   rz   s     r"   r@   zCredentialContext.delete   s1     ))B-}}##8G#TTr!   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rB   rv   rw   N)r   r{   r;   rC   rt   r|   s     r"   rC   zCredentialContext.delete_async   sF      ))B-]]//G 0 
 
 	
 
s   AA
AA
c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d         S )rF   application/jsonAcceptGETrw   r&   r9   )r   r{   r;   rG   rt   r   r3   r5   rz   r%   s      r"   rG   zCredentialContext.fetch   s]     ))B-.--%%U		7%S!MMu%
 	
r!   c                    K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d         S 7 )w)rI   r   r   r   rw   Nr&   r9   )r   r{   r;   rJ   rt   r   r3   r   s      r"   rJ   zCredentialContext.fetch_async   sr      ))B-.11dii 2 
 
 "MMu%
 	
	
s   AA4A2	*A4r)   rK   rL   r+   rM   rN   c           	      :   t        j                  |||t        j                  |      ||d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }	t        | j                  |	| j                  d   	      S )
rP   FriendlyNameCertificate
PrivateKeySandboxApiKeySecret!application/x-www-form-urlencodedContent-Typer   r   POSTrx   ry   datarz   r&   r9   )	r   r{   r   boolean_to_stringr;   rR   rt   r   r3   
r5   r)   rK   rL   r+   rM   rN   r   rz   r%   s
             r"   rR   zCredentialContext.update  s    , yy -*)$66w?! 	
 ))B-"E.--&&tyytW ' 
 "$--dnnU>STTr!   c           	      V  K   t        j                  |||t        j                  |      ||d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }	t        | j                  |	| j                  d	   
      S 7 )w)rU   r   r   r   r   r   r   r   Nr&   r9   )	r   r{   r   r   r;   rV   rt   r   r3   r   s
             r"   rV   zCredentialContext.update_async<  s     , yy -*)$66w?! 	
 ))B-"E.22tyytW 3 
 
 "$--dnnU>STT	
s   A;B)=B'>*B)c                     dj                  d | j                  j                         D              }dj                  |      S )rX   rY   c              3   F   K   | ]  \  }}d j                  ||        ywr[   r\   r^   s      r"   rb   z-CredentialContext.__repr__.<locals>.<genexpr>n  rc   rd   z,<Twilio.IpMessaging.V2.CredentialContext {}>re   rh   s     r"   rj   zCredentialContext.__repr__h  s6     ((SDNN<P<P<RSS=DDWMMr!   )r   r   r   r   rl   r0   rn   r@   rC   r   rG   rJ   r   ro   r   rk   rR   rV   rj   rp   rq   s   @r"   r:   r:      s   B Bc B
U 
U
D 

) 
(
#5 
0 -3LL*0,,*0,,'-||&,ll%+\\*US&[)*U 3;'*U 3;'	*U
 tV|$*U sF{#*U c6k"*U 
*U\ -3LL*0,,*0,,'-||&,ll%+\\*US&[)*U 3;'*U 3;'	*U
 tV|$*U sF{#*U c6k"*U 
*UXN# Nr!   r:   c                   2    e Zd Zdeeef   defdZdefdZy)CredentialPager%   r7   c                 .    t        | j                  |      S )zp
        Build an instance of CredentialInstance

        :param payload: Payload response from the API
        )r   r;   )r5   r%   s     r"   get_instancezCredentialPage.get_instancet  s     "$--99r!   c                      y)rX   z&<Twilio.IpMessaging.V2.CredentialPage>r    r<   s    r"   rj   zCredentialPage.__repr__|       8r!   N)	r   r   r   r   rl   r   r   r   rj   r    r!   r"   r   r   r  s*    :DcN :7I :8# 8r!   r   c                       e Zd Zdef fdZej                  ej                  ej                  ej                  ej                  ej                  fdddeee	f   deee	f   deee	f   dee
e	f   d	eee	f   d
eee	f   defdZej                  ej                  ej                  ej                  ej                  ej                  fdddeee	f   deee	f   deee	f   dee
e	f   d	eee	f   d
eee	f   defdZ	 	 ddee   dee   dee   fdZ	 	 ddee   dee   dee   fdZ	 	 ddee   dee   dee   fdZ	 	 ddee   dee   dee   fdZej                  ej                  ej                  fdeee	f   deee	f   deee	f   defdZej                  ej                  ej                  fdeee	f   deee	f   deee	f   defdZdedefdZdedefdZdedefdZdedefdZdefdZ xZ S ) CredentialListr$   c                 2    t         |   |       d| _        y)zl
        Initialize the CredentialList

        :param version: Version that contains the resource

        z/CredentialsN)r/   r0   rt   )r5   r$   r6   s     r"   r0   zCredentialList.__init__  s     	!"	r!   r*   r   r)   rK   rL   r+   rM   rN   r7   c           
      "   t        j                  ||||t        j                  |      ||d      }t        j                  ddi      }	d|	d<   d|	d<   | j                  j                  d| j                  ||	      }
t        | j                  |
      S )a  
        Create the CredentialInstance

        :param type:
        :param friendly_name:
        :param certificate:
        :param private_key:
        :param sandbox:
        :param api_key:
        :param secret:

        :returns: The created CredentialInstance
        Typer   r   r   r   r   r   r   r   r   r   r   r   )r   r{   r   r   r;   creatert   r   r5   r*   r)   rK   rL   r+   rM   rN   r   rz   r%   s              r"   r   zCredentialList.create  s    0 yy -*)$66w?! 

 ))^-PQR"E.--&&tyytW ' 
 "$--99r!   c           
      >  K   t        j                  ||||t        j                  |      ||d      }t        j                  ddi      }	d|	d<   d|	d<   | j                  j                  d| j                  ||	       d{   }
t        | j                  |
      S 7 w)	a#  
        Asynchronously create the CredentialInstance

        :param type:
        :param friendly_name:
        :param certificate:
        :param private_key:
        :param sandbox:
        :param api_key:
        :param secret:

        :returns: The created CredentialInstance
        r   r   r   r   r   r   r   N)r   r{   r   r   r;   create_asyncrt   r   r   s              r"   r   zCredentialList.create_async  s     0 yy -*)$66w?! 

 ))^-PQR"E.22tyytW 3 
 
 "$--99	
s   A>B BBlimit	page_sizec                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )a`  
        Streams CredentialInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, stream() will attempt to read the
                          limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        r   r   r   )r;   read_limitspagestreamr5   r   r   limitsr   s        r"   r   zCredentialList.stream  sJ    ( **5)<yy6+#6y7}}##D&/::r!   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)ao  
        Asynchronously streams CredentialInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, stream() will attempt to read the
                          limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        r   r   Nr   )r;   r   
page_asyncstream_asyncr   s        r"   r   zCredentialList.stream_async	  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists CredentialInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, list() will attempt to read the limit
                          with the most efficient page size, i.e. min(limit, 1000)

        :returns: list that will contain up to limit results
        r   r   )listr   )r5   r   r   s      r"   r   zCredentialList.list"  s(    & KK#  
 	
r!   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a  
        Asynchronously lists CredentialInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, list() will attempt to read the limit
                          with the most efficient page size, i.e. min(limit, 1000)

        :returns: list that will contain up to limit results
        r   N)r   )r5   r   r   records       r"   
list_asynczCredentialList.list_async<  sY     * '+&7&7# '8 ' ! !
 
 !
 
 	
 
s0   ;.;620
26;26;
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  |      S )ay  
        Retrieve a single page of CredentialInstance records from the API.
        Request is executed immediately

        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of CredentialInstance
        	PageTokenr   PageSizer   r   r   r   r   rx   ry   paramsrz   )r   r{   r;   r   rt   r   r5   r   r   r   r   rz   responses          r"   r   zCredentialList.pageW  sy      yy'#%
 ))^-PQR.==%%diig & 
 dmmX66r!   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  |      S 7 w)	a  
        Asynchronously retrieve a single page of CredentialInstance records from the API.
        Request is executed immediately

        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of CredentialInstance
        r   r   r   r   r   r   r   N)r   r{   r;   r   rt   r   r   s          r"   r   zCredentialList.page_asyncx  s       yy'#%
 ))^-PQR.11diig 2 
 
 dmmX66
s   A"B$A?%B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   |      S )z
        Retrieve a specific page of CredentialInstance records from the API.
        Request is executed immediately

        :param target_url: API-generated URL for the requested results page

        :returns: Page of CredentialInstance
        r   )r;   domaintwiliorequestr   r5   r   r   s      r"   get_pagezCredentialList.get_page  s7     ==''..66ujIdmmX66r!   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)a  
        Asynchronously retrieve a specific page of CredentialInstance records from the API.
        Request is executed immediately

        :param target_url: API-generated URL for the requested results page

        :returns: Page of CredentialInstance
        r   N)r;   r   r   request_asyncr   r   s      r"   get_page_asynczCredentialList.get_page_async  sD      --44BB5*UUdmmX66 Vs   4AAAr&   c                 0    t        | j                  |      S zE
        Constructs a CredentialContext

        :param sid:
        r9   r:   r;   r5   r&   s     r"   r1   zCredentialList.get       !C88r!   c                 0    t        | j                  |      S r   r   r   s     r"   __call__zCredentialList.__call__  r   r!   c                      y)rX   z&<Twilio.IpMessaging.V2.CredentialList>r    r<   s    r"   rj   zCredentialList.__repr__  r   r!   )NN)!r   r   r   r   r0   r   ro   r   rl   rk   rn   r   r   r   r   intr	   r   r
   r   r   r   r   r   r   r   r   r   r:   r1   r   rj   rp   rq   s   @r"   r   r     sq   	# 	# -3LL*0,,*0,,'-||&,ll%+\\-:.-: S&[)-: 3;'	-:
 3;'-: tV|$-: sF{#-: c6k"-: 
-:d -3LL*0,,*0,,'-||&,ll%+\\-:.-: S&[)-: 3;'	-:
 3;'-: tV|$-: sF{#-: c6k"-: 
-:b  $#';}; C=; 
$	%	;6  $#'A}A C=A 
)	*	A6  $#'
}
 C=
 
 	!	
8  $#'
}
 C=
 
 	!	
: *0*0,,(.	7#v+&7 3;'7 f%	7
 
7F *0*0,,(.	7#v+&7 3;'7 f%	7
 
7B
73 
7> 
7
7s 
7~ 
79s 90 99C 9$5 98# 8r!   r   N)__doc__r   typingr   r   r   r   r   r	   r
   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r:   r   r   r    r!   r"   <module>r      sj     L L L 6 6 8 : 2 ' !_O) _ODtN tNn8T 8&B8\ B8r!   