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 - 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	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d dddZd dddZedddZ  ZS )EsimProfileInstancec                   @   s$   e Zd ZdZdZdZdZdZdZdS )EsimProfileInstance.StatusnewZ	reserving	availableZ
downloaded	installedfailedN)	__name__
__module____qualname__ZNEWZ	RESERVINGZ	AVAILABLEZ
DOWNLOADEDZ	INSTALLEDZFAILED r   r   c/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/supersim/v1/esim_profile.pyStatus   s   r   N)versionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _|d| _t|d| _t|d| _|d| _d|p| ji| _d | _d S )Nr    account_sidiccidsim_sidstatuseidsmdp_plus_addressmatching_idactivation_code
error_codeerror_messagedate_createddate_updatedurl)super__init__getr    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r
   Ziso8601_datetimer+   r,   r-   	_solution_context)selfr   r   r    	__class__r   r   r/   4   s.     zEsimProfileInstance.__init__EsimProfileContext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: EsimProfileContext for this EsimProfileInstance
        Nr    r    )r2   r6   _versionr1   r3   r   r   r   _proxyQ   s    
zEsimProfileInstance._proxyc                 C   s
   | j  S )c
        Fetch the EsimProfileInstance


        :returns: The fetched EsimProfileInstance
        )r<   fetchr;   r   r   r   r>   `   s    zEsimProfileInstance.fetchc                    s   | j  I dH S )}
        Asynchronous coroutine to fetch the EsimProfileInstance


        :returns: The fetched EsimProfileInstance
        N)r<   fetch_asyncr;   r   r   r   r@   i   s    zEsimProfileInstance.fetch_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>x   s     z/EsimProfileInstance.__repr__.<locals>.<genexpr>z+<Twilio.Supersim.V1.EsimProfileInstance {}>joinr1   itemsrE   r3   contextr   r   r   __repr__r   s    zEsimProfileInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r/   propertyr<   r>   r@   rP   __classcell__r   r   r4   r   r      s     
 		r   c                       sN   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	  Z
S )r6   )r   r    c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the EsimProfileContext

        :param version: Version that contains the resource
        :param sid: The SID of the eSIM Profile resource to fetch.
        r    z/ESimProfiles/{sid}N)r.   r/   r1   rE   _uri)r3   r   r    r4   r   r   r/   ~   s
     zEsimProfileContext.__init__r7   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r=   application/jsonAcceptGETmethoduriheadersr    r9   )r   ofr:   r>   rU   r   r1   r3   r\   r   r   r   r   r>      s    
zEsimProfileContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r?   rV   rW   rX   rY   Nr    r9   )r   r]   r:   r@   rU   r   r1   r^   r   r   r   r@      s    
  zEsimProfileContext.fetch_asyncc                 C   s$   d dd | j D }d|S )rA   rB   c                 s   s   | ]\}}d  ||V  qdS rC   rD   rF   r   r   r   rJ      s     z.EsimProfileContext.__repr__.<locals>.<genexpr>z*<Twilio.Supersim.V1.EsimProfileContext {}>rK   rN   r   r   r   rP      s    zEsimProfileContext.__repr__)r   r   r   r   rR   r/   r   r>   r@   rP   rT   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 )EsimProfilePage)r   r8   c                 C   s   t | j|S )zq
        Build an instance of EsimProfileInstance

        :param payload: Payload response from the API
        )r   r:   )r3   r   r   r   r   get_instance   s    zEsimProfilePage.get_instancer7   c                 C   s   dS )rA   z$<Twilio.Supersim.V1.EsimProfilePage>r   r;   r   r   r   rP      s    zEsimProfilePage.__repr__N)	r   r   r   r   rR   r   r   r`   rP   r   r   r   r   r_      s   r_   c                	       s   e Zd Zed f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jejejd	d	feee	f eee	f ed
e	f ee ee ee dddZejejejd	d	feee	f eee	f ed
e	f ee ee ee dddZejejejd	d	feee	f eee	f ed
e	f ee ee ee dddZejejejd	d	feee	f eee	f ed
e	f ee ee ee dddZejejejejejejfeee	f eee	f ed
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feee	f eee	f ed
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 )&EsimProfileList)r   c                    s   t  | d| _dS )zm
        Initialize the EsimProfileList

        :param version: Version that contains the resource

        z/ESimProfilesN)r.   r/   rU   )r3   r   r4   r   r   r/      s    zEsimProfileList.__init__)callback_urlcallback_methodgenerate_matching_idr%   r8   c                 C   sZ   t ||t||d}t ddi}d|d< d|d< | jjd| j||d}t| j|S )a  
        Create the EsimProfileInstance

        :param callback_url: The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`.
        :param callback_method: The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST.
        :param generate_matching_id: When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile.
        :param eid: Identifier of the eUICC that will claim the eSIM Profile.

        :returns: The created EsimProfileInstance
        ZCallbackUrlZCallbackMethodZGenerateMatchingIdEidContent-Type!application/x-www-form-urlencodedrV   rW   POSTrZ   r[   datar\   )r   r]   r   boolean_to_stringr:   createrU   r   r3   rb   rc   rd   r%   rk   r\   r   r   r   r   rm      s"       zEsimProfileList.createc                    s`   t ||t||d}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|S )	a  
        Asynchronously create the EsimProfileInstance

        :param callback_url: The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`.
        :param callback_method: The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST.
        :param generate_matching_id: When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile.
        :param eid: Identifier of the eUICC that will claim the eSIM Profile.

        :returns: The created EsimProfileInstance
        re   rg   rh   rV   rW   ri   rj   N)r   r]   r   rl   r:   create_asyncrU   r   rn   r   r   r   ro     s"       zEsimProfileList.create_asyncNr   )r%   r#   r$   limit	page_sizer8   c                 C   s6   | j ||}| j||||d d}| j ||d S )a  
        Streams EsimProfileInstance 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 eid: List the eSIM Profiles that have been associated with an EId.
        :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records.
        :param &quot;EsimProfileInstance.Status&quot; status: List the eSIM Profiles that are in a given status.
        :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
        rq   r%   r#   r$   rq   rp   )r:   read_limitspagestreamr3   r%   r#   r$   rp   rq   Zlimitsrt   r   r   r   ru   -  s       zEsimProfileList.streamc                    s<   | j ||}| j||||d dI dH }| j ||d S )a  
        Asynchronously streams EsimProfileInstance 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 eid: List the eSIM Profiles that have been associated with an EId.
        :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records.
        :param &quot;EsimProfileInstance.Status&quot; status: List the eSIM Profiles that are in a given status.
        :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
        rq   rr   Nrp   )r:   rs   
page_asyncstream_asyncrv   r   r   r   rx   N  s       zEsimProfileList.stream_asyncc                 C   s   t | j|||||dS )a  
        Lists EsimProfileInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str eid: List the eSIM Profiles that have been associated with an EId.
        :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records.
        :param &quot;EsimProfileInstance.Status&quot; status: List the eSIM Profiles that are in a given status.
        :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#   r$   rp   rq   )listru   r3   r%   r#   r$   rp   rq   r   r   r   rz   o  s    zEsimProfileList.listc                    s*   dd | j |||||dI dH 2 I dH S )a  
        Asynchronously lists EsimProfileInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str eid: List the eSIM Profiles that have been associated with an EId.
        :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records.
        :param &quot;EsimProfileInstance.Status&quot; status: List the eSIM Profiles that are in a given status.
        :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   )rG   recordr   r   r   
<listcomp>  s   z.EsimProfileList.list_async.<locals>.<listcomp>ry   N)rx   r{   r   r   r   
list_async  s    
zEsimProfileList.list_async)r%   r#   r$   
page_tokenpage_numberrq   r8   c           
   	   C   sP   t ||||||d}t ddi}d|d< | jjd| j||d}	t| j|	S )a  
        Retrieve a single page of EsimProfileInstance records from the API.
        Request is executed immediately

        :param eid: List the eSIM Profiles that have been associated with an EId.
        :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records.
        :param status: List the eSIM Profiles that are in a given status.
        :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 EsimProfileInstance
        rf   ZSimSidr   Z	PageTokenr   ZPageSizerg   rh   rV   rW   rX   rZ   r[   paramsr\   )r   r]   r:   rt   rU   r_   
r3   r%   r#   r$   r   r   rq   rk   r\   responser   r   r   rt     s$       zEsimProfileList.pagec           
   	      sV   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 EsimProfileInstance records from the API.
        Request is executed immediately

        :param eid: List the eSIM Profiles that have been associated with an EId.
        :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records.
        :param status: List the eSIM Profiles that are in a given status.
        :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 EsimProfileInstance
        r   rg   rh   rV   rW   rX   r   N)r   r]   r:   rw   rU   r_   r   r   r   r   rw     s$       zEsimProfileList.page_async)
target_urlr8   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of EsimProfileInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EsimProfileInstance
        rX   )r:   domaintwiliorequestr_   r3   r   r   r   r   r   get_page
  s    	zEsimProfileList.get_pagec                    s$   | j jjd|I dH }t| j |S )a
  
        Asynchronously retrieve a specific page of EsimProfileInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EsimProfileInstance
        rX   N)r:   r   r   Zrequest_asyncr_   r   r   r   r   get_page_async  s    	zEsimProfileList.get_page_async)r    r8   c                 C   s   t | j|dS zu
        Constructs a EsimProfileContext

        :param sid: The SID of the eSIM Profile resource to fetch.
        r9   r6   r:   r3   r    r   r   r   r0   "  s    zEsimProfileList.getc                 C   s   t | j|dS r   r   r   r   r   r   __call__*  s    zEsimProfileList.__call__r7   c                 C   s   dS )rA   z$<Twilio.Supersim.V1.EsimProfileList>r   r;   r   r   r   rP   2  s    zEsimProfileList.__repr__)!r   r   r   r   r/   r   unsetr   rR   rQ   boolr   rm   ro   r   intr   ru   r	   rx   r   rz   r~   r_   rt   rw   r   r   r6   r0   r   rP   rT   r   r   r4   r   ra      s   



(



(


#


#


%


&





,





*ra   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   r_   ra   r   r   r   r   <module>   s   $cE