U
    ^g%i{                     @   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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 )RatePlanInstancec                   @   s   e Zd ZdZdZdS )"RatePlanInstance.DataLimitStrategyblockZthrottleN)__name__
__module____qualname__ZBLOCKZTHROTTLE r   r   `/var/www/html/api-medvista/venv/lib/python3.8/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|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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)   Ziso8601_datetimer*   r+   r,   	_solution_context)selfr   r   r   	__class__r   r   r.   2   sB     zRatePlanInstance.__init__RatePlanContextreturnc                 C   s&   | j dk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   )r2   r6   _versionr1   r3   r   r   r   _proxyY   s    
zRatePlanInstance._proxyc                 C   s
   | j  S )k
        Deletes the RatePlanInstance


        :returns: True if delete succeeds, False otherwise
        )r<   deleter;   r   r   r   r>   h   s    zRatePlanInstance.deletec                    s   | 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   r@   q   s    zRatePlanInstance.delete_asyncc                 C   s
   | j  S )]
        Fetch the RatePlanInstance


        :returns: The fetched RatePlanInstance
        )r<   fetchr;   r   r   r   rB   z   s    zRatePlanInstance.fetchc                    s   | j  I dH S )w
        Asynchronous coroutine to fetch the RatePlanInstance


        :returns: The fetched RatePlanInstance
        N)r<   fetch_asyncr;   r   r   r   rD      s    zRatePlanInstance.fetch_asyncr   r    r8   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r3   r   r    r   r   r   rH      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
        rG   N)r<   update_asyncrI   r   r   r   rK      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>   s     z,RatePlanInstance.__repr__.<locals>.<genexpr>z(<Twilio.Wireless.V1.RatePlanInstance {}>joinr1   itemsrP   r3   contextr   r   r   __repr__   s    zRatePlanInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r.   propertyr<   boolr>   r@   rB   rD   r   unsetr   rH   rK   r[   __classcell__r   r   r4   r   r      s8     
 '			



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 )r6   )r   r   c                    s*   t  | d|i| _djf | 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}N)r-   r.   r1   rP   _uri)r3   r   r   r4   r   r   r.      s
     zRatePlanContext.__init__r7   c                 C   s   t i }| jjd| j|dS )r=   DELETEmethoduriheaders)r   ofr:   r>   rb   r3   rg   r   r   r   r>      s    
zRatePlanContext.deletec                    s$   t i }| jjd| j|dI dH S )r?   rc   rd   N)r   rh   r:   r@   rb   ri   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 )rA   application/jsonAcceptGETrd   r   r9   )r   rh   r:   rB   rb   r   r1   r3   rg   r   r   r   r   rB      s    
zRatePlanContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )rC   rj   rk   rl   rd   Nr   r9   )r   rh   r:   rD   rb   r   r1   rm   r   r   r   rD      s    
  zRatePlanContext.fetch_asyncrE   c                 C   sV   t ||d}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
rF   
UniqueNameFriendlyName!application/x-www-form-urlencodedContent-Typerj   rk   POSTre   rf   datarg   r   r9   )r   rh   r:   rH   rb   r   r1   r3   r   r    ru   rg   r   r   r   r   rH     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 )rJ   rn   rq   rr   rj   rk   rs   rt   Nr   r9   )r   rh   r:   rK   rb   r   r1   rv   r   r   r   rK   /  s    
   zRatePlanContext.update_asyncc                 C   s$   d dd | j D }d|S )rL   rM   c                 s   s   | ]\}}d  ||V  qdS rN   rO   rQ   r   r   r   rU   U  s     z+RatePlanContext.__repr__.<locals>.<genexpr>z'<Twilio.Wireless.V1.RatePlanContext {}>rV   rY   r   r   r   r[   O  s    zRatePlanContext.__repr__)r   r   r   r   r]   r.   r_   r>   r@   r   rB   rD   r   r`   r   r\   rH   rK   r[   ra   r   r   r4   r   r6      s(   

"

 r6   c                   @   s2   e Zd Zeeef edddZedddZdS )RatePlanPage)r   r8   c                 C   s   t | j|S )zn
        Build an instance of RatePlanInstance

        :param payload: Payload response from the API
        )r   r:   )r3   r   r   r   r   get_instance[  s    zRatePlanPage.get_instancer7   c                 C   s   dS )rL   z!<Twilio.Wireless.V1.RatePlanPage>r   r;   r   r   r   r[   c  s    zRatePlanPage.__repr__N)	r   r   r   r   r]   r   r   rx   r[   r   r   r   r   rw   Y  s   rw   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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 e	f eee	f eee	f ed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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 e	f eee	f eee	f ed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.   rb   )r3   r   r4   r   r   r.   n  s    zRatePlanList.__init__r   )r   r    r!   r#   r"   r$   r%   r&   r(   r'   r)   data_limit_strategyr8   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   | S Nr   er   r   r   <lambda>      z%RatePlanList.create.<locals>.<lambda>ro   rp   ZDataEnabledZ	DataLimitZDataMeteringZMessagingEnabledZVoiceEnabledZNationalRoamingEnabledZInternationalRoamingZNationalRoamingDataLimitZInternationalRoamingDataLimitr   rr   rq   rj   rk   rs   rt   )	r   rh   r   boolean_to_stringmapr:   createrb   r   r3   r   r    r!   r#   r"   r$   r%   r&   r(   r'   r)   rz   ru   rg   r   r   r   r   r   y  s<    $    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   s   | S r{   r   r|   r   r   r   r~     r   z+RatePlanList.create_async.<locals>.<lambda>r   rr   rq   rj   rk   rs   rt   N)	r   rh   r   r   r   r:   create_asyncrb   r   r   r   r   r   r     s<    $    zRatePlanList.create_asyncN)limit	page_sizer8   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   )r:   read_limitspagestreamr3   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   )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   r3   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 r{   r   )rR   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_numberr   r8   c                 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
        Z	PageTokenr   ZPageSizerr   rq   rj   rk   rl   re   rf   paramsrg   )r   rh   r:   r   rb   rw   r3   r   r   r   ru   rg   responser   r   r   r   h  s       zRatePlanList.pagec                    sP   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   rr   rq   rj   rk   rl   r   N)r   rh   r:   r   rb   rw   r   r   r   r   r     s       zRatePlanList.page_async)
target_urlr8   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
        rl   )r:   domaintwiliorequestrw   r3   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
        rl   N)r:   r   r   Zrequest_asyncrw   r   r   r   r   get_page_async  s    	zRatePlanList.get_page_async)r   r8   c                 C   s   t | j|dS zo
        Constructs a RatePlanContext

        :param sid: The SID of the RatePlan resource to update.
        r9   r6   r:   r3   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__r7   c                 C   s   dS )rL   z!<Twilio.Wireless.V1.RatePlanList>r   r;   r   r   r   r[     s    zRatePlanList.__repr__)NN)NN)NN)NN)!r   r   r   r   r.   r   r`   r   r]   r\   r_   intr   r   r   r   r   r   r   r	   r   r   r   rw   r   r   r   r   r6   r/   r   r[   ra   r   r   r4   r   ry   l  s   









F









F        


#


!ry   N)__doc__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   r6   rw   ry   r   r   r   r   <module>   s   $ "  