o
    f>hI                     @   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 - Flex
    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dZ	ddedeeef dee f fddZ	e
dd
dZejfdeeef dd fddZejfdeeef dd fddZdefddZ  ZS )PluginReleaseInstancea5  
    :ivar sid: The unique string that we created to identify the Plugin Release resource.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Plugin Release resource and owns this resource.
    :ivar configuration_sid: The SID of the Plugin Configuration resource to release.
    :ivar date_created: The date and time in GMT when the Flex Plugin Release was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar url: The absolute URL of the Plugin Release resource.
    Nversionpayloadsidc                    sh   t  | |d| _|d| _|d| _t|d| _|d| _	d|p,| ji| _
d | _d S )Nr   account_sidconfiguration_siddate_createdurl)super__init__getr   r   r   r
   iso8601_datetimer   r   	_solution_context)selfr   r   r   	__class__ Y/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/flex_api/v1/plugin_release.pyr   "   s   

zPluginReleaseInstance.__init__returnPluginReleaseContextc                 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: PluginReleaseContext for this PluginReleaseInstance
        Nr   r   )r   r%   _versionr   r   r"   r"   r#   _proxy4   s   
zPluginReleaseInstance._proxyflex_metadatac                 C   s   | j j|dS )
        Fetch the PluginReleaseInstance

        :param flex_metadata: The Flex-Metadata HTTP request header

        :returns: The fetched PluginReleaseInstance
        r*   )r)   fetchr   r*   r"   r"   r#   r-   C   s   
zPluginReleaseInstance.fetchc                    s   | j j|dI dH S )
        Asynchronous coroutine to fetch the PluginReleaseInstance

        :param flex_metadata: The Flex-Metadata HTTP request header

        :returns: The fetched PluginReleaseInstance
        r,   N)r)   fetch_asyncr.   r"   r"   r#   r0   Q   s   
z!PluginReleaseInstance.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>e       z1PluginReleaseInstance.__repr__.<locals>.<genexpr>z,<Twilio.FlexApi.V1.PluginReleaseInstance {}>joinr   itemsr7   r   contextr"   r"   r#   __repr___      
zPluginReleaseInstance.__repr__N)r$   r%   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr)   r   unsetr   objectr-   r0   rC   __classcell__r"   r"   r    r#   r      s2    	




r   c                       st   e Zd Zdedef fddZejfdeee	f de
fddZejfdeee	f 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 PluginReleaseContext

        :param version: Version that contains the resource
        :param sid: The SID of the Flex Plugin Release resource to fetch.
        r   z/PluginService/Releases/{sid}Nr"   )r   r   r   r7   _uri)r   r   r   r    r"   r#   r   k   s   zPluginReleaseContext.__init__r*   r$   c                 C   sL   t d|i}t i }d|d< | jjd| j||d}t| j|| jd dS )r+   Flex-Metadataapplication/jsonAcceptGETmethoduriparamsheadersr   r&   )r   ofr'   r-   rO   r   r   r   r*   datarX   r   r"   r"   r#   r-   z   s   

zPluginReleaseContext.fetchc                    sT   t d|i}t i }d|d< | jjd| j||dI dH }t| j|| jd dS )	r/   rP   rQ   rR   rS   rT   Nr   r&   )r   rY   r'   r0   rO   r   r   rZ   r"   r"   r#   r0      s   

z PluginReleaseContext.fetch_asyncc                 C   r1   )r2   r3   c                 s   r4   r5   r6   r8   r"   r"   r#   r<      r=   z0PluginReleaseContext.__repr__.<locals>.<genexpr>z+<Twilio.FlexApi.V1.PluginReleaseContext {}>r>   rA   r"   r"   r#   rC      rD   zPluginReleaseContext.__repr__)rF   rG   rH   r   rJ   r   r   rL   r   rM   r   r-   r0   rC   rN   r"   r"   r    r#   r%   i   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 )PluginReleasePager   r$   c                 C   s   t | j|S )zs
        Build an instance of PluginReleaseInstance

        :param payload: Payload response from the API
        )r   r'   )r   r   r"   r"   r#   get_instance   s   zPluginReleasePage.get_instancec                 C      dS )r2   z%<Twilio.FlexApi.V1.PluginReleasePage>r"   r(   r"   r"   r#   rC         zPluginReleasePage.__repr__N)	rF   rG   rH   r   rJ   r   r   r]   rC   r"   r"   r"   r#   r\      s    r\   c                       s@  e Zd Zdef fddZejfdedeee	f de
fddZejfdedeee	f de
fd	d
Zejddfdeee	f dee dee dee
 fddZejddfdeee	f dee dee dee
 fddZejddfdeee	f dee dee dee
 fddZejddfdeee	f dee dee de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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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 )(PluginReleaseListr   c                    s   t  | d| _dS )zo
        Initialize the PluginReleaseList

        :param version: Version that contains the resource

        z/PluginService/ReleasesN)r   r   rO   )r   r   r    r"   r#   r      s   
zPluginReleaseList.__init__configuration_idr*   r$   c                 C   sP   t d|i}t |dd}d|d< d|d< | jjd| j||d}t| j|S )	a  
        Create the PluginReleaseInstance

        :param configuration_id: The SID or the Version of the Flex Plugin Configuration to release.
        :param flex_metadata: The Flex-Metadata HTTP request header

        :returns: The created PluginReleaseInstance
        ConfigurationId!application/x-www-form-urlencodedrP   Content-Typere   rQ   rR   POSTrU   rV   r[   rX   )r   rY   r'   createrO   r   r   ra   r*   r[   rX   r   r"   r"   r#   rh      s   
zPluginReleaseList.createc                    sX   t d|i}t |dd}d|d< d|d< | jjd| j||dI d	H }t| j|S )
a   
        Asynchronously create the PluginReleaseInstance

        :param configuration_id: The SID or the Version of the Flex Plugin Configuration to release.
        :param flex_metadata: The Flex-Metadata HTTP request header

        :returns: The created PluginReleaseInstance
        rb   rc   rd   re   rQ   rR   rf   rg   N)r   rY   r'   create_asyncrO   r   ri   r"   r"   r#   rj     s    
zPluginReleaseList.create_asyncNlimit	page_sizec                 C   s2   | j ||}| j||d d}| j ||d S )a  
        Streams PluginReleaseInstance 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 flex_metadata: The Flex-Metadata HTTP request header
        :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*   rl   rk   )r'   read_limitspagestreamr   r*   rk   rl   limitsro   r"   r"   r#   rp   &  s   zPluginReleaseList.streamc                    s:   | j ||}| j||d dI dH }| j ||d S )a  
        Asynchronously streams PluginReleaseInstance 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 flex_metadata: The Flex-Metadata HTTP request header
        :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#   rt   A  s   zPluginReleaseList.stream_asyncc                 C   s   t | j|||dS )aH  
        Lists PluginReleaseInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str flex_metadata: The Flex-Metadata HTTP request header
        :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*   rk   rl   )listrp   r   r*   rk   rl   r"   r"   r#   rv   ^  s   zPluginReleaseList.listc                    s(   dd | j |||dI dH 2 I dH S )aW  
        Asynchronously lists PluginReleaseInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str flex_metadata: The Flex-Metadata HTTP request header
        :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 rE   r"   )r9   recordr"   r"   r#   
<listcomp>  s
    z0PluginReleaseList.list_async.<locals>.<listcomp>ru   N)rt   rw   r"   r"   r#   
list_async{  s   
zPluginReleaseList.list_async
page_tokenpage_numberc                 C   sN   t ||||d}t |dd}d|d< | jjd| j||d}t| j|S )a  
        Retrieve a single page of PluginReleaseInstance records from the API.
        Request is executed immediately

        :param flex_metadata: The Flex-Metadata HTTP request header
        :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 PluginReleaseInstance
        rP   	PageTokenr   PageSizerc   rd   rQ   rR   rS   rT   )r   rY   r'   ro   rO   r\   r   r*   r{   r|   rl   r[   rX   responser"   r"   r#   ro     s"   	
zPluginReleaseList.pagec                    sV   t ||||d}t |dd}d|d< | jjd| j||dI dH }t| j|S )	a  
        Asynchronously retrieve a single page of PluginReleaseInstance records from the API.
        Request is executed immediately

        :param flex_metadata: The Flex-Metadata HTTP request header
        :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 PluginReleaseInstance
        r}   rc   rd   rQ   rR   rS   rT   N)r   rY   r'   rs   rO   r\   r   r"   r"   r#   rs     s$   	
zPluginReleaseList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of PluginReleaseInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PluginReleaseInstance
        rS   )r'   domaintwiliorequestr\   r   r   r   r"   r"   r#   get_page  s   	zPluginReleaseList.get_pagec                    s&   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of PluginReleaseInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PluginReleaseInstance
        rS   N)r'   r   r   request_asyncr\   r   r"   r"   r#   get_page_async  s   	z PluginReleaseList.get_page_asyncr   c                 C      t | j|dS z~
        Constructs a PluginReleaseContext

        :param sid: The SID of the Flex Plugin Release resource to fetch.
        r&   r%   r'   r   r   r"   r"   r#   r        zPluginReleaseList.getc                 C   r   r   r   r   r"   r"   r#   __call__  r   zPluginReleaseList.__call__c                 C   r^   )r2   z%<Twilio.FlexApi.V1.PluginReleaseList>r"   r(   r"   r"   r#   rC     r_   zPluginReleaseList.__repr__) rF   rG   rH   r   r   r   rL   rJ   r   rM   r   rh   rj   r   intr   rp   r	   rt   r   rv   rz   r\   ro   rs   r   r   r%   r   r   rC   rN   r"   r"   r    r#   r`      s    

#

$







 




+




)r`   N)rI   r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r%   r\   r`   r"   r"   r"   r#   <module>   s    $PY