U
    ^g%iG                     @   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 - Api
    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                       s   e Zd ZdZdeeeef eee d fddZ	e
dddd	Zedd
dZedddZd dddZd dddZejfeeef d dddZejfeeef d dddZedddZ  ZS )SigningKeyInstancez]
    :ivar sid:
    :ivar friendly_name:
    :ivar date_created:
    :ivar date_updated:
    N)versionpayloadaccount_sidsidc                    sd   t  | |d| _|d| _t|d| _t|d| _||pR| jd| _	d | _
d S )Nr   friendly_namedate_createddate_updatedr   r   )super__init__getr   r   r
   Zrfc2822_datetimer   r   	_solution_context)selfr   r   r   r   	__class__ h/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/api/v2010/account/signing_key.pyr   !   s    zSigningKeyInstance.__init__SigningKeyContextreturnc                 C   s.   | j dkr(t| j| jd | 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: SigningKeyContext for this SigningKeyInstance
        Nr   r   r   )r   r$   _versionr   r   r"   r"   r#   _proxy9   s    
zSigningKeyInstance._proxyc                 C   s
   | j  S )m
        Deletes the SigningKeyInstance


        :returns: True if delete succeeds, False otherwise
        )r)   deleter(   r"   r"   r#   r+   I   s    zSigningKeyInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the SigningKeyInstance


        :returns: True if delete succeeds, False otherwise
        N)r)   delete_asyncr(   r"   r"   r#   r-   R   s    zSigningKeyInstance.delete_asyncc                 C   s
   | j  S )a
        Fetch the SigningKeyInstance


        :returns: The fetched SigningKeyInstance
        )r)   fetchr(   r"   r"   r#   r/   [   s    zSigningKeyInstance.fetchc                    s   | j  I dH S ){
        Asynchronous coroutine to fetch the SigningKeyInstance


        :returns: The fetched SigningKeyInstance
        N)r)   fetch_asyncr(   r"   r"   r#   r1   d   s    zSigningKeyInstance.fetch_asyncr   r&   c                 C   s   | j j|dS )
        Update the SigningKeyInstance

        :param friendly_name:

        :returns: The updated SigningKeyInstance
        r   )r)   updater   r   r"   r"   r#   r5   m   s    
zSigningKeyInstance.updatec                    s   | j j|dI dH S )
        Asynchronous coroutine to update the SigningKeyInstance

        :param friendly_name:

        :returns: The updated SigningKeyInstance
        r4   N)r)   update_asyncr6   r"   r"   r#   r8   {   s    
zSigningKeyInstance.update_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr"   r"   r#   	<genexpr>   s     z.SigningKeyInstance.__repr__.<locals>.<genexpr>z(<Twilio.Api.V2010.SigningKeyInstance {}>joinr   itemsr=   r   contextr"   r"   r#   __repr__   s    zSigningKeyInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr)   boolr+   r-   r/   r1   r   unsetr   objectr5   r8   rH   __classcell__r"   r"   r    r#   r      s2    
			


r   c                       s   e Zd Zeeed fddZedddZedddZe	dd	d
Z
e	dddZejfeeef e	dddZejfeeef e	dddZedddZ  ZS )r$   )r   r   r   c                    s,   t  | ||d| _djf | j| _dS )z
        Initialize the SigningKeyContext

        :param version: Version that contains the resource
        :param account_sid:
        :param sid:
        r   z./Accounts/{account_sid}/SigningKeys/{sid}.jsonNr   r   r   r=   _uri)r   r   r   r   r    r"   r#   r      s    zSigningKeyContext.__init__r%   c                 C   s   t i }| jjd| j|dS )r*   DELETEmethoduriheaders)r   ofr'   r+   rT   r   rY   r"   r"   r#   r+      s    
zSigningKeyContext.deletec                    s$   t i }| jjd| j|dI dH S )r,   rU   rV   N)r   rZ   r'   r-   rT   r[   r"   r"   r#   r-      s    
  zSigningKeyContext.delete_asyncc                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r.   application/jsonAcceptGETrV   r   r   r   )r   rZ   r'   r/   rT   r   r   r   rY   r   r"   r"   r#   r/      s    
zSigningKeyContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r0   r\   r]   r^   rV   Nr   r   r   )r   rZ   r'   r1   rT   r   r   r_   r"   r"   r#   r1      s    
  zSigningKeyContext.fetch_asyncr2   c                 C   s\   t d|i}t i }d|d< d|d< | jjd| j||d}t| j|| jd | jd	 d
S )r3   FriendlyName!application/x-www-form-urlencodedContent-Typer\   r]   POSTrW   rX   datarY   r   r   r   )r   rZ   r'   r5   rT   r   r   r   r   re   rY   r   r"   r"   r#   r5      s(     
   zSigningKeyContext.updatec                    sb   t d|i}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 | jd
 dS )r7   r`   ra   rb   r\   r]   rc   rd   Nr   r   r   )r   rZ   r'   r8   rT   r   r   rf   r"   r"   r#   r8     s(     
   zSigningKeyContext.update_asyncc                 C   s$   d dd | j D }d|S )r9   r:   c                 s   s   | ]\}}d  ||V  qdS r;   r<   r>   r"   r"   r#   rB   6  s     z-SigningKeyContext.__repr__.<locals>.<genexpr>z'<Twilio.Api.V2010.SigningKeyContext {}>rC   rF   r"   r"   r#   rH   0  s    zSigningKeyContext.__repr__)rI   rJ   rK   r   rM   r   rO   r+   r-   r   r/   r1   r   rP   r   rQ   r5   r8   rH   rR   r"   r"   r    r#   r$      s    
"
!r$   c                   @   s2   e Zd Zeeef edddZedddZdS )SigningKeyPage)r   r&   c                 C   s   t | j|| jd dS )zp
        Build an instance of SigningKeyInstance

        :param payload: Payload response from the API
        r   )r   )r   r'   r   )r   r   r"   r"   r#   get_instance<  s
      zSigningKeyPage.get_instancer%   c                 C   s   dS )r9   z!<Twilio.Api.V2010.SigningKeyPage>r"   r(   r"   r"   r#   rH   F  s    zSigningKeyPage.__repr__N)	rI   rJ   rK   r   rM   r   r   rh   rH   r"   r"   r"   r#   rg   :  s   
rg   c                       sf  e Zd Zeed fddZd ee ee ee	 dddZ
d!ee ee ee	 ddd	Zd"ee ee ee	 dd
dZd#ee ee ee	 dddZejejejfeeef eeef eeef edddZejejejfeeef eeef eeef edddZeedddZeedddZeedddZeedddZedddZ  ZS )$SigningKeyList)r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the SigningKeyList

        :param version: Version that contains the resource
        :param account_sid:

        r   z(/Accounts/{account_sid}/SigningKeys.jsonNrS   )r   r   r   r    r"   r#   r   Q  s
     zSigningKeyList.__init__N)limit	page_sizer&   c                 C   s0   | j ||}| j|d d}| j ||d S )a`  
        Streams SigningKeyInstance 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
        rk   rk   rj   )r'   read_limitspagestreamr   rj   rk   Zlimitsrn   r"   r"   r#   ro   a  s    zSigningKeyList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )ao  
        Asynchronously streams SigningKeyInstance 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
        rk   rl   Nrj   )r'   rm   
page_asyncstream_asyncrp   r"   r"   r#   rr   z  s    zSigningKeyList.stream_asyncc                 C   s   t | j||dS )a  
        Lists SigningKeyInstance 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
        rj   rk   )listro   r   rj   rk   r"   r"   r#   rt     s    zSigningKeyList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists SigningKeyInstance 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 )Nr"   )r?   recordr"   r"   r#   
<listcomp>  s   z-SigningKeyList.list_async.<locals>.<listcomp>rs   N)rr   ru   r"   r"   r#   
list_async  s    
zSigningKeyList.list_async)
page_tokenpage_numberrk   r&   c                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )ay  
        Retrieve a single page of SigningKeyInstance 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 SigningKeyInstance
        Z	PageTokenr   ZPageSizerb   ra   r\   r]   r^   rW   rX   paramsrY   )r   rZ   r'   rn   rT   rg   r   r   ry   rz   rk   re   rY   responser"   r"   r#   rn     s       zSigningKeyList.pagec                    sT   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|| jS )	a  
        Asynchronously retrieve a single page of SigningKeyInstance 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 SigningKeyInstance
        r{   rb   ra   r\   r]   r^   r|   N)r   rZ   r'   rq   rT   rg   r   r~   r"   r"   r#   rq     s       zSigningKeyList.page_async)
target_urlr&   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of SigningKeyInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SigningKeyInstance
        r^   )r'   domaintwiliorequestrg   r   r   r   r   r"   r"   r#   get_page
  s    	zSigningKeyList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of SigningKeyInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SigningKeyInstance
        r^   N)r'   r   r   Zrequest_asyncrg   r   r   r"   r"   r#   get_page_async  s    	zSigningKeyList.get_page_async)r   r&   c                 C   s   t | j| jd |dS zE
        Constructs a SigningKeyContext

        :param sid:
        r   r   r$   r'   r   r   r   r"   r"   r#   r   "  s
      zSigningKeyList.getc                 C   s   t | j| jd |dS r   r   r   r"   r"   r#   __call__,  s
      zSigningKeyList.__call__r%   c                 C   s   dS )r9   z!<Twilio.Api.V2010.SigningKeyList>r"   r(   r"   r"   r#   rH   6  s    zSigningKeyList.__repr__)NN)NN)NN)NN)rI   rJ   rK   r   rM   r   r   intr   r   ro   r	   rr   r   rt   rx   r   rP   r   rQ   rg   rn   rq   r   r   r$   r   r   rH   rR   r"   r"   r    r#   ri   O  sh           


#


!

ri   N)rL   r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r$   rg   ri   r"   r"   r"   r#   <module>   s   $z (