
    pifJ                         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e      Z G d de      Z G d de      Z G d de      Zy)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                        e Zd ZdZ	 ddedeeef   dee   f fdZ	e
dd       Zej                  fdeeef   dd fd	Zej                  fdeeef   dd fd
ZdefdZ x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.
    versionpayloadsidc                 b   t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        |j                  d      | _	        d|xs | j                  i| _
        d | _        y )Nr   account_sidconfiguration_siddate_createdurl)super__init__getr   r   r   r   iso8601_datetimer   r   	_solution_context)selfr   r   r   	__class__s       h/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/flex_api/v1/plugin_release.pyr   zPluginReleaseInstance.__init__"   s     	!")++e"4*1++m*D07<O0P0;0L0LKK'1
 #*++e"4 3?$((
 9=    returnc                     | j                   )t        | j                  | j                  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
        r   r   )r!   PluginReleaseContext_versionr    r"   s    r$   _proxyzPluginReleaseInstance._proxy4   s9     == 0NN5)DM }}r%   flex_metadatac                 :    | j                   j                  |      S )
        Fetch the PluginReleaseInstance

        :param flex_metadata: The Flex-Metadata HTTP request header

        :returns: The fetched PluginReleaseInstance
        r-   )r,   fetchr"   r-   s     r$   r1   zPluginReleaseInstance.fetchC   s#     {{  ' ! 
 	
r%   c                 V   K   | j                   j                  |       d{   S 7 w)
        Asynchronous coroutine to fetch the PluginReleaseInstance

        :param flex_metadata: The Flex-Metadata HTTP request header

        :returns: The fetched PluginReleaseInstance
        r0   N)r,   fetch_asyncr2   s     r$   r5   z!PluginReleaseInstance.fetch_asyncQ   s1      [[,,' - 
 
 	
 
s    )')c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r$   	<genexpr>z1PluginReleaseInstance.__repr__.<locals>.<genexpr>e        SDAq7>>!Q/S   !z,<Twilio.FlexApi.V1.PluginReleaseInstance {}>joinr    itemsr<   r"   contexts     r$   __repr__zPluginReleaseInstance.__repr___   s6     ((SDNN<P<P<RSS=DDWMMr%   )N)r&   r)   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr,   r   unsetr   objectr1   r5   rI   __classcell__r#   s   @r$   r   r      s     OS==)-c3h=>Fsm=$   39,,
"3;/
	 
 39,,
"3;/
	 
N# Nr%   r   c                        e Zd Zdedef fdZej                  fdeee	f   de
fdZej                  fdeee	f   de
fdZdefdZ xZS )	r)   r   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)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}N )r   r   r    r<   _uri)r"   r   r   r#   s      r$   r   zPluginReleaseContext.__init__k   s@     	! 3
 ;3::LT^^L	r%   r-   r&   c                 "   t        j                  i       }|t         j                  u st        |t              r|r||d<   d|d<   | j
                  j                  d| j                  |      }t        | j
                  || j                  d         S )r/   Flex-Metadataapplication/jsonAcceptGETmethoduriheadersr   r(   )
r   ofrP   
isinstancerN   r*   r1   rW   r   r    r"   r-   r`   r   s       r$   r1   zPluginReleaseContext.fetchz   s     ))B- V\\)=#.}'4GO$.--%%U		7%S$MMu%
 	
r%   c                 >  K   t        j                  i       }|t         j                  u st        |t              r|r||d<   d|d<   | j
                  j                  d| j                  |       d{   }t        | j
                  || j                  d         S 7 )w)	r4   rY   rZ   r[   r\   r]   Nr   r(   )
r   ra   rP   rb   rN   r*   r5   rW   r   r    rc   s       r$   r5   z PluginReleaseContext.fetch_async   s      ))B- V\\)=#.}'4GO$.11dii 2 
 
 %MMu%
 	
	
s   A/B1B2*Bc                     dj                  d | j                  j                         D              }dj                  |      S )r7   r8   c              3   F   K   | ]  \  }}d j                  ||        ywr:   r;   r=   s      r$   rA   z0PluginReleaseContext.__repr__.<locals>.<genexpr>   rB   rC   z+<Twilio.FlexApi.V1.PluginReleaseContext {}>rD   rG   s     r$   rI   zPluginReleaseContext.__repr__   s6     ((SDNN<P<P<RSS<CCGLLr%   )rJ   rK   rL   r   rN   r   r   rP   r   rQ   r   r1   r5   rI   rR   rS   s   @r$   r)   r)   i   su    M Mc M  39,,
"3;/
	
< 39,,
"3;/
	
>M# Mr%   r)   c                   2    e Zd Zdeeef   defdZdefdZy)PluginReleasePager   r&   c                 .    t        | j                  |      S )zs
        Build an instance of PluginReleaseInstance

        :param payload: Payload response from the API
        )r   r*   )r"   r   s     r$   get_instancezPluginReleasePage.get_instance   s     %T]]G<<r%   c                      y)r7   z%<Twilio.FlexApi.V1.PluginReleasePage>rV   r+   s    r$   rI   zPluginReleasePage.__repr__        7r%   N)	rJ   rK   rL   r   rN   r   r   rj   rI   rV   r%   r$   rh   rh      s*    =DcN =7L =7# 7r%   rh   c                   X    e Zd Zdef fdZej                  fdedeee	f   de
fdZej                  fdedeee	f   de
fdZej                  ddfdeee	f   d	ee   d
ee   dee
   fdZej                  ddfdeee	f   d	ee   d
ee   dee
   fdZej                  ddfdeee	f   d	ee   d
ee   dee
   fdZej                  ddfdeee	f   d	ee   d
ee   dee
   f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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ZdedefdZdedefdZdedefdZdedefdZdefdZ xZS )PluginReleaseListr   c                 2    t         |   |       d| _        y)zo
        Initialize the PluginReleaseList

        :param version: Version that contains the resource

        z/PluginService/ReleasesN)r   r   rW   )r"   r   r#   s     r$   r   zPluginReleaseList.__init__   s     	!-	r%   configuration_idr-   r&   c                     t        j                  d|i      }t        j                  |dd      }d|d<   d|d<   | j                  j                  d| j                  ||      }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rY   Content-Typeru   rZ   r[   POSTr^   r_   datar`   )r   ra   r*   createrW   r   r"   rp   r-   rx   r`   r   s         r$   ry   zPluginReleaseList.create   s     yy!#3

 ))!. C
 #F.--&&tyytW ' 
 %T]]G<<r%   c                   K   t        j                  d|i      }t        j                  |dd      }d|d<   d|d<   | j                  j                  d| j                  ||       d	{   }t        | j                  |      S 7 w)
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
        rr   rs   rt   ru   rZ   r[   rv   rw   N)r   ra   r*   create_asyncrW   r   rz   s         r$   r|   zPluginReleaseList.create_async  s      yy!#3

 ))!. C
 #F.22tyytW 3 
 
 %T]]G<<	
s   A&B(B)BNlimit	page_sizec                     | j                   j                  ||      }| j                  ||d         }| j                   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
        r~   r-   r~   r}   )r*   read_limitspagestreamr"   r-   r}   r~   limitsr   s         r$   r   zPluginReleaseList.stream$  sL    , **5)<yy}{@SyT}}##D&/::r%   c                    K   | j                   j                  ||      }| j                  ||d          d{   }| j                   j                  ||d         S 7 #w)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
        r~   r   Nr}   )r*   r   
page_asyncstream_asyncr   s         r$   r   zPluginReleaseList.stream_async?  sb     , **5)<__'6+3F % 
 
 }}))$w@@	
s   6AA$Ac                 <    t        | j                  |||            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-   r}   r~   )listr   )r"   r-   r}   r~   s       r$   r   zPluginReleaseList.list\  s+    * KK+#  
 	
r%   c                 |   K   | j                  |||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)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
        r   N)r   )r"   r-   r}   r~   records        r$   
list_asynczPluginReleaseList.list_asyncy  sW     . '+&7&7+# '8 ' !
 
 !
 
 	
 
s0   </<731
37<37<
page_tokenpage_numberc                     t        j                  ||||d      }t        j                  |dd      }d|d<   | j                  j                  d| j                  ||      }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
        rY   	PageTokenr   PageSizers   rt   rZ   r[   r\   r^   r_   paramsr`   )r   ra   r*   r   rW   rh   r"   r-   r   r   r~   rx   r`   responses           r$   r   zPluginReleaseList.page  s    $ yy!.'#%	
 ))!. C
 /==%%diig & 
 !99r%   c                 
  K   t        j                  ||||d      }t        j                  |dd      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  |      S 7 w)	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   rs   rt   rZ   r[   r\   r   N)r   ra   r*   r   rW   rh   r   s           r$   r   zPluginReleaseList.page_async  s     $ yy!.'#%	
 ))!. C
 /11diig 2 
 
 !99
s   A$B&B'B
target_urlc                     | j                   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
        r\   )r*   domaintwiliorequestrh   r"   r   r   s      r$   get_pagezPluginReleaseList.get_page  s7     ==''..66ujI 99r%   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)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
        r\   N)r*   r   r   request_asyncrh   r   s      r$   get_page_asyncz PluginReleaseList.get_page_async  sD      --44BB5*UU 99 Vs   4AAAr   c                 0    t        | j                  |      S z~
        Constructs a PluginReleaseContext

        :param sid: The SID of the Flex Plugin Release resource to fetch.
        r(   r)   r*   r"   r   s     r$   r   zPluginReleaseList.get       $DMMs;;r%   c                 0    t        | j                  |      S r   r   r   s     r$   __call__zPluginReleaseList.__call__	  r   r%   c                      y)r7   z%<Twilio.FlexApi.V1.PluginReleaseList>rV   r+   s    r$   rI   zPluginReleaseList.__repr__  rl   r%   ) rJ   rK   rL   r   r   r   rP   rN   r   rQ   r   ry   r|   r   intr	   r   r
   r   r   r   r   rh   r   r   r   r   r)   r   r   rI   rR   rS   s   @r$   rn   rn      s	   	. 	. JP = # =49#v+4F =	 =F JP = # =49#v+4F =	 =H -3LL##'	;S&[); }; C=	;
 
'	(;: -3LL##'	AS&[)A }A C=	A
 
,	-A> -3LL##'	
S&[)
 }
 C=	

 
#	$
> -3LL##'	
S&[)
 }
 C=	

 
#	$
@ -3LL)/*0,,(.':S&[)': #v+&': 3;'	':
 f%': 
':V -3LL)/*0,,(.':S&[)': #v+&': 3;'	':
 f%': 
':R
:3 
:+< 
:
:s 
:7H 
:<s <3 <<C <$8 <7# 7r%   rn   N)rM   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)   rh   rn   rV   r%   r$   <module>r      sg     L L L + 8 : 2 ' !MN, MN`TM? TMn7 7&D7 D7r%   