o
    eA                     @   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                       sr   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
dd Zdd Zdd Zdd Z  ZS )VariableListk 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 VariableList

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the Service that the Variable resource is associated with
        :param environment_sid: The SID of the Environment in which the Variable exists

        :returns: twilio.rest.serverless.v1.service.environment.variable.VariableList
        :rtype: twilio.rest.serverless.v1.service.environment.variable.VariableList
        service_sidenvironment_sidz@/Services/{service_sid}/Environments/{environment_sid}/VariablesN )superr   __init__	_solutionformat_uri)selfversionr   r   	__class__r   i/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/serverless/v1/service/environment/variable.pyr      s   zVariableList.__init__Nc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams VariableInstance 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.variable.VariableInstance]
        	page_size)r   limit)_versionread_limitspagestream)r   r   r   limitsr   r   r   r   r   &   s   zVariableList.streamc                 C   s   t | j||dS )at  
        Lists VariableInstance 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.variable.VariableInstance]
        )r   r   )listr   )r   r   r   r   r   r   r   =   s   zVariableList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of VariableInstance 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 VariableInstance
        :rtype: twilio.rest.serverless.v1.service.environment.variable.VariablePage
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   VariablePager   )r   
page_tokenpage_numberr   dataresponser   r   r   r   O   s   zVariableList.pagec                 C   s"   | j jjd|}t| j || jS )aM  
        Retrieve a specific page of VariableInstance records from the API.
        Request is executed immediately

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

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

zVariableList.get_pagec                 C   sB   t ||d}| jjd| j|d}t| j|| jd | jd dS )ab  
        Create the VariableInstance

        :param unicode key: A string by which the Variable resource can be referenced
        :param unicode value: A string that contains the actual value of the Variable

        :returns: The created VariableInstance
        :rtype: twilio.rest.serverless.v1.service.environment.variable.VariableInstance
        KeyValuePOSTr#   r$   r*   r   r   r
   )r   r&   r   creater   VariableInstancer   r   keyvaluer*   payloadr   r   r   r6   s   s   
zVariableList.createc                 C      t | j| jd | jd |dS a  
        Constructs a VariableContext

        :param sid: The SID of the Variable resource to fetch

        :returns: twilio.rest.serverless.v1.service.environment.variable.VariableContext
        :rtype: twilio.rest.serverless.v1.service.environment.variable.VariableContext
        r   r   r   r   sidVariableContextr   r   r   r?   r   r   r   get      	zVariableList.getc                 C   r<   r=   r@   rB   r   r   r   __call__   rD   zVariableList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Serverless.V1.VariableList>r   r   r   r   r   __repr__      zVariableList.__repr__)NN)__name__
__module____qualname____doc__r   r   r   r   unsetr   r0   r6   rC   rE   rI   __classcell__r   r   r   r   r      s    


r   c                       s0   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 VariablePage

        :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 Variable resource is associated with
        :param environment_sid: The SID of the Environment in which the Variable exists

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

        :param dict payload: Payload response from the API

        :returns: twilio.rest.serverless.v1.service.environment.variable.VariableInstance
        :rtype: twilio.rest.serverless.v1.service.environment.variable.VariableInstance
        r   r   r
   )r7   r   r   r   r;   r   r   r   get_instance   s   	zVariablePage.get_instancec                 C   rF   )rG   z#<Twilio.Serverless.V1.VariablePage>r   rH   r   r   r   rI      rJ   zVariablePage.__repr__)rK   rL   rM   rN   r   rS   rI   rP   r   r   r   r   r'      s
    r'   c                       sJ   e Zd ZdZ fddZdd ZejejfddZdd	 Z	d
d Z
  ZS )rA   r	   c                    s6   t t| | |||d| _djdi | j| _dS )a  
        Initialize the VariableContext

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the Service to fetch the Variable resource from
        :param environment_sid: The SID of the Environment with the Variable resource to fetch
        :param sid: The SID of the Variable resource to fetch

        :returns: twilio.rest.serverless.v1.service.environment.variable.VariableContext
        :rtype: twilio.rest.serverless.v1.service.environment.variable.VariableContext
        r>   zF/Services/{service_sid}/Environments/{environment_sid}/Variables/{sid}Nr   )r   rA   r   r   r   r   )r   r   r   r   r?   r   r   r   r      s   zVariableContext.__init__c                 C   s8   | j jd| jd}t| j || jd | jd | jd dS )
        Fetch the VariableInstance

        :returns: The fetched VariableInstance
        :rtype: twilio.rest.serverless.v1.service.environment.variable.VariableInstance
        r"   r#   r$   r   r   r?   r>   )r   fetchr   r7   r   rR   r   r   r   rV      s   zVariableContext.fetchc                 C   sJ   t ||d}| jjd| j|d}t| j|| jd | jd | jd dS )b  
        Update the VariableInstance

        :param unicode key: A string by which the Variable resource can be referenced
        :param unicode value: A string that contains the actual value of the Variable

        :returns: The updated VariableInstance
        :rtype: twilio.rest.serverless.v1.service.environment.variable.VariableInstance
        r1   r4   r5   r   r   r?   r>   )r   r&   r   updater   r7   r   r8   r   r   r   rX     s   
zVariableContext.updatec                 C   s   | j jd| jdS )
        Deletes the VariableInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErU   )r   deleter   rH   r   r   r   r[     s   zVariableContext.deletec                 C   $   d dd | j D }d|S )rG    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>.      z+VariableContext.__repr__.<locals>.<genexpr>z)<Twilio.Serverless.V1.VariableContext {}>joinr   itemsr   r   contextr   r   r   rI   '     
zVariableContext.__repr__)rK   rL   rM   rN   r   rV   r   rO   rX   r[   rI   rP   r   r   r   r   rA      s    	rA   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edd Zdd ZejejfddZdd Zdd  Z  ZS )"r7   r	   Nc                    s   t t| | |d|d|d|d|d|dt|dt|d|d	d
	| _d| _|||pA| jd d| _dS )z
        Initialize the VariableInstance

        :returns: twilio.rest.serverless.v1.service.environment.variable.VariableInstance
        :rtype: twilio.rest.serverless.v1.service.environment.variable.VariableInstance
        r?   account_sidr   r   r9   r:   date_createddate_updatedurl)	r?   rm   r   r   r9   r:   rn   ro   rp   Nr>   )	r   r7   r   rC   r   iso8601_datetime_properties_contextr   )r   r   r;   r   r   r?   r   r   r   r   6  s    zVariableInstance.__init__c                 C   s6   | j du rt| j| jd | jd | jd d| _ | j S )aC  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: VariableContext for this VariableInstance
        :rtype: twilio.rest.serverless.v1.service.environment.variable.VariableContext
        Nr   r   r?   r>   )rs   rA   r   r   rH   r   r   r   _proxyT  s   
	zVariableInstance._proxyc                 C   
   | j d S )zk
        :returns: The unique string that identifies the Variable resource
        :rtype: unicode
        r?   rr   rH   r   r   r   r?   f     
zVariableInstance.sidc                 C   ru   )zm
        :returns: The SID of the Account that created the Variable resource
        :rtype: unicode
        rm   rv   rH   r   r   r   rm   n  rw   zVariableInstance.account_sidc                 C   ru   )zx
        :returns: The SID of the Service that the Variable resource is associated with
        :rtype: unicode
        r   rv   rH   r   r   r   r   v  rw   zVariableInstance.service_sidc                 C   ru   )zk
        :returns: The SID of the Environment in which the Variable exists
        :rtype: unicode
        r   rv   rH   r   r   r   r   ~  rw   z VariableInstance.environment_sidc                 C   ru   )zm
        :returns: A string by which the Variable resource can be referenced
        :rtype: unicode
        r9   rv   rH   r   r   r   r9     rw   zVariableInstance.keyc                 C   ru   )zk
        :returns: A string that contains the actual value of the Variable
        :rtype: unicode
        r:   rv   rH   r   r   r   r:     rw   zVariableInstance.valuec                 C   ru   )z}
        :returns: The ISO 8601 date and time in GMT when the Variable resource was created
        :rtype: datetime
        rn   rv   rH   r   r   r   rn     rw   zVariableInstance.date_createdc                 C   ru   )z
        :returns: The ISO 8601 date and time in GMT when the Variable resource was last updated
        :rtype: datetime
        ro   rv   rH   r   r   r   ro     rw   zVariableInstance.date_updatedc                 C   ru   )z]
        :returns: The absolute URL of the Variable resource
        :rtype: unicode
        rp   rv   rH   r   r   r   rp     rw   zVariableInstance.urlc                 C   
   | j  S )rT   )rt   rV   rH   r   r   r   rV        
zVariableInstance.fetchc                 C   s   | j j||dS )rW   )r9   r:   )rt   rX   )r   r9   r:   r   r   r   rX     s   
zVariableInstance.updatec                 C   rx   )rY   )rt   r[   rH   r   r   r   r[     ry   zVariableInstance.deletec                 C   r\   )rG   r]   c                 s   r^   r_   r`   ra   r   r   r   re     rf   z,VariableInstance.__repr__.<locals>.<genexpr>z*<Twilio.Serverless.V1.VariableInstance {}>rg   rj   r   r   r   rI     rl   zVariableInstance.__repr__)N)rK   rL   rM   rN   r   propertyrt   r?   rm   r   r   r9   r:   rn   ro   rp   rV   r   rO   rX   r[   rI   rP   r   r   r   r   r7   2  s6    









		r7   N)rN   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r'   rA   r7   r   r   r   r   <module>   s    "/Q