a
    !fT                     @   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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 - Preview
    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	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s   e Zd ZdZdeeeef 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jejfeeef eeef d dddZejejfeeef eeef d dddZedddZ  ZS )RatePlanInstancea\  
    :ivar sid:
    :ivar unique_name:
    :ivar account_sid:
    :ivar friendly_name:
    :ivar data_enabled:
    :ivar data_metering:
    :ivar data_limit:
    :ivar messaging_enabled:
    :ivar voice_enabled:
    :ivar national_roaming_enabled:
    :ivar international_roaming:
    :ivar date_created:
    :ivar date_updated:
    :ivar url:
    N)versionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _t	
|d| _|d| _|d	| _|d
| _|d| _t	|d| _t	|d| _|d| _d|p| ji| _d | _d S )Nr   unique_nameaccount_sidfriendly_namedata_enableddata_metering
data_limitmessaging_enabledvoice_enablednational_roaming_enabledinternational_roamingdate_createddate_updatedurl)super__init__getr   r   r   r   r   r   r
   integerr   r   r   r   r   iso8601_datetimer    r!   r"   	_solution_context)selfr   r   r   	__class__ g/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/preview/wireless/rate_plan.pyr$   -   s4    
zRatePlanInstance.__init__RatePlanContextreturnc                 C   s&   | j du 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: RatePlanContext for this RatePlanInstance
        Nr   r   )r)   r/   _versionr(   r*   r-   r-   r.   _proxyN   s    
zRatePlanInstance._proxyc                 C   s
   | j  S )k
        Deletes the RatePlanInstance


        :returns: True if delete succeeds, False otherwise
        )r5   deleter4   r-   r-   r.   r7   ]   s    zRatePlanInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the RatePlanInstance


        :returns: True if delete succeeds, False otherwise
        N)r5   delete_asyncr4   r-   r-   r.   r9   f   s    zRatePlanInstance.delete_asyncc                 C   s
   | j  S )]
        Fetch the RatePlanInstance


        :returns: The fetched RatePlanInstance
        )r5   fetchr4   r-   r-   r.   r;   o   s    zRatePlanInstance.fetchc                    s   | j  I dH S )w
        Asynchronous coroutine to fetch the RatePlanInstance


        :returns: The fetched RatePlanInstance
        N)r5   fetch_asyncr4   r-   r-   r.   r=   x   s    zRatePlanInstance.fetch_asyncr   r   r1   c                 C   s   | j j||dS )
        Update the RatePlanInstance

        :param unique_name:
        :param friendly_name:

        :returns: The updated RatePlanInstance
        r   r   )r5   updater*   r   r   r-   r-   r.   rA      s    zRatePlanInstance.updatec                    s   | j j||dI dH S )
        Asynchronous coroutine to update the RatePlanInstance

        :param unique_name:
        :param friendly_name:

        :returns: The updated RatePlanInstance
        r@   N)r5   update_asyncrB   r-   r-   r.   rD      s    zRatePlanInstance.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>       z,RatePlanInstance.__repr__.<locals>.<genexpr>z-<Twilio.Preview.Wireless.RatePlanInstance {}>joinr(   itemsrI   r*   contextr-   r-   r.   __repr__   s    zRatePlanInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r$   propertyr5   boolr7   r9   r;   r=   r   unsetr   objectrA   rD   rU   __classcell__r-   r-   r+   r.   r      s4    !			



r   c                       s   e Zd Z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jejfeeef eeef e	dddZejejfeeef eeef e	dddZedddZ  ZS )r/   )r   r   c                    s.   t  | d|i| _djf i | j| _dS )z
        Initialize the RatePlanContext

        :param version: Version that contains the resource
        :param sid:
        r   z/RatePlans/{sid}N)r#   r$   r(   rI   _uri)r*   r   r   r+   r-   r.   r$      s    zRatePlanContext.__init__r0   c                 C   s   | j jd| jdS )r6   DELETEmethoduri)r3   r7   r`   r4   r-   r-   r.   r7      s    zRatePlanContext.deletec                    s   | j jd| jdI dH S )r8   ra   rb   N)r3   r9   r`   r4   r-   r-   r.   r9      s    zRatePlanContext.delete_asyncc                 C   s(   | j jd| jd}t| j || jd dS )r:   GETrb   r   r2   )r3   r;   r`   r   r(   r*   r   r-   r-   r.   r;      s    zRatePlanContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r<   re   rb   Nr   r2   )r3   r=   r`   r   r(   rf   r-   r-   r.   r=      s    zRatePlanContext.fetch_asyncr>   c                 C   s:   t ||d}| jjd| j|d}t| j|| jd dS )r?   
UniqueNameFriendlyNamePOSTrc   rd   datar   r2   )r   ofr3   rA   r`   r   r(   r*   r   r   rl   r   r-   r-   r.   rA      s    zRatePlanContext.updatec                    s@   t ||d}| jjd| j|dI dH }t| j|| jd dS )rC   rg   rj   rk   Nr   r2   )r   rm   r3   rD   r`   r   r(   rn   r-   r-   r.   rD     s    zRatePlanContext.update_asyncc                 C   s$   d dd | j D }d|S )rE   rF   c                 s   s   | ]\}}d  ||V  qdS rG   rH   rJ   r-   r-   r.   rN   ;  rO   z+RatePlanContext.__repr__.<locals>.<genexpr>z,<Twilio.Preview.Wireless.RatePlanContext {}>rP   rS   r-   r-   r.   rU   5  s    zRatePlanContext.__repr__)rV   rW   rX   r   rZ   r$   r\   r7   r9   r   r;   r=   r   r]   r   r^   rA   rD   rU   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 )RatePlanPage)r   r1   c                 C   s   t | j|S )zn
        Build an instance of RatePlanInstance

        :param payload: Payload response from the API
        )r   r3   rf   r-   r-   r.   get_instance@  s    zRatePlanPage.get_instancer0   c                 C   s   dS )rE   z&<Twilio.Preview.Wireless.RatePlanPage>r-   r4   r-   r-   r.   rU   H  s    zRatePlanPage.__repr__N)	rV   rW   rX   r   rZ   r   r   rp   rU   r-   r-   r-   r.   ro   ?  s   ro   c                       s  e Zd Zed fddZejejejejejejejejejejf
eee	f eee	f ee
e	f eee	f eee	f ee
e	f ee
e	f ee
e	f ee
e	f eee e	f edddZejejejejejejejejejejf
eee	f eee	f ee
e	f eee	f eee	f ee
e	f ee
e	f ee
e	f ee
e	f eee e	f 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 ))RatePlanList)r   c                    s   t  | d| _dS )zj
        Initialize the RatePlanList

        :param version: Version that contains the resource

        z
/RatePlansN)r#   r$   r`   )r*   r   r+   r-   r.   r$   R  s    zRatePlanList.__init__)r   r   r   r   r   r   r   commands_enabledr   r   r1   c                 C   sL   t |||||||||	t|
dd d
}| jjd| j|d}t| j|S )a  
        Create the RatePlanInstance

        :param unique_name:
        :param friendly_name:
        :param data_enabled:
        :param data_limit:
        :param data_metering:
        :param messaging_enabled:
        :param voice_enabled:
        :param commands_enabled:
        :param national_roaming_enabled:
        :param international_roaming:

        :returns: The created RatePlanInstance
        c                 S   s   | S Nr-   er-   r-   r.   <lambda>  rO   z%RatePlanList.create.<locals>.<lambda>
rh   ri   ZDataEnabledZ	DataLimitZDataMeteringZMessagingEnabledZVoiceEnabledZCommandsEnabledZNationalRoamingEnabledZInternationalRoamingrj   rk   )r   rm   r   mapr3   creater`   r   r*   r   r   r   r   r   r   r   rr   r   r   rl   r   r-   r-   r.   ry   ]  s*    zRatePlanList.createc                    sR   t |||||||||	t|
dd d
}| jjd| j|dI dH }t| j|S )a  
        Asynchronously create the RatePlanInstance

        :param unique_name:
        :param friendly_name:
        :param data_enabled:
        :param data_limit:
        :param data_metering:
        :param messaging_enabled:
        :param voice_enabled:
        :param commands_enabled:
        :param national_roaming_enabled:
        :param international_roaming:

        :returns: The created RatePlanInstance
        c                 S   s   | S rs   r-   rt   r-   r-   r.   rv     rO   z+RatePlanList.create_async.<locals>.<lambda>rw   rj   rk   N)r   rm   r   rx   r3   create_asyncr`   r   rz   r-   r-   r.   r{     s*    zRatePlanList.create_asyncN)limit	page_sizer1   c                 C   s0   | j ||}| j|d d}| j ||d S )a^  
        Streams RatePlanInstance 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|   )r3   read_limitspagestreamr*   r|   r}   Zlimitsr   r-   r-   r.   r     s    zRatePlanList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )am  
        Asynchronously streams RatePlanInstance 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|   )r3   r   
page_asyncstream_asyncr   r-   r-   r.   r     s    zRatePlanList.stream_asyncc                 C   s   t | j||dS )a  
        Lists RatePlanInstance 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RatePlanList.listc                    s$   dd | j ||dI dH 2 I dH S )a
  
        Asynchronously lists RatePlanInstance 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 rs   r-   )rK   recordr-   r-   r.   
<listcomp>(  s   z+RatePlanList.list_async.<locals>.<listcomp>r   N)r   r   r-   r-   r.   
list_async  s    
zRatePlanList.list_async)
page_tokenpage_numberr}   r1   c                 C   s2   t |||d}| jjd| j|d}t| j|S )au  
        Retrieve a single page of RatePlanInstance 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 RatePlanInstance
        Z	PageTokenr   ZPageSizere   rc   rd   params)r   rm   r3   r   r`   ro   r*   r   r   r}   rl   responser-   r-   r.   r   0  s    zRatePlanList.pagec                    s8   t |||d}| jjd| j|dI dH }t| j|S )a  
        Asynchronously retrieve a single page of RatePlanInstance 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 RatePlanInstance
        r   re   r   N)r   rm   r3   r   r`   ro   r   r-   r-   r.   r   K  s    zRatePlanList.page_async)
target_urlr1   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of RatePlanInstance records from the API.
        Request is executed immediately

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

        :returns: Page of RatePlanInstance
        re   )r3   domaintwiliorequestro   r*   r   r   r-   r-   r.   get_pageh  s    	zRatePlanList.get_pagec                    s$   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of RatePlanInstance records from the API.
        Request is executed immediately

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

        :returns: Page of RatePlanInstance
        re   N)r3   r   r   Zrequest_asyncro   r   r-   r-   r.   get_page_asynct  s    	zRatePlanList.get_page_async)r   r1   c                 C   s   t | j|dS zC
        Constructs a RatePlanContext

        :param sid:
        r2   r/   r3   r*   r   r-   r-   r.   r%     s    zRatePlanList.getc                 C   s   t | j|dS r   r   r   r-   r-   r.   __call__  s    zRatePlanList.__call__r0   c                 C   s   dS )rE   z&<Twilio.Preview.Wireless.RatePlanList>r-   r4   r-   r-   r.   rU     s    zRatePlanList.__repr__)NN)NN)NN)NN)!rV   rW   rX   r   r$   r   r]   r   rZ   r^   r\   intr   r   ry   r{   r   r   r   r	   r   r   r   ro   r   r   r   r   r/   r%   r   rU   r_   r-   r-   r+   r.   rq   Q  s   








8








8        





rq   N)rY   r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   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/   ro   rq   r-   r-   r-   r.   <module>   s   $  