Skip to content

Commit 7306658

Browse files
authored
Add Quote message feature (#523)
* NO-ISSUE Update line-openapi digest to cdac946 * NO-ISSUE generate code * NO-ISSUE Modify test
1 parent 18d0003 commit 7306658

17 files changed

+438
-92
lines changed

Diff for: line-openapi

Diff for: linebot/v3/messaging/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,15 @@
120120
from linebot.v3.messaging.models.pnp_messages_request import PnpMessagesRequest
121121
from linebot.v3.messaging.models.postback_action import PostbackAction
122122
from linebot.v3.messaging.models.push_message_request import PushMessageRequest
123+
from linebot.v3.messaging.models.push_message_response import PushMessageResponse
123124
from linebot.v3.messaging.models.quick_reply import QuickReply
124125
from linebot.v3.messaging.models.quick_reply_item import QuickReplyItem
125126
from linebot.v3.messaging.models.quota_consumption_response import QuotaConsumptionResponse
126127
from linebot.v3.messaging.models.quota_type import QuotaType
127128
from linebot.v3.messaging.models.recipient import Recipient
128129
from linebot.v3.messaging.models.redelivery_recipient import RedeliveryRecipient
129130
from linebot.v3.messaging.models.reply_message_request import ReplyMessageRequest
131+
from linebot.v3.messaging.models.reply_message_response import ReplyMessageResponse
130132
from linebot.v3.messaging.models.rich_menu_alias_list_response import RichMenuAliasListResponse
131133
from linebot.v3.messaging.models.rich_menu_alias_response import RichMenuAliasResponse
132134
from linebot.v3.messaging.models.rich_menu_area import RichMenuArea
@@ -149,6 +151,7 @@
149151
from linebot.v3.messaging.models.room_member_count_response import RoomMemberCountResponse
150152
from linebot.v3.messaging.models.room_user_profile_response import RoomUserProfileResponse
151153
from linebot.v3.messaging.models.sender import Sender
154+
from linebot.v3.messaging.models.sent_message import SentMessage
152155
from linebot.v3.messaging.models.set_webhook_endpoint_request import SetWebhookEndpointRequest
153156
from linebot.v3.messaging.models.sticker_message import StickerMessage
154157
from linebot.v3.messaging.models.subscription_period_demographic import SubscriptionPeriodDemographic

Diff for: linebot/v3/messaging/api/async_messaging_api.py

+61-31
Large diffs are not rendered by default.

Diff for: linebot/v3/messaging/api/messaging_api.py

+51-21
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from pydantic.v1 import Field, StrictStr, conint, constr, validator
2222

23-
from typing import Optional
23+
from typing import Any, Dict, Optional
2424

2525
from linebot.v3.messaging.models.audience_match_messages_request import AudienceMatchMessagesRequest
2626
from linebot.v3.messaging.models.bot_info_response import BotInfoResponse
@@ -43,8 +43,10 @@
4343
from linebot.v3.messaging.models.number_of_messages_response import NumberOfMessagesResponse
4444
from linebot.v3.messaging.models.pnp_messages_request import PnpMessagesRequest
4545
from linebot.v3.messaging.models.push_message_request import PushMessageRequest
46+
from linebot.v3.messaging.models.push_message_response import PushMessageResponse
4647
from linebot.v3.messaging.models.quota_consumption_response import QuotaConsumptionResponse
4748
from linebot.v3.messaging.models.reply_message_request import ReplyMessageRequest
49+
from linebot.v3.messaging.models.reply_message_response import ReplyMessageResponse
4850
from linebot.v3.messaging.models.rich_menu_alias_list_response import RichMenuAliasListResponse
4951
from linebot.v3.messaging.models.rich_menu_alias_response import RichMenuAliasResponse
5052
from linebot.v3.messaging.models.rich_menu_batch_progress_response import RichMenuBatchProgressResponse
@@ -225,7 +227,7 @@ def audience_match_with_http_info(self, audience_match_messages_request : Audien
225227
_request_auth=_params.get('_request_auth'))
226228

227229
@validate_arguments
228-
def broadcast(self, broadcast_request : BroadcastRequest, x_line_retry_key : Annotated[Optional[StrictStr], Field(description="Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. ")] = None, **kwargs) -> None: # noqa: E501
230+
def broadcast(self, broadcast_request : BroadcastRequest, x_line_retry_key : Annotated[Optional[StrictStr], Field(description="Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. ")] = None, **kwargs) -> object: # noqa: E501
229231
"""broadcast # noqa: E501
230232
231233
Sends a message to multiple users at any time. # noqa: E501
@@ -248,7 +250,7 @@ def broadcast(self, broadcast_request : BroadcastRequest, x_line_retry_key : Ann
248250
:return: Returns the result object.
249251
If the method is called asynchronously,
250252
returns the request thread.
251-
:rtype: None
253+
:rtype: object
252254
"""
253255
kwargs['_return_http_data_only'] = True
254256
if '_preload_content' in kwargs:
@@ -292,7 +294,7 @@ def broadcast_with_http_info(self, broadcast_request : BroadcastRequest, x_line_
292294
:return: Returns the result object.
293295
If the method is called asynchronously,
294296
returns the request thread.
295-
:rtype: None
297+
:rtype: tuple(object, status_code(int), headers(HTTPHeaderDict))
296298
"""
297299

298300
_params = locals()
@@ -357,7 +359,13 @@ def broadcast_with_http_info(self, broadcast_request : BroadcastRequest, x_line_
357359
# authentication setting
358360
_auth_settings = ['Bearer'] # noqa: E501
359361

360-
_response_types_map = {}
362+
_response_types_map = {
363+
'200': "object",
364+
'400': "ErrorResponse",
365+
'403': "ErrorResponse",
366+
'409': "ErrorResponse",
367+
'429': "ErrorResponse",
368+
}
361369

362370
return self.api_client.call_api(
363371
'/v2/bot/message/broadcast', 'POST',
@@ -5907,7 +5915,7 @@ def mark_messages_as_read_with_http_info(self, mark_messages_as_read_request : M
59075915
_request_auth=_params.get('_request_auth'))
59085916

59095917
@validate_arguments
5910-
def multicast(self, multicast_request : MulticastRequest, x_line_retry_key : Annotated[Optional[StrictStr], Field(description="Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. ")] = None, **kwargs) -> None: # noqa: E501
5918+
def multicast(self, multicast_request : MulticastRequest, x_line_retry_key : Annotated[Optional[StrictStr], Field(description="Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. ")] = None, **kwargs) -> object: # noqa: E501
59115919
"""multicast # noqa: E501
59125920
59135921
An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats. # noqa: E501
@@ -5930,7 +5938,7 @@ def multicast(self, multicast_request : MulticastRequest, x_line_retry_key : Ann
59305938
:return: Returns the result object.
59315939
If the method is called asynchronously,
59325940
returns the request thread.
5933-
:rtype: None
5941+
:rtype: object
59345942
"""
59355943
kwargs['_return_http_data_only'] = True
59365944
if '_preload_content' in kwargs:
@@ -5974,7 +5982,7 @@ def multicast_with_http_info(self, multicast_request : MulticastRequest, x_line_
59745982
:return: Returns the result object.
59755983
If the method is called asynchronously,
59765984
returns the request thread.
5977-
:rtype: None
5985+
:rtype: tuple(object, status_code(int), headers(HTTPHeaderDict))
59785986
"""
59795987

59805988
_params = locals()
@@ -6039,7 +6047,13 @@ def multicast_with_http_info(self, multicast_request : MulticastRequest, x_line_
60396047
# authentication setting
60406048
_auth_settings = ['Bearer'] # noqa: E501
60416049

6042-
_response_types_map = {}
6050+
_response_types_map = {
6051+
'200': "object",
6052+
'400': "ErrorResponse",
6053+
'403': "ErrorResponse",
6054+
'409': "ErrorResponse",
6055+
'429': "ErrorResponse",
6056+
}
60436057

60446058
return self.api_client.call_api(
60456059
'/v2/bot/message/multicast', 'POST',
@@ -6059,7 +6073,7 @@ def multicast_with_http_info(self, multicast_request : MulticastRequest, x_line_
60596073
_request_auth=_params.get('_request_auth'))
60606074

60616075
@validate_arguments
6062-
def narrowcast(self, narrowcast_request : NarrowcastRequest, x_line_retry_key : Annotated[Optional[StrictStr], Field(description="Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. ")] = None, **kwargs) -> None: # noqa: E501
6076+
def narrowcast(self, narrowcast_request : NarrowcastRequest, x_line_retry_key : Annotated[Optional[StrictStr], Field(description="Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. ")] = None, **kwargs) -> object: # noqa: E501
60636077
"""narrowcast # noqa: E501
60646078
60656079
Send narrowcast message # noqa: E501
@@ -6082,7 +6096,7 @@ def narrowcast(self, narrowcast_request : NarrowcastRequest, x_line_retry_key :
60826096
:return: Returns the result object.
60836097
If the method is called asynchronously,
60846098
returns the request thread.
6085-
:rtype: None
6099+
:rtype: object
60866100
"""
60876101
kwargs['_return_http_data_only'] = True
60886102
if '_preload_content' in kwargs:
@@ -6126,7 +6140,7 @@ def narrowcast_with_http_info(self, narrowcast_request : NarrowcastRequest, x_li
61266140
:return: Returns the result object.
61276141
If the method is called asynchronously,
61286142
returns the request thread.
6129-
:rtype: None
6143+
:rtype: tuple(object, status_code(int), headers(HTTPHeaderDict))
61306144
"""
61316145

61326146
_params = locals()
@@ -6191,7 +6205,13 @@ def narrowcast_with_http_info(self, narrowcast_request : NarrowcastRequest, x_li
61916205
# authentication setting
61926206
_auth_settings = ['Bearer'] # noqa: E501
61936207

6194-
_response_types_map = {}
6208+
_response_types_map = {
6209+
'202': "object",
6210+
'400': "ErrorResponse",
6211+
'403': "ErrorResponse",
6212+
'409': "ErrorResponse",
6213+
'429': "ErrorResponse",
6214+
}
61956215

61966216
return self.api_client.call_api(
61976217
'/v2/bot/message/narrowcast', 'POST',
@@ -6211,7 +6231,7 @@ def narrowcast_with_http_info(self, narrowcast_request : NarrowcastRequest, x_li
62116231
_request_auth=_params.get('_request_auth'))
62126232

62136233
@validate_arguments
6214-
def push_message(self, push_message_request : PushMessageRequest, x_line_retry_key : Annotated[Optional[StrictStr], Field(description="Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. ")] = None, **kwargs) -> None: # noqa: E501
6234+
def push_message(self, push_message_request : PushMessageRequest, x_line_retry_key : Annotated[Optional[StrictStr], Field(description="Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. ")] = None, **kwargs) -> PushMessageResponse: # noqa: E501
62156235
"""push_message # noqa: E501
62166236
62176237
Sends a message to a user, group chat, or multi-person chat at any time. # noqa: E501
@@ -6234,7 +6254,7 @@ def push_message(self, push_message_request : PushMessageRequest, x_line_retry_k
62346254
:return: Returns the result object.
62356255
If the method is called asynchronously,
62366256
returns the request thread.
6237-
:rtype: None
6257+
:rtype: PushMessageResponse
62386258
"""
62396259
kwargs['_return_http_data_only'] = True
62406260
if '_preload_content' in kwargs:
@@ -6278,7 +6298,7 @@ def push_message_with_http_info(self, push_message_request : PushMessageRequest,
62786298
:return: Returns the result object.
62796299
If the method is called asynchronously,
62806300
returns the request thread.
6281-
:rtype: None
6301+
:rtype: tuple(PushMessageResponse, status_code(int), headers(HTTPHeaderDict))
62826302
"""
62836303

62846304
_params = locals()
@@ -6343,7 +6363,13 @@ def push_message_with_http_info(self, push_message_request : PushMessageRequest,
63436363
# authentication setting
63446364
_auth_settings = ['Bearer'] # noqa: E501
63456365

6346-
_response_types_map = {}
6366+
_response_types_map = {
6367+
'200': "PushMessageResponse",
6368+
'400': "ErrorResponse",
6369+
'403': "ErrorResponse",
6370+
'409': "ErrorResponse",
6371+
'429': "ErrorResponse",
6372+
}
63476373

63486374
return self.api_client.call_api(
63496375
'/v2/bot/message/push', 'POST',
@@ -6515,7 +6541,7 @@ def push_messages_by_phone_with_http_info(self, pnp_messages_request : PnpMessag
65156541
_request_auth=_params.get('_request_auth'))
65166542

65176543
@validate_arguments
6518-
def reply_message(self, reply_message_request : ReplyMessageRequest, **kwargs) -> None: # noqa: E501
6544+
def reply_message(self, reply_message_request : ReplyMessageRequest, **kwargs) -> ReplyMessageResponse: # noqa: E501
65196545
"""reply_message # noqa: E501
65206546
65216547
Send reply message # noqa: E501
@@ -6536,7 +6562,7 @@ def reply_message(self, reply_message_request : ReplyMessageRequest, **kwargs) -
65366562
:return: Returns the result object.
65376563
If the method is called asynchronously,
65386564
returns the request thread.
6539-
:rtype: None
6565+
:rtype: ReplyMessageResponse
65406566
"""
65416567
kwargs['_return_http_data_only'] = True
65426568
if '_preload_content' in kwargs:
@@ -6578,7 +6604,7 @@ def reply_message_with_http_info(self, reply_message_request : ReplyMessageReque
65786604
:return: Returns the result object.
65796605
If the method is called asynchronously,
65806606
returns the request thread.
6581-
:rtype: None
6607+
:rtype: tuple(ReplyMessageResponse, status_code(int), headers(HTTPHeaderDict))
65826608
"""
65836609

65846610
_params = locals()
@@ -6639,7 +6665,11 @@ def reply_message_with_http_info(self, reply_message_request : ReplyMessageReque
66396665
# authentication setting
66406666
_auth_settings = ['Bearer'] # noqa: E501
66416667

6642-
_response_types_map = {}
6668+
_response_types_map = {
6669+
'200': "ReplyMessageResponse",
6670+
'400': "ErrorResponse",
6671+
'429': "ErrorResponse",
6672+
}
66436673

66446674
return self.api_client.call_api(
66456675
'/v2/bot/message/reply', 'POST',

0 commit comments

Comments
 (0)