o
    6eT                     @   s   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 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 deZG dd deZG dd deZG dd deZdS )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values)InstanceContext)InstanceResource)ListResource)Version)Pagec                       sx  e Zd ZG dd deZ	 	d!dedeeef de	e f fddZ
ed"ddZd	efddZd	efddZd#ddZd#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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dZd	efdd Z  ZS )$CredentialInstancec                   @   s   e Zd ZdZdZdZdS )CredentialInstance.PushServicegcmapnfcmN)__name__
__module____qualname__GCMAPNFCM r   r   y/var/www/html/apis.geethamveg.com/public_html/venv/lib/python3.10/site-packages/twilio/rest/ip_messaging/v2/credential.pyPushService   s    r   Nversionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _t	|d| _
t	|d| _|d| _d|pA| ji| _d | _d S )	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__r   r   r*   +   s    

zCredentialInstance.__init__returnCredentialContextc                 C   s&   | j du rt| j| jd 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
        Nr!   r!   )r.   r3   _versionr-   r/   r   r   r   _proxyB   s   
zCredentialInstance._proxyc                 C   
   | j  S )m
        Deletes the CredentialInstance


        :returns: True if delete succeeds, False otherwise
        )r7   deleter6   r   r   r   r:   Q      
zCredentialInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the CredentialInstance


        :returns: True if delete succeeds, False otherwise
        N)r7   delete_asyncr6   r   r   r   r>   Z      zCredentialInstance.delete_asyncc                 C   r8   )a
        Fetch the CredentialInstance


        :returns: The fetched CredentialInstance
        )r7   fetchr6   r   r   r   rA   c   r;   zCredentialInstance.fetchc                    r<   ){
        Asynchronous coroutine to fetch the CredentialInstance


        :returns: The fetched CredentialInstance
        N)r7   fetch_asyncr6   r   r   r   rC   l   r?   zCredentialInstance.fetch_asyncr#   certificateprivate_keyr%   api_keysecretc                 C   s   | j j||||||dS )
        Update the CredentialInstance

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

        :returns: The updated CredentialInstance
        r#   rD   rE   r%   rF   rG   )r7   updater/   r#   rD   rE   r%   rF   rG   r   r   r   rJ   u   s   zCredentialInstance.updatec                    s    | j j||||||dI dH S )  
        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
        rI   N)r7   update_asyncrK   r   r   r   rM      s   zCredentialInstance.update_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>       z.CredentialInstance.__repr__.<locals>.<genexpr>z-<Twilio.IpMessaging.V2.CredentialInstance {}>joinr-   itemsrT   r/   contextr   r   r   __repr__      
zCredentialInstance.__repr__N)r2   r3   )r2   r   )r   r   r   objectr   r   r   strr   r   r*   propertyr7   boolr:   r>   rA   rC   r   unsetr   rJ   rM   r`   __classcell__r   r   r0   r   r      sx    
	
	
	






 






r   c                       sL  e Zd Zdedef fddZdefddZdefdd	Zde	fd
dZ
de	f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e	f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e	fddZdefddZ  ZS )r3   r   r!   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the CredentialContext

        :param version: Version that contains the resource
        :param sid:
        r!   z/Credentials/{sid}Nr   )r)   r*   r-   rT   _uri)r/   r   r!   r0   r   r   r*      s   zCredentialContext.__init__r2   c                 C   s   | j jd| jdS )r9   DELETEmethoduri)r5   r:   ri   r6   r   r   r   r:      s   zCredentialContext.deletec                    s   | j jd| jdI dH S )r=   rj   rk   N)r5   r>   ri   r6   r   r   r   r>      s
   zCredentialContext.delete_asyncc                 C   s(   | j jd| jd}t| j || jd dS )r@   GETrk   r!   r4   )r5   rA   ri   r   r-   r/   r    r   r   r   rA      s   zCredentialContext.fetchc                    s0   | j jd| jdI dH }t| j || jd dS )rB   rn   rk   Nr!   r4   )r5   rC   ri   r   r-   ro   r   r   r   rC      s   zCredentialContext.fetch_asyncr#   rD   rE   r%   rF   rG   c           	   	   C   sB   t ||||||d}| jjd| j|d}t| j|| jd dS )rH   FriendlyNameCertificate
PrivateKeySandboxApiKeySecretPOSTrl   rm   datar!   r4   )r   ofr5   rJ   ri   r   r-   	r/   r#   rD   rE   r%   rF   rG   ry   r    r   r   r   rJ   	  s   zCredentialContext.updatec           	   	      sJ   t ||||||d}| jjd| j|dI dH }t| j|| jd dS )rL   rp   rw   rx   Nr!   r4   )r   rz   r5   rM   ri   r   r-   r{   r   r   r   rM   1  s    zCredentialContext.update_asyncc                 C   rN   )rO   rP   c                 s   rQ   rR   rS   rU   r   r   r   rY   _  rZ   z-CredentialContext.__repr__.<locals>.<genexpr>z,<Twilio.IpMessaging.V2.CredentialContext {}>r[   r^   r   r   r   r`   Y  ra   zCredentialContext.__repr__)r   r   r   r   rd   r*   rf   r:   r>   r   rA   rC   r   rg   r   rc   rJ   rM   r`   rh   r   r   r0   r   r3      sb    






*






(r3   c                   @   s4   e Zd Zdeeef defddZdefddZdS )CredentialPager    r2   c                 C   s   t | j|S )zp
        Build an instance of CredentialInstance

        :param payload: Payload response from the API
        )r   r5   ro   r   r   r   get_instanced  s   zCredentialPage.get_instancec                 C      dS )rO   z&<Twilio.IpMessaging.V2.CredentialPage>r   r6   r   r   r   r`   l     zCredentialPage.__repr__N)	r   r   r   r   rd   r   r   r}   r`   r   r   r   r   r|   c  s    r|   c                       s  e Zd Zdef fd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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dZ		d.dee dee dee fddZ		d.dee dee dee fddZ		d.dee dee dee fddZ		d.dee dee dee fd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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 d!Zd"edefd#d$Zd"edefd%d&Zd'edefd(d)Zd'edefd*d+Zdefd,d-Z  Z S )/CredentialListr   c                    s   t  | d| _dS )zl
        Initialize the CredentialList

        :param version: Version that contains the resource

        z/CredentialsN)r)   r*   ri   )r/   r   r0   r   r   r*   v  s   
zCredentialList.__init__r$   r   r#   rD   rE   r%   rF   rG   r2   c           
   
   C   s:   t |||||||d}| jjd| j|d}	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
        Typerq   rr   rs   rt   ru   rv   rw   rx   )r   rz   r5   createri   r   
r/   r$   r#   rD   rE   r%   rF   rG   ry   r    r   r   r   r     s    zCredentialList.createc           
   
      sB   t |||||||d}| jjd| j|dI dH }	t| j|	S )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   rw   rx   N)r   rz   r5   create_asyncri   r   r   r   r   r   r     s"   zCredentialList.create_asyncNlimit	page_sizec                 C   s0   | j ||}| j|d d}| 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   )r5   read_limitspagestreamr/   r   r   limitsr   r   r   r   r     s   zCredentialList.streamc                    s8   | j ||}| j|d dI dH }| j ||d S )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   )r5   r   
page_asyncstream_asyncr   r   r   r   r     s   zCredentialList.stream_asyncc                 C   s   t | j||d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   r/   r   r   r   r   r   r   	  s   zCredentialList.listc                    s&   dd | j ||dI dH 2 I dH S )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
        c                    s   g | z3 d H W }|q6 S rb   r   )rV   recordr   r   r   
<listcomp>6  s
    z-CredentialList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r   
list_async#  s   
zCredentialList.list_async
page_tokenpage_numberc                 C   s2   t |||d}| jjd| j|d}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   PageSizern   rl   rm   params)r   rz   r5   r   ri   r|   r/   r   r   r   ry   responser   r   r   r   >  s   zCredentialList.pagec                    s:   t |||d}| jjd| j|dI dH }t| j|S )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   rn   r   N)r   rz   r5   r   ri   r|   r   r   r   r   r   Y  s   zCredentialList.page_async
target_urlc                 C   s   | 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
        rn   )r5   domaintwiliorequestr|   r/   r   r   r   r   r   get_pagev  s   	zCredentialList.get_pagec                    s&   | j jjd|I dH }t| j |S )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
        rn   N)r5   r   r   request_asyncr|   r   r   r   r   get_page_async  s   	zCredentialList.get_page_asyncr!   c                 C      t | j|dS zE
        Constructs a CredentialContext

        :param sid:
        r4   r3   r5   r/   r!   r   r   r   r+        zCredentialList.getc                 C   r   r   r   r   r   r   r   __call__  r   zCredentialList.__call__c                 C   r~   )rO   z&<Twilio.IpMessaging.V2.CredentialList>r   r6   r   r   r   r`     r   zCredentialList.__repr__)NN)!r   r   r   r   r*   r   rg   r   rd   rc   rf   r   r   r   r   intr   r   r	   r   r   r   r   r|   r   r   r   r   r3   r+   r   r`   rh   r   r   r0   r   r   u  s    





	
.





	
-











r   N)__doc__r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r3   r|   r   r   r   r   r   <module>   s    $ " )