o
    f>h_                     @   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dedeeef de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 )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| _||p;| 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
   iso8601_datetimer   r   r   	_solution_context)selfr   r   r   r   	__class__ h/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/verify/v2/service/messaging_configuration.pyr   $   s    
z'MessagingConfigurationInstance.__init__returnMessagingConfigurationContextc                 C   s.   | j du 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   
   | j  S )y
        Deletes the MessagingConfigurationInstance


        :returns: True if delete succeeds, False otherwise
        )r+   deleter*   r%   r%   r&   r.   O      
z%MessagingConfigurationInstance.deletec                       | 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&   r2   X      z+MessagingConfigurationInstance.delete_asyncc                 C   r,   )y
        Fetch the MessagingConfigurationInstance


        :returns: The fetched MessagingConfigurationInstance
        )r+   fetchr*   r%   r%   r&   r5   a   r/   z$MessagingConfigurationInstance.fetchc                    r0   )
        Asynchronous coroutine to fetch the MessagingConfigurationInstance


        :returns: The fetched MessagingConfigurationInstance
        N)r+   fetch_asyncr*   r%   r%   r&   r7   j   r3   z*MessagingConfigurationInstance.fetch_asyncr   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&   r:   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
        r9   N)r+   update_asyncr;   r%   r%   r&   r=      s   
z+MessagingConfigurationInstance.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>       z:MessagingConfigurationInstance.__repr__.<locals>.<genexpr>z4<Twilio.Verify.V2.MessagingConfigurationInstance {}>joinr    itemsrD   r"   contextr%   r%   r&   __repr__      
z'MessagingConfigurationInstance.__repr__N)r'   r(   )r'   r   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr+   boolr.   r2   r5   r7   r:   r=   rP   __classcell__r%   r%   r#   r&   r      s2    
	
	
		
r   c                       s   e Zd Zde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   r   c                    s0   t  | ||d| _djdi | 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}Nr%   r   r   r    rD   _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.   r\   r"   ra   r%   r%   r&   r.      s   
z$MessagingConfigurationContext.deletec                    s&   t i }| jjd| j|dI dH S )r1   r]   r^   N)r   rb   r)   r2   r\   rc   r%   r%   r&   r2      s
   
z*MessagingConfigurationContext.delete_asyncc                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r4   application/jsonAcceptGETr^   r   r   r   )r   rb   r)   r5   r\   r   r    r"   ra   r   r%   r%   r&   r5      s   
z#MessagingConfigurationContext.fetchc                    sL   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r6   rd   re   rf   r^   Nr   r   r   )r   rb   r)   r7   r\   r   r    rg   r%   r%   r&   r7      s   
z)MessagingConfigurationContext.fetch_asyncr   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 )r8   MessagingServiceSid!application/x-www-form-urlencodedContent-Typerd   re   POSTr_   r`   datara   r   r   r   )r   rb   r)   r:   r\   r   r    r"   r   rm   ra   r   r%   r%   r&   r:      s    	

z$MessagingConfigurationContext.updatec                    sd   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 )r<   rh   ri   rj   rd   re   rk   rl   Nr   r   r   )r   rb   r)   r=   r\   r   r    rn   r%   r%   r&   r=     s"   

z*MessagingConfigurationContext.update_asyncc                 C   r>   )r?   r@   c                 s   rA   rB   rC   rE   r%   r%   r&   rI   8  rJ   z9MessagingConfigurationContext.__repr__.<locals>.<genexpr>z3<Twilio.Verify.V2.MessagingConfigurationContext {}>rK   rN   r%   r%   r&   rP   2  rQ   z&MessagingConfigurationContext.__repr__)rS   rT   rU   r   rW   r   rY   r.   r2   r   r5   r7   r:   r=   rP   rZ   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 )MessagingConfigurationPager   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>     z'MessagingConfigurationPage.get_instancec                 C      dS )r?   z-<Twilio.Verify.V2.MessagingConfigurationPage>r%   r*   r%   r%   r&   rP   H     z#MessagingConfigurationPage.__repr__N)	rS   rT   rU   r   rW   r   r   rq   rP   r%   r%   r%   r&   ro   <  s    
ro   c                	       s  e Zd Zde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 ))MessagingConfigurationListr   r   c                    s.   t  | d|i| _djdi | 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}/MessagingConfigurationsNr%   r[   )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
        Countryrh   rj   ri   rd   re   rk   rl   r   rp   )r   rb   r)   creater\   r   r    r"   r   r   rm   ra   r   r%   r%   r&   rx   e  s   
z!MessagingConfigurationList.createc                    sb   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
        rv   rj   ri   rd   re   rk   rl   Nr   rp   )r   rb   r)   create_asyncr\   r   r    ry   r%   r%   r&   rz     s   
z'MessagingConfigurationList.create_asyncNlimit	page_sizec                 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
        r|   r|   r{   )r)   read_limitspagestreamr"   r{   r|   limitsr   r%   r%   r&   r     s   z!MessagingConfigurationList.streamc                    s8   | 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
        r|   r}   Nr{   )r)   r~   
page_asyncstream_asyncr   r%   r%   r&   r     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
        r{   r|   )listr   r"   r{   r|   r%   r%   r&   r     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 rR   r%   )rF   recordr%   r%   r&   
<listcomp>  s
    z9MessagingConfigurationList.list_async.<locals>.<listcomp>r   N)r   r   r%   r%   r&   
list_async  s   
z%MessagingConfigurationList.list_async
page_tokenpage_numberc                 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
        	PageTokenr   PageSizerj   ri   rd   re   rf   r_   r`   paramsra   )r   rb   r)   r   r\   ro   r    r"   r   r   r|   rm   ra   responser%   r%   r&   r     s   
zMessagingConfigurationList.pagec                    sV   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   rj   ri   rd   re   rf   r   N)r   rb   r)   r   r\   ro   r    r   r%   r%   r&   r   -  s   
z%MessagingConfigurationList.page_async
target_urlc                 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
        rf   )r)   domaintwiliorequestro   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
        rf   N)r)   r   r   request_asyncro   r    r   r%   r%   r&   get_page_asyncZ  s   	z)MessagingConfigurationList.get_page_asyncc                 C      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  rr   zMessagingConfigurationList.getc                 C   r   r   r   r   r%   r%   r&   __call__p  rr   z#MessagingConfigurationList.__call__c                 C   rs   )r?   z-<Twilio.Verify.V2.MessagingConfigurationList>r%   r*   r%   r%   r&   rP   z  rt   z#MessagingConfigurationList.__repr__)NN) rS   rT   rU   r   rW   r   r   rx   rz   r   intr   r   r	   r   r   r   r   r   unsetr   objectro   r   r   r   r   r(   r   r   rP   rZ   r%   r%   r#   r&   ru   Q  s    
 
"







#



!

ru   N)rV   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(   ro   ru   r%   r%   r%   r&   <module>   s    $~ &