o
    f>h{                     @   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 - Wireless
    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G dd de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 ) RatePlanInstancec                   @   s   e Zd ZdZdZdS )"RatePlanInstance.DataLimitStrategyblockthrottleN)__name__
__module____qualname__BLOCKTHROTTLE r   r   T/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/wireless/v1/rate_plan.pyDataLimitStrategy   s    r   Nversionpayloadsidc                    s  t  | |d| _|d| _|d| _|d| _|d| _|d| _t	
|d| _|d| _|d	| _|d
| _t	
|d| _|d| _t	
|d| _t	|d| _t	|d| _|d| _d|pz| 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national_roaming_data_limitinternational_roaming international_roaming_data_limitdate_createddate_updatedurl)super__init__getr    r!   r"   r#   r$   r%   r
   integerr&   r'   r(   r)   r*   r+   r,   iso8601_datetimer-   r.   r/   	_solution_context)selfr   r   r    	__class__r   r   r1   2   s@   

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    )r6   r;   _versionr5   r7   r   r   r   _proxyY   s   
zRatePlanInstance._proxyc                 C   
   | j  S )k
        Deletes the RatePlanInstance


        :returns: True if delete succeeds, False otherwise
        )r?   deleter>   r   r   r   rB   h      
zRatePlanInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the RatePlanInstance


        :returns: True if delete succeeds, False otherwise
        N)r?   delete_asyncr>   r   r   r   rF   q      zRatePlanInstance.delete_asyncc                 C   r@   )]
        Fetch the RatePlanInstance


        :returns: The fetched RatePlanInstance
        )r?   fetchr>   r   r   r   rI   z   rC   zRatePlanInstance.fetchc                    rD   )w
        Asynchronous coroutine to fetch the RatePlanInstance


        :returns: The fetched RatePlanInstance
        N)r?   fetch_asyncr>   r   r   r   rK      rG   zRatePlanInstance.fetch_asyncr!   r#   c                 C   s   | j j||dS )  
        Update the RatePlanInstance

        :param unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource.
        :param friendly_name: A descriptive string that you create to describe the resource. It does not have to be unique.

        :returns: The updated RatePlanInstance
        r!   r#   )r?   updater7   r!   r#   r   r   r   rN      s   zRatePlanInstance.updatec                    s   | j j||dI dH S )  
        Asynchronous coroutine to update the RatePlanInstance

        :param unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource.
        :param friendly_name: A descriptive string that you create to describe the resource. It does not have to be unique.

        :returns: The updated RatePlanInstance
        rM   N)r?   update_asyncrO   r   r   r   rQ      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.Wireless.V1.RatePlanInstance {}>joinr5   itemsrX   r7   contextr   r   r   __repr__      
zRatePlanInstance.__repr__N)r:   r;   )r:   r   )r   r   r   objectr   r   r   strr   r   r1   propertyr?   boolrB   rF   rI   rK   r   unsetr   rN   rQ   rd   __classcell__r   r   r8   r   r      sH    
'	
	
	





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 )r;   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: The SID of the RatePlan resource to update.
        r    z/RatePlans/{sid}Nr   )r0   r1   r5   rX   _uri)r7   r   r    r8   r   r   r1      s   zRatePlanContext.__init__r:   c                 C   s   t i }| jjd| j|dS )rA   DELETEmethoduriheaders)r   ofr=   rB   rm   r7   rr   r   r   r   rB      s   
zRatePlanContext.deletec                    s&   t i }| jjd| j|dI dH S )rE   rn   ro   N)r   rs   r=   rF   rm   rt   r   r   r   rF      s
   
zRatePlanContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )rH   application/jsonAcceptGETro   r    r<   )r   rs   r=   rI   rm   r   r5   r7   rr   r   r   r   r   rI      s   
zRatePlanContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )rJ   ru   rv   rw   ro   Nr    r<   )r   rs   r=   rK   rm   r   r5   rx   r   r   r   rK      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 )
rL   
UniqueNameFriendlyName!application/x-www-form-urlencodedContent-Typeru   rv   POSTrp   rq   datarr   r    r<   )r   rs   r=   rN   rm   r   r5   r7   r!   r#   r   rr   r   r   r   r   rN     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 )rP   ry   r|   r}   ru   rv   r~   r   Nr    r<   )r   rs   r=   rQ   rm   r   r5   r   r   r   r   rQ   /  s   

zRatePlanContext.update_asyncc                 C   rR   )rS   rT   c                 s   rU   rV   rW   rY   r   r   r   r]   U  r^   z+RatePlanContext.__repr__.<locals>.<genexpr>z'<Twilio.Wireless.V1.RatePlanContext {}>r_   rb   r   r   r   rd   O  re   zRatePlanContext.__repr__)r   r   r   r   rh   r1   rj   rB   rF   r   rI   rK   r   rk   r   rg   rN   rQ   rd   rl   r   r   r8   r   r;      s2    


"


 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 )RatePlanPager   r:   c                 C   s   t | j|S )zn
        Build an instance of RatePlanInstance

        :param payload: Payload response from the API
        )r   r=   )r7   r   r   r   r   get_instance[  s   zRatePlanPage.get_instancec                 C      dS )rS   z!<Twilio.Wireless.V1.RatePlanPage>r   r>   r   r   r   rd   c     zRatePlanPage.__repr__N)	r   r   r   r   rh   r   r   r   rd   r   r   r   r   r   Y  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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 e	f deee	f deee	f ded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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 e	f deee	f deee	f dede	f defddZ		d3dee dee dee fddZ		d3dee dee dee fddZ		d3dee dee dee fddZ		d3d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/d0Zdefd1d2Z  Z S )4RatePlanListr   c                    s   t  | d| _dS )zj
        Initialize the RatePlanList

        :param version: Version that contains the resource

        z
/RatePlansN)r0   r1   rm   )r7   r   r8   r   r   r1   n  s   
zRatePlanList.__init__r!   r#   r$   r&   r%   r'   r(   r)   r+   r*   r,   data_limit_strategyr   r:   c                 C   s   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 )
aR	  
        Create the RatePlanInstance

        :param unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource.
        :param friendly_name: A descriptive string that you create to describe the resource. It does not have to be unique.
        :param data_enabled: Whether SIMs can use GPRS/3G/4G/LTE data connectivity.
        :param data_limit: The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`.
        :param data_metering: The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans).
        :param messaging_enabled: Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource).
        :param voice_enabled: Deprecated.
        :param national_roaming_enabled: Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming).
        :param international_roaming: The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`.
        :param national_roaming_data_limit: The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info.
        :param international_roaming_data_limit: The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB.
        :param data_limit_strategy:

        :returns: The created RatePlanInstance
        c                 S      | S rf   r   er   r   r   <lambda>      z%RatePlanList.create.<locals>.<lambda>rz   r{   DataEnabled	DataLimitDataMeteringMessagingEnabledVoiceEnabledNationalRoamingEnabledInternationalRoamingNationalRoamingDataLimitInternationalRoamingDataLimitr   r}   r|   ru   rv   r~   r   )	r   rs   r   boolean_to_stringmapr=   createrm   r   r7   r!   r#   r$   r&   r%   r'   r(   r)   r+   r*   r,   r   r   rr   r   r   r   r   r   y  s4   $
zRatePlanList.createc                    s   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 )aa	  
        Asynchronously create the RatePlanInstance

        :param unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource.
        :param friendly_name: A descriptive string that you create to describe the resource. It does not have to be unique.
        :param data_enabled: Whether SIMs can use GPRS/3G/4G/LTE data connectivity.
        :param data_limit: The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`.
        :param data_metering: The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans).
        :param messaging_enabled: Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource).
        :param voice_enabled: Deprecated.
        :param national_roaming_enabled: Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming).
        :param international_roaming: The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`.
        :param national_roaming_data_limit: The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info.
        :param international_roaming_data_limit: The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB.
        :param data_limit_strategy:

        :returns: The created RatePlanInstance
        c                 S   r   rf   r   r   r   r   r   r     r   z+RatePlanList.create_async.<locals>.<lambda>r   r}   r|   ru   rv   r~   r   N)	r   rs   r   r   r   r=   create_asyncrm   r   r   r   r   r   r     s6   $
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   )r=   read_limitspagestreamr7   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   )r=   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   r7   r   r   r   r   r   r   3  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 rf   r   )rZ   recordr   r   r   
<listcomp>`  s
    z+RatePlanList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r   
list_asyncM  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   PageSizer}   r|   ru   rv   rw   rp   rq   paramsrr   )r   rs   r=   r   rm   r   r7   r   r   r   r   rr   responser   r   r   r   h  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   r}   r|   ru   rv   rw   r   N)r   rs   r=   r   rm   r   r   r   r   r   r     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
        rw   )r=   domaintwiliorequestr   r7   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
        rw   N)r=   r   r   request_asyncr   r   r   r   r   get_page_async  s   	zRatePlanList.get_page_asyncr    c                 C      t | j|dS zo
        Constructs a RatePlanContext

        :param sid: The SID of the RatePlan resource to update.
        r<   r;   r=   r7   r    r   r   r   r2        zRatePlanList.getc                 C   r   r   r   r   r   r   r   __call__  r   zRatePlanList.__call__c                 C   r   )rS   z!<Twilio.Wireless.V1.RatePlanList>r   r>   r   r   r   rd     r   zRatePlanList.__repr__)NN)!r   r   r   r   r1   r   rk   r   rh   rg   rj   intr   r   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   r;   r2   r   rd   rl   r   r   r8   r   r   l  s*   







	



F







	



F







#



!r   N)__doc__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   r;   r   r   r   r   r   r   <module>   s    $ "  