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
 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)	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       s   e Zd ZdZ fddZejejejddfddZejejejddfddZejejejejejejfd	d
Z	dd Z
dd Zdd Zdd Z  ZS )LogListk 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 LogList

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the Service that the Log resource is associated with
        :param environment_sid: The SID of the environment in which the log occurred

        :returns: twilio.rest.serverless.v1.service.environment.log.LogList
        :rtype: twilio.rest.serverless.v1.service.environment.log.LogList
        service_sidenvironment_sidz;/Services/{service_sid}/Environments/{environment_sid}/LogsN )superr	   __init__	_solutionformat_uri)selfversionr   r   	__class__r   d/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/serverless/v1/service/environment/log.pyr      s   zLogList.__init__Nc                 C   s6   | j ||}| j||||d d}| j ||d S )a  
        Streams LogInstance 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 unicode function_sid: The SID of the function whose invocation produced the Log resources to read
        :param datetime start_date: The date and time after which the Log resources must have been created.
        :param datetime end_date: The date and time before which the Log resource must have been created.
        :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.log.LogInstance]
        	page_size)function_sid
start_dateend_dater   limit)_versionread_limitspagestream)r   r   r   r   r   r   limitsr    r   r   r   r!   '   s   zLogList.streamc                 C   s   t | j|||||dS )a  
        Lists LogInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param unicode function_sid: The SID of the function whose invocation produced the Log resources to read
        :param datetime start_date: The date and time after which the Log resources must have been created.
        :param datetime end_date: The date and time before which the Log resource must have been created.
        :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.log.LogInstance]
        )r   r   r   r   r   )listr!   )r   r   r   r   r   r   r   r   r   r#   G   s   zLogList.listc           	   	   C   sH   t |t|t||||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of LogInstance records from the API.
        Request is executed immediately

        :param unicode function_sid: The SID of the function whose invocation produced the Log resources to read
        :param datetime start_date: The date and time after which the Log resources must have been created.
        :param datetime end_date: The date and time before which the Log resource must have been created.
        :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 LogInstance
        :rtype: twilio.rest.serverless.v1.service.environment.log.LogPage
        )FunctionSid	StartDateEndDate	PageTokenr   PageSizeGET)methoduriparams)	r   ofr   iso8601_datetimer   r    r   LogPager   )	r   r   r   r   
page_tokenpage_numberr   dataresponser   r   r   r    c   s   	zLogList.pagec                 C   s"   | j jjd|}t| j || jS )a9  
        Retrieve a specific page of LogInstance records from the API.
        Request is executed immediately

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

        :returns: Page of LogInstance
        :rtype: twilio.rest.serverless.v1.service.environment.log.LogPage
        r)   )r   domaintwiliorequestr/   r   )r   
target_urlr3   r   r   r   get_page   s
   

zLogList.get_pagec                 C      t | j| jd | jd |dS a  
        Constructs a LogContext

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

        :returns: twilio.rest.serverless.v1.service.environment.log.LogContext
        :rtype: twilio.rest.serverless.v1.service.environment.log.LogContext
        r   r   r   r   sid
LogContextr   r   r   r<   r   r   r   get      	zLogList.getc                 C   r9   r:   r=   r?   r   r   r   __call__   rA   zLogList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Serverless.V1.LogList>r   r   r   r   r   __repr__      zLogList.__repr__)__name__
__module____qualname____doc__r   r   unsetr!   r#   r    r8   r@   rB   rF   __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 LogPage

        :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 Log resource is associated with
        :param environment_sid: The SID of the environment in which the log occurred

        :returns: twilio.rest.serverless.v1.service.environment.log.LogPage
        :rtype: twilio.rest.serverless.v1.service.environment.log.LogPage
        N)r   r/   r   r   )r   r   r3   solutionr   r   r   r      s   
zLogPage.__init__c                 C   s   t | j|| jd | jd dS )a  
        Build an instance of LogInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.serverless.v1.service.environment.log.LogInstance
        :rtype: twilio.rest.serverless.v1.service.environment.log.LogInstance
        r   r   r   )LogInstancer   r   r   payloadr   r   r   get_instance   s   	zLogPage.get_instancec                 C   rC   )rD   z<Twilio.Serverless.V1.LogPage>r   rE   r   r   r   rF      rG   zLogPage.__repr__)rH   rI   rJ   rK   r   rS   rF   rM   r   r   r   r   r/      s
    r/   c                       rN   )r>   r
   c                    s6   t t| | |||d| _djdi | j| _dS )a  
        Initialize the LogContext

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the Service to fetch the Log resource from
        :param environment_sid: The SID of the environment with the Log resource to fetch
        :param sid: The SID that identifies the Log resource to fetch

        :returns: twilio.rest.serverless.v1.service.environment.log.LogContext
        :rtype: twilio.rest.serverless.v1.service.environment.log.LogContext
        r;   zA/Services/{service_sid}/Environments/{environment_sid}/Logs/{sid}Nr   )r   r>   r   r   r   r   )r   r   r   r   r<   r   r   r   r      s   zLogContext.__init__c                 C   s8   | j jd| jd}t| j || jd | jd | jd dS )
        Fetch the LogInstance

        :returns: The fetched LogInstance
        :rtype: twilio.rest.serverless.v1.service.environment.log.LogInstance
        r)   )r*   r+   r   r   r<   r;   )r   fetchr   rP   r   rQ   r   r   r   rU     s   zLogContext.fetchc                 C   $   d dd | j D }d|S )rD    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>      z&LogContext.__repr__.<locals>.<genexpr>z$<Twilio.Serverless.V1.LogContext {}>joinr   itemsr   r   contextr   r   r   rF        
zLogContext.__repr__)rH   rI   rJ   rK   r   rU   rF   rM   r   r   r   r   r>      s
    r>   c                       s   e Zd ZdZG dd de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edd Zedd Zedd  Zd!d" Zd#d$ Z  ZS )&rP   r
   c                   @   s   e Zd ZdZdZdZdS )zLogInstance.LevelinfowarnerrorN)rH   rI   rJ   INFOWARNERRORr   r   r   r   Level!  s    rm   Nc                    s   t t| | |d|d|d|d|d|d|d|d|d	|d
t|d|dd| _d| _|||pJ| jd d| _dS )z
        Initialize the LogInstance

        :returns: twilio.rest.serverless.v1.service.environment.log.LogInstance
        :rtype: twilio.rest.serverless.v1.service.environment.log.LogInstance
        r<   account_sidr   r   	build_siddeployment_sidr   request_sidlevelmessagedate_createdurl)r<   rn   r   r   ro   rp   r   rq   rr   rs   rt   ru   Nr;   )	r   rP   r   r@   r   r.   _properties_contextr   )r   r   rR   r   r   r<   r   r   r   r   &  s&   zLogInstance.__init__c                 C   s6   | j du rt| j| jd | jd | jd d| _ | j S )a/  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: LogContext for this LogInstance
        :rtype: twilio.rest.serverless.v1.service.environment.log.LogContext
        Nr   r   r<   r;   )rw   r>   r   r   rE   r   r   r   _proxyG  s   
	zLogInstance._proxyc                 C   
   | j d S )zf
        :returns: The unique string that identifies the Log resource
        :rtype: unicode
        r<   rv   rE   r   r   r   r<   Y     
zLogInstance.sidc                 C   ry   )zh
        :returns: The SID of the Account that created the Log resource
        :rtype: unicode
        rn   rz   rE   r   r   r   rn   a  r{   zLogInstance.account_sidc                 C   ry   )zs
        :returns: The SID of the Service that the Log resource is associated with
        :rtype: unicode
        r   rz   rE   r   r   r   r   i  r{   zLogInstance.service_sidc                 C   ry   )zh
        :returns: The SID of the environment in which the log occurred
        :rtype: unicode
        r   rz   rE   r   r   r   r   q  r{   zLogInstance.environment_sidc                 C   ry   )zd
        :returns: The SID of the build that corresponds to the log
        :rtype: unicode
        ro   rz   rE   r   r   r   ro   y  r{   zLogInstance.build_sidc                 C   ry   )zi
        :returns: The SID of the deployment that corresponds to the log
        :rtype: unicode
        rp   rz   rE   r   r   r   rp     r{   zLogInstance.deployment_sidc                 C   ry   )zm
        :returns: The SID of the function whose invocation produced the log
        :rtype: unicode
        r   rz   rE   r   r   r   r     r{   zLogInstance.function_sidc                 C   ry   )zb
        :returns: The SID of the request associated with the log
        :rtype: unicode
        rq   rz   rE   r   r   r   rq     r{   zLogInstance.request_sidc                 C   ry   )zK
        :returns: The log level
        :rtype: LogInstance.Level
        rr   rz   rE   r   r   r   rr     r{   zLogInstance.levelc                 C   ry   )zC
        :returns: The log message
        :rtype: unicode
        rs   rz   rE   r   r   r   rs     r{   zLogInstance.messagec                 C   ry   )zx
        :returns: The ISO 8601 date and time in GMT when the Log resource was created
        :rtype: datetime
        rt   rz   rE   r   r   r   rt     r{   zLogInstance.date_createdc                 C   ry   )zX
        :returns: The absolute URL of the Log resource
        :rtype: unicode
        ru   rz   rE   r   r   r   ru     r{   zLogInstance.urlc                 C   s
   | j  S )rT   )rx   rU   rE   r   r   r   rU     s   
zLogInstance.fetchc                 C   rV   )rD   rW   c                 s   rX   rY   rZ   r[   r   r   r   r_     r`   z'LogInstance.__repr__.<locals>.<genexpr>z%<Twilio.Serverless.V1.LogInstance {}>ra   rd   r   r   r   rF     rf   zLogInstance.__repr__)N)rH   rI   rJ   rK   objectrm   r   propertyrx   r<   rn   r   r   ro   rp   r   rq   rr   rs   rt   ru   rU   rF   rM   r   r   r   r   rP     s@    !












	rP   N)rK   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r/   r>   rP   r   r   r   r   <module>   s    +/2