o
    f>h`                     @   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dedeeef de	e f fddZ
edddZdddZdddZd	ef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new	reserving	available
downloaded	installedfailedN)	__name__
__module____qualname__NEW	RESERVING	AVAILABLE
DOWNLOADED	INSTALLEDFAILED r#   r#   W/var/www/html/venv/lib/python3.10/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|pe| 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/   r0   r1   r2   r
   iso8601_datetimer3   r4   r5   	_solution_context)selfr&   r'   r(   	__class__r#   r$   r7   4   s,   

zEsimProfileInstance.__init__returnEsimProfileContextc                 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(   )r;   r@   _versionr:   r<   r#   r#   r$   _proxyQ   s   
zEsimProfileInstance._proxyc                 C   s
   | j  S )c
        Fetch the EsimProfileInstance


        :returns: The fetched EsimProfileInstance
        )rD   fetchrC   r#   r#   r$   rF   `   s   
zEsimProfileInstance.fetchc                    s   | j  I dH S )}
        Asynchronous coroutine to fetch the EsimProfileInstance


        :returns: The fetched EsimProfileInstance
        N)rD   fetch_asyncrC   r#   r#   r$   rH   i   s   zEsimProfileInstance.fetch_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 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 {}>joinr:   itemsrO   r<   contextr#   r#   r$   __repr__r      
zEsimProfileInstance.__repr__N)r?   r@   )r?   r   )r   r   r   objectr%   r   r   strr   r   r7   propertyrD   rF   rH   r[   __classcell__r#   r#   r=   r$   r      s     


		r   c                       sP   e Zd Zdedef fddZdefddZdefdd	Zdefd
dZ	  Z
S )r@   r&   r(   c                    s.   t  | d|i| _djd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}Nr#   )r6   r7   r:   rO   _uri)r<   r&   r(   r=   r#   r$   r7   ~   s   zEsimProfileContext.__init__r?   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )rE   application/jsonAcceptGETmethoduriheadersr(   rA   )r   ofrB   rF   rb   r   r:   r<   ri   r'   r#   r#   r$   rF      s   
zEsimProfileContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )rG   rc   rd   re   rf   Nr(   rA   )r   rj   rB   rH   rb   r   r:   rk   r#   r#   r$   rH      s   
zEsimProfileContext.fetch_asyncc                 C   rI   )rJ   rK   c                 s   rL   rM   rN   rP   r#   r#   r$   rT      rU   z.EsimProfileContext.__repr__.<locals>.<genexpr>z*<Twilio.Supersim.V1.EsimProfileContext {}>rV   rY   r#   r#   r$   r[      r\   zEsimProfileContext.__repr__)r   r   r   r   r_   r7   r   rF   rH   r[   ra   r#   r#   r=   r$   r@   |   s
    r@   c                   @   s4   e Zd Zdeeef defddZdefddZdS )EsimProfilePager'   r?   c                 C   s   t | j|S )zq
        Build an instance of EsimProfileInstance

        :param payload: Payload response from the API
        )r   rB   )r<   r'   r#   r#   r$   get_instance   s   zEsimProfilePage.get_instancec                 C      dS )rJ   z$<Twilio.Supersim.V1.EsimProfilePage>r#   rC   r#   r#   r$   r[         zEsimProfilePage.__repr__N)	r   r   r   r   r_   r   r   rm   r[   r#   r#   r#   r$   rl      s    rl   c                       sX  e Zd Zdef fddZejejejejfdeee	f deee	f dee
e	f deee	f def
d	d
Zejejejejfdeee	f deee	f dee
e	f deee	f def
ddZejejejddfdeee	f deee	f dede	f dee dee dee fddZejejejddfdeee	f deee	f dede	f dee dee dee fddZejejejddfdeee	f deee	f dede	f dee dee dee fddZejejejddfdeee	f deee	f dede	f dee dee dee fddZejejejejejejfdeee	f deee	f dede	f deee	f deee	f deee	f defddZejejejejejejfdeee	f deee	f dede	f deee	f deee	f deee	f defdd Zd!edefd"d#Zd!edefd$d%Zd&edefd'd(Zd&edefd)d*Zdefd+d,Z  Z S )-EsimProfileListr&   c                    s   t  | d| _dS )zm
        Initialize the EsimProfileList

        :param version: Version that contains the resource

        z/ESimProfilesN)r6   r7   rb   )r<   r&   r=   r#   r$   r7      s   
zEsimProfileList.__init__callback_urlcallback_methodgenerate_matching_idr-   r?   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
        CallbackUrlCallbackMethodGenerateMatchingIdEidContent-Type!application/x-www-form-urlencodedrc   rd   POSTrg   rh   datari   )r   rj   r   boolean_to_stringrB   createrb   r   r<   rq   rr   rs   r-   r}   ri   r'   r#   r#   r$   r      s   
zEsimProfileList.createc                    sb   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
        rt   ry   rz   rc   rd   r{   r|   N)r   rj   r   r~   rB   create_asyncrb   r   r   r#   r#   r$   r     s   
zEsimProfileList.create_asyncNr+   r,   r   limit	page_sizec                 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
        r   r-   r+   r,   r   r   )rB   read_limitspagestreamr<   r-   r+   r,   r   r   limitsr   r#   r#   r$   r   -  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
        r   r   Nr   )rB   r   
page_asyncstream_asyncr   r#   r#   r$   r   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,   r   r   )listr   r<   r-   r+   r,   r   r   r#   r#   r$   r   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 r]   r#   )rQ   recordr#   r#   r$   
<listcomp>  s
    z.EsimProfileList.list_async.<locals>.<listcomp>r   N)r   r   r#   r#   r$   
list_async  s   
zEsimProfileList.list_async
page_tokenpage_numberc           
   	   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
        rx   SimSidr%   	PageTokenr   PageSizery   rz   rc   rd   re   rg   rh   paramsri   )r   rj   rB   r   rb   rl   
r<   r-   r+   r,   r   r   r   r}   ri   responser#   r#   r$   r     s   
zEsimProfileList.pagec           
   	      sX   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   ry   rz   rc   rd   re   r   N)r   rj   rB   r   rb   rl   r   r#   r#   r$   r     s    
zEsimProfileList.page_async
target_urlc                 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
        re   )rB   domaintwiliorequestrl   r<   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
        re   N)rB   r   r   request_asyncrl   r   r#   r#   r$   get_page_async  s   	zEsimProfileList.get_page_asyncr(   c                 C      t | j|dS zu
        Constructs a EsimProfileContext

        :param sid: The SID of the eSIM Profile resource to fetch.
        rA   r@   rB   r<   r(   r#   r#   r$   r8   "     zEsimProfileList.getc                 C   r   r   r   r   r#   r#   r$   __call__*  r   zEsimProfileList.__call__c                 C   rn   )rJ   z$<Twilio.Supersim.V1.EsimProfileList>r#   rC   r#   r#   r$   r[   2  ro   zEsimProfileList.__repr__)!r   r   r   r   r7   r   unsetr   r_   r^   boolr   r   r   r   intr   r   r	   r   r   r   r   rl   r   r   r   r   r@   r8   r   r[   ra   r#   r#   r=   r$   rp      s.   




(




(



#



#



%



&






,






*rp   N)__doc__r   typingr   r   r   r   r   r   r	   twilio.baser
   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r@   rl   rp   r#   r#   r#   r$   <module>   s    $cE