a
    !f                     @   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 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 - Supersim
    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values)InstanceContext)InstanceResource)ListResource)Version)Pagec                
       sd  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d dddZd dddZ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 d dddZ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 d dddZedddZ  ZS )FleetInstancec                   @   s   e Zd ZdZdS )zFleetInstance.DataMeteringZpaygN)__name__
__module____qualname__ZPAYG r   r   ^/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/supersim/v1/fleet.pyDataMetering   s   r   N)versionpayloadsidc                    s   t  | |d| _|d| _|d| _t|d| _t|d| _	|d| _
|d| _t|d| _|d	| _|d
| _|d| _|d| _|d| _|d| _|d| _d|p| ji| _d | _d S )Naccount_sidr   unique_namedate_createddate_updatedurldata_enabled
data_limitdata_meteringsms_commands_enabledsms_commands_urlsms_commands_methodnetwork_access_profile_sidip_commands_urlip_commands_method)super__init__getr   r   r   r
   iso8601_datetimer   r   r   r    integerr!   r"   r#   r$   r%   r&   r'   r(   	_solution_context)selfr   r   r   	__class__r   r   r*   0   s6    
zFleetInstance.__init__FleetContext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: FleetContext for this FleetInstance
        Nr   r   )r/   r3   _versionr.   r0   r   r   r   _proxyR   s    
zFleetInstance._proxyc                 C   s
   | j  S )W
        Fetch the FleetInstance


        :returns: The fetched FleetInstance
        )r9   fetchr8   r   r   r   r;   a   s    zFleetInstance.fetchc                    s   | j  I dH S )q
        Asynchronous coroutine to fetch the FleetInstance


        :returns: The fetched FleetInstance
        N)r9   fetch_asyncr8   r   r   r   r=   j   s    zFleetInstance.fetch_asyncr   network_access_profiler'   r(   r$   r%   r!   r5   c              	   C   s   | j j|||||||dS )C  
        Update the FleetInstance

        :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 network_access_profile: The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to.
        :param ip_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.
        :param ip_commands_method: A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.
        :param sms_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.
        :param sms_commands_method: A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.
        :param data_limit: The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000).

        :returns: The updated FleetInstance
        r   r?   r'   r(   r$   r%   r!   )r9   updater0   r   r?   r'   r(   r$   r%   r!   r   r   r   rB   s   s    zFleetInstance.updatec              	      s    | j j|||||||dI dH S )]  
        Asynchronous coroutine to update the FleetInstance

        :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 network_access_profile: The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to.
        :param ip_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.
        :param ip_commands_method: A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.
        :param sms_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.
        :param sms_commands_method: A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.
        :param data_limit: The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000).

        :returns: The updated FleetInstance
        rA   N)r9   update_asyncrC   r   r   r   rE      s    zFleetInstance.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)FleetInstance.__repr__.<locals>.<genexpr>z%<Twilio.Supersim.V1.FleetInstance {}>joinr.   itemsrJ   r0   contextr   r   r   __repr__   s    zFleetInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r*   propertyr9   r;   r=   r   unsetr   intrB   rE   rV   __classcell__r   r   r1   r   r      sX    "	






#






!r   c                
       s2  e Zd Zeed fddZedddZedddZ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d	d
dZ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d	ddZedddZ  ZS )r3   )r   r   c                    s.   t  | d|i| _djf i | j| _dS )z
        Initialize the FleetContext

        :param version: Version that contains the resource
        :param sid: The SID of the Fleet resource to update.
        r   z/Fleets/{sid}N)r)   r*   r.   rJ   _uri)r0   r   r   r1   r   r   r*      s    zFleetContext.__init__r4   c                 C   s(   | j jd| jd}t| j || jd dS )r:   GETmethodurir   r6   )r7   r;   r]   r   r.   r0   r   r   r   r   r;      s    zFleetContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r<   r^   r_   Nr   r6   )r7   r=   r]   r   r.   rb   r   r   r   r=      s    zFleetContext.fetch_asyncr>   c           
   
   C   sD   t |||||||d}| jjd| j|d}	t| j|	| jd dS )r@   
UniqueNameNetworkAccessProfileIpCommandsUrlIpCommandsMethodSmsCommandsUrlSmsCommandsMethod	DataLimitPOSTr`   ra   datar   r6   )r   ofr7   rB   r]   r   r.   
r0   r   r?   r'   r(   r$   r%   r!   rm   r   r   r   r   rB      s     zFleetContext.updatec           
   
      sJ   t |||||||d}| jjd| j|dI dH }	t| j|	| jd dS )rD   rc   rk   rl   Nr   r6   )r   rn   r7   rE   r]   r   r.   ro   r   r   r   rE      s     zFleetContext.update_asyncc                 C   s$   d dd | j D }d|S )rF   rG   c                 s   s   | ]\}}d  ||V  qdS rH   rI   rK   r   r   r   rO   Q  rP   z(FleetContext.__repr__.<locals>.<genexpr>z$<Twilio.Supersim.V1.FleetContext {}>rQ   rT   r   r   r   rV   K  s    zFleetContext.__repr__)r   r   r   r   rX   r*   r   r;   r=   r   rZ   r   rW   r[   rB   rE   rV   r\   r   r   r1   r   r3      sL   






-






+r3   c                   @   s2   e Zd Zeeef edddZedddZdS )	FleetPage)r   r5   c                 C   s   t | j|S )zk
        Build an instance of FleetInstance

        :param payload: Payload response from the API
        )r   r7   rb   r   r   r   get_instanceV  s    zFleetPage.get_instancer4   c                 C   s   dS )rF   z<Twilio.Supersim.V1.FleetPage>r   r8   r   r   r   rV   ^  s    zFleetPage.__repr__N)	r   r   r   r   rX   r   r   rq   rV   r   r   r   r   rp   U  s   rp   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fe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d
ddZejejejejejejejejfe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d
ddZejd	d	feee	f ee ee ee d
ddZejd	d	feee	f ee ee ee d
ddZejd	d	feee	f ee ee ee d
ddZejd	d	feee	f ee ee ee d
ddZ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dddZ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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 )%	FleetList)r   c                    s   t  | d| _dS )zg
        Initialize the FleetList

        :param version: Version that contains the resource

        z/FleetsN)r)   r*   r]   )r0   r   r1   r   r   r*   h  s    zFleetList.__init__)
r?   r   r    r!   r'   r(   r#   r$   r%   r5   c
                 C   s>   t |||||||||	d	}
| jjd| j|
d}t| j|S )av  
        Create the FleetInstance

        :param network_access_profile: The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to.
        :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 data_enabled: Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`.
        :param data_limit: The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000).
        :param ip_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.
        :param ip_commands_method: A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.
        :param sms_commands_enabled: Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`.
        :param sms_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.
        :param sms_commands_method: A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.

        :returns: The created FleetInstance
        	re   rd   ZDataEnabledrj   rf   rg   ZSmsCommandsEnabledrh   ri   rk   rl   )r   rn   r7   creater]   r   r0   r?   r   r    r!   r'   r(   r#   r$   r%   rm   r   r   r   r   rt   s  s$    zFleetList.createc
                    sD   t |||||||||	d	}
| jjd| j|
dI dH }t| j|S )a  
        Asynchronously create the FleetInstance

        :param network_access_profile: The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to.
        :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 data_enabled: Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`.
        :param data_limit: The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000).
        :param ip_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.
        :param ip_commands_method: A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.
        :param sms_commands_enabled: Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`.
        :param sms_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.
        :param sms_commands_method: A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`.

        :returns: The created FleetInstance
        rs   rk   rl   N)r   rn   r7   create_asyncr]   r   ru   r   r   r   rv     s$    zFleetList.create_asyncN)r?   limit	page_sizer5   c                 C   s2   | j ||}| j||d d}| j ||d S )a  
        Streams FleetInstance 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 str network_access_profile: The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to.
        :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
        rx   r?   rx   rw   )r7   read_limitspagestreamr0   r?   rw   rx   Zlimitsr{   r   r   r   r|     s
    zFleetList.streamc                    s8   | j ||}| j||d dI dH }| j ||d S )a  
        Asynchronously streams FleetInstance 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 str network_access_profile: The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to.
        :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
        rx   ry   Nrw   )r7   rz   
page_asyncstream_asyncr}   r   r   r   r     s
    zFleetList.stream_asyncc                 C   s   t | j|||dS )a  
        Lists FleetInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str network_access_profile: The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to.
        :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?   rw   rx   )listr|   r0   r?   rw   rx   r   r   r   r     s    zFleetList.listc                    s&   dd | j |||dI dH 2 I dH S )a  
        Asynchronously lists FleetInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str network_access_profile: The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to.
        :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 )Nr   )rL   recordr   r   r   
<listcomp>A  s   z(FleetList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r   
list_async,  s    
zFleetList.list_async)r?   
page_tokenpage_numberrx   r5   c                 C   s4   t ||||d}| jjd| j|d}t| j|S )a  
        Retrieve a single page of FleetInstance records from the API.
        Request is executed immediately

        :param network_access_profile: The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to.
        :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 FleetInstance
        re   Z	PageTokenr   ZPageSizer^   r`   ra   params)r   rn   r7   r{   r]   rp   r0   r?   r   r   rx   rm   responser   r   r   r{   J  s    	zFleetList.pagec                    s:   t ||||d}| jjd| j|dI dH }t| j|S )a!  
        Asynchronously retrieve a single page of FleetInstance records from the API.
        Request is executed immediately

        :param network_access_profile: The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to.
        :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 FleetInstance
        r   r^   r   N)r   rn   r7   r~   r]   rp   r   r   r   r   r~   h  s    	zFleetList.page_async)
target_urlr5   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of FleetInstance records from the API.
        Request is executed immediately

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

        :returns: Page of FleetInstance
        r^   )r7   domaintwiliorequestrp   r0   r   r   r   r   r   get_page  s    	zFleetList.get_pagec                    s$   | j jjd|I dH }t| j |S )z
        Asynchronously retrieve a specific page of FleetInstance records from the API.
        Request is executed immediately

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

        :returns: Page of FleetInstance
        r^   N)r7   r   r   Zrequest_asyncrp   r   r   r   r   get_page_async  s    	zFleetList.get_page_async)r   r5   c                 C   s   t | j|dS zi
        Constructs a FleetContext

        :param sid: The SID of the Fleet resource to update.
        r6   r3   r7   r0   r   r   r   r   r+     s    zFleetList.getc                 C   s   t | j|dS r   r   r   r   r   r   __call__  s    zFleetList.__call__r4   c                 C   s   dS )rF   z<Twilio.Supersim.V1.FleetList>r   r8   r   r   r   rV     s    zFleetList.__repr__)!r   r   r   r   r*   r   rZ   rX   r   rW   boolr[   r   rt   rv   r   r   r|   r	   r   r   r   r   rp   r{   r~   r   r   r3   r+   r   rV   r\   r   r   r1   r   rr   g  s   







4







3



 



 



 rr   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   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   r3   rp   rr   r   r   r   r   <module>   s   $ & 