Skip to content

Commit

Permalink
Add Quote message feature (#523)
Browse files Browse the repository at this point in the history
* NO-ISSUE Update line-openapi digest to cdac946

* NO-ISSUE generate code

* NO-ISSUE Modify test
  • Loading branch information
Yang-33 committed Sep 15, 2023
1 parent 18d0003 commit 7306658
Show file tree
Hide file tree
Showing 17 changed files with 438 additions and 92 deletions.
2 changes: 1 addition & 1 deletion line-openapi
3 changes: 3 additions & 0 deletions linebot/v3/messaging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,15 @@
from linebot.v3.messaging.models.pnp_messages_request import PnpMessagesRequest
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
from linebot.v3.messaging.models.quick_reply import QuickReply
from linebot.v3.messaging.models.quick_reply_item import QuickReplyItem
from linebot.v3.messaging.models.quota_consumption_response import QuotaConsumptionResponse
from linebot.v3.messaging.models.quota_type import QuotaType
from linebot.v3.messaging.models.recipient import Recipient
from linebot.v3.messaging.models.redelivery_recipient import RedeliveryRecipient
from linebot.v3.messaging.models.reply_message_request import ReplyMessageRequest
from linebot.v3.messaging.models.reply_message_response import ReplyMessageResponse
from linebot.v3.messaging.models.rich_menu_alias_list_response import RichMenuAliasListResponse
from linebot.v3.messaging.models.rich_menu_alias_response import RichMenuAliasResponse
from linebot.v3.messaging.models.rich_menu_area import RichMenuArea
Expand All @@ -149,6 +151,7 @@
from linebot.v3.messaging.models.room_member_count_response import RoomMemberCountResponse
from linebot.v3.messaging.models.room_user_profile_response import RoomUserProfileResponse
from linebot.v3.messaging.models.sender import Sender
from linebot.v3.messaging.models.sent_message import SentMessage
from linebot.v3.messaging.models.set_webhook_endpoint_request import SetWebhookEndpointRequest
from linebot.v3.messaging.models.sticker_message import StickerMessage
from linebot.v3.messaging.models.subscription_period_demographic import SubscriptionPeriodDemographic
Expand Down
92 changes: 61 additions & 31 deletions linebot/v3/messaging/api/async_messaging_api.py

Large diffs are not rendered by default.

72 changes: 51 additions & 21 deletions linebot/v3/messaging/api/messaging_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

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

from typing import Optional
from typing import Any, Dict, Optional

from linebot.v3.messaging.models.audience_match_messages_request import AudienceMatchMessagesRequest
from linebot.v3.messaging.models.bot_info_response import BotInfoResponse
Expand All @@ -43,8 +43,10 @@
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.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
from linebot.v3.messaging.models.reply_message_request import ReplyMessageRequest
from linebot.v3.messaging.models.reply_message_response import ReplyMessageResponse
from linebot.v3.messaging.models.rich_menu_alias_list_response import RichMenuAliasListResponse
from linebot.v3.messaging.models.rich_menu_alias_response import RichMenuAliasResponse
from linebot.v3.messaging.models.rich_menu_batch_progress_response import RichMenuBatchProgressResponse
Expand Down Expand Up @@ -225,7 +227,7 @@ def audience_match_with_http_info(self, audience_match_messages_request : Audien
_request_auth=_params.get('_request_auth'))

@validate_arguments
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
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
"""broadcast # noqa: E501
Sends a message to multiple users at any time. # noqa: E501
Expand All @@ -248,7 +250,7 @@ def broadcast(self, broadcast_request : BroadcastRequest, x_line_retry_key : Ann
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
:rtype: object
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
Expand Down Expand Up @@ -292,7 +294,7 @@ def broadcast_with_http_info(self, broadcast_request : BroadcastRequest, x_line_
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
:rtype: tuple(object, status_code(int), headers(HTTPHeaderDict))
"""

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

_response_types_map = {}
_response_types_map = {
'200': "object",
'400': "ErrorResponse",
'403': "ErrorResponse",
'409': "ErrorResponse",
'429': "ErrorResponse",
}

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

@validate_arguments
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
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
"""multicast # noqa: E501
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
Expand All @@ -5930,7 +5938,7 @@ def multicast(self, multicast_request : MulticastRequest, x_line_retry_key : Ann
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
:rtype: object
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
Expand Down Expand Up @@ -5974,7 +5982,7 @@ def multicast_with_http_info(self, multicast_request : MulticastRequest, x_line_
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
:rtype: tuple(object, status_code(int), headers(HTTPHeaderDict))
"""

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

_response_types_map = {}
_response_types_map = {
'200': "object",
'400': "ErrorResponse",
'403': "ErrorResponse",
'409': "ErrorResponse",
'429': "ErrorResponse",
}

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

@validate_arguments
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
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
"""narrowcast # noqa: E501
Send narrowcast message # noqa: E501
Expand All @@ -6082,7 +6096,7 @@ def narrowcast(self, narrowcast_request : NarrowcastRequest, x_line_retry_key :
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
:rtype: object
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
Expand Down Expand Up @@ -6126,7 +6140,7 @@ def narrowcast_with_http_info(self, narrowcast_request : NarrowcastRequest, x_li
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
:rtype: tuple(object, status_code(int), headers(HTTPHeaderDict))
"""

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

_response_types_map = {}
_response_types_map = {
'202': "object",
'400': "ErrorResponse",
'403': "ErrorResponse",
'409': "ErrorResponse",
'429': "ErrorResponse",
}

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

@validate_arguments
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
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
"""push_message # noqa: E501
Sends a message to a user, group chat, or multi-person chat at any time. # noqa: E501
Expand All @@ -6234,7 +6254,7 @@ def push_message(self, push_message_request : PushMessageRequest, x_line_retry_k
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
:rtype: PushMessageResponse
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
Expand Down Expand Up @@ -6278,7 +6298,7 @@ def push_message_with_http_info(self, push_message_request : PushMessageRequest,
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
:rtype: tuple(PushMessageResponse, status_code(int), headers(HTTPHeaderDict))
"""

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

_response_types_map = {}
_response_types_map = {
'200': "PushMessageResponse",
'400': "ErrorResponse",
'403': "ErrorResponse",
'409': "ErrorResponse",
'429': "ErrorResponse",
}

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

@validate_arguments
def reply_message(self, reply_message_request : ReplyMessageRequest, **kwargs) -> None: # noqa: E501
def reply_message(self, reply_message_request : ReplyMessageRequest, **kwargs) -> ReplyMessageResponse: # noqa: E501
"""reply_message # noqa: E501
Send reply message # noqa: E501
Expand All @@ -6536,7 +6562,7 @@ def reply_message(self, reply_message_request : ReplyMessageRequest, **kwargs) -
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
:rtype: ReplyMessageResponse
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
Expand Down Expand Up @@ -6578,7 +6604,7 @@ def reply_message_with_http_info(self, reply_message_request : ReplyMessageReque
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
:rtype: tuple(ReplyMessageResponse, status_code(int), headers(HTTPHeaderDict))
"""

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

_response_types_map = {}
_response_types_map = {
'200': "ReplyMessageResponse",
'400': "ErrorResponse",
'429': "ErrorResponse",
}

return self.api_client.call_api(
'/v2/bot/message/reply', 'POST',
Expand Down

0 comments on commit 7306658

Please sign in to comment.