o
    f>hZ                     @   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dedeeef 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ejejfdeeef deeef dd fddZejejfdeeef deeef dd fddZdef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|ph| 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__ Y/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/preview/wireless/rate_plan.pyr$   +   s4   

zRatePlanInstance.__init__returnRatePlanContextc                 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)   r0   _versionr(   r*   r-   r-   r.   _proxyL   s   
zRatePlanInstance._proxyc                 C   
   | j  S )k
        Deletes the RatePlanInstance


        :returns: True if delete succeeds, False otherwise
        )r4   deleter3   r-   r-   r.   r7   [      
zRatePlanInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the RatePlanInstance


        :returns: True if delete succeeds, False otherwise
        N)r4   delete_asyncr3   r-   r-   r.   r;   d      zRatePlanInstance.delete_asyncc                 C   r5   )]
        Fetch the RatePlanInstance


        :returns: The fetched RatePlanInstance
        )r4   fetchr3   r-   r-   r.   r>   m   r8   zRatePlanInstance.fetchc                    r9   )w
        Asynchronous coroutine to fetch the RatePlanInstance


        :returns: The fetched RatePlanInstance
        N)r4   fetch_asyncr3   r-   r-   r.   r@   v   r<   zRatePlanInstance.fetch_asyncr   r   c                 C   s   | j j||dS )
        Update the RatePlanInstance

        :param unique_name:
        :param friendly_name:

        :returns: The updated RatePlanInstance
        r   r   )r4   updater*   r   r   r-   r-   r.   rC      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
        rB   N)r4   update_asyncrD   r-   r-   r.   rF      s
   zRatePlanInstance.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,RatePlanInstance.__repr__.<locals>.<genexpr>z-<Twilio.Preview.Wireless.RatePlanInstance {}>joinr(   itemsrM   r*   contextr-   r-   r.   __repr__      
zRatePlanInstance.__repr__N)r/   r0   )r/   r   )__name__
__module____qualname____doc__r   r   strr   r   r$   propertyr4   boolr7   r;   r>   r@   r   unsetr   objectrC   rF   rY   __classcell__r-   r-   r+   r.   r      sF    
!	
	
	





r   c                       s   e Zd Z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ejejfdeeef deeef de	fddZejejfdeeef deeef de	fddZdefddZ  ZS )r0   r   r   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the RatePlanContext

        :param version: Version that contains the resource
        :param sid:
        r   z/RatePlans/{sid}Nr-   )r#   r$   r(   rM   _uri)r*   r   r   r+   r-   r.   r$      s   zRatePlanContext.__init__r/   c                 C   s   t i }| jjd| j|dS )r6   DELETEmethoduriheaders)r   ofr2   r7   rf   r*   rk   r-   r-   r.   r7      s   
zRatePlanContext.deletec                    s&   t i }| jjd| j|dI dH S )r:   rg   rh   N)r   rl   r2   r;   rf   rm   r-   r-   r.   r;      s
   
zRatePlanContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r=   application/jsonAcceptGETrh   r   r1   )r   rl   r2   r>   rf   r   r(   r*   rk   r   r-   r-   r.   r>      s   
zRatePlanContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r?   rn   ro   rp   rh   Nr   r1   )r   rl   r2   r@   rf   r   r(   rq   r-   r-   r.   r@      s   
zRatePlanContext.fetch_asyncr   r   c                 C   sV   t ||d}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
rA   
UniqueNameFriendlyName!application/x-www-form-urlencodedContent-Typern   ro   POSTri   rj   datark   r   r1   )r   rl   r2   rC   rf   r   r(   r*   r   r   ry   rk   r   r-   r-   r.   rC     s   

zRatePlanContext.updatec                    s^   t ||d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )rE   rr   ru   rv   rn   ro   rw   rx   Nr   r1   )r   rl   r2   rF   rf   r   r(   rz   r-   r-   r.   rF   "  s   

zRatePlanContext.update_asyncc                 C   rG   )rH   rI   c                 s   rJ   rK   rL   rN   r-   r-   r.   rR   H  rS   z+RatePlanContext.__repr__.<locals>.<genexpr>z,<Twilio.Preview.Wireless.RatePlanContext {}>rT   rW   r-   r-   r.   rY   B  rZ   zRatePlanContext.__repr__)r\   r]   r^   r   r`   r$   rb   r7   r;   r   r>   r@   r   rc   r   rd   rC   rF   rY   re   r-   r-   r+   r.   r0      s2    


"


 r0   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 )RatePlanPager   r/   c                 C   s   t | j|S )zn
        Build an instance of RatePlanInstance

        :param payload: Payload response from the API
        )r   r2   )r*   r   r-   r-   r.   get_instanceN  s   zRatePlanPage.get_instancec                 C      dS )rH   z&<Twilio.Preview.Wireless.RatePlanPage>r-   r3   r-   r-   r.   rY   V     zRatePlanPage.__repr__N)	r\   r]   r^   r   r`   r   r   r|   rY   r-   r-   r-   r.   r{   L  s    r{   c                       s   e Zd Zdef 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
deee	f deee	f dee
e	f deee	f deee	f d	ee
e	f d
ee
e	f dee
e	f dee
e	f deee e	f de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
deee	f deee	f dee
e	f deee	f deee	f d	ee
e	f d
ee
e	f dee
e	f dee
e	f deee e	f defddZ		d0dee dee dee fddZ		d0dee dee dee fddZ		d0dee dee dee fddZ		d0d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 )1RatePlanListr   c                    s   t  | d| _dS )zj
        Initialize the RatePlanList

        :param version: Version that contains the resource

        z
/RatePlansN)r#   r$   rf   )r*   r   r+   r-   r.   r$   a  s   
zRatePlanList.__init__r   r   r   r   r   r   r   commands_enabledr   r   r/   c                 C   s   t ||t|||t|t|t|t|	t|
dd d
}t ddi}d|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 r[   r-   er-   r-   r.   <lambda>      z%RatePlanList.create.<locals>.<lambda>
rs   rt   DataEnabled	DataLimitDataMeteringMessagingEnabledVoiceEnabledCommandsEnabledNationalRoamingEnabledInternationalRoamingrv   ru   rn   ro   rw   rx   )	r   rl   r   boolean_to_stringmapr2   createrf   r   r*   r   r   r   r   r   r   r   r   r   r   ry   rk   r   r-   r-   r.   r   l  s0   
zRatePlanList.createc                    s   t ||t|||t|t|t|t|	t|
dd d
}t ddi}d|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   r   r[   r-   r   r-   r-   r.   r     r   z+RatePlanList.create_async.<locals>.<lambda>r   rv   ru   rn   ro   rw   rx   N)	r   rl   r   r   r   r2   create_asyncrf   r   r   r-   r-   r.   r     s2   
zRatePlanList.create_asyncNlimit	page_sizec                 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   )r2   read_limitspagestreamr*   r   r   limitsr   r-   r-   r.   r     s   zRatePlanList.streamc                    s8   | 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   )r2   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 r[   r-   )rO   recordr-   r-   r.   
<listcomp>C  s
    z+RatePlanList.list_async.<locals>.<listcomp>r   N)r   r   r-   r-   r.   
list_async0  s   
zRatePlanList.list_async
page_tokenpage_numberc                 C   sJ   t |||d}t ddi}d|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
        	PageTokenr   PageSizerv   ru   rn   ro   rp   ri   rj   paramsrk   )r   rl   r2   r   rf   r{   r*   r   r   r   ry   rk   responser-   r-   r.   r   K  s   
zRatePlanList.pagec                    sR   t |||d}t ddi}d|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   rv   ru   rn   ro   rp   r   N)r   rl   r2   r   rf   r{   r   r-   r-   r.   r   l  s   
zRatePlanList.page_async
target_urlc                 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
        rp   )r2   domaintwiliorequestr{   r*   r   r   r-   r-   r.   get_page  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
        rp   N)r2   r   r   request_asyncr{   r   r-   r-   r.   get_page_async  s   	zRatePlanList.get_page_asyncr   c                 C      t | j|dS zC
        Constructs a RatePlanContext

        :param sid:
        r1   r0   r2   r*   r   r-   r-   r.   r%        zRatePlanList.getc                 C   r   r   r   r   r-   r-   r.   __call__  r   zRatePlanList.__call__c                 C   r}   )rH   z&<Twilio.Preview.Wireless.RatePlanList>r-   r3   r-   r-   r.   rY     r~   zRatePlanList.__repr__)NN)!r\   r]   r^   r   r$   r   rc   r   r`   rd   rb   intr   r   r   r   r   r   r   r	   r   r   r   r{   r   r   r   r   r0   r%   r   rY   re   r-   r-   r+   r.   r   _  s
   







	


>







	


>







#



!r   N)r_   r   typingr   r   r   r   r   r   r	   twilio.baser
   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r0   r{   r   r-   r-   r-   r.   <module>   s    $   