o
    f>h=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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f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| _||pA| jd	| _d | _d S )
Nr   account_sidr   date_createddate_updatedalpha_sendercapabilitiesurlr   r   )super__init__getr   r   r   r
   iso8601_datetimer   r   r   r   r   	_solution_context)selfr   r   r   r   	__class__ `/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/messaging/v1/service/alpha_sender.pyr   %   s"   
zAlphaSenderInstance.__init__returnAlphaSenderContextc                 C   s.   | j du 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   
   | j  S )n
        Deletes the AlphaSenderInstance


        :returns: True if delete succeeds, False otherwise
        )r,   deleter+   r&   r&   r'   r/   Q      
zAlphaSenderInstance.deletec                       | 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'   r3   Z      z AlphaSenderInstance.delete_asyncc                 C   r-   )c
        Fetch the AlphaSenderInstance


        :returns: The fetched AlphaSenderInstance
        )r,   fetchr+   r&   r&   r'   r6   c   r0   zAlphaSenderInstance.fetchc                    r1   )}
        Asynchronous coroutine to fetch the AlphaSenderInstance


        :returns: The fetched AlphaSenderInstance
        N)r,   fetch_asyncr+   r&   r&   r'   r8   l   r4   zAlphaSenderInstance.fetch_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/AlphaSenderInstance.__repr__.<locals>.<genexpr>z,<Twilio.Messaging.V1.AlphaSenderInstance {}>joinr!   itemsr?   r#   contextr&   r&   r'   __repr__u      
zAlphaSenderInstance.__repr__N)r(   r)   )r(   r   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr,   boolr/   r3   r6   r8   rK   __classcell__r&   r&   r$   r'   r      s&    
	
	
		r   c                       sp   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fddZ  ZS )r)   r   r   r   c                    s0   t  | ||d| _djdi | 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}Nr&   r   r   r!   r?   _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/   rW   r#   r\   r&   r&   r'   r/      s   
zAlphaSenderContext.deletec                    s&   t i }| jjd| j|dI dH S )r2   rX   rY   N)r   r]   r*   r3   rW   r^   r&   r&   r'   r3      s
   
zAlphaSenderContext.delete_asyncc                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r5   application/jsonAcceptGETrY   r   r   r   )r   r]   r*   r6   rW   r   r!   r#   r\   r   r&   r&   r'   r6      s   
zAlphaSenderContext.fetchc                    sL   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r7   r_   r`   ra   rY   Nr   r   r   )r   r]   r*   r8   rW   r   r!   rb   r&   r&   r'   r8      s   
zAlphaSenderContext.fetch_asyncc                 C   r9   )r:   r;   c                 s   r<   r=   r>   r@   r&   r&   r'   rD      rE   z.AlphaSenderContext.__repr__.<locals>.<genexpr>z+<Twilio.Messaging.V1.AlphaSenderContext {}>rF   rI   r&   r&   r'   rK      rL   zAlphaSenderContext.__repr__)rN   rO   rP   r   rR   r   rT   r/   r3   r   r6   r8   rK   rU   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 )AlphaSenderPager   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      zAlphaSenderPage.get_instancec                 C      dS )r:   z%<Twilio.Messaging.V1.AlphaSenderPage>r&   r+   r&   r&   r'   rK         zAlphaSenderPage.__repr__N)	rN   rO   rP   r   rR   r   r   re   rK   r&   r&   r&   r'   rc      s    
rc   c                	       s  e Zd Zdedef fddZdedefddZ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 ))AlphaSenderListr   r   c                    s.   t  | d|i| _djdi | 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}/AlphaSendersNr&   rV   )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-urlencodedr_   r`   POSTrZ   r[   datar\   r   rd   )r   r]   r*   createrW   r   r!   r#   r   ro   r\   r   r&   r&   r'   rp     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
        rj   rk   rl   r_   r`   rm   rn   Nr   rd   )r   r]   r*   create_asyncrW   r   r!   rq   r&   r&   r'   rr   '  s   	
zAlphaSenderList.create_asyncNlimit	page_sizec                 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
        rt   rt   rs   )r*   read_limitspagestreamr#   rs   rt   limitsrw   r&   r&   r'   rx   C  s   zAlphaSenderList.streamc                    s8   | 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
        rt   ru   Nrs   )r*   rv   
page_asyncstream_asyncry   r&   r&   r'   r|   \  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
        rs   rt   )listrx   r#   rs   rt   r&   r&   r'   r~   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 rM   r&   )rA   recordr&   r&   r'   
<listcomp>  s
    z.AlphaSenderList.list_async.<locals>.<listcomp>r}   N)r|   r   r&   r&   r'   
list_async  s   
zAlphaSenderList.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 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
        	PageTokenr   PageSizerk   rl   r_   r`   ra   rZ   r[   paramsr\   )r   r]   r*   rw   rW   rc   r!   r#   r   r   rt   ro   r\   responser&   r&   r'   rw     s   
zAlphaSenderList.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 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
        r   rk   rl   r_   r`   ra   r   N)r   r]   r*   r{   rW   rc   r!   r   r&   r&   r'   r{     s   
zAlphaSenderList.page_async
target_urlc                 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
        ra   )r*   domaintwiliorequestrc   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
        ra   N)r*   r   r   request_asyncrc   r!   r   r&   r&   r'   get_page_async  s   	zAlphaSenderList.get_page_asyncr   c                 C      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     rf   zAlphaSenderList.getc                 C   r   r   r   r   r&   r&   r'   __call__  rf   zAlphaSenderList.__call__c                 C   rg   )r:   z%<Twilio.Messaging.V1.AlphaSenderList>r&   r+   r&   r&   r'   rK     rh   zAlphaSenderList.__repr__)NN) rN   rO   rP   r   rR   r   r   rp   rr   r   intr   rx   r	   r|   r   r~   r   r   unsetr   objectrc   rw   r{   r   r   r)   r   r   rK   rU   r&   r&   r$   r'   ri      s    







#



!

ri   N)rQ   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)   rc   ri   r&   r&   r&   r'   <module>   s    $fe