o
    eB                     @   s   d 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 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )deserialize)	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                
       s   e Zd ZdZ fddZdddZdddZejejejfd	d
Z	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dZdd Zdd Zdd Z  ZS )RatePlanList PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                    s.   t t| | i | _djdi | j| _dS )z
        Initialize the RatePlanList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.preview.wireless.rate_plan.RatePlanList
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanList
        z
/RatePlansN )superr	   __init__	_solutionformat_uri)selfversion	__class__r   Y/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/preview/wireless/rate_plan.pyr      s   	zRatePlanList.__init__Nc                 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 int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.preview.wireless.rate_plan.RatePlanInstance]
        	page_size)r   limit)_versionread_limitspagestream)r   r   r   limitsr   r   r   r   r   &   s   zRatePlanList.streamc                 C   s   t | j||dS )ad  
        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 int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.preview.wireless.rate_plan.RatePlanInstance]
        )r   r   )listr   )r   r   r   r   r   r   r   =   s   zRatePlanList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of RatePlanInstance records from the API.
        Request is executed immediately

        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of RatePlanInstance
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanPage
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   RatePlanPager   )r   
page_tokenpage_numberr   dataresponser   r   r   r   O   s   zRatePlanList.pagec                 C   s"   | j jjd|}t| j || jS )a=  
        Retrieve a specific page of RatePlanInstance records from the API.
        Request is executed immediately

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

        :returns: Page of RatePlanInstance
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanPage
        r    )r   domaintwiliorequestr%   r   )r   
target_urlr)   r   r   r   get_pageb   s
   

zRatePlanList.get_pagec                 C   sL   t |||||||||	t|
dd d
}| jjd| j|d}t| j|S )a  
        Create the RatePlanInstance

        :param unicode unique_name: The unique_name
        :param unicode friendly_name: The friendly_name
        :param bool data_enabled: The data_enabled
        :param unicode data_limit: The data_limit
        :param unicode data_metering: The data_metering
        :param bool messaging_enabled: The messaging_enabled
        :param bool voice_enabled: The voice_enabled
        :param bool commands_enabled: The commands_enabled
        :param bool national_roaming_enabled: The national_roaming_enabled
        :param list[unicode] international_roaming: The international_roaming

        :returns: The created RatePlanInstance
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanInstance
        c                 S   s   | S Nr   )er   r   r   <lambda>   s    z%RatePlanList.create.<locals>.<lambda>)

UniqueNameFriendlyNameDataEnabled	DataLimitDataMeteringMessagingEnabledVoiceEnabledCommandsEnabledNationalRoamingEnabledInternationalRoamingPOSTr!   r"   r(   )r   r$   r   mapr   creater   RatePlanInstance)r   unique_namefriendly_namedata_enabled
data_limitdata_meteringmessaging_enabledvoice_enabledcommands_enablednational_roaming_enabledinternational_roamingr(   payloadr   r   r   r?   s   s   zRatePlanList.createc                 C      t | j|dS z
        Constructs a RatePlanContext

        :param sid: The sid

        :returns: twilio.rest.preview.wireless.rate_plan.RatePlanContext
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanContext
        sidRatePlanContextr   r   rO   r   r   r   get      	zRatePlanList.getc                 C   rL   rM   rP   rR   r   r   r   __call__   rT   zRatePlanList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z&<Twilio.Preview.Wireless.RatePlanList>r   r   r   r   r   __repr__      zRatePlanList.__repr__)NN)__name__
__module____qualname____doc__r   r   r   r   unsetr   r.   r?   rS   rU   rY   __classcell__r   r   r   r   r	      s&    



(r	   c                       s0   e Zd ZdZ fddZdd Zdd Z  ZS )r%   r
   c                    s   t t| || || _dS )a4  
        Initialize the RatePlanPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.preview.wireless.rate_plan.RatePlanPage
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanPage
        N)r   r%   r   r   )r   r   r)   solutionr   r   r   r      s   

zRatePlanPage.__init__c                 C   s   t | j|S )a  
        Build an instance of RatePlanInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.preview.wireless.rate_plan.RatePlanInstance
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanInstance
        )r@   r   r   rK   r   r   r   get_instance   s   	zRatePlanPage.get_instancec                 C   rV   )rW   z&<Twilio.Preview.Wireless.RatePlanPage>r   rX   r   r   r   rY      rZ   zRatePlanPage.__repr__)r[   r\   r]   r^   r   rc   rY   r`   r   r   r   r   r%      s
    r%   c                       sJ   e Zd ZdZ fddZdd ZejejfddZdd	 Z	d
d Z
  ZS )rQ   r
   c                    s2   t t| | d|i| _djdi | j| _dS )a!  
        Initialize the RatePlanContext

        :param Version version: Version that contains the resource
        :param sid: The sid

        :returns: twilio.rest.preview.wireless.rate_plan.RatePlanContext
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanContext
        rO   z/RatePlans/{sid}Nr   )r   rQ   r   r   r   r   )r   r   rO   r   r   r   r      s   

zRatePlanContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the RatePlanInstance

        :returns: The fetched RatePlanInstance
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanInstance
        r    r!   r"   rO   rN   )r   fetchr   r@   r   rb   r   r   r   rf      s   zRatePlanContext.fetchc                 C   s:   t ||d}| jjd| j|d}t| j|| jd dS )  
        Update the RatePlanInstance

        :param unicode unique_name: The unique_name
        :param unicode friendly_name: The friendly_name

        :returns: The updated RatePlanInstance
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanInstance
        )r2   r3   r<   r=   rO   rN   )r   r$   r   updater   r@   r   )r   rA   rB   r(   rK   r   r   r   rh     s   
zRatePlanContext.updatec                 C   s   | j jd| jdS )
        Deletes the RatePlanInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETEre   )r   deleter   rX   r   r   r   rk     s   zRatePlanContext.deletec                 C   $   d dd | j D }d|S )rW    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>$      z+RatePlanContext.__repr__.<locals>.<genexpr>z,<Twilio.Preview.Wireless.RatePlanContext {}>joinr   itemsr   r   contextr   r   r   rY        
zRatePlanContext.__repr__)r[   r\   r]   r^   r   rf   r   r_   rh   rk   rY   r`   r   r   r   r   rQ      s    	rQ   c                       s   e Zd ZdZd+ fdd	Zedd Zedd Zed	d
 Zedd Z	edd Z
edd Zedd Zedd Zedd Zedd Zedd Zedd Zedd Zedd  Zed!d" Zd#d$ Zejejfd%d&Zd'd( Zd)d* Z  ZS ),r@   r
   Nc                    s   t t| | |d|d|d|d|d|dt|d|d|d	|d
|dt|dt|d|dd| _d| _d|pW| jd i| _	dS )z
        Initialize the RatePlanInstance

        :returns: twilio.rest.preview.wireless.rate_plan.RatePlanInstance
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanInstance
        rO   rA   account_sidrB   rC   rE   rD   rF   rG   rI   rJ   date_createddate_updatedurl)rO   rA   r}   rB   rC   rE   rD   rF   rG   rI   rJ   r~   r   r   N)
r   r@   r   rS   r   integeriso8601_datetime_properties_contextr   )r   r   rK   rO   r   r   r   r   -  s$   zRatePlanInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )a3  
        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
        :rtype: twilio.rest.preview.wireless.rate_plan.RatePlanContext
        NrO   rN   )r   rQ   r   r   rX   r   r   r   _proxyL  s   
	zRatePlanInstance._proxyc                 C   
   | j d S )z;
        :returns: The sid
        :rtype: unicode
        rO   r   rX   r   r   r   rO   Y     
zRatePlanInstance.sidc                 C   r   )zC
        :returns: The unique_name
        :rtype: unicode
        rA   r   rX   r   r   r   rA   a  r   zRatePlanInstance.unique_namec                 C   r   )zC
        :returns: The account_sid
        :rtype: unicode
        r}   r   rX   r   r   r   r}   i  r   zRatePlanInstance.account_sidc                 C   r   )zE
        :returns: The friendly_name
        :rtype: unicode
        rB   r   rX   r   r   r   rB   q  r   zRatePlanInstance.friendly_namec                 C   r   )zA
        :returns: The data_enabled
        :rtype: bool
        rC   r   rX   r   r   r   rC   y  r   zRatePlanInstance.data_enabledc                 C   r   )zE
        :returns: The data_metering
        :rtype: unicode
        rE   r   rX   r   r   r   rE     r   zRatePlanInstance.data_meteringc                 C   r   )zB
        :returns: The data_limit
        :rtype: unicode
        rD   r   rX   r   r   r   rD     r   zRatePlanInstance.data_limitc                 C   r   )zF
        :returns: The messaging_enabled
        :rtype: bool
        rF   r   rX   r   r   r   rF     r   z"RatePlanInstance.messaging_enabledc                 C   r   )zB
        :returns: The voice_enabled
        :rtype: bool
        rG   r   rX   r   r   r   rG     r   zRatePlanInstance.voice_enabledc                 C   r   )zM
        :returns: The national_roaming_enabled
        :rtype: bool
        rI   r   rX   r   r   r   rI     r   z)RatePlanInstance.national_roaming_enabledc                 C   r   )zS
        :returns: The international_roaming
        :rtype: list[unicode]
        rJ   r   rX   r   r   r   rJ     r   z&RatePlanInstance.international_roamingc                 C   r   )zE
        :returns: The date_created
        :rtype: datetime
        r~   r   rX   r   r   r   r~     r   zRatePlanInstance.date_createdc                 C   r   )zE
        :returns: The date_updated
        :rtype: datetime
        r   r   rX   r   r   r   r     r   zRatePlanInstance.date_updatedc                 C   r   )z;
        :returns: The url
        :rtype: unicode
        r   r   rX   r   r   r   r     r   zRatePlanInstance.urlc                 C   
   | j  S )rd   )r   rf   rX   r   r   r   rf        
zRatePlanInstance.fetchc                 C   s   | j j||dS )rg   )rA   rB   )r   rh   )r   rA   rB   r   r   r   rh     s   
zRatePlanInstance.updatec                 C   r   )ri   )r   rk   rX   r   r   r   rk     r   zRatePlanInstance.deletec                 C   rl   )rW   rm   c                 s   rn   ro   rp   rq   r   r   r   ru     rv   z,RatePlanInstance.__repr__.<locals>.<genexpr>z-<Twilio.Preview.Wireless.RatePlanInstance {}>rw   rz   r   r   r   rY     r|   zRatePlanInstance.__repr__r/   )r[   r\   r]   r^   r   propertyr   rO   rA   r}   rB   rC   rE   rD   rF   rG   rI   rJ   r~   r   r   rf   r   r_   rh   rk   rY   r`   r   r   r   r   r@   (  sJ    














		r@   N)r^   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r%   rQ   r@   r   r   r   r   <module>   s    *)D