o
    e2                     @   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 )AwsListc                    s.   t t| | i | _djdi | j| _dS )z
        Initialize the AwsList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.accounts.v1.credential.aws.AwsList
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsList
        z/Credentials/AWSN )superr   __init__	_solutionformat_uri)selfversion	__class__r	   Y/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/accounts/v1/credential/aws.pyr      s   	zAwsList.__init__Nc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams AwsInstance 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.aws.AwsInstance]
        	page_size)r   limit)_versionread_limitspagestream)r   r   r   limitsr   r	   r	   r   r   "   s   zAwsList.streamc                 C   s   t | j||dS )aZ  
        Lists AwsInstance 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.aws.AwsInstance]
        )r   r   )listr   )r   r   r   r	   r	   r   r   9   s   zAwsList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of AwsInstance 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 AwsInstance
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsPage
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   AwsPager   )r   
page_tokenpage_numberr   dataresponser	   r	   r   r   K   s   zAwsList.pagec                 C   s"   | j jjd|}t| j || jS )a.  
        Retrieve a specific page of AwsInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AwsInstance
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsPage
        r   )r   domaintwiliorequestr#   r   )r   
target_urlr'   r	   r	   r   get_page^   s
   

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

        :param unicode credentials: A string that contains the AWS access credentials in the format <AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_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 AwsInstance
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsInstance
        )CredentialsFriendlyName
AccountSidPOSTr   r    r&   )r   r"   r   creater   AwsInstance)r   credentialsfriendly_nameaccount_sidr&   payloadr	   r	   r   r2   o   s   zAwsList.createc                 C      t | j|dS z
        Constructs a AwsContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.accounts.v1.credential.aws.AwsContext
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsContext
        sid
AwsContextr   r   r;   r	   r	   r   get      	zAwsList.getc                 C   r8   r9   r<   r>   r	   r	   r   __call__   r@   zAwsList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Accounts.V1.AwsList>r	   r   r	   r	   r   __repr__      zAwsList.__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 )a%  
        Initialize the AwsPage

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

        :returns: twilio.rest.accounts.v1.credential.aws.AwsPage
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsPage
        N)r
   r#   r   r   )r   r   r'   solutionr   r	   r   r      s   

zAwsPage.__init__c                 C   s   t | j|S )z
        Build an instance of AwsInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.accounts.v1.credential.aws.AwsInstance
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsInstance
        )r3   r   r   r7   r	   r	   r   get_instance   s   	zAwsPage.get_instancec                 C   rB   )rC   z<Twilio.Accounts.V1.AwsPage>r	   rD   r	   r	   r   rE      rF   zAwsPage.__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 )a9  
        Initialize the AwsContext

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

        :returns: twilio.rest.accounts.v1.credential.aws.AwsContext
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsContext
        r;   z/Credentials/AWS/{sid}Nr	   )r
   r=   r   r   r   r   )r   r   r;   r   r	   r   r      s   

zAwsContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the AwsInstance

        :returns: The fetched AwsInstance
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsInstance
        r   r   r    r;   r:   )r   fetchr   r3   r   rM   r	   r	   r   rQ      s   zAwsContext.fetchc                 C   s8   t d|i}| jjd| j|d}t| j|| jd dS )
        Update the AwsInstance

        :param unicode friendly_name: A string to describe the resource

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

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErP   )r   deleter   rD   r	   r	   r   rV      s   zAwsContext.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&AwsContext.__repr__.<locals>.<genexpr>z"<Twilio.Accounts.V1.AwsContext {}>joinr   itemsr   r   contextr	   r	   r   rE         
zAwsContext.__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 AwsInstance

        :returns: twilio.rest.accounts.v1.credential.aws.AwsInstance
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsInstance
        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AwsInstance.__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: AwsContext for this AwsInstance
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsContext
        Nr;   r:   )rm   r=   r   r   rD   r	   r	   r   _proxy$  s   
	zAwsInstance._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AwsInstance.sidc                 C   ro   )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r6   rp   rD   r	   r	   r   r6   9  rq   zAwsInstance.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AwsInstance.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AwsInstance.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AwsInstance.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AwsInstance.urlc                 C   
   | j  S )rO   )rn   rQ   rD   r	   r	   r   rQ   a     
zAwsInstance.fetchc                 C   s   | j j|dS )rR   )r5   )rn   rS   )r   r5   r	   r	   r   rS   j  r@   zAwsInstance.updatec                 C   rr   )rT   )rn   rV   rD   r	   r	   r   rV   u  rs   zAwsInstance.deletec                 C   rW   )rC   rX   c                 s   rY   rZ   r[   r\   r	   r	   r   r`     ra   z'AwsInstance.__repr__.<locals>.<genexpr>z#<Twilio.Accounts.V1.AwsInstance {}>rb   re   r	   r	   r   rE   ~  rg   zAwsInstance.__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    &@