o
    eI                     @   st   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	 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)InstanceResource)ListResource)Pagec                       s6  e Zd Z fddZejejejejejejejejejejejejejejejejejejddfddZejejejejejejejejejejejejejejejejejejddfddZejejejejejejejejejejejejejejejejejejejejejfdd	Zd
d Z	dd Z
  ZS )CallSummariesListc                    s.   t t| | i | _djdi | j| _dS )a  
        Initialize the CallSummariesList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.insights.v1.call_summaries.CallSummariesList
        :rtype: twilio.rest.insights.v1.call_summaries.CallSummariesList
        z/Voice/SummariesN )superr   __init__	_solutionformat_uri)selfversion	__class__r   Y/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/insights/v1/call_summaries.pyr
      s   	zCallSummariesList.__init__Nc                 C   s   | j ||}| jdi d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d|d|d|d|d }| j ||d S )a  
        Streams CallSummariesInstance 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 from_: The from
        :param unicode to: The to
        :param unicode from_carrier: The from_carrier
        :param unicode to_carrier: The to_carrier
        :param unicode from_country_code: The from_country_code
        :param unicode to_country_code: The to_country_code
        :param bool branded: The branded
        :param bool verified_caller: The verified_caller
        :param bool has_tag: The has_tag
        :param unicode start_time: The start_time
        :param unicode end_time: The end_time
        :param unicode call_type: The call_type
        :param unicode call_state: The call_state
        :param unicode direction: The direction
        :param CallSummariesInstance.ProcessingStateRequest processing_state: The processing_state
        :param CallSummariesInstance.SortBy sort_by: The sort_by
        :param unicode subaccount: The subaccount
        :param bool abnormal_session: The abnormal_session
        :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.insights.v1.call_summaries.CallSummariesInstance]
        from_tofrom_carrier
to_carrierfrom_country_codeto_country_codebrandedverified_callerhas_tag
start_timeend_time	call_type
call_state	directionprocessing_statesort_by
subaccountabnormal_session	page_sizelimitNr   )_versionread_limitspagestream)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r&   r%   limitsr)   r   r   r   r*   !   sR   +
	
zCallSummariesList.streamc                 C   s   t | jdi d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d|d|d|d|d|S )a)  
        Lists CallSummariesInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param unicode from_: The from
        :param unicode to: The to
        :param unicode from_carrier: The from_carrier
        :param unicode to_carrier: The to_carrier
        :param unicode from_country_code: The from_country_code
        :param unicode to_country_code: The to_country_code
        :param bool branded: The branded
        :param bool verified_caller: The verified_caller
        :param bool has_tag: The has_tag
        :param unicode start_time: The start_time
        :param unicode end_time: The end_time
        :param unicode call_type: The call_type
        :param unicode call_state: The call_state
        :param unicode direction: The direction
        :param CallSummariesInstance.ProcessingStateRequest processing_state: The processing_state
        :param CallSummariesInstance.SortBy sort_by: The sort_by
        :param unicode subaccount: The subaccount
        :param bool abnormal_session: The abnormal_session
        :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.insights.v1.call_summaries.CallSummariesInstance]
        r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r&   r%   Nr   )listr*   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r&   r%   r   r   r   r,   f   sR   *	
zCallSummariesList.listc                 C   s   t i d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d|d|||||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of CallSummariesInstance records from the API.
        Request is executed immediately

        :param unicode from_: The from
        :param unicode to: The to
        :param unicode from_carrier: The from_carrier
        :param unicode to_carrier: The to_carrier
        :param unicode from_country_code: The from_country_code
        :param unicode to_country_code: The to_country_code
        :param bool branded: The branded
        :param bool verified_caller: The verified_caller
        :param bool has_tag: The has_tag
        :param unicode start_time: The start_time
        :param unicode end_time: The end_time
        :param unicode call_type: The call_type
        :param unicode call_state: The call_state
        :param unicode direction: The direction
        :param CallSummariesInstance.ProcessingStateRequest processing_state: The processing_state
        :param CallSummariesInstance.SortBy sort_by: The sort_by
        :param unicode subaccount: The subaccount
        :param bool abnormal_session: The abnormal_session
        :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 CallSummariesInstance
        :rtype: twilio.rest.insights.v1.call_summaries.CallSummariesPage
        FromToFromCarrier	ToCarrierFromCountryCodeToCountryCodeBrandedVerifiedCallerHasTag	StartTimeEndTimeCallType	CallState	DirectionProcessingStateSortBy
Subaccount)AbnormalSession	PageTokenr   PageSizeGET)methoduriparams)r   ofr'   r)   r   CallSummariesPager   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   
page_tokenpage_numberr%   dataresponser   r   r   r)      sT   '	

zCallSummariesList.pagec                 C   s"   | j jjd|}t| j || jS )aL  
        Retrieve a specific page of CallSummariesInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CallSummariesInstance
        :rtype: twilio.rest.insights.v1.call_summaries.CallSummariesPage
        rA   )r'   domaintwiliorequestrF   r   )r   
target_urlrJ   r   r   r   get_page   s
   

zCallSummariesList.get_pagec                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z&<Twilio.Insights.V1.CallSummariesList>r   r   r   r   r   __repr__      zCallSummariesList.__repr__)__name__
__module____qualname__r
   r   unsetr*   r,   r)   rO   rS   __classcell__r   r   r   r   r      sF    
E

A
Cr   c                       s,   e Zd Z fddZdd Zdd Z  ZS )rF   c                    s   t t| || || _dS )aC  
        Initialize the CallSummariesPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.insights.v1.call_summaries.CallSummariesPage
        :rtype: twilio.rest.insights.v1.call_summaries.CallSummariesPage
        N)r	   rF   r
   r   )r   r   rJ   solutionr   r   r   r
     s   

zCallSummariesPage.__init__c                 C   s   t | j|S )a  
        Build an instance of CallSummariesInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.insights.v1.call_summaries.CallSummariesInstance
        :rtype: twilio.rest.insights.v1.call_summaries.CallSummariesInstance
        )CallSummariesInstancer'   )r   payloadr   r   r   get_instance  s   	zCallSummariesPage.get_instancec                 C   rP   )rQ   z&<Twilio.Insights.V1.CallSummariesPage>r   rR   r   r   r   rS   !  rT   zCallSummariesPage.__repr__)rU   rV   rW   r
   r]   rS   rY   r   r   r   r   rF     s    rF   c                       s  e Zd 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G d	d
 d
eZG dd deZ	 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ed)d* Zed+d, Zed-d. Zed/d0 Zed1d2 Zed3d4 Zed5d6 Zed7d8 Z d9d: Z!  Z"S );r[   c                   @      e Zd ZdZdZdZdZdS )zCallSummariesInstance.CallTypecarriersiptrunkingclientN)rU   rV   rW   CARRIERSIPTRUNKINGCLIENTr   r   r   r   r8   -  
    r8   c                   @   s,   e Zd ZdZdZdZdZdZdZdZ	dZ
d	S )
zCallSummariesInstance.CallStateringing	completedbusyfailnoanswercanceledansweredundialedN)rU   rV   rW   RINGING	COMPLETEDBUSYFAILNOANSWERCANCELEDANSWEREDUNDIALEDr   r   r   r   r9   3  s    r9   c                   @      e Zd ZdZdZdS )z%CallSummariesInstance.ProcessingStatecompletepartialN)rU   rV   rW   COMPLETEPARTIALr   r   r   r   r;   =      r;   c                   @   s    e Zd ZdZdZdZdZdZdS )z#CallSummariesInstance.CallDirectionoutbound_apioutbound_dialinboundtrunking_originatingtrunking_terminatingN)rU   rV   rW   OUTBOUND_APIOUTBOUND_DIALINBOUNDTRUNKING_ORIGINATINGTRUNKING_TERMINATINGr   r   r   r   CallDirectionA  s    r   c                   @   rx   )zCallSummariesInstance.SortByr   r   N)rU   rV   rW   
START_TIMEEND_TIMEr   r   r   r   r<   H  r}   r<   c                   @   r^   )z,CallSummariesInstance.ProcessingStateRequestri   startedrz   allN)rU   rV   rW   rq   STARTEDr|   ALLr   r   r   r   ProcessingStateRequestL  rg   r   c                    s6  t t| | i d|dd|dd|dd|dd|ddt|ddt|ddt|dd	t|d	d
t|d
d|dd|dd|dd|dd|dd|dd|d|d|d|d|dd| _d| _i | _	dS )z
        Initialize the CallSummariesInstance

        :returns: twilio.rest.insights.v1.call_summaries.CallSummariesInstance
        :rtype: twilio.rest.insights.v1.call_summaries.CallSummariesInstance
        account_sidcall_sidr   r   r!   created_timer   r   durationconnect_durationr   fromr   carrier_edgeclient_edgesdk_edgesip_edgetagsurl
attributes
propertiestrust)r   r   r   r   N)
r	   r[   r
   getr   iso8601_datetimeinteger_properties_contextr   )r   r   r\   r   r   r   r
   R  sV   




	









zCallSummariesInstance.__init__c                 C   
   | j d S )zC
        :returns: The account_sid
        :rtype: unicode
        r   r   rR   r   r   r   r   x     
z!CallSummariesInstance.account_sidc                 C   r   )z@
        :returns: The call_sid
        :rtype: unicode
        r   r   rR   r   r   r   r     r   zCallSummariesInstance.call_sidc                 C   r   )zX
        :returns: The call_type
        :rtype: CallSummariesInstance.CallType
        r   r   rR   r   r   r   r     r   zCallSummariesInstance.call_typec                 C   r   )zZ
        :returns: The call_state
        :rtype: CallSummariesInstance.CallState
        r   r   rR   r   r   r   r     r   z CallSummariesInstance.call_statec                 C   r   )zf
        :returns: The processing_state
        :rtype: CallSummariesInstance.ProcessingState
        r!   r   rR   r   r   r   r!     r   z&CallSummariesInstance.processing_statec                 C   r   )zE
        :returns: The created_time
        :rtype: datetime
        r   r   rR   r   r   r   r     r   z"CallSummariesInstance.created_timec                 C   r   )zC
        :returns: The start_time
        :rtype: datetime
        r   r   rR   r   r   r   r     r   z CallSummariesInstance.start_timec                 C   r   )zA
        :returns: The end_time
        :rtype: datetime
        r   r   rR   r   r   r   r     r   zCallSummariesInstance.end_timec                 C   r   )z@
        :returns: The duration
        :rtype: unicode
        r   r   rR   r   r   r   r     r   zCallSummariesInstance.durationc                 C   r   )zH
        :returns: The connect_duration
        :rtype: unicode
        r   r   rR   r   r   r   r     r   z&CallSummariesInstance.connect_durationc                 C   r   )z9
        :returns: The from
        :rtype: dict
        r   r   rR   r   r   r   r     r   zCallSummariesInstance.from_c                 C   r   )z7
        :returns: The to
        :rtype: dict
        r   r   rR   r   r   r   r     r   zCallSummariesInstance.toc                 C   r   )zA
        :returns: The carrier_edge
        :rtype: dict
        r   r   rR   r   r   r   r     r   z"CallSummariesInstance.carrier_edgec                 C   r   )z@
        :returns: The client_edge
        :rtype: dict
        r   r   rR   r   r   r   r     r   z!CallSummariesInstance.client_edgec                 C   r   )z=
        :returns: The sdk_edge
        :rtype: dict
        r   r   rR   r   r   r   r     r   zCallSummariesInstance.sdk_edgec                 C   r   )z=
        :returns: The sip_edge
        :rtype: dict
        r   r   rR   r   r   r   r     r   zCallSummariesInstance.sip_edgec                 C   r   )zB
        :returns: The tags
        :rtype: list[unicode]
        r   r   rR   r   r   r   r     r   zCallSummariesInstance.tagsc                 C   r   )z;
        :returns: The url
        :rtype: unicode
        r   r   rR   r   r   r   r      r   zCallSummariesInstance.urlc                 C   r   )z?
        :returns: The attributes
        :rtype: dict
        r   r   rR   r   r   r   r     r   z CallSummariesInstance.attributesc                 C   r   )z?
        :returns: The properties
        :rtype: dict
        r   r   rR   r   r   r   r     r   z CallSummariesInstance.propertiesc                 C   r   )z:
        :returns: The trust
        :rtype: dict
        r   r   rR   r   r   r   r     r   zCallSummariesInstance.trustc                 C   rP   )rQ   z*<Twilio.Insights.V1.CallSummariesInstance>r   rR   r   r   r   rS      rT   zCallSummariesInstance.__repr__)#rU   rV   rW   objectr8   r9   r;   r   r<   r   r
   propertyr   r   r   r   r!   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rS   rY   r   r   r   r   r[   +  sf    
&




















r[   N)__doc__twilio.baser   r   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   rF   r[   r   r   r   r   <module>   s    v&