U
    ^g%iYW                     @   s   d Z ddlmZmZmZmZmZ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 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 - Numbers
    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.
    )AnyDictListOptionalUnionIteratorAsyncIterator)values)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s   e Zd ZG dd deZG dd deZG dd deZdeee	e
f ee	 d fd	d
ZeddddZd dddZd dddZe	dddZ  ZS )ApplicationInstancec                   @   s.   e Zd ZdZeeef dddZdd ZdS )z5ApplicationInstance.CreateShortCodeApplicationRequest
        :ivar friendly_name: The friendly name for the short code application.
        :ivar iso_country: The ISO country code.
        :ivar business_information:
        :ivar setup:
        payloadc                 C   s4   | d| _| d| _| d| _| d| _d S Nfriendly_nameiso_countrybusiness_informationsetupgetr   r   r   r   selfr    r   a/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/numbers/v2/application.py__init__"   s    z>ApplicationInstance.CreateShortCodeApplicationRequest.__init__c                 C   s:   | j | j| jd k	r| j nd | jd k	r2| j nd dS N)r   r   r   r   r   r   r   to_dictr   r   r   r   r   r!   -   s    z=ApplicationInstance.CreateShortCodeApplicationRequest.to_dictN	__name__
__module____qualname____doc__r   strr   r   r!   r   r   r   r   !CreateShortCodeApplicationRequest   s   r)   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )zHApplicationInstance.CreateShortCodeApplicationRequestBusinessInformationu
        :ivar customer_facing_profile: The Compliance Profile SID for the customer-facing business profile.
        r   c                 C   s   | d| _d S Ncustomer_facing_profiler   r,   r   r   r   r   r   >   s    zQApplicationInstance.CreateShortCodeApplicationRequestBusinessInformation.__init__c                 C   s
   d| j iS r+   r,   r"   r   r   r   r!   D   s     zPApplicationInstance.CreateShortCodeApplicationRequestBusinessInformation.to_dictNr#   r   r   r   r   4CreateShortCodeApplicationRequestBusinessInformation9   s   r/   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )z:ApplicationInstance.CreateShortCodeApplicationRequestSetup&
        :ivar charges_apply:
        r   c                 C   s   | d| _d S Ncharges_applyr   r2   r   r   r   r   r   N   s    zCApplicationInstance.CreateShortCodeApplicationRequestSetup.__init__c                 C   s
   d| j iS r1   r2   r"   r   r   r   r!   R   s     zBApplicationInstance.CreateShortCodeApplicationRequestSetup.to_dictNr#   r   r   r   r   &CreateShortCodeApplicationRequestSetupI   s   r5   N)versionr   sidc                    sn   t  | |d| _|d| _|d| _|d| _|d| _|d| _d|p^| ji| _	d | _
d S )Nr7   
bundle_sidapplication_requirements_sidr   r   state)superr   r   r7   r8   r9   r   r   r:   	_solution_context)r   r6   r   r7   	__class__r   r   r   `   s     zApplicationInstance.__init__ApplicationContext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: ApplicationContext for this ApplicationInstance
        Nr7   r7   )r=   r@   _versionr<   r"   r   r   r   _proxys   s    
zApplicationInstance._proxyc                 C   s
   | j  S )c
        Fetch the ApplicationInstance


        :returns: The fetched ApplicationInstance
        )rE   fetchr"   r   r   r   rG      s    zApplicationInstance.fetchc                    s   | j  I dH S )}
        Asynchronous coroutine to fetch the ApplicationInstance


        :returns: The fetched ApplicationInstance
        N)rE   fetch_asyncr"   r   r   r   rI      s    zApplicationInstance.fetch_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/ApplicationInstance.__repr__.<locals>.<genexpr>z*<Twilio.Numbers.V2.ApplicationInstance {}>joinr<   itemsrN   r   contextr   r   r   __repr__   s    zApplicationInstance.__repr__)N)r$   r%   r&   objectr)   r/   r5   r   r   r(   r   r   r   propertyrE   rG   rI   rY   __classcell__r   r   r>   r   r      s     
 		r   c                       s~   e Zd ZG dd deZG dd deZG dd deZeed fdd	Z	e
d
ddZe
d
ddZed
ddZ  ZS )r@   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )z4ApplicationContext.CreateShortCodeApplicationRequestr   r   c                 C   s4   | d| _| d| _| d| _| d| _d S r   r   r   r   r   r   r      s    z=ApplicationContext.CreateShortCodeApplicationRequest.__init__c                 C   s:   | j | j| jd k	r| j nd | jd k	r2| j nd dS r   r    r"   r   r   r   r!      s    z<ApplicationContext.CreateShortCodeApplicationRequest.to_dictNr#   r   r   r   r   r)      s   r)   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )zGApplicationContext.CreateShortCodeApplicationRequestBusinessInformationr*   r   c                 C   s   | d| _d S r+   r-   r   r   r   r   r      s    zPApplicationContext.CreateShortCodeApplicationRequestBusinessInformation.__init__c                 C   s
   d| j iS r+   r.   r"   r   r   r   r!      s     zOApplicationContext.CreateShortCodeApplicationRequestBusinessInformation.to_dictNr#   r   r   r   r   r/      s   r/   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )z9ApplicationContext.CreateShortCodeApplicationRequestSetupr0   r   c                 C   s   | d| _d S r1   r3   r   r   r   r   r      s    zBApplicationContext.CreateShortCodeApplicationRequestSetup.__init__c                 C   s
   d| j iS r1   r4   r"   r   r   r   r!      s     zAApplicationContext.CreateShortCodeApplicationRequestSetup.to_dictNr#   r   r   r   r   r5      s   r5   )r6   r7   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the ApplicationContext

        :param version: Version that contains the resource
        :param sid: The unique string that identifies the Short Code Application resource.
        r7   z/ShortCodes/Applications/{sid}N)r;   r   r<   rN   _uri)r   r6   r7   r>   r   r   r      s
     zApplicationContext.__init__rA   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )rF   application/jsonAcceptGETmethoduriheadersr7   rC   )r	   ofrD   rG   r]   r   r<   r   rd   r   r   r   r   rG      s    
zApplicationContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )rH   r^   r_   r`   ra   Nr7   rC   )r	   re   rD   rI   r]   r   r<   rf   r   r   r   rI      s    
  zApplicationContext.fetch_asyncc                 C   s$   d dd | j D }d|S )rJ   rK   c                 s   s   | ]\}}d  ||V  qdS rL   rM   rO   r   r   r   rS     s     z.ApplicationContext.__repr__.<locals>.<genexpr>z)<Twilio.Numbers.V2.ApplicationContext {}>rT   rW   r   r   r   rY     s    zApplicationContext.__repr__)r$   r%   r&   rZ   r)   r/   r5   r   r(   r   r   rG   rI   rY   r\   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 )ApplicationPage)r   rB   c                 C   s   t | j|S )zq
        Build an instance of ApplicationInstance

        :param payload: Payload response from the API
        )r   rD   r   r   r   r   get_instance"  s    zApplicationPage.get_instancerA   c                 C   s   dS )rJ   z#<Twilio.Numbers.V2.ApplicationPage>r   r"   r   r   r   rY   *  s    zApplicationPage.__repr__N)	r$   r%   r&   r   r(   r   r   rh   rY   r   r   r   r   rg      s   rg   c                       s  e Zd ZG dd deZG dd deZG dd deZed fdd	Zee	d
ddZ
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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 )/ApplicationListc                   @   s.   e Zd ZdZeeef dddZdd ZdS )z1ApplicationList.CreateShortCodeApplicationRequestr   r   c                 C   s4   | d| _| d| _| d| _| d| _d S r   r   r   r   r   r   r   =  s    z:ApplicationList.CreateShortCodeApplicationRequest.__init__c                 C   s:   | j | j| jd k	r| j nd | jd k	r2| j nd dS r   r    r"   r   r   r   r!   H  s    z9ApplicationList.CreateShortCodeApplicationRequest.to_dictNr#   r   r   r   r   r)   5  s   r)   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )zDApplicationList.CreateShortCodeApplicationRequestBusinessInformationr*   r   c                 C   s   | d| _d S r+   r-   r   r   r   r   r   Y  s    zMApplicationList.CreateShortCodeApplicationRequestBusinessInformation.__init__c                 C   s
   d| j iS r+   r.   r"   r   r   r   r!   _  s     zLApplicationList.CreateShortCodeApplicationRequestBusinessInformation.to_dictNr#   r   r   r   r   r/   T  s   r/   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )z6ApplicationList.CreateShortCodeApplicationRequestSetupr0   r   c                 C   s   | d| _d S r1   r3   r   r   r   r   r   i  s    z?ApplicationList.CreateShortCodeApplicationRequestSetup.__init__c                 C   s
   d| j iS r1   r4   r"   r   r   r   r!   m  s     z>ApplicationList.CreateShortCodeApplicationRequestSetup.to_dictNr#   r   r   r   r   r5   d  s   r5   )r6   c                    s   t  | d| _dS )zm
        Initialize the ApplicationList

        :param version: Version that contains the resource

        z/ShortCodes/ApplicationsN)r;   r   r]   )r   r6   r>   r   r   r   r  s    zApplicationList.__init__)%create_short_code_application_requestrB   c                 C   sH   |  }tddi}d|d< d|d< | jjd| j||d}t| j|S )z
        Create the ApplicationInstance

        :param create_short_code_application_request:

        :returns: The created ApplicationInstance
        Content-Type!application/x-www-form-urlencodedr^   r_   POSTrb   rc   datard   )r!   r	   re   rD   creater]   r   r   rj   ro   rd   r   r   r   r   rp   }  s    
   zApplicationList.createc                    sN   |  }tddi}d|d< d|d< | jjd| j||dI dH }t| j|S )z
        Asynchronously create the ApplicationInstance

        :param create_short_code_application_request:

        :returns: The created ApplicationInstance
        rk   rl   r^   r_   rm   rn   N)r!   r	   re   rD   create_asyncr]   r   rq   r   r   r   rr     s    
   zApplicationList.create_asyncN)limit	page_sizerB   c                 C   s0   | j ||}| j|d d}| j ||d S )aa  
        Streams ApplicationInstance 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
        rt   rt   rs   )rD   read_limitspagestreamr   rs   rt   Zlimitsrw   r   r   r   rx     s    zApplicationList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )ap  
        Asynchronously streams ApplicationInstance 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
        rt   ru   Nrs   )rD   rv   
page_asyncstream_asyncry   r   r   r   r{     s    zApplicationList.stream_asyncc                 C   s   t | j||dS )a  
        Lists ApplicationInstance 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
        rs   rt   )listrx   r   rs   rt   r   r   r   r}     s    zApplicationList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists ApplicationInstance 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   )rP   recordr   r   r   
<listcomp>  s   z.ApplicationList.list_async.<locals>.<listcomp>r|   N)r{   r~   r   r   r   
list_async  s    
zApplicationList.list_async)
page_tokenpage_numberrt   rB   c                 C   sJ   t |||d}t ddi}d|d< | jjd| j||d}t| j|S )a{  
        Retrieve a single page of ApplicationInstance 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 ApplicationInstance
        Z	PageTokenr   ZPageSizerk   rl   r^   r_   r`   rb   rc   paramsrd   )r	   re   rD   rw   r]   rg   r   r   r   rt   ro   rd   responser   r   r   rw     s       zApplicationList.pagec                    sP   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 ApplicationInstance 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 ApplicationInstance
        r   rk   rl   r^   r_   r`   r   N)r	   re   rD   rz   r]   rg   r   r   r   r   rz   5  s       zApplicationList.page_async)
target_urlrB   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of ApplicationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ApplicationInstance
        r`   )rD   domaintwiliorequestrg   r   r   r   r   r   r   get_pageV  s    	zApplicationList.get_pagec                    s$   | j jjd|I dH }t| j |S )a
  
        Asynchronously retrieve a specific page of ApplicationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ApplicationInstance
        r`   N)rD   r   r   Zrequest_asyncrg   r   r   r   r   get_page_asyncb  s    	zApplicationList.get_page_async)r7   rB   c                 C   s   t | j|dS z
        Constructs a ApplicationContext

        :param sid: The unique string that identifies the Short Code Application resource.
        rC   r@   rD   r   r7   r   r   r   r   n  s    zApplicationList.getc                 C   s   t | j|dS r   r   r   r   r   r   __call__v  s    zApplicationList.__call__rA   c                 C   s   dS )rJ   z#<Twilio.Numbers.V2.ApplicationList>r   r"   r   r   r   rY   ~  s    zApplicationList.__repr__)NN)NN)NN)NN)#r$   r%   r&   rZ   r)   r/   r5   r   r   r   rp   rr   r   intr   rx   r   r{   r   r}   r   r	   unsetr   r(   rg   rw   rz   r   r   r@   r   r   rY   r\   r   r   r>   r   ri   3  sz           


#


!ri   N)r'   typingr   r   r   r   r   r   r   Ztwilio.baser	   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   $  