o
    f>h_J                     @   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 - Microvisor
    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dedeeef dee f fddZ	e
dd
dZdefddZdefddZdddZdddZdedd fddZdedd fddZdefddZ  ZS )AccountConfigInstancez
    :ivar key: The config key; up to 100 characters.
    :ivar date_updated:
    :ivar value: The config value; up to 4096 characters.
    :ivar url: The absolute URL of the Config.
    Nversionpayloadkeyc                    s\   t  | |d| _t|d| _|d| _|d| _d|p&| ji| _	d | _
d S )Nr   date_updatedvalueurl)super__init__getr   r
   iso8601_datetimer   r   r   	_solution_context)selfr   r   r   	__class__ [/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/microvisor/v1/account_config.pyr   !   s   

zAccountConfigInstance.__init__returnAccountConfigContextc                 C   s&   | j du 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: AccountConfigContext for this AccountConfigInstance
        Nr   r   )r   r$   _versionr   r   r!   r!   r"   _proxy2   s   
zAccountConfigInstance._proxyc                 C   
   | j  S )p
        Deletes the AccountConfigInstance


        :returns: True if delete succeeds, False otherwise
        )r(   deleter'   r!   r!   r"   r+   A      
zAccountConfigInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the AccountConfigInstance


        :returns: True if delete succeeds, False otherwise
        N)r(   delete_asyncr'   r!   r!   r"   r/   J      z"AccountConfigInstance.delete_asyncc                 C   r)   )g
        Fetch the AccountConfigInstance


        :returns: The fetched AccountConfigInstance
        )r(   fetchr'   r!   r!   r"   r2   S   r,   zAccountConfigInstance.fetchc                    r-   )
        Asynchronous coroutine to fetch the AccountConfigInstance


        :returns: The fetched AccountConfigInstance
        N)r(   fetch_asyncr'   r!   r!   r"   r4   \   r0   z!AccountConfigInstance.fetch_asyncr   c                 C   s   | j j|dS )
        Update the AccountConfigInstance

        :param value: The config value; up to 4096 characters.

        :returns: The updated AccountConfigInstance
        r   )r(   updater   r   r!   r!   r"   r7   e   s   zAccountConfigInstance.updatec                    s   | j j|dI dH S )
        Asynchronous coroutine to update the AccountConfigInstance

        :param value: The config value; up to 4096 characters.

        :returns: The updated AccountConfigInstance
        r6   N)r(   update_asyncr8   r!   r!   r"   r:   q   s   z"AccountConfigInstance.update_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr!   r!   r"   	<genexpr>       z1AccountConfigInstance.__repr__.<locals>.<genexpr>z/<Twilio.Microvisor.V1.AccountConfigInstance {}>joinr   itemsrA   r   contextr!   r!   r"   __repr__}      
zAccountConfigInstance.__repr__N)r#   r$   )r#   r   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr(   boolr+   r/   r2   r4   r7   r:   rM   __classcell__r!   r!   r   r"   r      s&    
	
	
		r   c                       s   e Zd Zdedef fddZdefddZdefdd	Zde	fd
dZ
de	fddZdede	fddZdede	fddZdefddZ  ZS )r$   r   r   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the AccountConfigContext

        :param version: Version that contains the resource
        :param key: The config key; up to 100 characters.
        r   z/Configs/{key}Nr!   )r   r   r   rA   _uri)r   r   r   r   r!   r"   r      s   zAccountConfigContext.__init__r#   c                 C   s   t i }| jjd| j|dS )r*   DELETEmethoduriheaders)r   ofr&   r+   rX   r   r]   r!   r!   r"   r+      s   
zAccountConfigContext.deletec                    s&   t i }| jjd| j|dI dH S )r.   rY   rZ   N)r   r^   r&   r/   rX   r_   r!   r!   r"   r/      s
   
z!AccountConfigContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r1   application/jsonAcceptGETrZ   r   r%   )r   r^   r&   r2   rX   r   r   r   r]   r   r!   r!   r"   r2      s   
zAccountConfigContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r3   r`   ra   rb   rZ   Nr   r%   )r   r^   r&   r4   rX   r   r   rc   r!   r!   r"   r4      s   
z AccountConfigContext.fetch_asyncr   c                 C   sT   t d|i}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
r5   Value!application/x-www-form-urlencodedContent-Typer`   ra   POSTr[   r\   datar]   r   r%   )r   r^   r&   r7   rX   r   r   r   r   ri   r]   r   r!   r!   r"   r7      s   	

zAccountConfigContext.updatec                    s\   t d|i}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )r9   rd   re   rf   r`   ra   rg   rh   Nr   r%   )r   r^   r&   r:   rX   r   r   rj   r!   r!   r"   r:      s   	

z!AccountConfigContext.update_asyncc                 C   r;   )r<   r=   c                 s   r>   r?   r@   rB   r!   r!   r"   rF     rG   z0AccountConfigContext.__repr__.<locals>.<genexpr>z.<Twilio.Microvisor.V1.AccountConfigContext {}>rH   rK   r!   r!   r"   rM     rN   zAccountConfigContext.__repr__)rP   rQ   rR   r   rT   r   rV   r+   r/   r   r2   r4   r7   r:   rM   rW   r!   r!   r   r"   r$      s    r$   c                   @   s4   e Zd Zdeeef defddZdefddZdS )AccountConfigPager   r#   c                 C   s   t | j|S )zs
        Build an instance of AccountConfigInstance

        :param payload: Payload response from the API
        )r   r&   )r   r   r!   r!   r"   get_instance  s   zAccountConfigPage.get_instancec                 C      dS )r<   z(<Twilio.Microvisor.V1.AccountConfigPage>r!   r'   r!   r!   r"   rM   $     zAccountConfigPage.__repr__N)	rP   rQ   rR   r   rT   r   r   rl   rM   r!   r!   r!   r"   rk     s    rk   c                	       s  e Zd Zdef fddZdededefddZdededefd	d
Z		d'de	e
 de	e
 dee fddZ		d'de	e
 de	e
 dee fddZ		d'de	e
 de	e
 dee fddZ		d'de	e
 de	e
 dee fddZejejejfdeeef dee
ef dee
ef defddZejejejfdeeef dee
ef dee
ef defddZdedefddZdedefdd Zdedefd!d"Zdedefd#d$Zdefd%d&Z  ZS )(AccountConfigListr   c                    s   t  | d| _dS )zo
        Initialize the AccountConfigList

        :param version: Version that contains the resource

        z/ConfigsN)r   r   rX   )r   r   r   r!   r"   r   /  s   
zAccountConfigList.__init__r   r   r#   c                 C   sP   t ||d}t ddi}d|d< d|d< | jjd| j||d}t| j|S )z
        Create the AccountConfigInstance

        :param key: The config key; up to 100 characters.
        :param value: The config value; up to 4096 characters.

        :returns: The created AccountConfigInstance
        Keyrd   rf   re   r`   ra   rg   rh   )r   r^   r&   createrX   r   r   r   r   ri   r]   r   r!   r!   r"   rr   :  s   

zAccountConfigList.createc                    sX   t ||d}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|S )	z
        Asynchronously create the AccountConfigInstance

        :param key: The config key; up to 100 characters.
        :param value: The config value; up to 4096 characters.

        :returns: The created AccountConfigInstance
        rp   rf   re   r`   ra   rg   rh   N)r   r^   r&   create_asyncrX   r   rs   r!   r!   r"   rt   V  s   

zAccountConfigList.create_asyncNlimit	page_sizec                 C   s0   | j ||}| j|d d}| j ||d S )ac  
        Streams AccountConfigInstance 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
        rv   rv   ru   )r&   read_limitspagestreamr   ru   rv   limitsry   r!   r!   r"   rz   r  s   zAccountConfigList.streamc                    s8   | j ||}| j|d dI dH }| j ||d S )ar  
        Asynchronously streams AccountConfigInstance 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
        rv   rw   Nru   )r&   rx   
page_asyncstream_asyncr{   r!   r!   r"   r~     s   zAccountConfigList.stream_asyncc                 C   s   t | j||dS )a   
        Lists AccountConfigInstance 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
        ru   rv   )listrz   r   ru   rv   r!   r!   r"   r     s   zAccountConfigList.listc                    s&   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists AccountConfigInstance 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 rO   r!   )rC   recordr!   r!   r"   
<listcomp>  s
    z0AccountConfigList.list_async.<locals>.<listcomp>r   N)r~   r   r!   r!   r"   
list_async  s   
zAccountConfigList.list_async
page_tokenpage_numberc                 C   sJ   t |||d}t ddi}d|d< | jjd| j||d}t| j|S )a  
        Retrieve a single page of AccountConfigInstance 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 AccountConfigInstance
        	PageTokenr   PageSizerf   re   r`   ra   rb   r[   r\   paramsr]   )r   r^   r&   ry   rX   rk   r   r   r   rv   ri   r]   responser!   r!   r"   ry     s   
zAccountConfigList.pagec                    sR   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|S )	a  
        Asynchronously retrieve a single page of AccountConfigInstance 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 AccountConfigInstance
        r   rf   re   r`   ra   rb   r   N)r   r^   r&   r}   rX   rk   r   r!   r!   r"   r}     s   
zAccountConfigList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of AccountConfigInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AccountConfigInstance
        rb   )r&   domaintwiliorequestrk   r   r   r   r!   r!   r"   get_page  s   	zAccountConfigList.get_pagec                    s&   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of AccountConfigInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AccountConfigInstance
        rb   N)r&   r   r   request_asyncrk   r   r!   r!   r"   get_page_async'  s   	z AccountConfigList.get_page_asyncc                 C      t | j|dS zn
        Constructs a AccountConfigContext

        :param key: The config key; up to 100 characters.
        r%   r$   r&   r   r   r!   r!   r"   r   3     zAccountConfigList.getc                 C   r   r   r   r   r!   r!   r"   __call__;  r   zAccountConfigList.__call__c                 C   rm   )r<   z(<Twilio.Microvisor.V1.AccountConfigList>r!   r'   r!   r!   r"   rM   C  rn   zAccountConfigList.__repr__)NN) rP   rQ   rR   r   r   rT   r   rr   rt   r   intr   rz   r	   r~   r   r   r   r   unsetr   objectrk   ry   r}   r   r   r$   r   r   rM   rW   r!   r!   r   r"   ro   -  s    







#



!ro   N)rS   r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r$   rk   ro   r!   r!   r!   r"   <module>   s    $n 