a
    !fD                     @   s   d Z ddlmZmZmZmZ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 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.
    )AnyDictListOptionalUnionIteratorAsyncIterator)values)InstanceContext)InstanceResource)ListResource)Version)Pagec                       st   e Zd Zd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 )NetworkInstancea  
    :ivar sid: The unique string that we created to identify the Network resource.
    :ivar friendly_name: A human readable identifier of this resource.
    :ivar url: The absolute URL of the Network resource.
    :ivar iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resource.
    :ivar identifiers: Array of objects identifying the [MCC-MNCs](https://en.wikipedia.org/wiki/Mobile_country_code) that are included in the Network resource.
    N)versionpayloadsidc                    sb   t  | |d| _|d| _|d| _|d| _|d| _d|pR| ji| _d | _	d S )Nr   friendly_nameurliso_countryidentifiers)
super__init__getr   r   r   r   r   	_solution_context)selfr   r   r   	__class__ `/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/supersim/v1/network.pyr   #   s    
zNetworkInstance.__init__NetworkContext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: NetworkContext for this NetworkInstance
        Nr   r   )r   r!   _versionr   r   r   r   r    _proxy3   s    
zNetworkInstance._proxyc                 C   s
   | j  S )[
        Fetch the NetworkInstance


        :returns: The fetched NetworkInstance
        )r'   fetchr&   r   r   r    r)   B   s    zNetworkInstance.fetchc                    s   | j  I dH S )u
        Asynchronous coroutine to fetch the NetworkInstance


        :returns: The fetched NetworkInstance
        N)r'   fetch_asyncr&   r   r   r    r+   K   s    zNetworkInstance.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>Z       z+NetworkInstance.__repr__.<locals>.<genexpr>z'<Twilio.Supersim.V1.NetworkInstance {}>joinr   itemsr0   r   contextr   r   r    __repr__T   s    zNetworkInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr'   r)   r+   r<   __classcell__r   r   r   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 )r!   )r   r   c                    s.   t  | d|i| _djf i | j| _dS )z
        Initialize the NetworkContext

        :param version: Version that contains the resource
        :param sid: The SID of the Network resource to fetch.
        r   z/Networks/{sid}N)r   r   r   r0   _uri)r   r   r   r   r   r    r   _   s    zNetworkContext.__init__r"   c                 C   s(   | j jd| jd}t| j || jd dS )r(   GETmethodurir   r$   )r%   r)   rD   r   r   r   r   r   r   r    r)   n   s    zNetworkContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r*   rE   rF   Nr   r$   )r%   r+   rD   r   r   rI   r   r   r    r+      s    zNetworkContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r,   r-   c                 s   s   | ]\}}d  ||V  qdS r.   r/   r1   r   r   r    r5      r6   z*NetworkContext.__repr__.<locals>.<genexpr>z&<Twilio.Supersim.V1.NetworkContext {}>r7   r:   r   r   r    r<      s    zNetworkContext.__repr__)r=   r>   r?   r   rA   r   r   r)   r+   r<   rC   r   r   r   r    r!   ^   s   r!   c                   @   s2   e Zd Zeeef edddZedddZdS )NetworkPage)r   r#   c                 C   s   t | j|S )zm
        Build an instance of NetworkInstance

        :param payload: Payload response from the API
        )r   r%   rI   r   r   r    get_instance   s    zNetworkPage.get_instancer"   c                 C   s   dS )r,   z <Twilio.Supersim.V1.NetworkPage>r   r&   r   r   r    r<      s    zNetworkPage.__repr__N)	r=   r>   r?   r   rA   r   r   rK   r<   r   r   r   r    rJ      s   rJ   c                	       sp  e Zd Zed fddZejejejddfeee	f eee	f ee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e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e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e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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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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 ) NetworkList)r   c                    s   t  | d| _dS )zi
        Initialize the NetworkList

        :param version: Version that contains the resource

        z	/NetworksN)r   r   rD   )r   r   r   r   r    r      s    zNetworkList.__init__N)r   mccmnclimit	page_sizer#   c                 C   s6   | j ||}| j||||d d}| j ||d S )a  
        Streams NetworkInstance 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 iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read.
        :param str mcc: The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read.
        :param str mnc: The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read.
        :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
        rP   r   rM   rN   rP   rO   )r%   read_limitspagestreamr   r   rM   rN   rO   rP   ZlimitsrS   r   r   r    rT      s
    zNetworkList.streamc                    s<   | j ||}| j||||d dI dH }| j ||d S )a  
        Asynchronously streams NetworkInstance 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 iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read.
        :param str mcc: The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read.
        :param str mnc: The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read.
        :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
        rP   rQ   NrO   )r%   rR   
page_asyncstream_asyncrU   r   r   r    rW      s
    zNetworkList.stream_asyncc                 C   s   t | j|||||dS )a  
        Lists NetworkInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read.
        :param str mcc: The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read.
        :param str mnc: The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read.
        :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   rM   rN   rO   rP   )listrT   r   r   rM   rN   rO   rP   r   r   r    rY      s    zNetworkList.listc                    s*   dd | j |||||dI dH 2 I dH S )a  
        Asynchronously lists NetworkInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read.
        :param str mcc: The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read.
        :param str mnc: The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read.
        :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   )r2   recordr   r   r    
<listcomp>:  s   z*NetworkList.list_async.<locals>.<listcomp>rX   N)rW   rZ   r   r   r    
list_async!  s    
zNetworkList.list_async)r   rM   rN   
page_tokenpage_numberrP   r#   c           	   	   C   s8   t ||||||d}| jjd| j|d}t| j|S )a  
        Retrieve a single page of NetworkInstance records from the API.
        Request is executed immediately

        :param iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read.
        :param mcc: The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read.
        :param mnc: The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read.
        :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 NetworkInstance
        Z
IsoCountryZMccZMncZ	PageTokenr   ZPageSizerE   rG   rH   params)r	   ofr%   rS   rD   rJ   	r   r   rM   rN   r^   r_   rP   dataresponser   r   r    rS   E  s    zNetworkList.pagec           	   	      s>   t ||||||d}| jjd| j|dI dH }t| j|S )a  
        Asynchronously retrieve a single page of NetworkInstance records from the API.
        Request is executed immediately

        :param iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read.
        :param mcc: The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read.
        :param mnc: The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read.
        :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 NetworkInstance
        r`   rE   ra   N)r	   rc   r%   rV   rD   rJ   rd   r   r   r    rV   i  s    zNetworkList.page_async)
target_urlr#   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of NetworkInstance records from the API.
        Request is executed immediately

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

        :returns: Page of NetworkInstance
        rE   )r%   domaintwiliorequestrJ   r   rg   rf   r   r   r    get_page  s    	zNetworkList.get_pagec                    s$   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of NetworkInstance records from the API.
        Request is executed immediately

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

        :returns: Page of NetworkInstance
        rE   N)r%   rh   ri   Zrequest_asyncrJ   rk   r   r   r    get_page_async  s    	zNetworkList.get_page_async)r   r#   c                 C   s   t | j|dS zl
        Constructs a NetworkContext

        :param sid: The SID of the Network resource to fetch.
        r$   r!   r%   r   r   r   r   r    r     s    zNetworkList.getc                 C   s   t | j|dS rn   ro   rp   r   r   r    __call__  s    zNetworkList.__call__r"   c                 C   s   dS )r,   z <Twilio.Supersim.V1.NetworkList>r   r&   r   r   r    r<     s    zNetworkList.__repr__)r=   r>   r?   r   r   r	   unsetr   rA   objectr   intr   r   rT   r   rW   r   rY   r]   rJ   rS   rV   rl   rm   r!   r   rq   r<   rC   r   r   r   r    rL      s   


#


#


%


&





&





&rL   N)r@   typingr   r   r   r   r   r   r   Ztwilio.baser	   Ztwilio.base.instance_contextr
   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r!   rJ   rL   r   r   r   r    <module>   s   $E@