U
    ^g%i=K                     @   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 - Messaging
    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Z  ZS )AlphaSenderInstancea  
    :ivar sid: The unique string that we created to identify the AlphaSender resource.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AlphaSender resource.
    :ivar service_sid: The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the resource is associated with.
    :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar alpha_sender: The Alphanumeric Sender ID string.
    :ivar capabilities: An array of values that describe whether the number can receive calls or messages. Can be: `SMS`.
    :ivar url: The absolute URL of the AlphaSender resource.
    N)versionpayloadservice_sidsidc                    s   t  | |d| _|d| _|d| _t|d| _t|d| _	|d| _
|d| _|d| _||p| jd	| _d | _d S )
Nr   account_sidr   date_createddate_updatedalpha_sendercapabilitiesurlr   r   )super__init__getr   r   r   r
   Ziso8601_datetimer   r   r   r   r   	_solution_context)selfr   r   r   r   	__class__ l/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/messaging/v1/service/alpha_sender.pyr   %   s"    zAlphaSenderInstance.__init__AlphaSenderContextreturnc                 C   s.   | j dkr(t| j| jd | 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: AlphaSenderContext for this AlphaSenderInstance
        Nr   r   r   )r!   r'   _versionr    r"   r%   r%   r&   _proxyA   s    
zAlphaSenderInstance._proxyc                 C   s
   | j  S )n
        Deletes the AlphaSenderInstance


        :returns: True if delete succeeds, False otherwise
        )r,   deleter+   r%   r%   r&   r.   Q   s    zAlphaSenderInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the AlphaSenderInstance


        :returns: True if delete succeeds, False otherwise
        N)r,   delete_asyncr+   r%   r%   r&   r0   Z   s    z AlphaSenderInstance.delete_asyncc                 C   s
   | j  S )c
        Fetch the AlphaSenderInstance


        :returns: The fetched AlphaSenderInstance
        )r,   fetchr+   r%   r%   r&   r2   c   s    zAlphaSenderInstance.fetchc                    s   | j  I dH S )}
        Asynchronous coroutine to fetch the AlphaSenderInstance


        :returns: The fetched AlphaSenderInstance
        N)r,   fetch_asyncr+   r%   r%   r&   r4   l   s    zAlphaSenderInstance.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/AlphaSenderInstance.__repr__.<locals>.<genexpr>z,<Twilio.Messaging.V1.AlphaSenderInstance {}>joinr    itemsr9   r"   contextr%   r%   r&   __repr__u   s    zAlphaSenderInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr,   boolr.   r0   r2   r4   rD   __classcell__r%   r%   r#   r&   r      s    
				r   c                       sl   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dddZ  ZS )r'   )r   r   r   c                    s,   t  | ||d| _djf | j| _dS )a:  
        Initialize the AlphaSenderContext

        :param version: Version that contains the resource
        :param service_sid: The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the resource from.
        :param sid: The SID of the AlphaSender resource to fetch.
        r   z*/Services/{service_sid}/AlphaSenders/{sid}Nr   r   r    r9   _uri)r"   r   r   r   r#   r%   r&   r      s    zAlphaSenderContext.__init__r(   c                 C   s   t i }| jjd| j|dS )r-   DELETEmethoduriheaders)r   ofr*   r.   rN   r"   rS   r%   r%   r&   r.      s    
zAlphaSenderContext.deletec                    s$   t i }| jjd| j|dI dH S )r/   rO   rP   N)r   rT   r*   r0   rN   rU   r%   r%   r&   r0      s    
  zAlphaSenderContext.delete_asyncc                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r1   application/jsonAcceptGETrP   r   r   r   )r   rT   r*   r2   rN   r   r    r"   rS   r   r%   r%   r&   r2      s    
zAlphaSenderContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r3   rV   rW   rX   rP   Nr   r   r   )r   rT   r*   r4   rN   r   r    rY   r%   r%   r&   r4      s    
  zAlphaSenderContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r5   r6   c                 s   s   | ]\}}d  ||V  qdS r7   r8   r:   r%   r%   r&   r>      s     z.AlphaSenderContext.__repr__.<locals>.<genexpr>z+<Twilio.Messaging.V1.AlphaSenderContext {}>r?   rB   r%   r%   r&   rD      s    zAlphaSenderContext.__repr__)rE   rF   rG   r   rI   r   rK   r.   r0   r   r2   r4   rD   rL   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 )AlphaSenderPage)r   r)   c                 C   s   t | j|| jd dS )zq
        Build an instance of AlphaSenderInstance

        :param payload: Payload response from the API
        r   r   )r   r*   r    )r"   r   r%   r%   r&   get_instance   s
      zAlphaSenderPage.get_instancer(   c                 C   s   dS )r5   z%<Twilio.Messaging.V1.AlphaSenderPage>r%   r+   r%   r%   r&   rD      s    zAlphaSenderPage.__repr__N)	rE   rF   rG   r   rI   r   r   r\   rD   r%   r%   r%   r&   rZ      s   
rZ   c                       s  e Zd Ze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 ))AlphaSenderList)r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the AlphaSenderList

        :param version: Version that contains the resource
        :param service_sid: The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to read the resources from.

        r   z$/Services/{service_sid}/AlphaSendersNrM   )r"   r   r   r#   r%   r&   r      s
     zAlphaSenderList.__init__)r   r)   c                 C   sX   t d|i}t ddi}d|d< d|d< | jjd| j||d}t| j|| jd d	S )
aP  
        Create the AlphaSenderInstance

        :param alpha_sender: The Alphanumeric Sender ID string. Can be up to 11 characters long. Valid characters are A-Z, a-z, 0-9, space, hyphen `-`, plus `+`, underscore `_` and ampersand `&`. This value cannot contain only numbers.

        :returns: The created AlphaSenderInstance
        AlphaSenderContent-Type!application/x-www-form-urlencodedrV   rW   POSTrQ   rR   datarS   r   r[   )r   rT   r*   createrN   r   r    r"   r   rc   rS   r   r%   r%   r&   rd     s&    	      zAlphaSenderList.createc                    s^   t d|i}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 AlphaSenderInstance

        :param alpha_sender: The Alphanumeric Sender ID string. Can be up to 11 characters long. Valid characters are A-Z, a-z, 0-9, space, hyphen `-`, plus `+`, underscore `_` and ampersand `&`. This value cannot contain only numbers.

        :returns: The created AlphaSenderInstance
        r^   r_   r`   rV   rW   ra   rb   Nr   r[   )r   rT   r*   create_asyncrN   r   r    re   r%   r%   r&   rf   '  s&    	      zAlphaSenderList.create_asyncN)limit	page_sizer)   c                 C   s0   | j ||}| j|d d}| j ||d S )aa  
        Streams AlphaSenderInstance 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
        rh   rh   rg   )r*   read_limitspagestreamr"   rg   rh   Zlimitsrk   r%   r%   r&   rl   C  s    zAlphaSenderList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )ap  
        Asynchronously streams AlphaSenderInstance 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
        rh   ri   Nrg   )r*   rj   
page_asyncstream_asyncrm   r%   r%   r&   ro   \  s    zAlphaSenderList.stream_asyncc                 C   s   t | j||dS )a  
        Lists AlphaSenderInstance 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
        rg   rh   )listrl   r"   rg   rh   r%   r%   r&   rq   u  s    zAlphaSenderList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists AlphaSenderInstance 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.AlphaSenderList.list_async.<locals>.<listcomp>rp   N)ro   rr   r%   r%   r&   
list_async  s    
zAlphaSenderList.list_async)
page_tokenpage_numberrh   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 AlphaSenderInstance 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 AlphaSenderInstance
        Z	PageTokenr   ZPageSizer_   r`   rV   rW   rX   rQ   rR   paramsrS   )r   rT   r*   rk   rN   rZ   r    r"   rv   rw   rh   rc   rS   responser%   r%   r&   rk     s       zAlphaSenderList.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 AlphaSenderInstance 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 AlphaSenderInstance
        rx   r_   r`   rV   rW   rX   ry   N)r   rT   r*   rn   rN   rZ   r    r{   r%   r%   r&   rn     s       zAlphaSenderList.page_async)
target_urlr)   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of AlphaSenderInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AlphaSenderInstance
        rX   )r*   domaintwiliorequestrZ   r    r"   r}   r|   r%   r%   r&   get_page  s    	zAlphaSenderList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a
  
        Asynchronously retrieve a specific page of AlphaSenderInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AlphaSenderInstance
        rX   N)r*   r~   r   Zrequest_asyncrZ   r    r   r%   r%   r&   get_page_async  s    	zAlphaSenderList.get_page_async)r   r)   c                 C   s   t | j| jd |dS zt
        Constructs a AlphaSenderContext

        :param sid: The SID of the AlphaSender resource to fetch.
        r   r   r'   r*   r    r"   r   r%   r%   r&   r     s
      zAlphaSenderList.getc                 C   s   t | j| jd |dS r   r   r   r%   r%   r&   __call__  s
      zAlphaSenderList.__call__r(   c                 C   s   dS )r5   z%<Twilio.Messaging.V1.AlphaSenderList>r%   r+   r%   r%   r&   rD     s    zAlphaSenderList.__repr__)NN)NN)NN)NN) rE   rF   rG   r   rI   r   r   rd   rf   r   intr   rl   r	   ro   r   rq   ru   r   unsetr   objectrZ   rk   rn   r   r   r'   r   r   rD   rL   r%   r%   r#   r&   r]      sl           


#


!

r]   N)rH   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'   rZ   r]   r%   r%   r%   r&   <module>   s   $fe