
    pikK                         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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 - Serverless
    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                   z     e Zd ZdZ	 ddedeeef   dededee   f
 fdZ	e
dd	       Zdd
ZddZdefdZ xZS )DeploymentInstanceaJ  
    :ivar sid: The unique string that we created to identify the Deployment resource.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Deployment resource.
    :ivar service_sid: The SID of the Service that the Deployment resource is associated with.
    :ivar environment_sid: The SID of the Environment for the Deployment.
    :ivar build_sid: The SID of the Build for the deployment.
    :ivar date_created: The date and time in GMT when the Deployment resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar date_updated: The date and time in GMT when the Deployment resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar url: The absolute URL of the Deployment resource.
    versionpayloadservice_sidenvironment_sidsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _
        t        j                  |j                  d            | _        |j                  d      | _        |||xs | j                  d	| _        d | _        y )
Nr   account_sidr   r   	build_siddate_createddate_updatedurlr   r   r   )super__init__getr   r   r   r   r   r   iso8601_datetimer   r   r   	_solution_context)selfr   r   r   r   r   	__class__s         z/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/serverless/v1/service/environment/deployment.pyr"   zDeploymentInstance.__init__%   s     	!")++e"4*1++m*D*1++m*D.5kk:K.L(/K(@0;0L0LKK'1
 1<0L0LKK'1
 #*++e"4 '.?$((

 6:    returnc                     | j                   Et        | j                  | j                  d   | j                  d   | 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: DeploymentContext for this DeploymentInstance
        r   r   r   r    )r&   DeploymentContext_versionr%   r'   s    r)   _proxyzDeploymentInstance._proxyC   sR     == - NN=9 $/@ ANN5)	DM }}r*   c                 6    | j                   j                         S )a
        Fetch the DeploymentInstance


        :returns: The fetched DeploymentInstance
        )r0   fetchr/   s    r)   r3   zDeploymentInstance.fetchT   s     {{  ""r*   c                 R   K   | j                   j                          d{   S 7 w){
        Asynchronous coroutine to fetch the DeploymentInstance


        :returns: The fetched DeploymentInstance
        N)r0   fetch_asyncr/   s    r)   r6   zDeploymentInstance.fetch_async]   s!      [[,,....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>z.DeploymentInstance.__repr__.<locals>.<genexpr>l        SDAq7>>!Q/S   !z,<Twilio.Serverless.V1.DeploymentInstance {}>joinr%   itemsr=   r'   contexts     r)   __repr__zDeploymentInstance.__repr__f   s6     ((SDNN<P<P<RSS=DDWMMr*   )N)r+   r-   )r+   r   )__name__
__module____qualname____doc__r   r   strr   r   r"   propertyr0   r3   r6   rJ   __classcell__r(   s   @r)   r   r      sz    	" ":: c3h: 	:
 : c]:<   #/N# Nr*   r   c                   T     e Zd Zdedededef fdZdefdZdefdZdefd	Z	 xZ
S )
r-   r   r   r   r   c                 |    t         |   |       |||d| _         dj                  di | j                  | _        y)ar  
        Initialize the DeploymentContext

        :param version: Version that contains the resource
        :param service_sid: The SID of the Service to fetch the Deployment resource from.
        :param environment_sid: The SID of the Environment used by the Deployment to fetch.
        :param sid: The SID that identifies the Deployment resource to fetch.
        r    zH/Services/{service_sid}/Environments/{environment_sid}/Deployments/{sid}N r!   r"   r%   r=   _uri)r'   r   r   r   r   r(   s        r)   r"   zDeploymentContext.__init__r   sJ     	! '.

 f^ee 
nn
	r*   r+   c                    t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d   | j                  d         S )	r2   application/jsonAcceptGETmethoduriheadersr   r   r   r    )r   ofr.   r3   rW   r   r%   r'   r_   r   s      r)   r3   zDeploymentContext.fetch   sv     ))B-.--%%U		7%S!MM}5 NN+<=u%
 	
r*   c                 $  K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d   | j                  d   	      S 7 Ew)
r5   rY   rZ   r[   r\   Nr   r   r   r    )r   r`   r.   r6   rW   r   r%   ra   s      r)   r6   zDeploymentContext.fetch_async   s      ))B-.11dii 2 
 
 "MM}5 NN+<=u%
 	
	
s   ABB	ABc                     dj                  d | j                  j                         D              }dj                  |      S )r8   r9   c              3   F   K   | ]  \  }}d j                  ||        ywr;   r<   r>   s      r)   rB   z-DeploymentContext.__repr__.<locals>.<genexpr>   rC   rD   z+<Twilio.Serverless.V1.DeploymentContext {}>rE   rH   s     r)   rJ   zDeploymentContext.__repr__   s6     ((SDNN<P<P<RSS<CCGLLr*   )rK   rL   rM   r   rO   r"   r   r3   r6   rJ   rQ   rR   s   @r)   r-   r-   p   sP    

-0
CF
MP
.
) 
,
#5 
0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)DeploymentPager   r+   c                 h    t        | j                  || j                  d   | j                  d         S )zp
        Build an instance of DeploymentInstance

        :param payload: Payload response from the API
        r   r   r   r   )r   r.   r%   )r'   r   s     r)   get_instancezDeploymentPage.get_instance   s4     "MM}5 NN+<=	
 	
r*   c                      y)r8   z%<Twilio.Serverless.V1.DeploymentPage>rU   r/   s    r)   rJ   zDeploymentPage.__repr__        7r*   N)	rK   rL   rM   r   rO   r   r   ri   rJ   rU   r*   r)   rf   rf      s*    
DcN 
7I 
7# 7r*   rf   c            	           e Zd Zdededef fdZej                  ej                  fdeee	f   dee
e	f   defdZej                  ej                  fdeee	f   dee
e	f   defd	Z	 	 dd
ee   dee   dee   fdZ	 	 dd
ee   dee   dee   fdZ	 	 dd
ee   dee   dee   fdZ	 	 dd
ee   dee   dee   fdZej                  ej                  ej                  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                  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 )DeploymentListr   r   r   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)a+  
        Initialize the DeploymentList

        :param version: Version that contains the resource
        :param service_sid: The SID of the Service to read the Deployment resources from.
        :param environment_sid: The SID of the Environment used by the Deployment resources to read.

        rh   zB/Services/{service_sid}/Environments/{environment_sid}/DeploymentsNrU   rV   )r'   r   r   r   r(   s       r)   r"   zDeploymentList.__init__   sJ     	! '.

 XPWW .. 		r*   r   	is_pluginr+   c                 R   t        j                  |t        j                  |      d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   | j                  d	   
      S )z
        Create the DeploymentInstance

        :param build_sid: The SID of the Build for the Deployment.
        :param is_plugin: Whether the Deployment is a plugin.

        :returns: The created DeploymentInstance
        BuildSidIsPluginContent-Type!application/x-www-form-urlencodedrY   rZ   POSTr]   r^   datar_   r   r   rh   )	r   r`   r   boolean_to_stringr.   createrW   r   r%   r'   r   ro   rx   r_   r   s         r)   rz   zDeploymentList.create   s     yy%%77	B
 ))^-PQR"E.--&&tyytW ' 
 "MM}5 NN+<=	
 	
r*   c                 n  K   t        j                  |t        j                  |      d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   | j                  d
         S 7 7w)z
        Asynchronously create the DeploymentInstance

        :param build_sid: The SID of the Build for the Deployment.
        :param is_plugin: Whether the Deployment is a plugin.

        :returns: The created DeploymentInstance
        rq   rt   ru   rY   rZ   rv   rw   Nr   r   rh   )	r   r`   r   ry   r.   create_asyncrW   r   r%   r{   s         r)   r}   zDeploymentList.create_async  s      yy%%77	B
 ))^-PQR"E.22tyytW 3 
 
 "MM}5 NN+<=	
 	
	
s   A9B5;B3<8B5limit	page_sizec                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )a`  
        Streams DeploymentInstance 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 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.   read_limitspagestreamr'   r~   r   limitsr   s        r)   r   zDeploymentList.stream;  sJ    ( **5)<yy6+#6y7}}##D&/::r*   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)ao  
        Asynchronously streams DeploymentInstance 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 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DeploymentList.stream_asyncT  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists DeploymentInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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   )listr   )r'   r~   r   s      r)   r   zDeploymentList.listm  s(    & KK#  
 	
r*   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a  
        Asynchronously lists DeploymentInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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   records       r)   
list_asynczDeploymentList.list_async  sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                        S )ay  
        Retrieve a single page of DeploymentInstance records from the API.
        Request is executed immediately

        :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 DeploymentInstance
        	PageTokenr   PageSizert   ru   rY   rZ   r[   r]   r^   paramsr_   )r   r`   r.   r   rW   rf   r%   r'   r   r   r   rx   r_   responses          r)   r   zDeploymentList.page  s      yy'#%
 ))^-PQR.==%%diig & 
 dmmXt~~FFr*   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	a  
        Asynchronously retrieve a single page of DeploymentInstance records from the API.
        Request is executed immediately

        :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 DeploymentInstance
        r   rt   ru   rY   rZ   r[   r   N)r   r`   r.   r   rW   rf   r%   r   s          r)   r   zDeploymentList.page_async  s       yy'#%
 ))^-PQR.11diig 2 
 
 dmmXt~~FF
s   A"B$B
%&B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of DeploymentInstance records from the API.
        Request is executed immediately

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

        :returns: Page of DeploymentInstance
        r[   )r.   domaintwiliorequestrf   r%   r'   r   r   s      r)   get_pagezDeploymentList.get_page  s=     ==''..66ujIdmmXt~~FFr*   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)a  
        Asynchronously retrieve a specific page of DeploymentInstance records from the API.
        Request is executed immediately

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

        :returns: Page of DeploymentInstance
        r[   N)r.   r   r   request_asyncrf   r%   r   s      r)   get_page_asynczDeploymentList.get_page_async  sJ      --44BB5*UUdmmXt~~FF Vs   4AA&Ar   c                 h    t        | j                  | j                  d   | j                  d   |      S z
        Constructs a DeploymentContext

        :param sid: The SID that identifies the Deployment resource to fetch.
        r   r   r    r-   r.   r%   r'   r   s     r)   r#   zDeploymentList.get  4     !MM}5 NN+<=	
 	
r*   c                 h    t        | j                  | j                  d   | j                  d   |      S r   r   r   s     r)   __call__zDeploymentList.__call__	  r   r*   c                      y)r8   z%<Twilio.Serverless.V1.DeploymentList>rU   r/   s    r)   rJ   zDeploymentList.__repr__  rk   r*   )NN)!rK   rL   rM   r   rO   r"   r   unsetr   objectboolr   rz   r}   r   intr	   r   r
   r   r   r   r   rf   r   r   r   r   r-   r#   r   rJ   rQ   rR   s   @r)   rm   rm      s   
 
c 
C 
0 )/)/#
f%#
 v&#
 
	#
N )/)/#
f%#
 v&#
 
	#
N  $#';}; C=; 
$	%	;6  $#'A}A C=A 
)	*	A6  $#'
}
 C=
 
 	!	
8  $#'
}
 C=
 
 	!	
: *0*0,,(.	G#v+&G 3;'G f%	G
 
GF *0*0,,(.	G#v+&G 3;'G f%	G
 
GB
G3 
G> 
G
Gs 
G~ 
G
s 
0 

C 
$5 
7# 7r*   rm   N)rN   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-   rf   rm   rU   r*   r)   <module>r      sj     L L L 6 6 8 : 2 ' !TN) TNnNM NMb7T 70C7\ C7r*   