o
    �¨ÊhÐ0  ã                   @   s�   d 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	 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
é    )Údeserialize)Úvalues)ÚInstanceContext)ÚInstanceResource)ÚListResource)ÚPagec                       sj   e Zd ZdZ‡ fdd„Zddd„Zddd„Zejejejfd	d
„Z	dd„ Z
dd„ Zdd„ Zdd„ Z‡  ZS )ÚKeyListú  c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )a=  
        Initialize the KeyList

        :param Version version: Version that contains the resource
        :param account_sid: A 34 character string that uniquely identifies this resource.

        :returns: twilio.rest.api.v2010.account.key.KeyList
        :rtype: twilio.rest.api.v2010.account.key.KeyList
        Úaccount_sidz!/Accounts/{account_sid}/Keys.jsonN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr
   ©Ú	__class__r   úS/var/www/html/env/lib/python3.10/site-packages/twilio/rest/api/v2010/account/key.pyr      s   

zKeyList.__init__Nc                 C   s6   | j  ||¡}| j|d d�}| j  ||d |d ¡S )aµ  
        Streams KeyInstance 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 int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.api.v2010.account.key.KeyInstance]
        Ú	page_size)r   ÚlimitÚ
page_limit)Ú_versionÚread_limitsÚpageÚstream)r   r   r   Úlimitsr   r   r   r   r   $   s   zKeyList.streamc                 C   s   t | j||d�ƒS )aU  
        Lists KeyInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.api.v2010.account.key.KeyInstance]
        )r   r   )Úlistr   )r   r   r   r   r   r   r   ;   s   zKeyList.listc                 C   s6   t  |||dœ¡}| jjd| j|d�}t| j|| jƒS )a±  
        Retrieve a single page of KeyInstance records from the API.
        Request is executed immediately

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

        :returns: Page of KeyInstance
        :rtype: twilio.rest.api.v2010.account.key.KeyPage
        )Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   Úofr   r   r   ÚKeyPager   )r   Ú
page_tokenÚpage_numberr   r#   Úresponser   r   r   r   M   s   ýzKeyList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )a)  
        Retrieve a specific page of KeyInstance records from the API.
        Request is executed immediately

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

        :returns: Page of KeyInstance
        :rtype: twilio.rest.api.v2010.account.key.KeyPage
        r!   )r   ÚdomainÚtwilioÚrequestr%   r   )r   Ú
target_urlr(   r   r   r   Úget_paged   s
   

þzKeyList.get_pagec                 C   ó   t | j| jd |d�S ©zÃ
        Constructs a KeyContext

        :param sid: The sid

        :returns: twilio.rest.api.v2010.account.key.KeyContext
        :rtype: twilio.rest.api.v2010.account.key.KeyContext
        r
   ©r
   Úsid©Ú
KeyContextr   r   ©r   r1   r   r   r   Úgetu   ó   	zKeyList.getc                 C   r.   r/   r2   r4   r   r   r   Ú__call__€   r6   zKeyList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Api.V2010.KeyList>r   ©r   r   r   r   Ú__repr__‹   ó   zKeyList.__repr__)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   Úunsetr   r-   r5   r7   r;   Ú__classcell__r   r   r   r   r      s    


ÿr   c                       s0   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Z‡  ZS )r%   r	   c                    s   t t| ƒ ||¡ || _dS )au  
        Initialize the KeyPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param account_sid: A 34 character string that uniquely identifies this resource.

        :returns: twilio.rest.api.v2010.account.key.KeyPage
        :rtype: twilio.rest.api.v2010.account.key.KeyPage
        N)r   r%   r   r   )r   r   r(   Úsolutionr   r   r   r   ˜   s   
zKeyPage.__init__c                 C   s   t | j|| jd d�S )zí
        Build an instance of KeyInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.key.KeyInstance
        :rtype: twilio.rest.api.v2010.account.key.KeyInstance
        r
   )r
   )ÚKeyInstancer   r   )r   Úpayloadr   r   r   Úget_instance¨   r6   zKeyPage.get_instancec                 C   r8   )r9   z<Twilio.Api.V2010.KeyPage>r   r:   r   r   r   r;   ³   r<   zKeyPage.__repr__)r=   r>   r?   r@   r   rF   r;   rB   r   r   r   r   r%   •   s
    r%   c                       sF   e Zd ZdZ‡ fdd„Zdd„ Zejfdd„Zdd	„ Z	d
d„ Z
‡  ZS )r3   r	   c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )a4  
        Initialize the KeyContext

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

        :returns: twilio.rest.api.v2010.account.key.KeyContext
        :rtype: twilio.rest.api.v2010.account.key.KeyContext
        r0   z'/Accounts/{account_sid}/Keys/{sid}.jsonNr   )r   r3   r   r   r   r   )r   r   r
   r1   r   r   r   r   À   s   zKeyContext.__init__c                 C   s<   t  i ¡}| jjd| j|d�}t| j|| jd | jd d�S )úŠ
        Fetch a KeyInstance

        :returns: Fetched KeyInstance
        :rtype: twilio.rest.api.v2010.account.key.KeyInstance
        r!   r"   r
   r1   r0   )r   r$   r   Úfetchr   rD   r   )r   r#   rE   r   r   r   rH   Ñ   s   
ýüzKeyContext.fetchc                 C   s@   t  d|i¡}| jjd| j|d�}t| j|| jd | jd d�S )á  
        Update the KeyInstance

        :param unicode friendly_name: A descriptive string for this resource, chosen by your application, up to 64 characters long.

        :returns: Updated KeyInstance
        :rtype: twilio.rest.api.v2010.account.key.KeyInstance
        ÚFriendlyNameÚPOST)Údatar
   r1   r0   )r   r$   r   Úupdater   rD   r   )r   Úfriendly_namerL   rE   r   r   r   rM   ç   s   	ýüzKeyContext.updatec                 C   s   | j  d| j¡S )úz
        Deletes the KeyInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rP   r   r:   r   r   r   rP   ÿ   s   zKeyContext.deletec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )r9   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>  ó   € z&KeyContext.__repr__.<locals>.<genexpr>z <Twilio.Api.V2010.KeyContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   r;     ó   
zKeyContext.__repr__)r=   r>   r?   r@   r   rH   r   rA   rM   rP   r;   rB   r   r   r   r   r3   ½   s    	r3   c                       s„   e Zd ZdZd‡ fdd„	Zedd„ ƒZedd„ ƒZed	d
„ ƒZedd„ ƒZ	edd„ ƒZ
dd„ Zejfdd„Zdd„ Zdd„ Z‡  ZS )rD   r	   Nc                    s\   t t| ƒ |¡ |d |d t |d ¡t |d ¡dœ| _d| _||p(| jd dœ| _dS )z«
        Initialize the KeyInstance

        :returns: twilio.rest.api.v2010.account.key.KeyInstance
        :rtype: twilio.rest.api.v2010.account.key.KeyInstance
        r1   rN   Údate_createdÚdate_updated)r1   rN   rb   rc   Nr0   )r   rD   r   r   Úrfc2822_datetimeÚ_propertiesÚ_contextr   )r   r   rE   r
   r1   r   r   r   r     s   üzKeyInstance.__init__c                 C   s.   | j du rt| j| jd | jd d�| _ | j S )a  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: KeyContext for this KeyInstance
        :rtype: twilio.rest.api.v2010.account.key.KeyContext
        Nr
   r1   r0   )rf   r3   r   r   r:   r   r   r   Ú_proxy+  s   
	ýzKeyInstance._proxyc                 C   ó
   | j d S )zp
        :returns: A 34 character string that uniquely identifies this API Key.
        :rtype: unicode
        r1   ©re   r:   r   r   r   r1   <  ó   
zKeyInstance.sidc                 C   rh   )z‘
        :returns: A descriptive string for this resource, chosen by your application, up to 64 characters long.
        :rtype: unicode
        rN   ri   r:   r   r   r   rN   D  rj   zKeyInstance.friendly_namec                 C   rh   )z{
        :returns: The date-time this API Key was created, given as a RFC 2822 Timestamp.
        :rtype: datetime
        rb   ri   r:   r   r   r   rb   L  rj   zKeyInstance.date_createdc                 C   rh   )zŠ
        :returns: The date-time this API Key was most recently updated, given as a  RFC 2822 Timestamp.
        :rtype: datetime
        rc   ri   r:   r   r   r   rc   T  rj   zKeyInstance.date_updatedc                 C   ó
   | j  ¡ S )rG   )rg   rH   r:   r   r   r   rH   \  ó   
zKeyInstance.fetchc                 C   s   | j j|d�S )rI   )rN   )rg   rM   )r   rN   r   r   r   rM   e  s   	zKeyInstance.updatec                 C   rk   )rO   )rg   rP   r:   r   r   r   rP   p  rl   zKeyInstance.deletec                 C   rQ   )r9   rR   c                 s   rS   rT   rU   rV   r   r   r   rZ   €  r[   z'KeyInstance.__repr__.<locals>.<genexpr>z!<Twilio.Api.V2010.KeyInstance {}>r\   r_   r   r   r   r;   y  ra   zKeyInstance.__repr__)N)r=   r>   r?   r@   r   Úpropertyrg   r1   rN   rb   rc   rH   r   rA   rM   rP   r;   rB   r   r   r   r   rD     s"    




		rD   N)r@   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r%   r3   rD   r   r   r   r   Ú<module>   s    (V