o
    e:                     @   s   d 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )deserialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       sx   e Zd ZdZ fddZdddZdddZejejejfd	d
Z	dd Z
ejfddZdd Zdd Zdd Z  ZS )DeploymentListk PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. c                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the DeploymentList

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the Service that the Deployment resource is associated with
        :param environment_sid: The SID of the Environment for the Deployment

        :returns: twilio.rest.serverless.v1.service.environment.deployment.DeploymentList
        :rtype: twilio.rest.serverless.v1.service.environment.deployment.DeploymentList
        service_sidenvironment_sidzB/Services/{service_sid}/Environments/{environment_sid}/DeploymentsN )superr   __init__	_solutionformat_uri)selfversionr   r   	__class__r   k/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/serverless/v1/service/environment/deployment.pyr      s   zDeploymentList.__init__Nc                 C   s0   | j ||}| j|d d}| 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 int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.serverless.v1.service.environment.deployment.DeploymentInstance]
        	page_size)r   limit)_versionread_limitspagestream)r   r   r   limitsr   r   r   r   r   &   s   zDeploymentList.streamc                 C   s   t | j||dS )az  
        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 int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.serverless.v1.service.environment.deployment.DeploymentInstance]
        )r   r   )listr   )r   r   r   r   r   r   r   =   s   zDeploymentList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of DeploymentInstance records from the API.
        Request is executed immediately

        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of DeploymentInstance
        :rtype: twilio.rest.serverless.v1.service.environment.deployment.DeploymentPage
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   DeploymentPager   )r   
page_tokenpage_numberr   dataresponser   r   r   r   O   s   zDeploymentList.pagec                 C   s"   | j jjd|}t| j || jS )aU  
        Retrieve a specific page of DeploymentInstance records from the API.
        Request is executed immediately

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

        :returns: Page of DeploymentInstance
        :rtype: twilio.rest.serverless.v1.service.environment.deployment.DeploymentPage
        r"   )r   domaintwiliorequestr'   r   )r   
target_urlr+   r   r   r   get_pageb   s
   

zDeploymentList.get_pagec                 C   s@   t d|i}| jjd| j|d}t| j|| jd | jd dS )a  
        Create the DeploymentInstance

        :param unicode build_sid: The SID of the Build for the Deployment

        :returns: The created DeploymentInstance
        :rtype: twilio.rest.serverless.v1.service.environment.deployment.DeploymentInstance
        BuildSidPOST)r#   r$   r*   r   r   r
   )r   r&   r   creater   DeploymentInstancer   )r   	build_sidr*   payloadr   r   r   r3   s   s   	zDeploymentList.createc                 C      t | j| jd | jd |dS a7  
        Constructs a DeploymentContext

        :param sid: The SID that identifies the Deployment resource to fetch

        :returns: twilio.rest.serverless.v1.service.environment.deployment.DeploymentContext
        :rtype: twilio.rest.serverless.v1.service.environment.deployment.DeploymentContext
        r   r   r   r   sidDeploymentContextr   r   r   r:   r   r   r   get      	zDeploymentList.getc                 C   r7   r8   r;   r=   r   r   r   __call__   r?   zDeploymentList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Serverless.V1.DeploymentList>r   r   r   r   r   __repr__      zDeploymentList.__repr__)NN)__name__
__module____qualname____doc__r   r   r   r   unsetr   r0   r3   r>   r@   rD   __classcell__r   r   r   r   r      s    


r   c                       0   e Zd ZdZ fddZdd Zdd Z  ZS )r'   r	   c                    s   t t| || || _dS )a  
        Initialize the DeploymentPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param service_sid: The SID of the Service that the Deployment resource is associated with
        :param environment_sid: The SID of the Environment for the Deployment

        :returns: twilio.rest.serverless.v1.service.environment.deployment.DeploymentPage
        :rtype: twilio.rest.serverless.v1.service.environment.deployment.DeploymentPage
        N)r   r'   r   r   )r   r   r+   solutionr   r   r   r      s   
zDeploymentPage.__init__c                 C   s   t | j|| jd | jd dS )a0  
        Build an instance of DeploymentInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.serverless.v1.service.environment.deployment.DeploymentInstance
        :rtype: twilio.rest.serverless.v1.service.environment.deployment.DeploymentInstance
        r   r   r
   )r4   r   r   r   r6   r   r   r   get_instance   s   	zDeploymentPage.get_instancec                 C   rA   )rB   z%<Twilio.Serverless.V1.DeploymentPage>r   rC   r   r   r   rD      rE   zDeploymentPage.__repr__)rF   rG   rH   rI   r   rO   rD   rK   r   r   r   r   r'      s
    r'   c                       rL   )r<   r	   c                    s6   t t| | |||d| _djdi | j| _dS )a0  
        Initialize the DeploymentContext

        :param Version 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

        :returns: twilio.rest.serverless.v1.service.environment.deployment.DeploymentContext
        :rtype: twilio.rest.serverless.v1.service.environment.deployment.DeploymentContext
        r9   zH/Services/{service_sid}/Environments/{environment_sid}/Deployments/{sid}Nr   )r   r<   r   r   r   r   )r   r   r   r   r:   r   r   r   r      s   zDeploymentContext.__init__c                 C   s8   | j jd| jd}t| j || jd | jd | jd dS )
        Fetch the DeploymentInstance

        :returns: The fetched DeploymentInstance
        :rtype: twilio.rest.serverless.v1.service.environment.deployment.DeploymentInstance
        r"   )r#   r$   r   r   r:   r9   )r   fetchr   r4   r   rN   r   r   r   rQ      s   zDeploymentContext.fetchc                 C   $   d dd | j D }d|S )rB    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>      z-DeploymentContext.__repr__.<locals>.<genexpr>z+<Twilio.Serverless.V1.DeploymentContext {}>joinr   itemsr   r   contextr   r   r   rD        
zDeploymentContext.__repr__)rF   rG   rH   rI   r   rQ   rD   rK   r   r   r   r   r<      s
    r<   c                       s   e Zd ZdZd fdd	Zedd Zedd Zed	d
 Zedd Z	edd Z
edd Zedd Zedd Zedd Zdd Zdd Z  ZS )r4   r	   Nc                    s   t t| | |d|d|d|d|dt|dt|d|dd	| _d
| _|||p=| jd d| _d
S )z
        Initialize the DeploymentInstance

        :returns: twilio.rest.serverless.v1.service.environment.deployment.DeploymentInstance
        :rtype: twilio.rest.serverless.v1.service.environment.deployment.DeploymentInstance
        r:   account_sidr   r   r5   date_createddate_updatedurl)r:   rc   r   r   r5   rd   re   rf   Nr9   )	r   r4   r   r>   r   iso8601_datetime_properties_contextr   )r   r   r6   r   r   r:   r   r   r   r     s   zDeploymentInstance.__init__c                 C   s6   | j du rt| j| jd | jd | jd d| _ | j S )aK  
        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
        :rtype: twilio.rest.serverless.v1.service.environment.deployment.DeploymentContext
        Nr   r   r:   r9   )ri   r<   r   r   rC   r   r   r   _proxy3  s   
	zDeploymentInstance._proxyc                 C   
   | j d S )zm
        :returns: The unique string that identifies the Deployment resource
        :rtype: unicode
        r:   rh   rC   r   r   r   r:   E     
zDeploymentInstance.sidc                 C   rk   )zo
        :returns: The SID of the Account that created the Deployment resource
        :rtype: unicode
        rc   rl   rC   r   r   r   rc   M  rm   zDeploymentInstance.account_sidc                 C   rk   )zz
        :returns: The SID of the Service that the Deployment resource is associated with
        :rtype: unicode
        r   rl   rC   r   r   r   r   U  rm   zDeploymentInstance.service_sidc                 C   rk   )za
        :returns: The SID of the Environment for the Deployment
        :rtype: unicode
        r   rl   rC   r   r   r   r   ]  rm   z"DeploymentInstance.environment_sidc                 C   rk   )z[
        :returns: The SID of the Build for the deployment
        :rtype: unicode
        r5   rl   rC   r   r   r   r5   e  rm   zDeploymentInstance.build_sidc                 C   rk   )z
        :returns: The ISO 8601 date and time in GMT when the Deployment resource was created
        :rtype: datetime
        rd   rl   rC   r   r   r   rd   m  rm   zDeploymentInstance.date_createdc                 C   rk   )z
        :returns: The ISO 8601 date and time in GMT when the Deployment resource was last updated
        :rtype: datetime
        re   rl   rC   r   r   r   re   u  rm   zDeploymentInstance.date_updatedc                 C   rk   )z_
        :returns: The absolute URL of the Deployment resource
        :rtype: unicode
        rf   rl   rC   r   r   r   rf   }  rm   zDeploymentInstance.urlc                 C   s
   | j  S )rP   )rj   rQ   rC   r   r   r   rQ     s   
zDeploymentInstance.fetchc                 C   rR   )rB   rS   c                 s   rT   rU   rV   rW   r   r   r   r[     r\   z.DeploymentInstance.__repr__.<locals>.<genexpr>z,<Twilio.Serverless.V1.DeploymentInstance {}>r]   r`   r   r   r   rD     rb   zDeploymentInstance.__repr__)N)rF   rG   rH   rI   r   propertyrj   r:   rc   r   r   r5   rd   re   rf   rQ   rD   rK   r   r   r   r   r4     s.    








	r4   N)rI   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r'   r<   r4   r   r   r   r   <module>   s    !/2