a
    !fG\                     @   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                       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   e/var/www/html/python-backend/venv/lib/python3.9/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
   iso8601_datetimer*   r+   r,   	_solution_context)selfr   r   r   	__class__r   r   r.   4   s,    
zEsimProfileInstance.__init__EsimProfileContext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: 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       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@   rQ   __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 i | 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(   | j jd| jd}t| j || jd dS )r=   GETmethodurir   r9   )r:   r>   rV   r   r1   r3   r   r   r   r   r>      s    zEsimProfileContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r?   rW   rX   Nr   r9   )r:   r@   rV   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      rK   z.EsimProfileContext.__repr__.<locals>.<genexpr>z*<Twilio.Supersim.V1.EsimProfileContext {}>rL   rO   r   r   r   rQ      s    zEsimProfileContext.__repr__)r   r   r   r   rS   r.   r   r>   r@   rQ   rU   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:   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   rQ      s    zEsimProfilePage.__repr__N)	r   r   r   r   rS   r   r   r]   rQ   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.   rV   )r3   r   r4   r   r   r.      s    zEsimProfileList.__init__)callback_urlcallback_methodgenerate_matching_idr$   r8   c                 C   s4   t ||||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POSTrY   rZ   data)r   ofr:   createrV   r   r3   r_   r`   ra   r$   rf   r   r   r   r   rh      s    	zEsimProfileList.createc                    s:   t ||||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
        rb   rd   re   N)r   rg   r:   create_asyncrV   r   ri   r   r   r   rj      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/wireless/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
        rl   r$   r"   r#   rl   rk   )r:   read_limitspagestreamr3   r$   r"   r#   rk   rl   Zlimitsro   r   r   r   rp     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/wireless/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
        rl   rm   Nrk   )r:   rn   
page_asyncstream_asyncrq   r   r   r   rs   ?  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/wireless/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#   rk   rl   )listrp   r3   r$   r"   r#   rk   rl   r   r   r   ru   `  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/wireless/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>rt   N)rs   rv   r   r   r   
list_async  s    
zEsimProfileList.list_async)r$   r"   r#   
page_tokenpage_numberrl   r8   c           	   	   C   s8   t ||||||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/wireless/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
        rc   ZSimSidr   Z	PageTokenr   ZPageSizerW   rY   rZ   params)r   rg   r:   ro   rV   r\   	r3   r$   r"   r#   rz   r{   rl   rf   responser   r   r   ro     s    zEsimProfileList.pagec           	   	      s>   t ||||||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/wireless/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|   rW   r}   N)r   rg   r:   rr   rV   r\   r   r   r   r   rr     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
        rW   )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
        rW   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   r/   	  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   rQ     s    zEsimProfileList.__repr__)!r   r   r   r   r.   r   unsetr   rS   rR   boolr   rh   rj   r   intr   rp   r	   rs   r   ru   ry   r\   ro   rr   r   r   r6   r/   r   rQ   rU   r   r   r4   r   r^      s   



$



$


#


#


%


&





&





&r^   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   r6   r\   r^   r   r   r   r   <module>   s   $b@