Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion line-openapi
Submodule line-openapi updated 1 files
+176 −0 messaging-api.yml
5 changes: 5 additions & 0 deletions linebot/v3/messaging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@
from linebot.v3.messaging.models.operator_demographic_filter import OperatorDemographicFilter
from linebot.v3.messaging.models.operator_recipient import OperatorRecipient
from linebot.v3.messaging.models.pnp_messages_request import PnpMessagesRequest
from linebot.v3.messaging.models.pnp_templated_button import PnpTemplatedButton
from linebot.v3.messaging.models.pnp_templated_emphasized_item import PnpTemplatedEmphasizedItem
from linebot.v3.messaging.models.pnp_templated_item import PnpTemplatedItem
from linebot.v3.messaging.models.pnp_templated_message_body import PnpTemplatedMessageBody
from linebot.v3.messaging.models.pnp_templated_message_request import PnpTemplatedMessageRequest
from linebot.v3.messaging.models.postback_action import PostbackAction
from linebot.v3.messaging.models.push_message_request import PushMessageRequest
from linebot.v3.messaging.models.push_message_response import PushMessageResponse
Expand Down
316 changes: 316 additions & 0 deletions linebot/v3/messaging/api/async_messaging_api.py

Large diffs are not rendered by default.

296 changes: 296 additions & 0 deletions linebot/v3/messaging/api/messaging_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from linebot.v3.messaging.models.narrowcast_request import NarrowcastRequest
from linebot.v3.messaging.models.number_of_messages_response import NumberOfMessagesResponse
from linebot.v3.messaging.models.pnp_messages_request import PnpMessagesRequest
from linebot.v3.messaging.models.pnp_templated_message_request import PnpTemplatedMessageRequest
from linebot.v3.messaging.models.push_message_request import PushMessageRequest
from linebot.v3.messaging.models.push_message_response import PushMessageResponse
from linebot.v3.messaging.models.quota_consumption_response import QuotaConsumptionResponse
Expand Down Expand Up @@ -4207,6 +4208,147 @@ def get_pnp_message_statistics_with_http_info(self, var_date : Annotated[constr(
collection_formats=_collection_formats,
_request_auth=_params.get('_request_auth'))

@validate_arguments
def get_pnp_templated_message_statistics(self, var_date : Annotated[constr(strict=True), Field(..., description="Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 ")], **kwargs) -> NumberOfMessagesResponse: # noqa: E501
"""get_pnp_templated_message_statistics # noqa: E501

Get number of sent LINE notification messages (template) # 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_pnp_templated_message_statistics(var_date, async_req=True)
>>> result = thread.get()

:param var_date: Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: 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: NumberOfMessagesResponse
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
raise ValueError("Error! Please call the get_pnp_templated_message_statistics_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
return self.get_pnp_templated_message_statistics_with_http_info(var_date, **kwargs) # noqa: E501

@validate_arguments
def get_pnp_templated_message_statistics_with_http_info(self, var_date : Annotated[constr(strict=True), Field(..., description="Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 ")], **kwargs) -> ApiResponse: # noqa: E501
"""get_pnp_templated_message_statistics # noqa: E501

Get number of sent LINE notification messages (template) # 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_pnp_templated_message_statistics_with_http_info(var_date, async_req=True)
>>> result = thread.get()

:param var_date: Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: 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(NumberOfMessagesResponse, status_code(int), headers(HTTPHeaderDict))
"""

_host = self.line_base_path
_params = locals()

_all_params = [
'var_date'
]
_all_params.extend(
[
'async_req',
'_return_http_data_only',
'_preload_content',
'_request_timeout',
'_request_auth',
'_content_type',
'_headers'
]
)

# validate the arguments
for _key, _val in _params['kwargs'].items():
if _key not in _all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method get_pnp_templated_message_statistics" % _key
)
_params[_key] = _val
del _params['kwargs']

_collection_formats = {}

# process the path parameters
_path_params = {}

# process the query parameters
_query_params = []
if _params.get('var_date') is not None: # noqa: E501
_query_params.append(('date', _params['var_date']))

# process the header parameters
_header_params = dict(_params.get('_headers', {}))
# process the form parameters
_form_params = []
_files = {}
# process the body parameter
_body_params = None
# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501

# authentication setting
_auth_settings = ['Bearer'] # noqa: E501

_response_types_map = {
'200': "NumberOfMessagesResponse",
}

return self.api_client.call_api(
'/v2/bot/message/delivery/pnp/templated', 'GET',
_path_params,
_query_params,
_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
response_types_map=_response_types_map,
auth_settings=_auth_settings,
async_req=_params.get('async_req'),
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
_preload_content=_params.get('_preload_content', True),
_request_timeout=_params.get('_request_timeout'),
_host=_host,
collection_formats=_collection_formats,
_request_auth=_params.get('_request_auth'))

@validate_arguments
def get_profile(self, user_id : Annotated[StrictStr, Field(..., description="User ID")], **kwargs) -> UserProfileResponse: # noqa: E501
"""get_profile # noqa: E501
Expand Down Expand Up @@ -7531,6 +7673,160 @@ def push_messages_by_phone_with_http_info(self, pnp_messages_request : PnpMessag
collection_formats=_collection_formats,
_request_auth=_params.get('_request_auth'))

@validate_arguments
def push_templated_messages_by_phone(self, pnp_templated_message_request : PnpTemplatedMessageRequest, x_line_delivery_tag : Annotated[Optional[constr(strict=True, max_length=100, min_length=16)], Field(description="String returned in the delivery.data property of the delivery completion event via Webhook.")] = None, **kwargs) -> None: # noqa: E501
"""push_templated_messages_by_phone # noqa: E501

Send LINE notification message (template) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

>>> thread = api.push_templated_messages_by_phone(pnp_templated_message_request, x_line_delivery_tag, async_req=True)
>>> result = thread.get()

:param pnp_templated_message_request: (required)
:type pnp_templated_message_request: PnpTemplatedMessageRequest
:param x_line_delivery_tag: String returned in the delivery.data property of the delivery completion event via Webhook.
:type x_line_delivery_tag: 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: None
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
raise ValueError("Error! Please call the push_templated_messages_by_phone_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
return self.push_templated_messages_by_phone_with_http_info(pnp_templated_message_request, x_line_delivery_tag, **kwargs) # noqa: E501

@validate_arguments
def push_templated_messages_by_phone_with_http_info(self, pnp_templated_message_request : PnpTemplatedMessageRequest, x_line_delivery_tag : Annotated[Optional[constr(strict=True, max_length=100, min_length=16)], Field(description="String returned in the delivery.data property of the delivery completion event via Webhook.")] = None, **kwargs) -> ApiResponse: # noqa: E501
"""push_templated_messages_by_phone # noqa: E501

Send LINE notification message (template) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

>>> thread = api.push_templated_messages_by_phone_with_http_info(pnp_templated_message_request, x_line_delivery_tag, async_req=True)
>>> result = thread.get()

:param pnp_templated_message_request: (required)
:type pnp_templated_message_request: PnpTemplatedMessageRequest
:param x_line_delivery_tag: String returned in the delivery.data property of the delivery completion event via Webhook.
:type x_line_delivery_tag: 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: None
"""

_host = self.line_base_path
_params = locals()

_all_params = [
'pnp_templated_message_request',
'x_line_delivery_tag'
]
_all_params.extend(
[
'async_req',
'_return_http_data_only',
'_preload_content',
'_request_timeout',
'_request_auth',
'_content_type',
'_headers'
]
)

# validate the arguments
for _key, _val in _params['kwargs'].items():
if _key not in _all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method push_templated_messages_by_phone" % _key
)
_params[_key] = _val
del _params['kwargs']

_collection_formats = {}

# process the path parameters
_path_params = {}

# process the query parameters
_query_params = []
# process the header parameters
_header_params = dict(_params.get('_headers', {}))
if _params['x_line_delivery_tag']:
_header_params['X-Line-Delivery-Tag'] = _params['x_line_delivery_tag']

# process the form parameters
_form_params = []
_files = {}
# process the body parameter
_body_params = None
if _params['pnp_templated_message_request'] is not None:
_body_params = _params['pnp_templated_message_request']

# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501

# set the HTTP header `Content-Type`
_content_types_list = _params.get('_content_type',
self.api_client.select_header_content_type(
['application/json']))
if _content_types_list:
_header_params['Content-Type'] = _content_types_list

# authentication setting
_auth_settings = ['Bearer'] # noqa: E501

_response_types_map = {}

return self.api_client.call_api(
'/v2/bot/message/pnp/templated/push', 'POST',
_path_params,
_query_params,
_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
response_types_map=_response_types_map,
auth_settings=_auth_settings,
async_req=_params.get('async_req'),
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
_preload_content=_params.get('_preload_content', True),
_request_timeout=_params.get('_request_timeout'),
_host=_host,
collection_formats=_collection_formats,
_request_auth=_params.get('_request_auth'))

@validate_arguments
def reply_message(self, reply_message_request : ReplyMessageRequest, **kwargs) -> ReplyMessageResponse: # noqa: E501
"""reply_message # noqa: E501
Expand Down
Loading