o
    #`^h                     @   s   d Z ddlZddlZddlmZmZ ddlmZ ddlmZm	Z	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 ddlmZ ddlmZ ddlmZmZ G dd deZdS )a  
    LINE Messaging API(Insight)

    This document describes LINE Messaging API(Insight).  # noqa: E501

    The version of the OpenAPI document: 0.0.1
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
    N)validate_argumentsValidationError)	Annotated)Fieldconstr	validator)Optional)GetFriendsDemographicsResponse)GetMessageEventResponse)GetNumberOfFollowersResponse)$GetNumberOfMessageDeliveriesResponse)GetStatisticsPerUnitResponse)	ApiClient)ApiResponse)ApiTypeErrorApiValueErrorc                   @   s:  e Zd ZdZd-ddZedefddZedefdd	Z	ed
e
edddedddf defddZed
e
edddedddf defddZed-de
eedddd eddf defddZed-de
eedddd eddf defddZede
eddddedddf defddZede
eddddedddf defd d!Zed"e
edd#ddedd$df d%e
eddddedd&df d'e
eddddedd(df defd)d*Zed"e
edd#ddedd$df d%e
eddddedd&df d'e
eddddedd(df defd+d,ZdS ).InsightzNOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    Nc                 C   s    |d u rt  }|| _d| _d S )Nzhttps://api.line.me)r   get_default
api_clientline_base_path)selfr    r   \/home/air/shanriGPT/back/venv/lib/python3.10/site-packages/linebot/v3/insight/api/insight.py__init__.   s   
zInsight.__init__returnc                 K   s(   d|d< d|v rt d| jdi |S )al  get_friends_demographics  # noqa: E501

        Retrieves the demographic attributes for a LINE Official Account's friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID).   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_friends_demographics(async_req=True)
        >>> result = thread.get()

        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: GetFriendsDemographicsResponse
        T_return_http_data_only_preload_contentzError! Please call the get_friends_demographics_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_dataNr   )
ValueError'get_friends_demographics_with_http_info)r   kwargsr   r   r   get_friends_demographics5   s   z Insight.get_friends_demographicsc                 K   s   | j }t }g }|g d |d  D ]\}}||vr#td| |||< q|d= i }i }g }	t|di }
g }i }d}| jdg|
d< dg}d	d
i}| jj	dd||	|
||||||d|d|dd|d|||ddS )a  get_friends_demographics  # noqa: E501

        Retrieves the demographic attributes for a LINE Official Account's friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID).   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_friends_demographics_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(GetFriendsDemographicsResponse, status_code(int), headers(HTTPHeaderDict))
        	async_reqr   r   _request_timeout_request_auth_content_type_headersr   zJGot an unexpected keyword argument '%s' to method get_friends_demographicsr&   Napplication/jsonAcceptBearer200r	   z/v2/bot/insight/demographicGETr"   r   r   Tr#   r$   bodypost_paramsfilesresponse_types_mapauth_settingsr"   r   r   r#   _hostcollection_formatsr$   )
r   localsextenditemsr   dictgetr   select_header_acceptcall_api)r   r   r2   _params_all_params_key_val_collection_formats_path_params_query_params_header_params_form_params_files_body_params_auth_settings_response_types_mapr   r   r   r   P   s\   $

z/Insight.get_friends_demographics_with_http_info
request_idT   )strict
min_length.zfRequest ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. )descriptionc                 K   *   d|d< d|v rt d| j|fi |S )a  Get user interaction statistics  # noqa: E501

        Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_message_event(request_id, async_req=True)
        >>> result = thread.get()

        :param request_id: Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID.  (required)
        :type request_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: GetMessageEventResponse
        Tr   r   zError! Please call the get_message_event_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data)r    get_message_event_with_http_info)r   rH   r   r   r   r   get_message_event      zInsight.get_message_eventc                 K     | j }t }dg}|g d |d  D ]\}}||vr$td| |||< q|d= i }i }	g }
|ddurB|
d|d f t|di }g }i }d}| j	dg|d	< d
g}ddi}| jj
dd|	|
|||||||d|d|dd|d|||ddS )ah  Get user interaction statistics  # noqa: E501

        Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_message_event_with_http_info(request_id, async_req=True)
        >>> result = thread.get()

        :param request_id: Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID.  (required)
        :type request_id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(GetMessageEventResponse, status_code(int), headers(HTTPHeaderDict))
        rH   r!   r   zCGot an unexpected keyword argument '%s' to method get_message_eventN	requestIdr&   r'   r(   r)   r*   r
   z/v2/bot/insight/message/eventr+   r"   r   r   Tr#   r$   r,   r   r4   r5   r6   r   r8   appendr7   r   r9   r:   )r   rH   r   r2   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r   r   r   rN      b   &

z(Insight.get_message_event_with_http_infovar_date   )rJ   
max_lengthrK   zfDate for which to retrieve the number of followers.  Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 c                 K   rM   )a  Get number of followers  # noqa: E501

        Returns the number of users who have added the LINE Official Account on or before a specified date.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_number_of_followers(var_date, async_req=True)
        >>> result = thread.get()

        :param var_date: Date for which to retrieve the number of followers.  Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 
        :type var_date: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: GetNumberOfFollowersResponse
        Tr   r   zError! Please call the get_number_of_followers_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data)r   &get_number_of_followers_with_http_infor   rV   r   r   r   r   get_number_of_followersG  rP   zInsight.get_number_of_followersc                 K   rQ   )a=  Get number of followers  # noqa: E501

        Returns the number of users who have added the LINE Official Account on or before a specified date.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_number_of_followers_with_http_info(var_date, async_req=True)
        >>> result = thread.get()

        :param var_date: Date for which to retrieve the number of followers.  Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 
        :type var_date: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(GetNumberOfFollowersResponse, status_code(int), headers(HTTPHeaderDict))
        rV   r!   r   zIGot an unexpected keyword argument '%s' to method get_number_of_followersNdater&   r'   r(   r)   r*   r   z/v2/bot/insight/followersr+   r"   r   r   Tr#   r$   r,   rS   r   rV   r   r2   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r   r   r   rY   d  rU   z.Insight.get_number_of_followers_with_http_infoziDate for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 c                 K   rM   )a  Get number of message deliveries  # noqa: E501

        Returns the number of messages sent from LINE Official Account on a specified day.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_number_of_message_deliveries(var_date, async_req=True)
        >>> result = thread.get()

        :param var_date: Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9  (required)
        :type var_date: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: GetNumberOfMessageDeliveriesResponse
        Tr   r   zError! Please call the get_number_of_message_deliveries_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data)r   /get_number_of_message_deliveries_with_http_inforZ   r   r   r    get_number_of_message_deliveries  rP   z(Insight.get_number_of_message_deliveriesc                 K   rQ   )aT  Get number of message deliveries  # noqa: E501

        Returns the number of messages sent from LINE Official Account on a specified day.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_number_of_message_deliveries_with_http_info(var_date, async_req=True)
        >>> result = thread.get()

        :param var_date: Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9  (required)
        :type var_date: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(GetNumberOfMessageDeliveriesResponse, status_code(int), headers(HTTPHeaderDict))
        rV   r!   r   zRGot an unexpected keyword argument '%s' to method get_number_of_message_deliveriesNr\   r&   r'   r(   r)   r*   r   z /v2/bot/insight/message/deliveryr+   r"   r   r   Tr#   r$   r,   rS   r]   r   r   r   r^     rU   z7Insight.get_number_of_message_deliveries_with_http_infocustom_aggregation_unit   zName of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. var_fromzUStart date of aggregation period.  Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 tozEnd date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331.  Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 c                 K   s.   d|d< d|v rt d| j|||fi |S )a  get_statistics_per_unit  # noqa: E501

        You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_statistics_per_unit(custom_aggregation_unit, var_from, to, async_req=True)
        >>> result = thread.get()

        :param custom_aggregation_unit: Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names.  (required)
        :type custom_aggregation_unit: str
        :param var_from: Start date of aggregation period.  Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9  (required)
        :type var_from: str
        :param to: End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331.  Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9  (required)
        :type to: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: GetStatisticsPerUnitResponse
        Tr   r   zError! Please call the get_statistics_per_unit_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data)r   &get_statistics_per_unit_with_http_info)r   r`   rb   rc   r   r   r   r   get_statistics_per_unita  s   zInsight.get_statistics_per_unitc                 K   sP  | j }t }g d}|g d |d  D ]\}}	||vr%td| |	||< q|d= i }
i }g }|ddurC|d|d f |ddurS|d	|d f |d
durc|d
|d
 f t|di }g }i }d}| j	dg|d< dg}ddi}| jj
dd|||||||||d|d|dd|d||
|ddS )a
  get_statistics_per_unit  # noqa: E501

        You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_statistics_per_unit_with_http_info(custom_aggregation_unit, var_from, to, async_req=True)
        >>> result = thread.get()

        :param custom_aggregation_unit: Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names.  (required)
        :type custom_aggregation_unit: str
        :param var_from: Start date of aggregation period.  Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9  (required)
        :type var_from: str
        :param to: End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331.  Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9  (required)
        :type to: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(GetStatisticsPerUnitResponse, status_code(int), headers(HTTPHeaderDict))
        )r`   rb   rc   r!   r   zIGot an unexpected keyword argument '%s' to method get_statistics_per_unitr`   NcustomAggregationUnitrb   fromrc   r&   r'   r(   r)   r*   r   z)/v2/bot/insight/message/event/aggregationr+   r"   r   r   Tr#   r$   r,   rS   )r   r`   rb   rc   r   r2   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r   r   r   rd     sh   *

z.Insight.get_statistics_per_unit_with_http_info)N)__name__
__module____qualname____doc__r   r   r	   r    r   r   r   r   r   r
   rO   rN   r   r   r[   rY   r   r_   r^   r   re   rd   r   r   r   r   r   '   s.    
i,,o22o..oj nr   ) rk   reiopydantic.v1r   r   typing_extensionsr   r   r   r   typingr   ;linebot.v3.insight.models.get_friends_demographics_responser	   4linebot.v3.insight.models.get_message_event_responser
   :linebot.v3.insight.models.get_number_of_followers_responser   Clinebot.v3.insight.models.get_number_of_message_deliveries_responser   :linebot.v3.insight.models.get_statistics_per_unit_responser   linebot.v3.insight.api_clientr   linebot.v3.insight.api_responser   linebot.v3.insight.exceptionsr   r   objectr   r   r   r   r   <module>   s    