U
    ^g%i_                     @   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 - Verify
    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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d dddZed dddZedddZ  ZS )MessagingConfigurationInstancea  
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource.
    :ivar service_sid: The SID of the [Service](https://www.twilio.com/docs/verify/api/service) that the resource is associated with.
    :ivar country: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`.
    :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration.
    :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 URL of this resource.
    N)versionpayloadservice_sidcountryc                    s   t  | |d| _|d| _|d| _|d| _t|d| _	t|d| _
|d| _||pv| jd| _d | _d S )	Naccount_sidr   r   messaging_service_siddate_createddate_updatedurlr   r   )super__init__getr   r   r   r   r
   Ziso8601_datetimer   r   r   	_solution_context)selfr   r   r   r   	__class__ t/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/verify/v2/service/messaging_configuration.pyr   $   s     z'MessagingConfigurationInstance.__init__MessagingConfigurationContextreturnc                 C   s.   | j dkr(t| j| jd | 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: MessagingConfigurationContext for this MessagingConfigurationInstance
        Nr   r   r   )r    r&   _versionr   r!   r$   r$   r%   _proxy?   s    
z%MessagingConfigurationInstance._proxyc                 C   s
   | j  S )y
        Deletes the MessagingConfigurationInstance


        :returns: True if delete succeeds, False otherwise
        )r+   deleter*   r$   r$   r%   r-   O   s    z%MessagingConfigurationInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the MessagingConfigurationInstance


        :returns: True if delete succeeds, False otherwise
        N)r+   delete_asyncr*   r$   r$   r%   r/   X   s    z+MessagingConfigurationInstance.delete_asyncc                 C   s
   | j  S )y
        Fetch the MessagingConfigurationInstance


        :returns: The fetched MessagingConfigurationInstance
        )r+   fetchr*   r$   r$   r%   r1   a   s    z$MessagingConfigurationInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the MessagingConfigurationInstance


        :returns: The fetched MessagingConfigurationInstance
        N)r+   fetch_asyncr*   r$   r$   r%   r3   j   s    z*MessagingConfigurationInstance.fetch_asyncr   r(   c                 C   s   | j j|dS )<  
        Update the MessagingConfigurationInstance

        :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration.

        :returns: The updated MessagingConfigurationInstance
        r   )r+   updater!   r   r$   r$   r%   r7   s   s    z%MessagingConfigurationInstance.updatec                    s   | j j|dI dH S )V  
        Asynchronous coroutine to update the MessagingConfigurationInstance

        :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration.

        :returns: The updated MessagingConfigurationInstance
        r6   N)r+   update_asyncr8   r$   r$   r%   r:      s    
z+MessagingConfigurationInstance.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:MessagingConfigurationInstance.__repr__.<locals>.<genexpr>z4<Twilio.Verify.V2.MessagingConfigurationInstance {}>joinr   itemsr?   r!   contextr$   r$   r%   __repr__   s    z'MessagingConfigurationInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr+   boolr-   r/   r1   r3   r7   r:   rJ   __classcell__r$   r$   r"   r%   r      s&    
				r   c                       s   e Zd Ze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e	dddZee	dddZedddZ  ZS )r&   )r   r   r   c                    s,   t  | ||d| _djf | j| _dS )a  
        Initialize the MessagingConfigurationContext

        :param version: Version that contains the resource
        :param service_sid: The SID of the [Service](https://www.twilio.com/docs/verify/api/service) that the resource is associated with.
        :param country: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`.
        r   z9/Services/{service_sid}/MessagingConfigurations/{country}Nr   r   r   r?   _uri)r!   r   r   r   r"   r$   r%   r      s    z&MessagingConfigurationContext.__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$MessagingConfigurationContext.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*MessagingConfigurationContext.delete_asyncc                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r0   application/jsonAcceptGETrV   r   r   r   )r   rZ   r)   r1   rT   r   r   r!   rY   r   r$   r$   r%   r1      s    
z#MessagingConfigurationContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r2   r\   r]   r^   rV   Nr   r   r   )r   rZ   r)   r3   rT   r   r   r_   r$   r$   r%   r3      s    
  z)MessagingConfigurationContext.fetch_asyncr4   c                 C   s\   t d|i}t i }d|d< d|d< | jjd| j||d}t| j|| jd | jd	 d
S )r5   MessagingServiceSid!application/x-www-form-urlencodedContent-Typer\   r]   POSTrW   rX   datarY   r   r   r   )r   rZ   r)   r7   rT   r   r   r!   r   re   rY   r   r$   r$   r%   r7      s(    	 
   z$MessagingConfigurationContext.updatec                    sb   t d|i}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 | jd
 dS )r9   r`   ra   rb   r\   r]   rc   rd   Nr   r   r   )r   rZ   r)   r:   rT   r   r   rf   r$   r$   r%   r:     s(     
   z*MessagingConfigurationContext.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%   rD   8  s     z9MessagingConfigurationContext.__repr__.<locals>.<genexpr>z3<Twilio.Verify.V2.MessagingConfigurationContext {}>rE   rH   r$   r$   r%   rJ   2  s    z&MessagingConfigurationContext.__repr__)rK   rL   rM   r   rO   r   rQ   r-   r/   r   r1   r3   r7   r:   rJ   rR   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 )MessagingConfigurationPage)r   r(   c                 C   s   t | j|| jd dS )z|
        Build an instance of MessagingConfigurationInstance

        :param payload: Payload response from the API
        r   r   )r   r)   r   )r!   r   r$   r$   r%   get_instance>  s
      z'MessagingConfigurationPage.get_instancer'   c                 C   s   dS )r;   z-<Twilio.Verify.V2.MessagingConfigurationPage>r$   r*   r$   r$   r%   rJ   H  s    z#MessagingConfigurationPage.__repr__N)	rK   rL   rM   r   rO   r   r   ri   rJ   r$   r$   r$   r%   rg   <  s   
rg   c                       s  e Zd Zeed fddZeeedddZ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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 ))MessagingConfigurationList)r   r   c                    s*   t  | d|i| _djf | j| _dS )a  
        Initialize the MessagingConfigurationList

        :param version: Version that contains the resource
        :param service_sid: The SID of the [Service](https://www.twilio.com/docs/verify/api/service) that the resource is associated with.

        r   z//Services/{service_sid}/MessagingConfigurationsNrS   )r!   r   r   r"   r$   r%   r   S  s     z#MessagingConfigurationList.__init__)r   r   r(   c                 C   sZ   t ||d}t ddi}d|d< d|d< | jjd| j||d}t| j|| jd d	S )
a   
        Create the MessagingConfigurationInstance

        :param country: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`.
        :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration.

        :returns: The created MessagingConfigurationInstance
        ZCountryr`   rb   ra   r\   r]   rc   rd   r   rh   )r   rZ   r)   createrT   r   r   r!   r   r   re   rY   r   r$   r$   r%   rl   e  s&         z!MessagingConfigurationList.createc                    s`   t ||d}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )a/  
        Asynchronously create the MessagingConfigurationInstance

        :param country: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`.
        :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration.

        :returns: The created MessagingConfigurationInstance
        rk   rb   ra   r\   r]   rc   rd   Nr   rh   )r   rZ   r)   create_asyncrT   r   r   rm   r$   r$   r%   rn     s&         z'MessagingConfigurationList.create_asyncN)limit	page_sizer(   c                 C   s0   | j ||}| j|d d}| j ||d S )al  
        Streams MessagingConfigurationInstance 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
        rp   rp   ro   )r)   read_limitspagestreamr!   ro   rp   Zlimitsrs   r$   r$   r%   rt     s    z!MessagingConfigurationList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )a{  
        Asynchronously streams MessagingConfigurationInstance 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
        rp   rq   Nro   )r)   rr   
page_asyncstream_asyncru   r$   r$   r%   rw     s    z'MessagingConfigurationList.stream_asyncc                 C   s   t | j||dS )a	  
        Lists MessagingConfigurationInstance 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
        ro   rp   )listrt   r!   ro   rp   r$   r$   r%   ry     s    zMessagingConfigurationList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists MessagingConfigurationInstance 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$   )rA   recordr$   r$   r%   
<listcomp>  s   z9MessagingConfigurationList.list_async.<locals>.<listcomp>rx   N)rw   rz   r$   r$   r%   
list_async  s    
z%MessagingConfigurationList.list_async)
page_tokenpage_numberrp   r(   c                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )a  
        Retrieve a single page of MessagingConfigurationInstance 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 MessagingConfigurationInstance
        Z	PageTokenr   ZPageSizerb   ra   r\   r]   r^   rW   rX   paramsrY   )r   rZ   r)   rs   rT   rg   r   r!   r~   r   rp   re   rY   responser$   r$   r%   rs     s       zMessagingConfigurationList.pagec                    sT   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|| jS )	a  
        Asynchronously retrieve a single page of MessagingConfigurationInstance 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 MessagingConfigurationInstance
        r   rb   ra   r\   r]   r^   r   N)r   rZ   r)   rv   rT   rg   r   r   r$   r$   r%   rv   -  s       z%MessagingConfigurationList.page_async)
target_urlr(   c                 C   s"   | j jjd|}t| j || jS )a  
        Retrieve a specific page of MessagingConfigurationInstance records from the API.
        Request is executed immediately

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

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

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

        :returns: Page of MessagingConfigurationInstance
        r^   N)r)   r   r   Zrequest_asyncrg   r   r   r$   r$   r%   get_page_asyncZ  s    	z)MessagingConfigurationList.get_page_async)r   r(   c                 C   s   t | j| jd |dS a!  
        Constructs a MessagingConfigurationContext

        :param country: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`.
        r   r   r&   r)   r   r!   r   r$   r$   r%   r   f  s
      zMessagingConfigurationList.getc                 C   s   t | j| jd |dS r   r   r   r$   r$   r%   __call__p  s
      z#MessagingConfigurationList.__call__r'   c                 C   s   dS )r;   z-<Twilio.Verify.V2.MessagingConfigurationList>r$   r*   r$   r$   r%   rJ   z  s    z#MessagingConfigurationList.__repr__)NN)NN)NN)NN) rK   rL   rM   r   rO   r   r   rl   rn   r   intr   rt   r	   rw   r   ry   r}   r   unsetr   objectrg   rs   rv   r   r   r&   r   r   rJ   rR   r$   r$   r"   r%   rj   Q  sx    ! "        


#


!

rj   N)rN   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   rj   r$   r$   r$   r%   <module>   s   $~ &