o
    e4                     @   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                       sx   e 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 )PublicKeyListc                    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/venv/lib/python3.10/site-packages/twilio/rest/accounts/v1/credential/public_key.pyr      s   	zPublicKeyList.__init__Nc                 C   s0   | j ||}| j|d d}| j ||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)_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   9   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)methoduriparams)r   ofr   r   r   PublicKeyPager   )r   
page_tokenpage_numberr   dataresponser	   r	   r   r   K   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_page^   s
   

zPublicKeyList.get_pagec                 C   s2   t |||d}| jjd| j|d}t| j|S )a  
        Create the PublicKeyInstance

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

        :returns: The created PublicKeyInstance
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
        )	PublicKeyFriendlyName
AccountSidPOSTr   r    r&   )r   r"   r   creater   PublicKeyInstance)r   
public_keyfriendly_nameaccount_sidr&   payloadr	   r	   r   r2   o   s   zPublicKeyList.createc                 C      t | j|dS a  
        Constructs a PublicKeyContext

        :param sid: The unique string that identifies the resource

        :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   r8   r9   r<   r>   r	   r	   r   __call__   r@   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__r   r   r   r   unsetr   r,   r2   r?   rA   rE   __classcell__r	   r	   r   r   r      s    



r   c                       s,   e Zd Z fddZdd Zdd Z  ZS )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
        )r3   r   r   r7   r	   r	   r   get_instance   s   	zPublicKeyPage.get_instancec                 C   rB   )rC   z"<Twilio.Accounts.V1.PublicKeyPage>r	   rD   r	   r	   r   rE      rF   zPublicKeyPage.__repr__)rG   rH   rI   r   rN   rE   rK   r	   r	   r   r   r#      s    r#   c                       sB   e 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=   c                    s2   t t| | d|i| _djdi | j| _dS )aY  
        Initialize the PublicKeyContext

        :param Version version: Version that contains the resource
        :param sid: The unique string that identifies the resource

        :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   s(   | j jd| jd}t| j || jd dS )
        Fetch the PublicKeyInstance

        :returns: The fetched PublicKeyInstance
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
        r   r   r    r;   r:   )r   fetchr   r3   r   rM   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 string to describe the resource

        :returns: The updated PublicKeyInstance
        :rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
        r.   r0   r1   r;   r:   )r   r"   r   updater   r3   r   )r   r5   r&   r7   r	   r	   r   rS      s   	zPublicKeyContext.updatec                 C   s   | j jd| jdS )
        Deletes the PublicKeyInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErP   )r   deleter   rD   r	   r	   r   rV      s   zPublicKeyContext.deletec                 C   $   d dd | j D }d|S )rC    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   rE         
zPublicKeyContext.__repr__)rG   rH   rI   r   rQ   r   rJ   rS   rV   rE   rK   r	   r	   r   r   r=      s    	r=   c                       s   e 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 )r3   Nc              	      sr   t t| | |d|d|dt|dt|d|dd| _d| _d|p4| 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;   r6   r5   date_createddate_updatedurl)r;   r6   r5   rh   ri   rj   N)	r
   r3   r   r?   r   iso8601_datetime_properties_contextr   )r   r   r7   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:   )rm   r=   r   r   rD   r	   r	   r   _proxy$  s   
	zPublicKeyInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r;   rl   rD   r	   r	   r   r;   1     
zPublicKeyInstance.sidc                 C   ro   )z
        :returns: The SID of the Account that created the Credential that the PublicKey resource belongs to
        :rtype: unicode
        r6   rp   rD   r	   r	   r   r6   9  rq   zPublicKeyInstance.account_sidc                 C   ro   )zi
        :returns: The string that you assigned to describe the resource
        :rtype: unicode
        r5   rp   rD   r	   r	   r   r5   A  rq   zPublicKeyInstance.friendly_namec                 C   ro   )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        rh   rp   rD   r	   r	   r   rh   I  rq   zPublicKeyInstance.date_createdc                 C   ro   )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        ri   rp   rD   r	   r	   r   ri   Q  rq   zPublicKeyInstance.date_updatedc                 C   ro   )zx
        :returns: The URI for this resource, relative to `https://accounts.twilio.com`
        :rtype: unicode
        rj   rp   rD   r	   r	   r   rj   Y  rq   zPublicKeyInstance.urlc                 C   
   | j  S )rO   )rn   rQ   rD   r	   r	   r   rQ   a     
zPublicKeyInstance.fetchc                 C   s   | j j|dS )rR   )r5   )rn   rS   )r   r5   r	   r	   r   rS   j  r@   zPublicKeyInstance.updatec                 C   rr   )rT   )rn   rV   rD   r	   r	   r   rV   u  rs   zPublicKeyInstance.deletec                 C   rW   )rC   rX   c                 s   rY   rZ   r[   r\   r	   r	   r   r`     ra   z-PublicKeyInstance.__repr__.<locals>.<genexpr>z)<Twilio.Accounts.V1.PublicKeyInstance {}>rb   re   r	   r	   r   rE   ~  rg   zPublicKeyInstance.__repr__)N)rG   rH   rI   r   propertyrn   r;   r6   r5   rh   ri   rj   rQ   r   rJ   rS   rV   rE   rK   r	   r	   r   r   r3     s(    






		r3   N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r#   r=   r3   r	   r	   r	   r   <module>   s    &@