o
    �¨Êh25  ã                   @   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                       s|   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
ejejfdd„Zdd„ Zdd„ Zdd„ Z‡  ZS )ÚPublicKeyListú  c                    s.   t t| ƒ |¡ i | _djdi | j¤Ž| _dS )a  
        Initialize the PublicKeyList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.accounts.v1.credential.public_key.PublicKeyList
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyList
        z/Credentials/PublicKeysN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversion©Ú	__class__r
   ú_/var/www/html/env/lib/python3.10/site-packages/twilio/rest/accounts/v1/credential/public_key.pyr      s   	zPublicKeyList.__init__Nc                 C   s6   | j  ||¡}| j|d d�}| j  ||d |d ¡S )aÍ  
        Streams PublicKeyInstance 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.accounts.v1.credential.public_key.PublicKeyInstance]
        Ú	page_size)r   ÚlimitÚ
page_limit)Ú_versionÚread_limitsÚpageÚstream)r   r   r   Úlimitsr   r
   r
   r   r   #   s   zPublicKeyList.streamc                 C   s   t | j||d�ƒS )am  
        Lists PublicKeyInstance 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.accounts.v1.credential.public_key.PublicKeyInstance]
        )r   r   )Úlistr   )r   r   r   r
   r
   r   r   :   s   zPublicKeyList.listc                 C   s6   t  |||dœ¡}| jjd| j|d�}t| j|| jƒS )aÏ  
        Retrieve a single page of PublicKeyInstance 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 PublicKeyInstance
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyPage
        )Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   Úofr   r   r   ÚPublicKeyPager   )r   Ú
page_tokenÚpage_numberr   r"   Úresponser
   r
   r   r   L   s   ýzPublicKeyList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )aG  
        Retrieve a specific page of PublicKeyInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PublicKeyInstance
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyPage
        r    )r   ÚdomainÚtwilioÚrequestr$   r   )r   Ú
target_urlr'   r
   r
   r   Úget_pagec   s
   

þzPublicKeyList.get_pagec                 C   s2   t  |||dœ¡}| jjd| j|d�}t| j|ƒS )a¶  
        Create a new PublicKeyInstance

        :param unicode public_key: URL encoded representation of the public key
        :param unicode friendly_name: A human readable description of this resource
        :param unicode account_sid: The Subaccount this Credential should be associated with.

        :returns: Newly created PublicKeyInstance
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
        )Ú	PublicKeyÚFriendlyNameÚ
AccountSidÚPOST©Údata)r   r#   r   Úcreater   ÚPublicKeyInstance)r   Ú
public_keyÚfriendly_nameÚaccount_sidr2   Úpayloadr
   r
   r   r3   t   s   ýýzPublicKeyList.createc                 C   ó   t | j|d�S ©a  
        Constructs a PublicKeyContext

        :param sid: Fetch by unique Credential Sid

        :returns: twilio.rest.accounts.v1.credential.public_key.PublicKeyContext
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyContext
        ©Úsid©ÚPublicKeyContextr   ©r   r<   r
   r
   r   ÚgetŽ   ó   	zPublicKeyList.getc                 C   r9   r:   r=   r?   r
   r
   r   Ú__call__™   rA   zPublicKeyList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z"<Twilio.Accounts.V1.PublicKeyList>r
   ©r   r
   r
   r   Ú__repr__¤   ó   zPublicKeyList.__repr__)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   Úunsetr   r,   r3   r@   rB   rF   Ú__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 )aE  
        Initialize the PublicKeyPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.accounts.v1.credential.public_key.PublicKeyPage
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyPage
        N)r   r$   r   r   )r   r   r'   Úsolutionr   r
   r   r   ±   s   

zPublicKeyPage.__init__c                 C   s   t | j|ƒS )a  
        Build an instance of PublicKeyInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
        )r4   r   )r   r8   r
   r
   r   Úget_instanceÀ   s   	zPublicKeyPage.get_instancec                 C   rC   )rD   z"<Twilio.Accounts.V1.PublicKeyPage>r
   rE   r
   r
   r   rF   Ë   rG   zPublicKeyPage.__repr__)rH   rI   rJ   rK   r   rO   rF   rM   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 )r>   r	   c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )aI  
        Initialize the PublicKeyContext

        :param Version version: Version that contains the resource
        :param sid: Fetch by unique Credential Sid

        :returns: twilio.rest.accounts.v1.credential.public_key.PublicKeyContext
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyContext
        r<   z/Credentials/PublicKeys/{sid}Nr
   )r   r>   r   r   r   r   )r   r   r<   r   r
   r   r   Ø   s   

zPublicKeyContext.__init__c                 C   s4   t  i ¡}| jjd| j|d�}t| j|| jd d�S )ú¨
        Fetch a PublicKeyInstance

        :returns: Fetched PublicKeyInstance
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
        r    r!   r<   r;   )r   r#   r   Úfetchr   r4   r   )r   r"   r8   r
   r
   r   rQ   è   s   
ýzPublicKeyContext.fetchc                 C   s8   t  d|i¡}| jjd| j|d�}t| j|| jd d�S )á   
        Update the PublicKeyInstance

        :param unicode friendly_name: A human readable description of this resource

        :returns: Updated PublicKeyInstance
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
        r.   r0   r1   r<   r;   )r   r#   r   Úupdater   r4   r   )r   r6   r2   r8   r
   r
   r   rS   ù   s   	ýzPublicKeyContext.updatec                 C   s   | j  d| j¡S )ú€
        Deletes the PublicKeyInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rU   r   rE   r
   r
   r   rU     s   zPublicKeyContext.deletec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rD   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr
   r
   r   Ú	<genexpr>  ó   € z,PublicKeyContext.__repr__.<locals>.<genexpr>z(<Twilio.Accounts.V1.PublicKeyContext {}>©Újoinr   Úitemsr   ©r   Úcontextr
   r
   r   rF     ó   
zPublicKeyContext.__repr__)rH   rI   rJ   rK   r   rQ   r   rL   rS   rU   rF   rM   r
   r
   r   r   r>   Õ   s    	r>   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
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 )r4   r	   Nc                    sf   t t| ƒ |¡ |d |d |d t |d ¡t |d ¡|d dœ| _d| _d|p.| jd i| _dS )	zÕ
        Initialize the PublicKeyInstance

        :returns: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
        r<   r7   r6   Údate_createdÚdate_updatedÚurl)r<   r7   r6   rg   rh   ri   N)r   r4   r   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   r8   r<   r   r
   r   r   #  s   ú
zPublicKeyInstance.__init__c                 C   s&   | j du rt| j| 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: PublicKeyContext for this PublicKeyInstance
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyContext
        Nr<   r;   )rl   r>   r   r   rE   r
   r
   r   Ú_proxy:  s   
	zPublicKeyInstance._proxyc                 C   ó
   | j d S )zq
        :returns: A 34 character string that uniquely identifies this resource.
        :rtype: unicode
        r<   ©rk   rE   r
   r
   r   r<   G  ó   
zPublicKeyInstance.sidc                 C   rn   )za
        :returns: AccountSid the Credential resource belongs to
        :rtype: unicode
        r7   ro   rE   r
   r
   r   r7   O  rp   zPublicKeyInstance.account_sidc                 C   rn   )za
        :returns: A human readable description of this resource
        :rtype: unicode
        r6   ro   rE   r
   r
   r   r6   W  rp   zPublicKeyInstance.friendly_namec                 C   rn   )zW
        :returns: The date this resource was created
        :rtype: datetime
        rg   ro   rE   r
   r
   r   rg   _  rp   zPublicKeyInstance.date_createdc                 C   rn   )z\
        :returns: The date this resource was last updated
        :rtype: datetime
        rh   ro   rE   r
   r
   r   rh   g  rp   zPublicKeyInstance.date_updatedc                 C   rn   )zx
        :returns: The URI for this resource, relative to `https://accounts.twilio.com`
        :rtype: unicode
        ri   ro   rE   r
   r
   r   ri   o  rp   zPublicKeyInstance.urlc                 C   ó
   | j  ¡ S )rP   )rm   rQ   rE   r
   r
   r   rQ   w  ó   
zPublicKeyInstance.fetchc                 C   s   | j j|d�S )rR   )r6   )rm   rS   )r   r6   r
   r
   r   rS   €  rA   zPublicKeyInstance.updatec                 C   rq   )rT   )rm   rU   rE   r
   r
   r   rU   ‹  rr   zPublicKeyInstance.deletec                 C   rV   )rD   rW   c                 s   rX   rY   rZ   r[   r
   r
   r   r_   ›  r`   z-PublicKeyInstance.__repr__.<locals>.<genexpr>z)<Twilio.Accounts.V1.PublicKeyInstance {}>ra   rd   r
   r
   r   rF   ”  rf   zPublicKeyInstance.__repr__)N)rH   rI   rJ   rK   r   Úpropertyrm   r<   r7   r6   rg   rh   ri   rQ   r   rL   rS   rU   rF   rM   r
   r
   r   r   r4      s*    






		r4   N)rK   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r$   r>   r4   r
   r
   r
   r   Ú<module>   s    'K