a
    !f                     @   s   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 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 )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Insights
    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values)InstanceResource)ListResource)Version)Pagec                       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	e
eeef d fddZedddZ  ZS )CallSummariesInstancec                   @   s(   e Zd ZdZdZdZdZdZdZdZ	dS )	 CallSummariesInstance.AnsweredByunknownZmachine_startZmachine_end_beepZmachine_end_silenceZmachine_end_otherZhumanfaxN)
__name__
__module____qualname__UNKNOWNZMACHINE_STARTZMACHINE_END_BEEPZMACHINE_END_SILENCEZMACHINE_END_OTHERZHUMANZFAX r   r   g/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/insights/v1/call_summaries.py
AnsweredBy   s   r   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.CallStateZringing	completedbusyZfailZnoanswercanceledZansweredZundialedN)r   r   r   ZRINGING	COMPLETEDZBUSYFAILZNOANSWERZCANCELEDZANSWEREDZUNDIALEDr   r   r   r   	CallState$   s   r    c                   @   s   e Zd ZdZdZdZdZdS )zCallSummariesInstance.CallTypeZcarriersipZtrunkingclientN)r   r   r   ZCARRIERZSIPZTRUNKINGZCLIENTr   r   r   r   CallType.   s   r#   c                   @   s   e Zd ZdZdZdS )z%CallSummariesInstance.ProcessingStateZcompletepartialN)r   r   r   ZCOMPLETEPARTIALr   r   r   r   ProcessingState4   s   r&   c                   @   s   e Zd ZdZdZdZdZdS ),CallSummariesInstance.ProcessingStateRequestr   startedr$   allN)r   r   r   r   ZSTARTEDr%   ALLr   r   r   r   ProcessingStateRequest8   s   r+   c                   @   s   e Zd ZdZdZdS )CallSummariesInstance.SortBy
start_timeend_timeN)r   r   r   Z
START_TIMEZEND_TIMEr   r   r   r   SortBy>   s   r/   )versionpayloadc                    sB  t  | |d| _|d| _|d| _|d| _|d| _|d| _t	
|d| _t	
|d| _t	
|d	| _t	|d
| _t	|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _d S )Naccount_sidcall_sidanswered_by	call_type
call_stateprocessing_statecreated_timer-   r.   durationconnect_durationfromtocarrier_edgeclient_edgesdk_edgesip_edgetagsurl
attributes
propertiestrust
annotation)super__init__getr2   r3   r4   r5   r6   r7   r
   iso8601_datetimer8   r-   r.   integerr9   r:   Z_fromr<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   )selfr0   r1   	__class__r   r   rH   \   sN    zCallSummariesInstance.__init__returnc                 C   s   dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z*<Twilio.Insights.V1.CallSummariesInstance>r   rL   r   r   r   __repr__   s    zCallSummariesInstance.__repr__)r   r   r   objectr   r    r#   r&   r+   r/   r   r   strr   rH   rS   __classcell__r   r   rM   r   r      s   	
+r   c                   @   s2   e Zd Zeeef edddZedddZdS )CallSummariesPage)r1   rP   c                 C   s   t | j|S )zs
        Build an instance of CallSummariesInstance

        :param payload: Payload response from the API
        )r   _version)rL   r1   r   r   r   get_instance   s    zCallSummariesPage.get_instancerO   c                 C   s   dS )rQ   z&<Twilio.Insights.V1.CallSummariesPage>r   rR   r   r   r   rS      s    zCallSummariesPage.__repr__N)	r   r   r   r   rU   r   r   rY   rS   r   r   r   r   rW      s   rW   c                       s  e Zd Ze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ejejddfeee	f eee	f eee	f eee	f eee	f eee	f ee
e	f ee
e	f ee
e	f eee	f eee	f eee	f eee	f eee	f ede	f ede	f eee	f ee
e	f ede	f eee	f eee	f ee
e	f eee	f ee ee ee d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ejejddfeee	f eee	f eee	f eee	f eee	f eee	f ee
e	f ee
e	f ee
e	f eee	f eee	f eee	f eee	f eee	f ede	f ede	f eee	f ee
e	f ede	f eee	f eee	f ee
e	f eee	f ee ee ee d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ejejddfeee	f eee	f eee	f eee	f eee	f eee	f ee
e	f ee
e	f ee
e	f eee	f eee	f eee	f eee	f eee	f ede	f ede	f eee	f ee
e	f ede	f eee	f eee	f ee
e	f eee	f ee ee ee d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ejejddfeee	f eee	f eee	f eee	f eee	f eee	f ee
e	f ee
e	f ee
e	f eee	f eee	f eee	f eee	f eee	f ede	f ede	f eee	f ee
e	f ede	f eee	f eee	f ee
e	f eee	f ee ee ee d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ejejejejejfeee	f eee	f eee	f eee	f eee	f eee	f ee
e	f ee
e	f ee
e	f eee	f eee	f eee	f eee	f eee	f ede	f ede	f eee	f ee
e	f ede	f eee	f eee	f ee
e	f eee	f eee	f eee	f eee	f ed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ejejejejejfeee	f eee	f eee	f eee	f eee	f eee	f ee
e	f ee
e	f ee
e	f eee	f eee	f eee	f eee	f eee	f ede	f ede	f eee	f ee
e	f ede	f eee	f eee	f ee
e	f eee	f eee	f eee	f eee	f edddZeedddZeedddZedddZ  ZS )CallSummariesList)r0   c                    s   t  | d| _dS )zo
        Initialize the CallSummariesList

        :param version: Version that contains the resource

        z/Voice/SummariesN)rG   rH   _uri)rL   r0   rM   r   r   rH      s    zCallSummariesList.__init__Nr'   r,   r   )from_r<   from_carrier
to_carrierfrom_country_codeto_country_codebrandedverified_callerhas_tagr-   r.   r5   r6   	directionr7   sort_by
subaccountabnormal_sessionr4   connectivity_issuequality_issuespam
call_scorelimit	page_sizerP   c                 C   s^   | j ||}| j|||||||||	|
||||||||||||||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 str from_: A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param str to: A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param str from_carrier: An origination carrier.
        :param str to_carrier: A destination carrier.
        :param str from_country_code: A source country code based on phone number in From.
        :param str to_country_code: A destination country code. Based on phone number in To.
        :param bool branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls.
        :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.
        :param bool has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags).
        :param str start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h.
        :param str end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m.
        :param str call_type: A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`.
        :param str call_state: A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`.
        :param str direction: A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`.
        :param &quot;CallSummariesInstance.ProcessingStateRequest&quot; processing_state: A Processing State of the Call Summaries. One of `completed`, `partial` or `all`.
        :param &quot;CallSummariesInstance.SortBy&quot; sort_by: A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`.
        :param str subaccount: A unique SID identifier of a Subaccount.
        :param bool abnormal_session: A boolean flag indicating an abnormal session where the last SIP response was not 200 OK.
        :param &quot;CallSummariesInstance.AnsweredBy&quot; answered_by: An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`.
        :param str connectivity_issue: A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`.
        :param str quality_issue: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`.
        :param bool spam: A boolean flag indicating spam calls.
        :param str call_score: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad].
        :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
        rm   r\   r<   r]   r^   r_   r`   ra   rb   rc   r-   r.   r5   r6   rd   r7   re   rf   rg   r4   rh   ri   rj   rk   rm   rl   )rX   read_limitspagestreamrL   r\   r<   r]   r^   r_   r`   ra   rb   rc   r-   r.   r5   r6   rd   r7   re   rf   rg   r4   rh   ri   rj   rk   rl   rm   Zlimitsrp   r   r   r   rq      s8    DzCallSummariesList.streamc                    sd   | j ||}| j|||||||||	|
||||||||||||||d dI dH }| j ||d S )a  
        Asynchronously 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 str from_: A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param str to: A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param str from_carrier: An origination carrier.
        :param str to_carrier: A destination carrier.
        :param str from_country_code: A source country code based on phone number in From.
        :param str to_country_code: A destination country code. Based on phone number in To.
        :param bool branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls.
        :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.
        :param bool has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags).
        :param str start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h.
        :param str end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m.
        :param str call_type: A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`.
        :param str call_state: A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`.
        :param str direction: A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`.
        :param &quot;CallSummariesInstance.ProcessingStateRequest&quot; processing_state: A Processing State of the Call Summaries. One of `completed`, `partial` or `all`.
        :param &quot;CallSummariesInstance.SortBy&quot; sort_by: A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`.
        :param str subaccount: A unique SID identifier of a Subaccount.
        :param bool abnormal_session: A boolean flag indicating an abnormal session where the last SIP response was not 200 OK.
        :param &quot;CallSummariesInstance.AnsweredBy&quot; answered_by: An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`.
        :param str connectivity_issue: A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`.
        :param str quality_issue: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`.
        :param bool spam: A boolean flag indicating spam calls.
        :param str call_score: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad].
        :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
        rm   rn   Nrl   )rX   ro   
page_asyncstream_asyncrr   r   r   r   rt     s8    DzCallSummariesList.stream_asyncc                 C   s@   t | j|||||||||	|
|||||||||||||||dS )a8  
        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 str from_: A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param str to: A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param str from_carrier: An origination carrier.
        :param str to_carrier: A destination carrier.
        :param str from_country_code: A source country code based on phone number in From.
        :param str to_country_code: A destination country code. Based on phone number in To.
        :param bool branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls.
        :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.
        :param bool has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags).
        :param str start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h.
        :param str end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m.
        :param str call_type: A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`.
        :param str call_state: A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`.
        :param str direction: A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`.
        :param &quot;CallSummariesInstance.ProcessingStateRequest&quot; processing_state: A Processing State of the Call Summaries. One of `completed`, `partial` or `all`.
        :param &quot;CallSummariesInstance.SortBy&quot; sort_by: A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`.
        :param str subaccount: A unique SID identifier of a Subaccount.
        :param bool abnormal_session: A boolean flag indicating an abnormal session where the last SIP response was not 200 OK.
        :param &quot;CallSummariesInstance.AnsweredBy&quot; answered_by: An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`.
        :param str connectivity_issue: A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`.
        :param str quality_issue: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`.
        :param bool spam: A boolean flag indicating spam calls.
        :param str call_score: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad].
        :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<   r]   r^   r_   r`   ra   rb   rc   r-   r.   r5   r6   rd   r7   re   rf   rg   r4   rh   ri   rj   rk   rl   rm   )listrq   rL   r\   r<   r]   r^   r_   r`   ra   rb   rc   r-   r.   r5   r6   rd   r7   re   rf   rg   r4   rh   ri   rj   rk   rl   rm   r   r   r   rv   s  s:    CzCallSummariesList.listc                    sR   dd | j |||||||||	|
|||||||||||||||dI dH 2 I dH S )aG  
        Asynchronously 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 str from_: A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param str to: A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param str from_carrier: An origination carrier.
        :param str to_carrier: A destination carrier.
        :param str from_country_code: A source country code based on phone number in From.
        :param str to_country_code: A destination country code. Based on phone number in To.
        :param bool branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls.
        :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.
        :param bool has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags).
        :param str start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h.
        :param str end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m.
        :param str call_type: A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`.
        :param str call_state: A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`.
        :param str direction: A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`.
        :param &quot;CallSummariesInstance.ProcessingStateRequest&quot; processing_state: A Processing State of the Call Summaries. One of `completed`, `partial` or `all`.
        :param &quot;CallSummariesInstance.SortBy&quot; sort_by: A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`.
        :param str subaccount: A unique SID identifier of a Subaccount.
        :param bool abnormal_session: A boolean flag indicating an abnormal session where the last SIP response was not 200 OK.
        :param &quot;CallSummariesInstance.AnsweredBy&quot; answered_by: An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`.
        :param str connectivity_issue: A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`.
        :param str quality_issue: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`.
        :param bool spam: A boolean flag indicating spam calls.
        :param str call_score: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad].
        :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
        c                    s   g | z3 d H W }|q6 S )Nr   ).0recordr   r   r   
<listcomp>  s   z0CallSummariesList.list_async.<locals>.<listcomp>ru   N)rt   rw   r   r   r   
list_async  s:    C
zCallSummariesList.list_async)r\   r<   r]   r^   r_   r`   ra   rb   rc   r-   r.   r5   r6   rd   r7   re   rf   rg   r4   rh   ri   rj   rk   
page_tokenpage_numberrm   rP   c                 C   s`   t |||||||||	|
||||||||||||||||d}| jjd| j|d}t| j|S )a  
        Retrieve a single page of CallSummariesInstance records from the API.
        Request is executed immediately

        :param from_: A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param to: A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param from_carrier: An origination carrier.
        :param to_carrier: A destination carrier.
        :param from_country_code: A source country code based on phone number in From.
        :param to_country_code: A destination country code. Based on phone number in To.
        :param branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls.
        :param verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.
        :param has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags).
        :param start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h.
        :param end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m.
        :param call_type: A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`.
        :param call_state: A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`.
        :param direction: A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`.
        :param processing_state: A Processing State of the Call Summaries. One of `completed`, `partial` or `all`.
        :param sort_by: A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`.
        :param subaccount: A unique SID identifier of a Subaccount.
        :param abnormal_session: A boolean flag indicating an abnormal session where the last SIP response was not 200 OK.
        :param answered_by: An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`.
        :param connectivity_issue: A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`.
        :param quality_issue: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`.
        :param spam: A boolean flag indicating spam calls.
        :param call_score: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad].
        :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 CallSummariesInstance
        FromToZFromCarrierZ	ToCarrierZFromCountryCodeZToCountryCodeZBrandedZVerifiedCallerZHasTagZ	StartTimeZEndTimer#   r    Z	Directionr&   r/   Z
SubaccountZAbnormalSessionr   ZConnectivityIssueZQualityIssueZSpamZ	CallScoreZ	PageTokenr   ZPageSizeGETmethoduriparams)r   ofrX   rp   r[   rW   rL   r\   r<   r]   r^   r_   r`   ra   rb   rc   r-   r.   r5   r6   rd   r7   re   rf   rg   r4   rh   ri   rj   rk   r|   r}   rm   dataresponser   r   r   rp   6  s>    @zCallSummariesList.pagec                    sf   t |||||||||	|
||||||||||||||||d}| jjd| j|dI dH }t| j|S )a  
        Asynchronously retrieve a single page of CallSummariesInstance records from the API.
        Request is executed immediately

        :param from_: A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param to: A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.
        :param from_carrier: An origination carrier.
        :param to_carrier: A destination carrier.
        :param from_country_code: A source country code based on phone number in From.
        :param to_country_code: A destination country code. Based on phone number in To.
        :param branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls.
        :param verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.
        :param has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags).
        :param start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h.
        :param end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m.
        :param call_type: A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`.
        :param call_state: A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`.
        :param direction: A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`.
        :param processing_state: A Processing State of the Call Summaries. One of `completed`, `partial` or `all`.
        :param sort_by: A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`.
        :param subaccount: A unique SID identifier of a Subaccount.
        :param abnormal_session: A boolean flag indicating an abnormal session where the last SIP response was not 200 OK.
        :param answered_by: An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`.
        :param connectivity_issue: A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`.
        :param quality_issue: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`.
        :param spam: A boolean flag indicating spam calls.
        :param call_score: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad].
        :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 CallSummariesInstance
        r~   r   r   N)r   r   rX   rs   r[   rW   r   r   r   r   rs     sB    @zCallSummariesList.page_async)
target_urlrP   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of CallSummariesInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CallSummariesInstance
        r   )rX   domaintwiliorequestrW   rL   r   r   r   r   r   get_page  s    	zCallSummariesList.get_pagec                    s$   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of CallSummariesInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CallSummariesInstance
        r   N)rX   r   r   Zrequest_asyncrW   r   r   r   r   get_page_async  s    	z CallSummariesList.get_page_asyncrO   c                 C   s   dS )rQ   z&<Twilio.Insights.V1.CallSummariesList>r   rR   r   r   r   rS     s    zCallSummariesList.__repr__)r   r   r   r   rH   r   unsetr   rU   rT   boolr   intr   r   rq   r	   rt   r   rv   r{   rW   rp   rs   r   r   rS   rV   r   r   rM   r   rZ      s  





















d





















d





















c





















d
























d
























drZ   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   rW   rZ   r   r   r   r   <module>   s   $w