U
    ^g%iP                     @   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 - Accounts
    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 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 )AwsInstancea  
    :ivar sid: The unique string that we created to identify the AWS resource.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AWS resource.
    :ivar friendly_name: The string that you assigned to describe the resource.
    :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    :ivar url: The URI for this resource, relative to `https://accounts.twilio.com`
    N)versionpayloadsidc                    sz   t  | |d| _|d| _|d| _t|d| _t|d| _	|d| _
d|pj| ji| _d | _d S )Nr   account_sidfriendly_namedate_createddate_updatedurl)super__init__getr   r   r   r
   Ziso8601_datetimer   r   r   	_solution_context)selfr   r   r   	__class__ e/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/accounts/v1/credential/aws.pyr   #   s     zAwsInstance.__init__
AwsContextreturnc                 C   s&   | j dkr t| j| 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: AwsContext for this AwsInstance
        Nr   r   )r   r$   _versionr   r   r"   r"   r#   _proxy8   s    
zAwsInstance._proxyc                 C   s
   | j  S )f
        Deletes the AwsInstance


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


        :returns: True if delete succeeds, False otherwise
        N)r*   delete_asyncr)   r"   r"   r#   r.   P   s    zAwsInstance.delete_asyncc                 C   s
   | j  S )S
        Fetch the AwsInstance


        :returns: The fetched AwsInstance
        )r*   fetchr)   r"   r"   r#   r0   Y   s    zAwsInstance.fetchc                    s   | j  I dH S )m
        Asynchronous coroutine to fetch the AwsInstance


        :returns: The fetched AwsInstance
        N)r*   fetch_asyncr)   r"   r"   r#   r2   b   s    zAwsInstance.fetch_asyncr   r&   c                 C   s   | j j|dS )
        Update the AwsInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.

        :returns: The updated AwsInstance
        r   )r*   updater   r   r"   r"   r#   r6   k   s    zAwsInstance.updatec                    s   | j j|dI dH S )
        Asynchronous coroutine to update the AwsInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.

        :returns: The updated AwsInstance
        r5   N)r*   update_asyncr7   r"   r"   r#   r9   w   s    
zAwsInstance.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'AwsInstance.__repr__.<locals>.<genexpr>z#<Twilio.Accounts.V1.AwsInstance {}>joinr   itemsr>   r   contextr"   r"   r#   __repr__   s    zAwsInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr*   boolr,   r.   r0   r2   r   unsetr   objectr6   r9   rI   __classcell__r"   r"   r    r#   r      s(   
  
 				
r   c                       s   e Zd Z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   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the AwsContext

        :param version: Version that contains the resource
        :param sid: The Twilio-provided string that uniquely identifies the AWS resource to update.
        r   z/Credentials/AWS/{sid}N)r   r   r   r>   _uri)r   r   r   r    r"   r#   r      s
     zAwsContext.__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AwsContext.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AwsContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r/   application/jsonAcceptGETrV   r   r'   )r   rZ   r(   r0   rT   r   r   r   rY   r   r"   r"   r#   r0      s    
zAwsContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r1   r\   r]   r^   rV   Nr   r'   )r   rZ   r(   r2   rT   r   r   r_   r"   r"   r#   r2      s    
  zAwsContext.fetch_asyncr3   c                 C   sT   t d|i}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
r4   FriendlyName!application/x-www-form-urlencodedContent-Typer\   r]   POSTrW   rX   datarY   r   r'   )r   rZ   r(   r6   rT   r   r   r   r   re   rY   r   r"   r"   r#   r6      s    	 
   zAwsContext.updatec                    sZ   t d|i}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )r8   r`   ra   rb   r\   r]   rc   rd   Nr   r'   )r   rZ   r(   r9   rT   r   r   rf   r"   r"   r#   r9      s     
   zAwsContext.update_asyncc                 C   s$   d dd | j D }d|S )r:   r;   c                 s   s   | ]\}}d  ||V  qdS r<   r=   r?   r"   r"   r#   rC      s     z&AwsContext.__repr__.<locals>.<genexpr>z"<Twilio.Accounts.V1.AwsContext {}>rD   rG   r"   r"   r#   rI     s    zAwsContext.__repr__)rJ   rK   rL   r   rN   r   rP   r,   r.   r   r0   r2   r   rQ   r   rR   r6   r9   rI   rS   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 )AwsPage)r   r&   c                 C   s   t | j|S )zi
        Build an instance of AwsInstance

        :param payload: Payload response from the API
        )r   r(   )r   r   r"   r"   r#   get_instance&  s    zAwsPage.get_instancer%   c                 C   s   dS )r:   z<Twilio.Accounts.V1.AwsPage>r"   r)   r"   r"   r#   rI   .  s    zAwsPage.__repr__N)	rJ   rK   rL   r   rN   r   r   rh   rI   r"   r"   r"   r#   rg   $  s   rg   c                       s  e Zd Zed fddZejejfeeee	f eee	f e
dddZejejfeeee	f eee	f 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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 ))AwsList)r   c                    s   t  | d| _dS )ze
        Initialize the AwsList

        :param version: Version that contains the resource

        z/Credentials/AWSN)r   r   rT   )r   r   r    r"   r#   r   9  s    zAwsList.__init__)credentialsr   r   r&   c                 C   sR   t |||d}t ddi}d|d< d|d< | jjd| j||d}t| j|S )aR  
        Create the AwsInstance

        :param credentials: A string that contains the AWS access credentials in the format `<AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY>`. For example, `AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`
        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
        :param account_sid: The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request.

        :returns: The created AwsInstance
        Credentialsr`   Z
AccountSidrb   ra   r\   r]   rc   rd   )r   rZ   r(   createrT   r   r   rj   r   r   re   rY   r   r"   r"   r#   rm   D  s        zAwsList.createc                    sX   t |||d}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|S )	aa  
        Asynchronously create the AwsInstance

        :param credentials: A string that contains the AWS access credentials in the format `<AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY>`. For example, `AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`
        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
        :param account_sid: The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request.

        :returns: The created AwsInstance
        rk   rb   ra   r\   r]   rc   rd   N)r   rZ   r(   create_asyncrT   r   rn   r"   r"   r#   ro   g  s        zAwsList.create_asyncN)limit	page_sizer&   c                 C   s0   | j ||}| j|d d}| j ||d S )aY  
        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 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
        rq   rq   rp   )r(   read_limitspagestreamr   rp   rq   Zlimitsrt   r"   r"   r#   ru     s    zAwsList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )ah  
        Asynchronously 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 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
        rq   rr   Nrp   )r(   rs   
page_asyncstream_asyncrv   r"   r"   r#   rx     s    zAwsList.stream_asyncc                 C   s   t | j||dS )a  
        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 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
        rp   rq   )listru   r   rp   rq   r"   r"   r#   rz     s    zAwsList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously 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 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&AwsList.list_async.<locals>.<listcomp>ry   N)rx   r{   r"   r"   r#   
list_async  s    
zAwsList.list_async)
page_tokenpage_numberrq   r&   c                 C   sJ   t |||d}t ddi}d|d< | jjd| j||d}t| j|S )ak  
        Retrieve a single page of AwsInstance 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 AwsInstance
        Z	PageTokenr   ZPageSizerb   ra   r\   r]   r^   rW   rX   paramsrY   )r   rZ   r(   rt   rT   rg   r   r   r   rq   re   rY   responser"   r"   r#   rt     s       zAwsList.pagec                    sP   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|S )	az  
        Asynchronously retrieve a single page of AwsInstance 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 AwsInstance
        r   rb   ra   r\   r]   r^   r   N)r   rZ   r(   rw   rT   rg   r   r"   r"   r#   rw     s       zAwsList.page_async)
target_urlr&   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of AwsInstance records from the API.
        Request is executed immediately

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

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

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

        :returns: Page of AwsInstance
        r^   N)r(   r   r   Zrequest_asyncrg   r   r"   r"   r#   get_page_async?  s    	zAwsList.get_page_async)r   r&   c                 C   s   t | j|dS z
        Constructs a AwsContext

        :param sid: The Twilio-provided string that uniquely identifies the AWS resource to update.
        r'   r$   r(   r   r   r"   r"   r#   r   K  s    zAwsList.getc                 C   s   t | j|dS r   r   r   r"   r"   r#   __call__S  s    zAwsList.__call__r%   c                 C   s   dS )r:   z<Twilio.Accounts.V1.AwsList>r"   r)   r"   r"   r#   rI   [  s    zAwsList.__repr__)NN)NN)NN)NN) rJ   rK   rL   r   r   r   rQ   rN   r   rR   r   rm   ro   r   intr   ru   r	   rx   r   rz   r~   rg   rt   rw   r   r   r$   r   r   rI   rS   r"   r"   r    r#   ri   7  s   

&

%        


#


!ri   N)rM   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   $v 