U
    iRfC]                     @   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	available
downloaded	installedfailedN)	__name__
__module____qualname__ZNEWZ	RESERVINGZ	AVAILABLEZ
DOWNLOADEDZ	INSTALLEDZFAILED r   r   H/tmp/pip-unpacked-wheel-74se_viw/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   r0   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!   )r4   r8   _versionr3   r5   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   rB   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 {}>joinr3   itemsrG   r5   contextr   r   r   __repr__r   s    zEsimProfileInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r0   propertyr>   r@   rB   rR   __classcell__r   r   r6   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 )r8   )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/   r0   r3   rG   _uri)r5   r   r!   r6   r   r   r0   ~   s
     zEsimProfileContext.__init__r9   c                 C   s(   | j jd| jd}t| j || jd dS )r?   GETmethodurir!   r;   )r<   r@   rW   r   r3   r5   r    r   r   r   r@      s    zEsimProfileContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )rA   rX   rY   Nr!   r;   )r<   rB   rW   r   r3   r\   r   r   r   rB      s    zEsimProfileContext.fetch_asyncc                 C   s$   d dd | j D }d|S )rC   rD   c                 s   s   | ]\}}d  ||V  qdS rE   rF   rH   r   r   r   rL      s     z.EsimProfileContext.__repr__.<locals>.<genexpr>z*<Twilio.Supersim.V1.EsimProfileContext {}>rM   rP   r   r   r   rR      s    zEsimProfileContext.__repr__)r   r   r   r   rT   r0   r   r@   rB   rR   rV   r   r   r6   r   r8   |   s   r8   c                   @   s2   e Zd Zeeef edddZedddZdS )EsimProfilePage)r    r:   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_instancer9   c                 C   s   dS )rC   z$<Twilio.Supersim.V1.EsimProfilePage>r   r=   r   r   r   rR      s    zEsimProfilePage.__repr__N)	r   r   r   r   rT   r   r   r^   rR   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/   r0   rW   )r5   r   r6   r   r   r0      s    zEsimProfileList.__init__)callback_urlcallback_methodgenerate_matching_idr&   r:   c                 C   sJ   t ||t||d}t ddi}| 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-urlencodedPOSTrZ   r[   dataheaders)r   ofr   boolean_to_stringr<   createrW   r   r5   r`   ra   rb   r&   ri   rj   r    r   r   r   rm      s       zEsimProfileList.createc                    sP   t ||t||d}t ddi}| 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
        rc   re   rf   rg   rh   N)r   rk   r   rl   r<   create_asyncrW   r   rn   r   r   r   ro      s       zEsimProfileList.create_asyncNr   )r&   r$   r%   limit	page_sizer:   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r5   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   B  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   r5   r&   r$   r%   rp   rq   r   r   r   rz   c  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   )rI   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   r:   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/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
        rd   ZSimSidr   Z	PageTokenr   ZPageSizerX   rZ   r[   params)r   rk   r<   rt   rW   r]   	r5   r&   r$   r%   r   r   rq   ri   responser   r   r   rt     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/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   rX   r   N)r   rk   r<   rw   rW   r]   r   r   r   r   rw     s      zEsimProfileList.page_async)
target_urlr:   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]   r5   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!   r:   c                 C   s   t | j|dS zu
        Constructs a EsimProfileContext

        :param sid: The SID of the eSIM Profile resource to fetch.
        r;   r8   r<   r5   r!   r   r   r   r1     s    zEsimProfileList.getc                 C   s   t | j|dS r   r   r   r   r   r   __call__  s    zEsimProfileList.__call__r9   c                 C   s   dS )rC   z$<Twilio.Supersim.V1.EsimProfileList>r   r=   r   r   r   rR     s    zEsimProfileList.__repr__)!r   r   r   r   r0   r   Zunsetr   rT   rS   boolr   rm   ro   r   intr   ru   r	   rx   r   rz   r~   r]   rt   rw   r   r   r8   r1   r   rR   rV   r   r   r6   r   r_      s   



$



$


#


#


%


&





&





&r_   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   r8   r]   r_   r   r   r   r   <module>   s   $cA