From 2a039624ac87399c344c3ccd952c9ab25059a041 Mon Sep 17 00:00:00 2001 From: habara keigo Date: Tue, 14 Apr 2026 16:19:47 +0900 Subject: [PATCH 1/4] Add unified client --- docs/source/linebot.v3.rst | 9 + .../python-nextgen-custom-client/api.mustache | 3 + .../asyncio/async_api.mustache | 3 + linebot/v3/__init__.py | 3 + linebot/v3/async_line_bot_client.py | 2405 ++++++++++++++++ .../v3/audience/api/async_manage_audience.py | 3 + .../api/async_manage_audience_blob.py | 3 + linebot/v3/audience/api/manage_audience.py | 3 + .../v3/audience/api/manage_audience_blob.py | 3 + linebot/v3/insight/api/async_insight.py | 3 + linebot/v3/insight/api/insight.py | 3 + linebot/v3/liff/api/async_liff.py | 3 + linebot/v3/liff/api/liff.py | 3 + linebot/v3/line_bot_client.py | 2409 +++++++++++++++++ .../v3/messaging/api/async_messaging_api.py | 3 + .../messaging/api/async_messaging_api_blob.py | 3 + linebot/v3/messaging/api/messaging_api.py | 3 + .../v3/messaging/api/messaging_api_blob.py | 3 + linebot/v3/module/api/async_line_module.py | 3 + linebot/v3/module/api/line_module.py | 3 + .../api/async_line_module_attach.py | 3 + .../v3/moduleattach/api/line_module_attach.py | 3 + .../oauth/api/async_channel_access_token.py | 3 + linebot/v3/oauth/api/channel_access_token.py | 3 + linebot/v3/shop/api/async_shop.py | 3 + linebot/v3/shop/api/shop.py | 3 + linebot/v3/webhooks/api/async_dummy.py | 3 + linebot/v3/webhooks/api/dummy.py | 3 + tests/v3/test_async_line_bot_client.py | 524 ++++ tests/v3/test_line_bot_client.py | 647 +++++ tools/generate_unified_client.py | 850 ++++++ 31 files changed, 6919 insertions(+) create mode 100644 linebot/v3/async_line_bot_client.py create mode 100644 linebot/v3/line_bot_client.py create mode 100644 tests/v3/test_async_line_bot_client.py create mode 100644 tests/v3/test_line_bot_client.py create mode 100644 tools/generate_unified_client.py diff --git a/docs/source/linebot.v3.rst b/docs/source/linebot.v3.rst index 62c748a29..4088b2ac1 100644 --- a/docs/source/linebot.v3.rst +++ b/docs/source/linebot.v3.rst @@ -3,6 +3,15 @@ linebot.v3 package .. automodule:: linebot.v3 +Client +------ + +.. autoclass:: linebot.v3.line_bot_client.LineBotClient + :members: + +.. autoclass:: linebot.v3.async_line_bot_client.AsyncLineBotClient + :members: + linebot.v3.webhook module -------------------------- diff --git a/generator/src/main/resources/python-nextgen-custom-client/api.mustache b/generator/src/main/resources/python-nextgen-custom-client/api.mustache index c9d63c21f..f6852f7f1 100644 --- a/generator/src/main/resources/python-nextgen-custom-client/api.mustache +++ b/generator/src/main/resources/python-nextgen-custom-client/api.mustache @@ -27,6 +27,9 @@ class {{classname}}(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/generator/src/main/resources/python-nextgen-custom-client/asyncio/async_api.mustache b/generator/src/main/resources/python-nextgen-custom-client/asyncio/async_api.mustache index 4ce037c8a..e8e222c76 100644 --- a/generator/src/main/resources/python-nextgen-custom-client/asyncio/async_api.mustache +++ b/generator/src/main/resources/python-nextgen-custom-client/asyncio/async_api.mustache @@ -28,6 +28,9 @@ class Async{{classname}}(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/__init__.py b/linebot/v3/__init__.py index 7d85fcfe5..c4a00cd47 100644 --- a/linebot/v3/__init__.py +++ b/linebot/v3/__init__.py @@ -20,3 +20,6 @@ WebhookHandler, WebhookPayload, ) + +from .line_bot_client import LineBotClient # noqa +from .async_line_bot_client import AsyncLineBotClient # noqa diff --git a/linebot/v3/async_line_bot_client.py b/linebot/v3/async_line_bot_client.py new file mode 100644 index 000000000..31a163162 --- /dev/null +++ b/linebot/v3/async_line_bot_client.py @@ -0,0 +1,2405 @@ +# coding: utf-8 + +# Auto-generated by tools/generate_unified_client.py. Do not edit manually. + +from typing import Optional, Union +from typing_extensions import Annotated +from pydantic.v1 import Field, StrictBool, StrictBytes, StrictInt, StrictStr, conint, conlist, constr + +from linebot.v3.audience.configuration import Configuration as AudienceConfiguration +from linebot.v3.audience.async_api_client import AsyncApiClient as AudienceAsyncApiClient +from linebot.v3.insight.configuration import Configuration as InsightConfiguration +from linebot.v3.insight.async_api_client import AsyncApiClient as InsightAsyncApiClient +from linebot.v3.liff.configuration import Configuration as LiffConfiguration +from linebot.v3.liff.async_api_client import AsyncApiClient as LiffAsyncApiClient +from linebot.v3.messaging.configuration import Configuration as MessagingConfiguration +from linebot.v3.messaging.async_api_client import AsyncApiClient as MessagingAsyncApiClient +from linebot.v3.module.configuration import Configuration as ModuleConfiguration +from linebot.v3.module.async_api_client import AsyncApiClient as ModuleAsyncApiClient +from linebot.v3.moduleattach.configuration import Configuration as ModuleattachConfiguration +from linebot.v3.moduleattach.async_api_client import AsyncApiClient as ModuleattachAsyncApiClient +from linebot.v3.shop.configuration import Configuration as ShopConfiguration +from linebot.v3.shop.async_api_client import AsyncApiClient as ShopAsyncApiClient + +from linebot.v3.audience.api.async_manage_audience import AsyncManageAudience +from linebot.v3.audience.api.async_manage_audience_blob import AsyncManageAudienceBlob +from linebot.v3.insight.api.async_insight import AsyncInsight +from linebot.v3.liff.api.async_liff import AsyncLiff +from linebot.v3.messaging.api.async_messaging_api import AsyncMessagingApi +from linebot.v3.messaging.api.async_messaging_api_blob import AsyncMessagingApiBlob +from linebot.v3.module.api.async_line_module import AsyncLineModule +from linebot.v3.moduleattach.api.async_line_module_attach import AsyncLineModuleAttach +from linebot.v3.shop.api.async_shop import AsyncShop +from linebot.v3.audience.api_response import ApiResponse + +from linebot.v3.audience.models.add_audience_to_audience_group_request import AddAudienceToAudienceGroupRequest +from linebot.v3.audience.models.audience_group_create_route import AudienceGroupCreateRoute +from linebot.v3.audience.models.audience_group_status import AudienceGroupStatus +from linebot.v3.audience.models.create_audience_group_request import CreateAudienceGroupRequest +from linebot.v3.audience.models.create_audience_group_response import CreateAudienceGroupResponse +from linebot.v3.audience.models.create_click_based_audience_group_request import CreateClickBasedAudienceGroupRequest +from linebot.v3.audience.models.create_click_based_audience_group_response import CreateClickBasedAudienceGroupResponse +from linebot.v3.audience.models.create_imp_based_audience_group_request import CreateImpBasedAudienceGroupRequest +from linebot.v3.audience.models.create_imp_based_audience_group_response import CreateImpBasedAudienceGroupResponse +from linebot.v3.audience.models.get_audience_data_response import GetAudienceDataResponse +from linebot.v3.audience.models.get_audience_groups_response import GetAudienceGroupsResponse +from linebot.v3.audience.models.get_shared_audience_data_response import GetSharedAudienceDataResponse +from linebot.v3.audience.models.get_shared_audience_groups_response import GetSharedAudienceGroupsResponse +from linebot.v3.audience.models.update_audience_group_description_request import UpdateAudienceGroupDescriptionRequest +from linebot.v3.insight.models.get_friends_demographics_response import GetFriendsDemographicsResponse +from linebot.v3.insight.models.get_message_event_response import GetMessageEventResponse +from linebot.v3.insight.models.get_number_of_followers_response import GetNumberOfFollowersResponse +from linebot.v3.insight.models.get_number_of_message_deliveries_response import GetNumberOfMessageDeliveriesResponse +from linebot.v3.insight.models.get_statistics_per_unit_response import GetStatisticsPerUnitResponse +from linebot.v3.liff.models.add_liff_app_request import AddLiffAppRequest +from linebot.v3.liff.models.add_liff_app_response import AddLiffAppResponse +from linebot.v3.liff.models.get_all_liff_apps_response import GetAllLiffAppsResponse +from linebot.v3.liff.models.update_liff_app_request import UpdateLiffAppRequest +from linebot.v3.messaging.models.bot_info_response import BotInfoResponse +from linebot.v3.messaging.models.broadcast_request import BroadcastRequest +from linebot.v3.messaging.models.coupon_create_request import CouponCreateRequest +from linebot.v3.messaging.models.coupon_create_response import CouponCreateResponse +from linebot.v3.messaging.models.coupon_response import CouponResponse +from linebot.v3.messaging.models.create_rich_menu_alias_request import CreateRichMenuAliasRequest +from linebot.v3.messaging.models.get_aggregation_unit_name_list_response import GetAggregationUnitNameListResponse +from linebot.v3.messaging.models.get_aggregation_unit_usage_response import GetAggregationUnitUsageResponse +from linebot.v3.messaging.models.get_followers_response import GetFollowersResponse +from linebot.v3.messaging.models.get_joined_membership_users_response import GetJoinedMembershipUsersResponse +from linebot.v3.messaging.models.get_membership_subscription_response import GetMembershipSubscriptionResponse +from linebot.v3.messaging.models.get_message_content_transcoding_response import GetMessageContentTranscodingResponse +from linebot.v3.messaging.models.get_webhook_endpoint_response import GetWebhookEndpointResponse +from linebot.v3.messaging.models.group_member_count_response import GroupMemberCountResponse +from linebot.v3.messaging.models.group_summary_response import GroupSummaryResponse +from linebot.v3.messaging.models.group_user_profile_response import GroupUserProfileResponse +from linebot.v3.messaging.models.issue_link_token_response import IssueLinkTokenResponse +from linebot.v3.messaging.models.mark_messages_as_read_by_token_request import MarkMessagesAsReadByTokenRequest +from linebot.v3.messaging.models.mark_messages_as_read_request import MarkMessagesAsReadRequest +from linebot.v3.messaging.models.members_ids_response import MembersIdsResponse +from linebot.v3.messaging.models.membership_list_response import MembershipListResponse +from linebot.v3.messaging.models.message_quota_response import MessageQuotaResponse +from linebot.v3.messaging.models.messaging_api_pager_coupon_list_response import MessagingApiPagerCouponListResponse +from linebot.v3.messaging.models.multicast_request import MulticastRequest +from linebot.v3.messaging.models.narrowcast_progress_response import NarrowcastProgressResponse +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.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 +from linebot.v3.messaging.models.rich_menu_batch_request import RichMenuBatchRequest +from linebot.v3.messaging.models.rich_menu_bulk_link_request import RichMenuBulkLinkRequest +from linebot.v3.messaging.models.rich_menu_bulk_unlink_request import RichMenuBulkUnlinkRequest +from linebot.v3.messaging.models.rich_menu_id_response import RichMenuIdResponse +from linebot.v3.messaging.models.rich_menu_list_response import RichMenuListResponse +from linebot.v3.messaging.models.rich_menu_request import RichMenuRequest +from linebot.v3.messaging.models.rich_menu_response import RichMenuResponse +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.set_webhook_endpoint_request import SetWebhookEndpointRequest +from linebot.v3.messaging.models.show_loading_animation_request import ShowLoadingAnimationRequest +from linebot.v3.messaging.models.test_webhook_endpoint_request import TestWebhookEndpointRequest +from linebot.v3.messaging.models.test_webhook_endpoint_response import TestWebhookEndpointResponse +from linebot.v3.messaging.models.update_rich_menu_alias_request import UpdateRichMenuAliasRequest +from linebot.v3.messaging.models.user_profile_response import UserProfileResponse +from linebot.v3.messaging.models.validate_message_request import ValidateMessageRequest +from linebot.v3.module.models.acquire_chat_control_request import AcquireChatControlRequest +from linebot.v3.module.models.detach_module_request import DetachModuleRequest +from linebot.v3.module.models.get_modules_response import GetModulesResponse +from linebot.v3.moduleattach.models.attach_module_response import AttachModuleResponse +from linebot.v3.shop.models.mission_sticker_request import MissionStickerRequest + + +class AsyncLineBotClient: + """Async version of :class:`LineBotClient`. + + Wraps all LINE API subpackages into a single async client so that + every API method can be called through one instance. + See :class:`LineBotClient` for details. + + Auto-generated by ``tools/generate_unified_client.py``. + Do not edit manually. + + Usage:: + + from linebot.v3 import AsyncLineBotClient + + async with AsyncLineBotClient(channel_access_token="YOUR_TOKEN") as client: + await client.reply_message(...) + """ + + def __init__(self, channel_access_token: str, **kwargs) -> None: + """Create a unified async LINE Bot client. + + :param str channel_access_token: Channel access token. + :param kwargs: Additional keyword arguments passed to each Configuration. + """ + self._audience_configuration = AudienceConfiguration( + access_token=channel_access_token, **kwargs + ) + self._audience_api_client = AudienceAsyncApiClient( + self._audience_configuration + ) + self._insight_configuration = InsightConfiguration( + access_token=channel_access_token, **kwargs + ) + self._insight_api_client = InsightAsyncApiClient( + self._insight_configuration + ) + self._liff_configuration = LiffConfiguration( + access_token=channel_access_token, **kwargs + ) + self._liff_api_client = LiffAsyncApiClient( + self._liff_configuration + ) + self._messaging_configuration = MessagingConfiguration( + access_token=channel_access_token, **kwargs + ) + self._messaging_api_client = MessagingAsyncApiClient( + self._messaging_configuration + ) + self._module_configuration = ModuleConfiguration( + access_token=channel_access_token, **kwargs + ) + self._module_api_client = ModuleAsyncApiClient( + self._module_configuration + ) + self._moduleattach_configuration = ModuleattachConfiguration( + access_token=channel_access_token, **kwargs + ) + self._moduleattach_api_client = ModuleattachAsyncApiClient( + self._moduleattach_configuration + ) + self._shop_configuration = ShopConfiguration( + access_token=channel_access_token, **kwargs + ) + self._shop_api_client = ShopAsyncApiClient( + self._shop_configuration + ) + + self._manage_audience = AsyncManageAudience(self._audience_api_client) + self._manage_audience_blob = AsyncManageAudienceBlob(self._audience_api_client) + self._insight = AsyncInsight(self._insight_api_client) + self._liff = AsyncLiff(self._liff_api_client) + self._messaging_api = AsyncMessagingApi(self._messaging_api_client) + self._messaging_api_blob = AsyncMessagingApiBlob(self._messaging_api_client) + self._line_module = AsyncLineModule(self._module_api_client) + self._line_module_attach = AsyncLineModuleAttach(self._moduleattach_api_client) + self._shop = AsyncShop(self._shop_api_client) + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() + + async def close(self) -> None: + """Close all underlying async API clients.""" + errors: list[BaseException] = [] + try: + await self._audience_api_client.close() + except Exception as e: + errors.append(e) + try: + await self._insight_api_client.close() + except Exception as e: + errors.append(e) + try: + await self._liff_api_client.close() + except Exception as e: + errors.append(e) + try: + await self._messaging_api_client.close() + except Exception as e: + errors.append(e) + try: + await self._module_api_client.close() + except Exception as e: + errors.append(e) + try: + await self._moduleattach_api_client.close() + except Exception as e: + errors.append(e) + try: + await self._shop_api_client.close() + except Exception as e: + errors.append(e) + if errors: + raise errors[0] + + async def add_audience_to_audience_group(self, add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest) -> None: + """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) + + :param add_audience_to_audience_group_request: (required) + :type add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest + :return: Returns the result object. + :rtype: None + """ + return await self._manage_audience.add_audience_to_audience_group(add_audience_to_audience_group_request) + + async def add_audience_to_audience_group_with_http_info(self, add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest) -> ApiResponse: + """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) + + :param add_audience_to_audience_group_request: (required) + :type add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest + :return: Returns the result object. + :rtype: None + """ + return await self._manage_audience.add_audience_to_audience_group_with_http_info(add_audience_to_audience_group_request) + + async def create_audience_group(self, create_audience_group_request: CreateAudienceGroupRequest) -> CreateAudienceGroupResponse: + """Create audience for uploading user IDs (by JSON) + + :param create_audience_group_request: (required) + :type create_audience_group_request: CreateAudienceGroupRequest + :return: Returns the result object. + :rtype: CreateAudienceGroupResponse + """ + return await self._manage_audience.create_audience_group(create_audience_group_request) + + async def create_audience_group_with_http_info(self, create_audience_group_request: CreateAudienceGroupRequest) -> ApiResponse: + """Create audience for uploading user IDs (by JSON) + + :param create_audience_group_request: (required) + :type create_audience_group_request: CreateAudienceGroupRequest + :return: Returns the result object. + :rtype: tuple(CreateAudienceGroupResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._manage_audience.create_audience_group_with_http_info(create_audience_group_request) + + async def create_click_based_audience_group(self, create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest) -> CreateClickBasedAudienceGroupResponse: + """Create audience for click-based retargeting + + :param create_click_based_audience_group_request: (required) + :type create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest + :return: Returns the result object. + :rtype: CreateClickBasedAudienceGroupResponse + """ + return await self._manage_audience.create_click_based_audience_group(create_click_based_audience_group_request) + + async def create_click_based_audience_group_with_http_info(self, create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest) -> ApiResponse: + """Create audience for click-based retargeting + + :param create_click_based_audience_group_request: (required) + :type create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest + :return: Returns the result object. + :rtype: tuple(CreateClickBasedAudienceGroupResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._manage_audience.create_click_based_audience_group_with_http_info(create_click_based_audience_group_request) + + async def create_imp_based_audience_group(self, create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest) -> CreateImpBasedAudienceGroupResponse: + """Create audience for impression-based retargeting + + :param create_imp_based_audience_group_request: (required) + :type create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest + :return: Returns the result object. + :rtype: CreateImpBasedAudienceGroupResponse + """ + return await self._manage_audience.create_imp_based_audience_group(create_imp_based_audience_group_request) + + async def create_imp_based_audience_group_with_http_info(self, create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest) -> ApiResponse: + """Create audience for impression-based retargeting + + :param create_imp_based_audience_group_request: (required) + :type create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest + :return: Returns the result object. + :rtype: tuple(CreateImpBasedAudienceGroupResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._manage_audience.create_imp_based_audience_group_with_http_info(create_imp_based_audience_group_request) + + async def delete_audience_group(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> None: + """Delete audience + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: None + """ + return await self._manage_audience.delete_audience_group(audience_group_id) + + async def delete_audience_group_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + """Delete audience + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: None + """ + return await self._manage_audience.delete_audience_group_with_http_info(audience_group_id) + + async def get_audience_data(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> GetAudienceDataResponse: + """Gets audience data. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: GetAudienceDataResponse + """ + return await self._manage_audience.get_audience_data(audience_group_id) + + async def get_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + """Gets audience data. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: tuple(GetAudienceDataResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._manage_audience.get_audience_data_with_http_info(audience_group_id) + + async def get_audience_groups(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, includes_external_public_groups: Annotated[Optional[StrictBool], Field(description='true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None) -> GetAudienceGroupsResponse: + """Gets data for more than one audience. + + :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) + :type page: int + :param description: The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + :type description: str + :param status: The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + :type status: AudienceGroupStatus + :param size: The number of audiences per page. Default: 20 Max: 40 + :type size: int + :param includes_external_public_groups: true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. + :type includes_external_public_groups: bool + :param create_route: How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + :type create_route: AudienceGroupCreateRoute + :return: Returns the result object. + :rtype: GetAudienceGroupsResponse + """ + return await self._manage_audience.get_audience_groups(page, description, status, size, includes_external_public_groups, create_route) + + async def get_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, includes_external_public_groups: Annotated[Optional[StrictBool], Field(description='true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None) -> ApiResponse: + """Gets data for more than one audience. + + :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) + :type page: int + :param description: The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + :type description: str + :param status: The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + :type status: AudienceGroupStatus + :param size: The number of audiences per page. Default: 20 Max: 40 + :type size: int + :param includes_external_public_groups: true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. + :type includes_external_public_groups: bool + :param create_route: How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + :type create_route: AudienceGroupCreateRoute + :return: Returns the result object. + :rtype: tuple(GetAudienceGroupsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._manage_audience.get_audience_groups_with_http_info(page, description, status, size, includes_external_public_groups, create_route) + + async def get_shared_audience_data(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> GetSharedAudienceDataResponse: + """Gets audience data. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: GetSharedAudienceDataResponse + """ + return await self._manage_audience.get_shared_audience_data(audience_group_id) + + async def get_shared_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + """Gets audience data. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: tuple(GetSharedAudienceDataResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._manage_audience.get_shared_audience_data_with_http_info(audience_group_id) + + async def get_shared_audience_groups(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None, includes_owned_audience_groups: Annotated[Optional[StrictBool], Field(description='true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ')] = None) -> GetSharedAudienceGroupsResponse: + """Gets data for more than one audience, including those shared by the Business Manager. + + :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) + :type page: int + :param description: The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + :type description: str + :param status: The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + :type status: AudienceGroupStatus + :param size: The number of audiences per page. Default: 20 Max: 40 + :type size: int + :param create_route: How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + :type create_route: AudienceGroupCreateRoute + :param includes_owned_audience_groups: true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + :type includes_owned_audience_groups: bool + :return: Returns the result object. + :rtype: GetSharedAudienceGroupsResponse + """ + return await self._manage_audience.get_shared_audience_groups(page, description, status, size, create_route, includes_owned_audience_groups) + + async def get_shared_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None, includes_owned_audience_groups: Annotated[Optional[StrictBool], Field(description='true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ')] = None) -> ApiResponse: + """Gets data for more than one audience, including those shared by the Business Manager. + + :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) + :type page: int + :param description: The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + :type description: str + :param status: The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + :type status: AudienceGroupStatus + :param size: The number of audiences per page. Default: 20 Max: 40 + :type size: int + :param create_route: How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + :type create_route: AudienceGroupCreateRoute + :param includes_owned_audience_groups: true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + :type includes_owned_audience_groups: bool + :return: Returns the result object. + :rtype: tuple(GetSharedAudienceGroupsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._manage_audience.get_shared_audience_groups_with_http_info(page, description, status, size, create_route, includes_owned_audience_groups) + + async def update_audience_group_description(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')], update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest) -> None: + """Renames an existing audience. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :param update_audience_group_description_request: (required) + :type update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest + :return: Returns the result object. + :rtype: None + """ + return await self._manage_audience.update_audience_group_description(audience_group_id, update_audience_group_description_request) + + async def update_audience_group_description_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')], update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest) -> ApiResponse: + """Renames an existing audience. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :param update_audience_group_description_request: (required) + :type update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest + :return: Returns the result object. + :rtype: None + """ + return await self._manage_audience.update_audience_group_description_with_http_info(audience_group_id, update_audience_group_description_request) + + async def add_user_ids_to_audience(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], audience_group_id: Annotated[Optional[StrictInt], Field(description='The audience ID.')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register with the job')] = None) -> None: + """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). + + :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) + :type file: bytearray + :param audience_group_id: The audience ID. + :type audience_group_id: int + :param upload_description: The description to register with the job + :type upload_description: str + :return: Returns the result object. + :rtype: None + """ + return await self._manage_audience_blob.add_user_ids_to_audience(file, audience_group_id, upload_description) + + async def add_user_ids_to_audience_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], audience_group_id: Annotated[Optional[StrictInt], Field(description='The audience ID.')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register with the job')] = None) -> ApiResponse: + """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). + + :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) + :type file: bytearray + :param audience_group_id: The audience ID. + :type audience_group_id: int + :param upload_description: The description to register with the job + :type upload_description: str + :return: Returns the result object. + :rtype: None + """ + return await self._manage_audience_blob.add_user_ids_to_audience_with_http_info(file, audience_group_id, upload_description) + + async def create_audience_for_uploading_user_ids(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], description: Annotated[Optional[constr(strict=True, max_length=120)], Field(description="The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 ")] = None, is_ifa_audience: Annotated[Optional[StrictBool], Field(description='To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. ')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register for the job (in `jobs[].description`). ')] = None) -> CreateAudienceGroupResponse: + """Create audience for uploading user IDs (by file). + + :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) + :type file: bytearray + :param description: The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + :type description: str + :param is_ifa_audience: To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. + :type is_ifa_audience: bool + :param upload_description: The description to register for the job (in `jobs[].description`). + :type upload_description: str + :return: Returns the result object. + :rtype: CreateAudienceGroupResponse + """ + return await self._manage_audience_blob.create_audience_for_uploading_user_ids(file, description, is_ifa_audience, upload_description) + + async def create_audience_for_uploading_user_ids_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], description: Annotated[Optional[constr(strict=True, max_length=120)], Field(description="The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 ")] = None, is_ifa_audience: Annotated[Optional[StrictBool], Field(description='To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. ')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register for the job (in `jobs[].description`). ')] = None) -> ApiResponse: + """Create audience for uploading user IDs (by file). + + :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) + :type file: bytearray + :param description: The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + :type description: str + :param is_ifa_audience: To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. + :type is_ifa_audience: bool + :param upload_description: The description to register for the job (in `jobs[].description`). + :type upload_description: str + :return: Returns the result object. + :rtype: tuple(CreateAudienceGroupResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._manage_audience_blob.create_audience_for_uploading_user_ids_with_http_info(file, description, is_ifa_audience, upload_description) + + async def get_friends_demographics(self) -> GetFriendsDemographicsResponse: + """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). + + :return: Returns the result object. + :rtype: GetFriendsDemographicsResponse + """ + return await self._insight.get_friends_demographics() + + async def get_friends_demographics_with_http_info(self) -> ApiResponse: + """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). + + :return: Returns the result object. + :rtype: tuple(GetFriendsDemographicsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._insight.get_friends_demographics_with_http_info() + + async def get_message_event(self, request_id: Annotated[constr(strict=True, min_length=1), Field(..., description='Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. ')]) -> GetMessageEventResponse: + """Get user interaction statistics + + Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. + + :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 + :return: Returns the result object. + :rtype: GetMessageEventResponse + """ + return await self._insight.get_message_event(request_id) + + async def get_message_event_with_http_info(self, request_id: Annotated[constr(strict=True, min_length=1), Field(..., description='Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. ')]) -> ApiResponse: + """Get user interaction statistics + + Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. + + :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 + :return: Returns the result object. + :rtype: tuple(GetMessageEventResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._insight.get_message_event_with_http_info(request_id) + + async def get_number_of_followers(self, var_date: Annotated[Optional[constr(strict=True, max_length=8, min_length=8)], Field(description='Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')] = None) -> GetNumberOfFollowersResponse: + """Get number of followers + + Returns the number of users who have added the LINE Official Account on or before a specified date. + + :param var_date: Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + :type var_date: str + :return: Returns the result object. + :rtype: GetNumberOfFollowersResponse + """ + return await self._insight.get_number_of_followers(var_date) + + async def get_number_of_followers_with_http_info(self, var_date: Annotated[Optional[constr(strict=True, max_length=8, min_length=8)], Field(description='Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')] = None) -> ApiResponse: + """Get number of followers + + Returns the number of users who have added the LINE Official Account on or before a specified date. + + :param var_date: Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + :type var_date: str + :return: Returns the result object. + :rtype: tuple(GetNumberOfFollowersResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._insight.get_number_of_followers_with_http_info(var_date) + + async def get_number_of_message_deliveries(self, var_date: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 ')]) -> GetNumberOfMessageDeliveriesResponse: + """Get number of message deliveries + + Returns the number of messages sent from LINE Official Account on a specified day. + + :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 + :return: Returns the result object. + :rtype: GetNumberOfMessageDeliveriesResponse + """ + return await self._insight.get_number_of_message_deliveries(var_date) + + async def get_number_of_message_deliveries_with_http_info(self, var_date: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 ')]) -> ApiResponse: + """Get number of message deliveries + + Returns the number of messages sent from LINE Official Account on a specified day. + + :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 + :return: Returns the result object. + :rtype: tuple(GetNumberOfMessageDeliveriesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._insight.get_number_of_message_deliveries_with_http_info(var_date) + + async def get_statistics_per_unit(self, custom_aggregation_unit: Annotated[constr(strict=True, max_length=30, min_length=1), Field(..., description='Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. ')], var_from: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 ')], to: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='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 ')]) -> GetStatisticsPerUnitResponse: + """You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. + + :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 + :return: Returns the result object. + :rtype: GetStatisticsPerUnitResponse + """ + return await self._insight.get_statistics_per_unit(custom_aggregation_unit, var_from, to) + + async def get_statistics_per_unit_with_http_info(self, custom_aggregation_unit: Annotated[constr(strict=True, max_length=30, min_length=1), Field(..., description='Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. ')], var_from: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 ')], to: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='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 ')]) -> ApiResponse: + """You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. + + :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 + :return: Returns the result object. + :rtype: tuple(GetStatisticsPerUnitResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._insight.get_statistics_per_unit_with_http_info(custom_aggregation_unit, var_from, to) + + async def add_liff_app(self, add_liff_app_request: AddLiffAppRequest) -> AddLiffAppResponse: + """Create LIFF app + + Adding the LIFF app to a channel + + :param add_liff_app_request: (required) + :type add_liff_app_request: AddLiffAppRequest + :return: Returns the result object. + :rtype: AddLiffAppResponse + """ + return await self._liff.add_liff_app(add_liff_app_request) + + async def add_liff_app_with_http_info(self, add_liff_app_request: AddLiffAppRequest) -> ApiResponse: + """Create LIFF app + + Adding the LIFF app to a channel + + :param add_liff_app_request: (required) + :type add_liff_app_request: AddLiffAppRequest + :return: Returns the result object. + :rtype: tuple(AddLiffAppResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._liff.add_liff_app_with_http_info(add_liff_app_request) + + async def delete_liff_app(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')]) -> None: + """Delete LIFF app from a channel + + Deletes a LIFF app from a channel. + + :param liff_id: ID of the LIFF app to be updated (required) + :type liff_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._liff.delete_liff_app(liff_id) + + async def delete_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')]) -> ApiResponse: + """Delete LIFF app from a channel + + Deletes a LIFF app from a channel. + + :param liff_id: ID of the LIFF app to be updated (required) + :type liff_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._liff.delete_liff_app_with_http_info(liff_id) + + async def get_all_liff_apps(self) -> GetAllLiffAppsResponse: + """Get all LIFF apps + + Gets information on all the LIFF apps added to the channel. + + :return: Returns the result object. + :rtype: GetAllLiffAppsResponse + """ + return await self._liff.get_all_liff_apps() + + async def get_all_liff_apps_with_http_info(self) -> ApiResponse: + """Get all LIFF apps + + Gets information on all the LIFF apps added to the channel. + + :return: Returns the result object. + :rtype: tuple(GetAllLiffAppsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._liff.get_all_liff_apps_with_http_info() + + async def update_liff_app(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')], update_liff_app_request: UpdateLiffAppRequest) -> None: + """Update LIFF app from a channel + + Update LIFF app settings + + :param liff_id: ID of the LIFF app to be updated (required) + :type liff_id: str + :param update_liff_app_request: (required) + :type update_liff_app_request: UpdateLiffAppRequest + :return: Returns the result object. + :rtype: None + """ + return await self._liff.update_liff_app(liff_id, update_liff_app_request) + + async def update_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')], update_liff_app_request: UpdateLiffAppRequest) -> ApiResponse: + """Update LIFF app from a channel + + Update LIFF app settings + + :param liff_id: ID of the LIFF app to be updated (required) + :type liff_id: str + :param update_liff_app_request: (required) + :type update_liff_app_request: UpdateLiffAppRequest + :return: Returns the result object. + :rtype: None + """ + return await self._liff.update_liff_app_with_http_info(liff_id, update_liff_app_request) + + async 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) -> object: + """Sends a message to multiple users at any time. + + :param broadcast_request: (required) + :type broadcast_request: BroadcastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: object + """ + return await self._messaging_api.broadcast(broadcast_request, x_line_retry_key) + + async def broadcast_with_http_info(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) -> ApiResponse: + """Sends a message to multiple users at any time. + + :param broadcast_request: (required) + :type broadcast_request: BroadcastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.broadcast_with_http_info(broadcast_request, x_line_retry_key) + + async def cancel_default_rich_menu(self) -> None: + """Cancel default rich menu + + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.cancel_default_rich_menu() + + async def cancel_default_rich_menu_with_http_info(self) -> ApiResponse: + """Cancel default rich menu + + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.cancel_default_rich_menu_with_http_info() + + async def close_coupon(self, coupon_id: StrictStr) -> None: + """Close coupon + + :param coupon_id: (required) + :type coupon_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.close_coupon(coupon_id) + + async def close_coupon_with_http_info(self, coupon_id: StrictStr) -> ApiResponse: + """Close coupon + + :param coupon_id: (required) + :type coupon_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.close_coupon_with_http_info(coupon_id) + + async def create_coupon(self, coupon_create_request: Optional[CouponCreateRequest] = None) -> CouponCreateResponse: + """Create a new coupon. Define coupon details such as type, title, and validity period. + + :param coupon_create_request: + :type coupon_create_request: CouponCreateRequest + :return: Returns the result object. + :rtype: CouponCreateResponse + """ + return await self._messaging_api.create_coupon(coupon_create_request) + + async def create_coupon_with_http_info(self, coupon_create_request: Optional[CouponCreateRequest] = None) -> ApiResponse: + """Create a new coupon. Define coupon details such as type, title, and validity period. + + :param coupon_create_request: + :type coupon_create_request: CouponCreateRequest + :return: Returns the result object. + :rtype: tuple(CouponCreateResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.create_coupon_with_http_info(coupon_create_request) + + async def create_rich_menu(self, rich_menu_request: RichMenuRequest) -> RichMenuIdResponse: + """Create rich menu + + :param rich_menu_request: (required) + :type rich_menu_request: RichMenuRequest + :return: Returns the result object. + :rtype: RichMenuIdResponse + """ + return await self._messaging_api.create_rich_menu(rich_menu_request) + + async def create_rich_menu_with_http_info(self, rich_menu_request: RichMenuRequest) -> ApiResponse: + """Create rich menu + + :param rich_menu_request: (required) + :type rich_menu_request: RichMenuRequest + :return: Returns the result object. + :rtype: tuple(RichMenuIdResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.create_rich_menu_with_http_info(rich_menu_request) + + async def create_rich_menu_alias(self, create_rich_menu_alias_request: CreateRichMenuAliasRequest) -> None: + """Create rich menu alias + + :param create_rich_menu_alias_request: (required) + :type create_rich_menu_alias_request: CreateRichMenuAliasRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.create_rich_menu_alias(create_rich_menu_alias_request) + + async def create_rich_menu_alias_with_http_info(self, create_rich_menu_alias_request: CreateRichMenuAliasRequest) -> ApiResponse: + """Create rich menu alias + + :param create_rich_menu_alias_request: (required) + :type create_rich_menu_alias_request: CreateRichMenuAliasRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.create_rich_menu_alias_with_http_info(create_rich_menu_alias_request) + + async def delete_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> None: + """Deletes a rich menu. + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.delete_rich_menu(rich_menu_id) + + async def delete_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + """Deletes a rich menu. + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.delete_rich_menu_with_http_info(rich_menu_id) + + async def delete_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='Rich menu alias ID that you want to delete.')]) -> None: + """Delete rich menu alias + + :param rich_menu_alias_id: Rich menu alias ID that you want to delete. (required) + :type rich_menu_alias_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.delete_rich_menu_alias(rich_menu_alias_id) + + async def delete_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='Rich menu alias ID that you want to delete.')]) -> ApiResponse: + """Delete rich menu alias + + :param rich_menu_alias_id: Rich menu alias ID that you want to delete. (required) + :type rich_menu_alias_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.delete_rich_menu_alias_with_http_info(rich_menu_alias_id) + + async def get_aggregation_unit_name_list(self, limit: Annotated[Optional[StrictStr], Field(description='The maximum number of aggregation units you can get per request. ')] = None, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. ")] = None) -> GetAggregationUnitNameListResponse: + """Get name list of units used this month + + :param limit: The maximum number of aggregation units you can get per request. + :type limit: str + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. + :type start: str + :return: Returns the result object. + :rtype: GetAggregationUnitNameListResponse + """ + return await self._messaging_api.get_aggregation_unit_name_list(limit, start) + + async def get_aggregation_unit_name_list_with_http_info(self, limit: Annotated[Optional[StrictStr], Field(description='The maximum number of aggregation units you can get per request. ')] = None, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. ")] = None) -> ApiResponse: + """Get name list of units used this month + + :param limit: The maximum number of aggregation units you can get per request. + :type limit: str + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. + :type start: str + :return: Returns the result object. + :rtype: tuple(GetAggregationUnitNameListResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_aggregation_unit_name_list_with_http_info(limit, start) + + async def get_aggregation_unit_usage(self) -> GetAggregationUnitUsageResponse: + """Get number of units used this month + + :return: Returns the result object. + :rtype: GetAggregationUnitUsageResponse + """ + return await self._messaging_api.get_aggregation_unit_usage() + + async def get_aggregation_unit_usage_with_http_info(self) -> ApiResponse: + """Get number of units used this month + + :return: Returns the result object. + :rtype: tuple(GetAggregationUnitUsageResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_aggregation_unit_usage_with_http_info() + + async def get_bot_info(self) -> BotInfoResponse: + """Get bot info + + :return: Returns the result object. + :rtype: BotInfoResponse + """ + return await self._messaging_api.get_bot_info() + + async def get_bot_info_with_http_info(self) -> ApiResponse: + """Get bot info + + :return: Returns the result object. + :rtype: tuple(BotInfoResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_bot_info_with_http_info() + + async def get_coupon_detail(self, coupon_id: StrictStr) -> CouponResponse: + """Get coupon detail + + :param coupon_id: (required) + :type coupon_id: str + :return: Returns the result object. + :rtype: CouponResponse + """ + return await self._messaging_api.get_coupon_detail(coupon_id) + + async def get_coupon_detail_with_http_info(self, coupon_id: StrictStr) -> ApiResponse: + """Get coupon detail + + :param coupon_id: (required) + :type coupon_id: str + :return: Returns the result object. + :rtype: tuple(CouponResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_coupon_detail_with_http_info(coupon_id) + + async def get_default_rich_menu_id(self) -> RichMenuIdResponse: + """Gets the ID of the default rich menu set with the Messaging API. + + :return: Returns the result object. + :rtype: RichMenuIdResponse + """ + return await self._messaging_api.get_default_rich_menu_id() + + async def get_default_rich_menu_id_with_http_info(self) -> ApiResponse: + """Gets the ID of the default rich menu set with the Messaging API. + + :return: Returns the result object. + :rtype: tuple(RichMenuIdResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_default_rich_menu_id_with_http_info() + + async def get_followers(self, start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. ')] = None, limit: Annotated[Optional[conint(strict=True, le=1000)], Field(description='The maximum number of user IDs to retrieve in a single request.')] = None) -> GetFollowersResponse: + """Get a list of users who added your LINE Official Account as a friend + + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. + :type start: str + :param limit: The maximum number of user IDs to retrieve in a single request. + :type limit: int + :return: Returns the result object. + :rtype: GetFollowersResponse + """ + return await self._messaging_api.get_followers(start, limit) + + async def get_followers_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. ')] = None, limit: Annotated[Optional[conint(strict=True, le=1000)], Field(description='The maximum number of user IDs to retrieve in a single request.')] = None) -> ApiResponse: + """Get a list of users who added your LINE Official Account as a friend + + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. + :type start: str + :param limit: The maximum number of user IDs to retrieve in a single request. + :type limit: int + :return: Returns the result object. + :rtype: tuple(GetFollowersResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_followers_with_http_info(start, limit) + + async def get_group_member_count(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> GroupMemberCountResponse: + """Get number of users in a group chat + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: GroupMemberCountResponse + """ + return await self._messaging_api.get_group_member_count(group_id) + + async def get_group_member_count_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + """Get number of users in a group chat + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: tuple(GroupMemberCountResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_group_member_count_with_http_info(group_id) + + async def get_group_member_profile(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> GroupUserProfileResponse: + """Get group chat member profile + + :param group_id: Group ID (required) + :type group_id: str + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: GroupUserProfileResponse + """ + return await self._messaging_api.get_group_member_profile(group_id, user_id) + + async def get_group_member_profile_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + """Get group chat member profile + + :param group_id: Group ID (required) + :type group_id: str + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(GroupUserProfileResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_group_member_profile_with_http_info(group_id, user_id) + + async def get_group_members_ids(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> MembersIdsResponse: + """Get group chat member user IDs + + :param group_id: Group ID (required) + :type group_id: str + :param start: Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + :type start: str + :return: Returns the result object. + :rtype: MembersIdsResponse + """ + return await self._messaging_api.get_group_members_ids(group_id, start) + + async def get_group_members_ids_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> ApiResponse: + """Get group chat member user IDs + + :param group_id: Group ID (required) + :type group_id: str + :param start: Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + :type start: str + :return: Returns the result object. + :rtype: tuple(MembersIdsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_group_members_ids_with_http_info(group_id, start) + + async def get_group_summary(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> GroupSummaryResponse: + """Get group chat summary + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: GroupSummaryResponse + """ + return await self._messaging_api.get_group_summary(group_id) + + async def get_group_summary_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + """Get group chat summary + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: tuple(GroupSummaryResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_group_summary_with_http_info(group_id) + + async def get_joined_membership_users(self, membership_id: Annotated[StrictInt, Field(..., description='Membership plan ID.')], start: Annotated[Optional[StrictStr], Field(description="A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). ")] = None, limit: Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description='The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. ')] = None) -> GetJoinedMembershipUsersResponse: + """Get a list of user IDs who joined the membership. + + :param membership_id: Membership plan ID. (required) + :type membership_id: int + :param start: A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). + :type start: str + :param limit: The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. + :type limit: int + :return: Returns the result object. + :rtype: GetJoinedMembershipUsersResponse + """ + return await self._messaging_api.get_joined_membership_users(membership_id, start, limit) + + async def get_joined_membership_users_with_http_info(self, membership_id: Annotated[StrictInt, Field(..., description='Membership plan ID.')], start: Annotated[Optional[StrictStr], Field(description="A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). ")] = None, limit: Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description='The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. ')] = None) -> ApiResponse: + """Get a list of user IDs who joined the membership. + + :param membership_id: Membership plan ID. (required) + :type membership_id: int + :param start: A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). + :type start: str + :param limit: The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. + :type limit: int + :return: Returns the result object. + :rtype: tuple(GetJoinedMembershipUsersResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_joined_membership_users_with_http_info(membership_id, start, limit) + + async def get_membership_list(self) -> MembershipListResponse: + """Get a list of memberships. + + :return: Returns the result object. + :rtype: MembershipListResponse + """ + return await self._messaging_api.get_membership_list() + + async def get_membership_list_with_http_info(self) -> ApiResponse: + """Get a list of memberships. + + :return: Returns the result object. + :rtype: tuple(MembershipListResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_membership_list_with_http_info() + + async def get_membership_subscription(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> GetMembershipSubscriptionResponse: + """Get a user's membership subscription. + + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: GetMembershipSubscriptionResponse + """ + return await self._messaging_api.get_membership_subscription(user_id) + + async def get_membership_subscription_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + """Get a user's membership subscription. + + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(GetMembershipSubscriptionResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_membership_subscription_with_http_info(user_id) + + async def get_message_quota(self) -> MessageQuotaResponse: + """Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. + + :return: Returns the result object. + :rtype: MessageQuotaResponse + """ + return await self._messaging_api.get_message_quota() + + async def get_message_quota_with_http_info(self) -> ApiResponse: + """Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. + + :return: Returns the result object. + :rtype: tuple(MessageQuotaResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_message_quota_with_http_info() + + async def get_message_quota_consumption(self) -> QuotaConsumptionResponse: + """Gets the number of messages sent in the current month. + + :return: Returns the result object. + :rtype: QuotaConsumptionResponse + """ + return await self._messaging_api.get_message_quota_consumption() + + async def get_message_quota_consumption_with_http_info(self) -> ApiResponse: + """Gets the number of messages sent in the current month. + + :return: Returns the result object. + :rtype: tuple(QuotaConsumptionResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_message_quota_consumption_with_http_info() + + async def get_narrowcast_progress(self, request_id: Annotated[StrictStr, Field(..., description="The narrowcast message's request ID. Each Messaging API request has a request ID.")]) -> NarrowcastProgressResponse: + """Gets the status of a narrowcast message. + + :param request_id: The narrowcast message's request ID. Each Messaging API request has a request ID. (required) + :type request_id: str + :return: Returns the result object. + :rtype: NarrowcastProgressResponse + """ + return await self._messaging_api.get_narrowcast_progress(request_id) + + async def get_narrowcast_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description="The narrowcast message's request ID. Each Messaging API request has a request ID.")]) -> ApiResponse: + """Gets the status of a narrowcast message. + + :param request_id: The narrowcast message's request ID. Each Messaging API request has a request ID. (required) + :type request_id: str + :return: Returns the result object. + :rtype: tuple(NarrowcastProgressResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_narrowcast_progress_with_http_info(request_id) + + async def get_number_of_sent_broadcast_messages(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')]) -> NumberOfMessagesResponse: + """Get number of sent broadcast messages + + :param var_date: Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: NumberOfMessagesResponse + """ + return await self._messaging_api.get_number_of_sent_broadcast_messages(var_date) + + async def get_number_of_sent_broadcast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')]) -> ApiResponse: + """Get number of sent broadcast messages + + :param var_date: Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: tuple(NumberOfMessagesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_number_of_sent_broadcast_messages_with_http_info(var_date) + + async def get_number_of_sent_multicast_messages(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> NumberOfMessagesResponse: + """Get number of sent multicast messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: NumberOfMessagesResponse + """ + return await self._messaging_api.get_number_of_sent_multicast_messages(var_date) + + async def get_number_of_sent_multicast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + """Get number of sent multicast messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: tuple(NumberOfMessagesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_number_of_sent_multicast_messages_with_http_info(var_date) + + async def get_number_of_sent_push_messages(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> NumberOfMessagesResponse: + """Get number of sent push messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: NumberOfMessagesResponse + """ + return await self._messaging_api.get_number_of_sent_push_messages(var_date) + + async def get_number_of_sent_push_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + """Get number of sent push messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: tuple(NumberOfMessagesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_number_of_sent_push_messages_with_http_info(var_date) + + async def get_number_of_sent_reply_messages(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> NumberOfMessagesResponse: + """Get number of sent reply messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: NumberOfMessagesResponse + """ + return await self._messaging_api.get_number_of_sent_reply_messages(var_date) + + async def get_number_of_sent_reply_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + """Get number of sent reply messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: tuple(NumberOfMessagesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_number_of_sent_reply_messages_with_http_info(var_date) + + async def get_pnp_message_statistics(self, var_date: Annotated[constr(strict=True), Field(..., description='Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 ')]) -> NumberOfMessagesResponse: + """Get number of sent LINE notification messages + + :param var_date: Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: NumberOfMessagesResponse + """ + return await self._messaging_api.get_pnp_message_statistics(var_date) + + async def get_pnp_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 ')]) -> ApiResponse: + """Get number of sent LINE notification messages + + :param var_date: Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: tuple(NumberOfMessagesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_pnp_message_statistics_with_http_info(var_date) + + async def get_profile(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> UserProfileResponse: + """Get profile + + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: UserProfileResponse + """ + return await self._messaging_api.get_profile(user_id) + + async def get_profile_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + """Get profile + + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(UserProfileResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_profile_with_http_info(user_id) + + async def get_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> RichMenuResponse: + """Gets a rich menu via a rich menu ID. + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: RichMenuResponse + """ + return await self._messaging_api.get_rich_menu(rich_menu_id) + + async def get_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + """Gets a rich menu via a rich menu ID. + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: tuple(RichMenuResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_rich_menu_with_http_info(rich_menu_id) + + async def get_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID whose information you want to obtain.')]) -> RichMenuAliasResponse: + """Get rich menu alias information + + :param rich_menu_alias_id: The rich menu alias ID whose information you want to obtain. (required) + :type rich_menu_alias_id: str + :return: Returns the result object. + :rtype: RichMenuAliasResponse + """ + return await self._messaging_api.get_rich_menu_alias(rich_menu_alias_id) + + async def get_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID whose information you want to obtain.')]) -> ApiResponse: + """Get rich menu alias information + + :param rich_menu_alias_id: The rich menu alias ID whose information you want to obtain. (required) + :type rich_menu_alias_id: str + :return: Returns the result object. + :rtype: tuple(RichMenuAliasResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_rich_menu_alias_with_http_info(rich_menu_alias_id) + + async def get_rich_menu_alias_list(self) -> RichMenuAliasListResponse: + """Get list of rich menu alias + + :return: Returns the result object. + :rtype: RichMenuAliasListResponse + """ + return await self._messaging_api.get_rich_menu_alias_list() + + async def get_rich_menu_alias_list_with_http_info(self) -> ApiResponse: + """Get list of rich menu alias + + :return: Returns the result object. + :rtype: tuple(RichMenuAliasListResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_rich_menu_alias_list_with_http_info() + + async def get_rich_menu_batch_progress(self, request_id: Annotated[StrictStr, Field(..., description='A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.')]) -> RichMenuBatchProgressResponse: + """Get the status of Replace or unlink a linked rich menus in batches. + + :param request_id: A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. (required) + :type request_id: str + :return: Returns the result object. + :rtype: RichMenuBatchProgressResponse + """ + return await self._messaging_api.get_rich_menu_batch_progress(request_id) + + async def get_rich_menu_batch_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description='A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.')]) -> ApiResponse: + """Get the status of Replace or unlink a linked rich menus in batches. + + :param request_id: A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. (required) + :type request_id: str + :return: Returns the result object. + :rtype: tuple(RichMenuBatchProgressResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_rich_menu_batch_progress_with_http_info(request_id) + + async def get_rich_menu_id_of_user(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> RichMenuIdResponse: + """Get rich menu ID of user + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: RichMenuIdResponse + """ + return await self._messaging_api.get_rich_menu_id_of_user(user_id) + + async def get_rich_menu_id_of_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> ApiResponse: + """Get rich menu ID of user + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(RichMenuIdResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_rich_menu_id_of_user_with_http_info(user_id) + + async def get_rich_menu_list(self) -> RichMenuListResponse: + """Get rich menu list + + :return: Returns the result object. + :rtype: RichMenuListResponse + """ + return await self._messaging_api.get_rich_menu_list() + + async def get_rich_menu_list_with_http_info(self) -> ApiResponse: + """Get rich menu list + + :return: Returns the result object. + :rtype: tuple(RichMenuListResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_rich_menu_list_with_http_info() + + async def get_room_member_count(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> RoomMemberCountResponse: + """Get number of users in a multi-person chat + + :param room_id: Room ID (required) + :type room_id: str + :return: Returns the result object. + :rtype: RoomMemberCountResponse + """ + return await self._messaging_api.get_room_member_count(room_id) + + async def get_room_member_count_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> ApiResponse: + """Get number of users in a multi-person chat + + :param room_id: Room ID (required) + :type room_id: str + :return: Returns the result object. + :rtype: tuple(RoomMemberCountResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_room_member_count_with_http_info(room_id) + + async def get_room_member_profile(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> RoomUserProfileResponse: + """Get multi-person chat member profile + + :param room_id: Room ID (required) + :type room_id: str + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: RoomUserProfileResponse + """ + return await self._messaging_api.get_room_member_profile(room_id, user_id) + + async def get_room_member_profile_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + """Get multi-person chat member profile + + :param room_id: Room ID (required) + :type room_id: str + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(RoomUserProfileResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_room_member_profile_with_http_info(room_id, user_id) + + async def get_room_members_ids(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> MembersIdsResponse: + """Get multi-person chat member user IDs + + :param room_id: Room ID (required) + :type room_id: str + :param start: Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + :type start: str + :return: Returns the result object. + :rtype: MembersIdsResponse + """ + return await self._messaging_api.get_room_members_ids(room_id, start) + + async def get_room_members_ids_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> ApiResponse: + """Get multi-person chat member user IDs + + :param room_id: Room ID (required) + :type room_id: str + :param start: Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + :type start: str + :return: Returns the result object. + :rtype: tuple(MembersIdsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_room_members_ids_with_http_info(room_id, start) + + async def get_webhook_endpoint(self) -> GetWebhookEndpointResponse: + """Get webhook endpoint information + + :return: Returns the result object. + :rtype: GetWebhookEndpointResponse + """ + return await self._messaging_api.get_webhook_endpoint() + + async def get_webhook_endpoint_with_http_info(self) -> ApiResponse: + """Get webhook endpoint information + + :return: Returns the result object. + :rtype: tuple(GetWebhookEndpointResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.get_webhook_endpoint_with_http_info() + + async def issue_link_token(self, user_id: Annotated[StrictStr, Field(..., description='User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. ')]) -> IssueLinkTokenResponse: + """Issue link token + + :param user_id: User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: IssueLinkTokenResponse + """ + return await self._messaging_api.issue_link_token(user_id) + + async def issue_link_token_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. ')]) -> ApiResponse: + """Issue link token + + :param user_id: User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(IssueLinkTokenResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.issue_link_token_with_http_info(user_id) + + async def leave_group(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> None: + """Leave group chat + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.leave_group(group_id) + + async def leave_group_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + """Leave group chat + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.leave_group_with_http_info(group_id) + + async def leave_room(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> None: + """Leave multi-person chat + + :param room_id: Room ID (required) + :type room_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.leave_room(room_id) + + async def leave_room_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> ApiResponse: + """Leave multi-person chat + + :param room_id: Room ID (required) + :type room_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.leave_room_with_http_info(room_id) + + async def link_rich_menu_id_to_user(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')], rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> None: + """Link rich menu to user. + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.link_rich_menu_id_to_user(user_id, rich_menu_id) + + async def link_rich_menu_id_to_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')], rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + """Link rich menu to user. + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.link_rich_menu_id_to_user_with_http_info(user_id, rich_menu_id) + + async def link_rich_menu_id_to_users(self, rich_menu_bulk_link_request: RichMenuBulkLinkRequest) -> None: + """Link rich menu to multiple users + + :param rich_menu_bulk_link_request: (required) + :type rich_menu_bulk_link_request: RichMenuBulkLinkRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.link_rich_menu_id_to_users(rich_menu_bulk_link_request) + + async def link_rich_menu_id_to_users_with_http_info(self, rich_menu_bulk_link_request: RichMenuBulkLinkRequest) -> ApiResponse: + """Link rich menu to multiple users + + :param rich_menu_bulk_link_request: (required) + :type rich_menu_bulk_link_request: RichMenuBulkLinkRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.link_rich_menu_id_to_users_with_http_info(rich_menu_bulk_link_request) + + async def list_coupon(self, status: Annotated[Optional[conlist(StrictStr, unique_items=True)], Field(description='Filter coupons by their status.')] = None, start: Annotated[Optional[StrictStr], Field(description='Pagination token to retrieve the next page of results.')] = None, limit: Annotated[Optional[conint(strict=True, le=100, ge=1)], Field(description='Maximum number of coupons to return per request.')] = None) -> MessagingApiPagerCouponListResponse: + """Get a paginated list of coupons. + + :param status: Filter coupons by their status. + :type status: List[str] + :param start: Pagination token to retrieve the next page of results. + :type start: str + :param limit: Maximum number of coupons to return per request. + :type limit: int + :return: Returns the result object. + :rtype: MessagingApiPagerCouponListResponse + """ + return await self._messaging_api.list_coupon(status, start, limit) + + async def list_coupon_with_http_info(self, status: Annotated[Optional[conlist(StrictStr, unique_items=True)], Field(description='Filter coupons by their status.')] = None, start: Annotated[Optional[StrictStr], Field(description='Pagination token to retrieve the next page of results.')] = None, limit: Annotated[Optional[conint(strict=True, le=100, ge=1)], Field(description='Maximum number of coupons to return per request.')] = None) -> ApiResponse: + """Get a paginated list of coupons. + + :param status: Filter coupons by their status. + :type status: List[str] + :param start: Pagination token to retrieve the next page of results. + :type start: str + :param limit: Maximum number of coupons to return per request. + :type limit: int + :return: Returns the result object. + :rtype: tuple(MessagingApiPagerCouponListResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.list_coupon_with_http_info(status, start, limit) + + async def mark_messages_as_read(self, mark_messages_as_read_request: MarkMessagesAsReadRequest) -> None: + """Mark messages from users as read + + :param mark_messages_as_read_request: (required) + :type mark_messages_as_read_request: MarkMessagesAsReadRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.mark_messages_as_read(mark_messages_as_read_request) + + async def mark_messages_as_read_with_http_info(self, mark_messages_as_read_request: MarkMessagesAsReadRequest) -> ApiResponse: + """Mark messages from users as read + + :param mark_messages_as_read_request: (required) + :type mark_messages_as_read_request: MarkMessagesAsReadRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.mark_messages_as_read_with_http_info(mark_messages_as_read_request) + + async def mark_messages_as_read_by_token(self, mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest) -> None: + """Mark messages from users as read by token + + :param mark_messages_as_read_by_token_request: (required) + :type mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.mark_messages_as_read_by_token(mark_messages_as_read_by_token_request) + + async def mark_messages_as_read_by_token_with_http_info(self, mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest) -> ApiResponse: + """Mark messages from users as read by token + + :param mark_messages_as_read_by_token_request: (required) + :type mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.mark_messages_as_read_by_token_with_http_info(mark_messages_as_read_by_token_request) + + async 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) -> object: + """An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats. + + :param multicast_request: (required) + :type multicast_request: MulticastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: object + """ + return await self._messaging_api.multicast(multicast_request, x_line_retry_key) + + async def multicast_with_http_info(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) -> ApiResponse: + """An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats. + + :param multicast_request: (required) + :type multicast_request: MulticastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.multicast_with_http_info(multicast_request, x_line_retry_key) + + async 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) -> object: + """Send narrowcast message + + :param narrowcast_request: (required) + :type narrowcast_request: NarrowcastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: object + """ + return await self._messaging_api.narrowcast(narrowcast_request, x_line_retry_key) + + async def narrowcast_with_http_info(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) -> ApiResponse: + """Send narrowcast message + + :param narrowcast_request: (required) + :type narrowcast_request: NarrowcastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.narrowcast_with_http_info(narrowcast_request, x_line_retry_key) + + async 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) -> PushMessageResponse: + """Sends a message to a user, group chat, or multi-person chat at any time. + + :param push_message_request: (required) + :type push_message_request: PushMessageRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: PushMessageResponse + """ + return await self._messaging_api.push_message(push_message_request, x_line_retry_key) + + async def push_message_with_http_info(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) -> ApiResponse: + """Sends a message to a user, group chat, or multi-person chat at any time. + + :param push_message_request: (required) + :type push_message_request: PushMessageRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: tuple(PushMessageResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.push_message_with_http_info(push_message_request, x_line_retry_key) + + async def push_messages_by_phone(self, pnp_messages_request: PnpMessagesRequest, 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) -> None: + """Send LINE notification message + + :param pnp_messages_request: (required) + :type pnp_messages_request: PnpMessagesRequest + :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 + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.push_messages_by_phone(pnp_messages_request, x_line_delivery_tag) + + async def push_messages_by_phone_with_http_info(self, pnp_messages_request: PnpMessagesRequest, 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) -> ApiResponse: + """Send LINE notification message + + :param pnp_messages_request: (required) + :type pnp_messages_request: PnpMessagesRequest + :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 + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.push_messages_by_phone_with_http_info(pnp_messages_request, x_line_delivery_tag) + + async def reply_message(self, reply_message_request: ReplyMessageRequest) -> ReplyMessageResponse: + """Send reply message + + :param reply_message_request: (required) + :type reply_message_request: ReplyMessageRequest + :return: Returns the result object. + :rtype: ReplyMessageResponse + """ + return await self._messaging_api.reply_message(reply_message_request) + + async def reply_message_with_http_info(self, reply_message_request: ReplyMessageRequest) -> ApiResponse: + """Send reply message + + :param reply_message_request: (required) + :type reply_message_request: ReplyMessageRequest + :return: Returns the result object. + :rtype: tuple(ReplyMessageResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.reply_message_with_http_info(reply_message_request) + + async def rich_menu_batch(self, rich_menu_batch_request: RichMenuBatchRequest) -> None: + """You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu + + :param rich_menu_batch_request: (required) + :type rich_menu_batch_request: RichMenuBatchRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.rich_menu_batch(rich_menu_batch_request) + + async def rich_menu_batch_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> ApiResponse: + """You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu + + :param rich_menu_batch_request: (required) + :type rich_menu_batch_request: RichMenuBatchRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.rich_menu_batch_with_http_info(rich_menu_batch_request) + + async def set_default_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> None: + """Set default rich menu + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.set_default_rich_menu(rich_menu_id) + + async def set_default_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + """Set default rich menu + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.set_default_rich_menu_with_http_info(rich_menu_id) + + async def set_webhook_endpoint(self, set_webhook_endpoint_request: SetWebhookEndpointRequest) -> None: + """Set webhook endpoint URL + + :param set_webhook_endpoint_request: (required) + :type set_webhook_endpoint_request: SetWebhookEndpointRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.set_webhook_endpoint(set_webhook_endpoint_request) + + async def set_webhook_endpoint_with_http_info(self, set_webhook_endpoint_request: SetWebhookEndpointRequest) -> ApiResponse: + """Set webhook endpoint URL + + :param set_webhook_endpoint_request: (required) + :type set_webhook_endpoint_request: SetWebhookEndpointRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.set_webhook_endpoint_with_http_info(set_webhook_endpoint_request) + + async def show_loading_animation(self, show_loading_animation_request: ShowLoadingAnimationRequest) -> object: + """Display a loading animation in one-on-one chats between users and LINE Official Accounts. + + :param show_loading_animation_request: (required) + :type show_loading_animation_request: ShowLoadingAnimationRequest + :return: Returns the result object. + :rtype: object + """ + return await self._messaging_api.show_loading_animation(show_loading_animation_request) + + async def show_loading_animation_with_http_info(self, show_loading_animation_request: ShowLoadingAnimationRequest) -> ApiResponse: + """Display a loading animation in one-on-one chats between users and LINE Official Accounts. + + :param show_loading_animation_request: (required) + :type show_loading_animation_request: ShowLoadingAnimationRequest + :return: Returns the result object. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.show_loading_animation_with_http_info(show_loading_animation_request) + + async def test_webhook_endpoint(self, test_webhook_endpoint_request: Optional[TestWebhookEndpointRequest] = None) -> TestWebhookEndpointResponse: + """Test webhook endpoint + + :param test_webhook_endpoint_request: + :type test_webhook_endpoint_request: TestWebhookEndpointRequest + :return: Returns the result object. + :rtype: TestWebhookEndpointResponse + """ + return await self._messaging_api.test_webhook_endpoint(test_webhook_endpoint_request) + + async def test_webhook_endpoint_with_http_info(self, test_webhook_endpoint_request: Optional[TestWebhookEndpointRequest] = None) -> ApiResponse: + """Test webhook endpoint + + :param test_webhook_endpoint_request: + :type test_webhook_endpoint_request: TestWebhookEndpointRequest + :return: Returns the result object. + :rtype: tuple(TestWebhookEndpointResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api.test_webhook_endpoint_with_http_info(test_webhook_endpoint_request) + + async def unlink_rich_menu_id_from_user(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> None: + """Unlink rich menu from user + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.unlink_rich_menu_id_from_user(user_id) + + async def unlink_rich_menu_id_from_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> ApiResponse: + """Unlink rich menu from user + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.unlink_rich_menu_id_from_user_with_http_info(user_id) + + async def unlink_rich_menu_id_from_users(self, rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest) -> None: + """Unlink rich menus from multiple users + + :param rich_menu_bulk_unlink_request: (required) + :type rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.unlink_rich_menu_id_from_users(rich_menu_bulk_unlink_request) + + async def unlink_rich_menu_id_from_users_with_http_info(self, rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest) -> ApiResponse: + """Unlink rich menus from multiple users + + :param rich_menu_bulk_unlink_request: (required) + :type rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.unlink_rich_menu_id_from_users_with_http_info(rich_menu_bulk_unlink_request) + + async def update_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID you want to update.')], update_rich_menu_alias_request: UpdateRichMenuAliasRequest) -> None: + """Update rich menu alias + + :param rich_menu_alias_id: The rich menu alias ID you want to update. (required) + :type rich_menu_alias_id: str + :param update_rich_menu_alias_request: (required) + :type update_rich_menu_alias_request: UpdateRichMenuAliasRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.update_rich_menu_alias(rich_menu_alias_id, update_rich_menu_alias_request) + + async def update_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID you want to update.')], update_rich_menu_alias_request: UpdateRichMenuAliasRequest) -> ApiResponse: + """Update rich menu alias + + :param rich_menu_alias_id: The rich menu alias ID you want to update. (required) + :type rich_menu_alias_id: str + :param update_rich_menu_alias_request: (required) + :type update_rich_menu_alias_request: UpdateRichMenuAliasRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.update_rich_menu_alias_with_http_info(rich_menu_alias_id, update_rich_menu_alias_request) + + async def validate_broadcast(self, validate_message_request: ValidateMessageRequest) -> None: + """Validate message objects of a broadcast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_broadcast(validate_message_request) + + async def validate_broadcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + """Validate message objects of a broadcast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_broadcast_with_http_info(validate_message_request) + + async def validate_multicast(self, validate_message_request: ValidateMessageRequest) -> None: + """Validate message objects of a multicast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_multicast(validate_message_request) + + async def validate_multicast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + """Validate message objects of a multicast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_multicast_with_http_info(validate_message_request) + + async def validate_narrowcast(self, validate_message_request: ValidateMessageRequest) -> None: + """Validate message objects of a narrowcast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_narrowcast(validate_message_request) + + async def validate_narrowcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + """Validate message objects of a narrowcast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_narrowcast_with_http_info(validate_message_request) + + async def validate_push(self, validate_message_request: ValidateMessageRequest) -> None: + """Validate message objects of a push message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_push(validate_message_request) + + async def validate_push_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + """Validate message objects of a push message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_push_with_http_info(validate_message_request) + + async def validate_reply(self, validate_message_request: ValidateMessageRequest) -> None: + """Validate message objects of a reply message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_reply(validate_message_request) + + async def validate_reply_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + """Validate message objects of a reply message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_reply_with_http_info(validate_message_request) + + async def validate_rich_menu_batch_request(self, rich_menu_batch_request: RichMenuBatchRequest) -> None: + """Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. + + :param rich_menu_batch_request: (required) + :type rich_menu_batch_request: RichMenuBatchRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_rich_menu_batch_request(rich_menu_batch_request) + + async def validate_rich_menu_batch_request_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> ApiResponse: + """Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. + + :param rich_menu_batch_request: (required) + :type rich_menu_batch_request: RichMenuBatchRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_rich_menu_batch_request_with_http_info(rich_menu_batch_request) + + async def validate_rich_menu_object(self, rich_menu_request: RichMenuRequest) -> None: + """Validate rich menu object + + :param rich_menu_request: (required) + :type rich_menu_request: RichMenuRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_rich_menu_object(rich_menu_request) + + async def validate_rich_menu_object_with_http_info(self, rich_menu_request: RichMenuRequest) -> ApiResponse: + """Validate rich menu object + + :param rich_menu_request: (required) + :type rich_menu_request: RichMenuRequest + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api.validate_rich_menu_object_with_http_info(rich_menu_request) + + async def get_message_content(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> bytearray: + """Download image, video, and audio data sent from users. + + :param message_id: Message ID of video or audio (required) + :type message_id: str + :return: Returns the result object. + :rtype: bytearray + """ + return await self._messaging_api_blob.get_message_content(message_id) + + async def get_message_content_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> ApiResponse: + """Download image, video, and audio data sent from users. + + :param message_id: Message ID of video or audio (required) + :type message_id: str + :return: Returns the result object. + :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api_blob.get_message_content_with_http_info(message_id) + + async def get_message_content_preview(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of image or video')]) -> bytearray: + """Get a preview image of the image or video + + :param message_id: Message ID of image or video (required) + :type message_id: str + :return: Returns the result object. + :rtype: bytearray + """ + return await self._messaging_api_blob.get_message_content_preview(message_id) + + async def get_message_content_preview_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of image or video')]) -> ApiResponse: + """Get a preview image of the image or video + + :param message_id: Message ID of image or video (required) + :type message_id: str + :return: Returns the result object. + :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api_blob.get_message_content_preview_with_http_info(message_id) + + async def get_message_content_transcoding_by_message_id(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> GetMessageContentTranscodingResponse: + """Verify the preparation status of a video or audio for getting + + :param message_id: Message ID of video or audio (required) + :type message_id: str + :return: Returns the result object. + :rtype: GetMessageContentTranscodingResponse + """ + return await self._messaging_api_blob.get_message_content_transcoding_by_message_id(message_id) + + async def get_message_content_transcoding_by_message_id_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> ApiResponse: + """Verify the preparation status of a video or audio for getting + + :param message_id: Message ID of video or audio (required) + :type message_id: str + :return: Returns the result object. + :rtype: tuple(GetMessageContentTranscodingResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api_blob.get_message_content_transcoding_by_message_id_with_http_info(message_id) + + async def get_rich_menu_image(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of the rich menu with the image to be downloaded')]) -> bytearray: + """Download rich menu image. + + :param rich_menu_id: ID of the rich menu with the image to be downloaded (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: bytearray + """ + return await self._messaging_api_blob.get_rich_menu_image(rich_menu_id) + + async def get_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of the rich menu with the image to be downloaded')]) -> ApiResponse: + """Download rich menu image. + + :param rich_menu_id: ID of the rich menu with the image to be downloaded (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._messaging_api_blob.get_rich_menu_image_with_http_info(rich_menu_id) + + async def set_rich_menu_image(self, rich_menu_id: Annotated[StrictStr, Field(..., description='The ID of the rich menu to attach the image to')], body: Union[StrictBytes, StrictStr]) -> None: + """Upload rich menu image + + :param rich_menu_id: The ID of the rich menu to attach the image to (required) + :type rich_menu_id: str + :param body: (required) + :type body: bytearray + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api_blob.set_rich_menu_image(rich_menu_id, body) + + async def set_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='The ID of the rich menu to attach the image to')], body: Union[StrictBytes, StrictStr]) -> ApiResponse: + """Upload rich menu image + + :param rich_menu_id: The ID of the rich menu to attach the image to (required) + :type rich_menu_id: str + :param body: (required) + :type body: bytearray + :return: Returns the result object. + :rtype: None + """ + return await self._messaging_api_blob.set_rich_menu_image_with_http_info(rich_menu_id, body) + + async def acquire_chat_control(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')], acquire_chat_control_request: Optional[AcquireChatControlRequest] = None) -> None: + """If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. + + :param chat_id: The `userId`, `roomId`, or `groupId` (required) + :type chat_id: str + :param acquire_chat_control_request: + :type acquire_chat_control_request: AcquireChatControlRequest + :return: Returns the result object. + :rtype: None + """ + return await self._line_module.acquire_chat_control(chat_id, acquire_chat_control_request) + + async def acquire_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')], acquire_chat_control_request: Optional[AcquireChatControlRequest] = None) -> ApiResponse: + """If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. + + :param chat_id: The `userId`, `roomId`, or `groupId` (required) + :type chat_id: str + :param acquire_chat_control_request: + :type acquire_chat_control_request: AcquireChatControlRequest + :return: Returns the result object. + :rtype: None + """ + return await self._line_module.acquire_chat_control_with_http_info(chat_id, acquire_chat_control_request) + + async def detach_module(self, detach_module_request: Optional[DetachModuleRequest] = None) -> None: + """The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. + + :param detach_module_request: + :type detach_module_request: DetachModuleRequest + :return: Returns the result object. + :rtype: None + """ + return await self._line_module.detach_module(detach_module_request) + + async def detach_module_with_http_info(self, detach_module_request: Optional[DetachModuleRequest] = None) -> ApiResponse: + """The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. + + :param detach_module_request: + :type detach_module_request: DetachModuleRequest + :return: Returns the result object. + :rtype: None + """ + return await self._line_module.detach_module_with_http_info(detach_module_request) + + async def get_modules(self, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. ")] = None, limit: Annotated[Optional[conint(strict=True, le=100)], Field(description='Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 ')] = None) -> GetModulesResponse: + """Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. + + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. + :type start: str + :param limit: Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 + :type limit: int + :return: Returns the result object. + :rtype: GetModulesResponse + """ + return await self._line_module.get_modules(start, limit) + + async def get_modules_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. ")] = None, limit: Annotated[Optional[conint(strict=True, le=100)], Field(description='Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 ')] = None) -> ApiResponse: + """Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. + + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. + :type start: str + :param limit: Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 + :type limit: int + :return: Returns the result object. + :rtype: tuple(GetModulesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._line_module.get_modules_with_http_info(start, limit) + + async def release_chat_control(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')]) -> None: + """To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. + + :param chat_id: The `userId`, `roomId`, or `groupId` (required) + :type chat_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._line_module.release_chat_control(chat_id) + + async def release_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')]) -> ApiResponse: + """To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. + + :param chat_id: The `userId`, `roomId`, or `groupId` (required) + :type chat_id: str + :return: Returns the result object. + :rtype: None + """ + return await self._line_module.release_chat_control_with_http_info(chat_id) + + async def attach_module(self, grant_type: Annotated[StrictStr, Field(..., description='authorization_code')], code: Annotated[StrictStr, Field(..., description='Authorization code received from the LINE Platform.')], redirect_uri: Annotated[StrictStr, Field(..., description='Specify the redirect_uri specified in the URL for authentication and authorization.')], code_verifier: Annotated[Optional[StrictStr], Field(description='Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks.')] = None, client_id: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. ')] = None, client_secret: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. ')] = None, region: Annotated[Optional[StrictStr], Field(description='If you specified a value for region in the URL for authentication and authorization, specify the same value. ')] = None, basic_search_id: Annotated[Optional[StrictStr], Field(description='If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value.')] = None, scope: Annotated[Optional[StrictStr], Field(description='If you specified a value for scope in the URL for authentication and authorization, specify the same value.')] = None, brand_type: Annotated[Optional[StrictStr], Field(description='If you specified a value for brand_type in the URL for authentication and authorization, specify the same value.')] = None) -> AttachModuleResponse: + """Attach by operation of the module channel provider + + :param grant_type: authorization_code (required) + :type grant_type: str + :param code: Authorization code received from the LINE Platform. (required) + :type code: str + :param redirect_uri: Specify the redirect_uri specified in the URL for authentication and authorization. (required) + :type redirect_uri: str + :param code_verifier: Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks. + :type code_verifier: str + :param client_id: Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. + :type client_id: str + :param client_secret: Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. + :type client_secret: str + :param region: If you specified a value for region in the URL for authentication and authorization, specify the same value. + :type region: str + :param basic_search_id: If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value. + :type basic_search_id: str + :param scope: If you specified a value for scope in the URL for authentication and authorization, specify the same value. + :type scope: str + :param brand_type: If you specified a value for brand_type in the URL for authentication and authorization, specify the same value. + :type brand_type: str + :return: Returns the result object. + :rtype: AttachModuleResponse + """ + return await self._line_module_attach.attach_module(grant_type, code, redirect_uri, code_verifier, client_id, client_secret, region, basic_search_id, scope, brand_type) + + async def attach_module_with_http_info(self, grant_type: Annotated[StrictStr, Field(..., description='authorization_code')], code: Annotated[StrictStr, Field(..., description='Authorization code received from the LINE Platform.')], redirect_uri: Annotated[StrictStr, Field(..., description='Specify the redirect_uri specified in the URL for authentication and authorization.')], code_verifier: Annotated[Optional[StrictStr], Field(description='Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks.')] = None, client_id: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. ')] = None, client_secret: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. ')] = None, region: Annotated[Optional[StrictStr], Field(description='If you specified a value for region in the URL for authentication and authorization, specify the same value. ')] = None, basic_search_id: Annotated[Optional[StrictStr], Field(description='If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value.')] = None, scope: Annotated[Optional[StrictStr], Field(description='If you specified a value for scope in the URL for authentication and authorization, specify the same value.')] = None, brand_type: Annotated[Optional[StrictStr], Field(description='If you specified a value for brand_type in the URL for authentication and authorization, specify the same value.')] = None) -> ApiResponse: + """Attach by operation of the module channel provider + + :param grant_type: authorization_code (required) + :type grant_type: str + :param code: Authorization code received from the LINE Platform. (required) + :type code: str + :param redirect_uri: Specify the redirect_uri specified in the URL for authentication and authorization. (required) + :type redirect_uri: str + :param code_verifier: Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks. + :type code_verifier: str + :param client_id: Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. + :type client_id: str + :param client_secret: Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. + :type client_secret: str + :param region: If you specified a value for region in the URL for authentication and authorization, specify the same value. + :type region: str + :param basic_search_id: If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value. + :type basic_search_id: str + :param scope: If you specified a value for scope in the URL for authentication and authorization, specify the same value. + :type scope: str + :param brand_type: If you specified a value for brand_type in the URL for authentication and authorization, specify the same value. + :type brand_type: str + :return: Returns the result object. + :rtype: tuple(AttachModuleResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return await self._line_module_attach.attach_module_with_http_info(grant_type, code, redirect_uri, code_verifier, client_id, client_secret, region, basic_search_id, scope, brand_type) + + async def mission_sticker_v3(self, mission_sticker_request: MissionStickerRequest) -> None: + """Sends a mission sticker. + + :param mission_sticker_request: (required) + :type mission_sticker_request: MissionStickerRequest + :return: Returns the result object. + :rtype: None + """ + return await self._shop.mission_sticker_v3(mission_sticker_request) + + async def mission_sticker_v3_with_http_info(self, mission_sticker_request: MissionStickerRequest) -> ApiResponse: + """Sends a mission sticker. + + :param mission_sticker_request: (required) + :type mission_sticker_request: MissionStickerRequest + :return: Returns the result object. + :rtype: None + """ + return await self._shop.mission_sticker_v3_with_http_info(mission_sticker_request) + diff --git a/linebot/v3/audience/api/async_manage_audience.py b/linebot/v3/audience/api/async_manage_audience.py index 3a4dc1dd9..1413ffc82 100644 --- a/linebot/v3/audience/api/async_manage_audience.py +++ b/linebot/v3/audience/api/async_manage_audience.py @@ -52,6 +52,9 @@ class AsyncManageAudience(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/audience/api/async_manage_audience_blob.py b/linebot/v3/audience/api/async_manage_audience_blob.py index 0c5efdf39..cfa9a0432 100644 --- a/linebot/v3/audience/api/async_manage_audience_blob.py +++ b/linebot/v3/audience/api/async_manage_audience_blob.py @@ -39,6 +39,9 @@ class AsyncManageAudienceBlob(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/audience/api/manage_audience.py b/linebot/v3/audience/api/manage_audience.py index d575501db..8e5210bf3 100644 --- a/linebot/v3/audience/api/manage_audience.py +++ b/linebot/v3/audience/api/manage_audience.py @@ -50,6 +50,9 @@ class ManageAudience(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/audience/api/manage_audience_blob.py b/linebot/v3/audience/api/manage_audience_blob.py index 189e21f1e..55f07ded4 100644 --- a/linebot/v3/audience/api/manage_audience_blob.py +++ b/linebot/v3/audience/api/manage_audience_blob.py @@ -37,6 +37,9 @@ class ManageAudienceBlob(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/insight/api/async_insight.py b/linebot/v3/insight/api/async_insight.py index d81e797c6..cf3463d01 100644 --- a/linebot/v3/insight/api/async_insight.py +++ b/linebot/v3/insight/api/async_insight.py @@ -43,6 +43,9 @@ class AsyncInsight(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/insight/api/insight.py b/linebot/v3/insight/api/insight.py index 70c774e52..238402283 100644 --- a/linebot/v3/insight/api/insight.py +++ b/linebot/v3/insight/api/insight.py @@ -41,6 +41,9 @@ class Insight(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/liff/api/async_liff.py b/linebot/v3/liff/api/async_liff.py index 174db3d77..4e89a6415 100644 --- a/linebot/v3/liff/api/async_liff.py +++ b/linebot/v3/liff/api/async_liff.py @@ -40,6 +40,9 @@ class AsyncLiff(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/liff/api/liff.py b/linebot/v3/liff/api/liff.py index 3e063b66a..f16663b1a 100644 --- a/linebot/v3/liff/api/liff.py +++ b/linebot/v3/liff/api/liff.py @@ -38,6 +38,9 @@ class Liff(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/line_bot_client.py b/linebot/v3/line_bot_client.py new file mode 100644 index 000000000..30c75e471 --- /dev/null +++ b/linebot/v3/line_bot_client.py @@ -0,0 +1,2409 @@ +# coding: utf-8 + +# Auto-generated by tools/generate_unified_client.py. Do not edit manually. + +from typing import Optional, Union +from typing_extensions import Annotated +from pydantic.v1 import Field, StrictBool, StrictBytes, StrictInt, StrictStr, conint, conlist, constr + +from linebot.v3.audience.configuration import Configuration as AudienceConfiguration +from linebot.v3.audience.api_client import ApiClient as AudienceApiClient +from linebot.v3.insight.configuration import Configuration as InsightConfiguration +from linebot.v3.insight.api_client import ApiClient as InsightApiClient +from linebot.v3.liff.configuration import Configuration as LiffConfiguration +from linebot.v3.liff.api_client import ApiClient as LiffApiClient +from linebot.v3.messaging.configuration import Configuration as MessagingConfiguration +from linebot.v3.messaging.api_client import ApiClient as MessagingApiClient +from linebot.v3.module.configuration import Configuration as ModuleConfiguration +from linebot.v3.module.api_client import ApiClient as ModuleApiClient +from linebot.v3.moduleattach.configuration import Configuration as ModuleattachConfiguration +from linebot.v3.moduleattach.api_client import ApiClient as ModuleattachApiClient +from linebot.v3.shop.configuration import Configuration as ShopConfiguration +from linebot.v3.shop.api_client import ApiClient as ShopApiClient + +from linebot.v3.audience.api.manage_audience import ManageAudience +from linebot.v3.audience.api.manage_audience_blob import ManageAudienceBlob +from linebot.v3.insight.api.insight import Insight +from linebot.v3.liff.api.liff import Liff +from linebot.v3.messaging.api.messaging_api import MessagingApi +from linebot.v3.messaging.api.messaging_api_blob import MessagingApiBlob +from linebot.v3.module.api.line_module import LineModule +from linebot.v3.moduleattach.api.line_module_attach import LineModuleAttach +from linebot.v3.shop.api.shop import Shop +from linebot.v3.audience.api_response import ApiResponse + +from linebot.v3.audience.models.add_audience_to_audience_group_request import AddAudienceToAudienceGroupRequest +from linebot.v3.audience.models.audience_group_create_route import AudienceGroupCreateRoute +from linebot.v3.audience.models.audience_group_status import AudienceGroupStatus +from linebot.v3.audience.models.create_audience_group_request import CreateAudienceGroupRequest +from linebot.v3.audience.models.create_audience_group_response import CreateAudienceGroupResponse +from linebot.v3.audience.models.create_click_based_audience_group_request import CreateClickBasedAudienceGroupRequest +from linebot.v3.audience.models.create_click_based_audience_group_response import CreateClickBasedAudienceGroupResponse +from linebot.v3.audience.models.create_imp_based_audience_group_request import CreateImpBasedAudienceGroupRequest +from linebot.v3.audience.models.create_imp_based_audience_group_response import CreateImpBasedAudienceGroupResponse +from linebot.v3.audience.models.get_audience_data_response import GetAudienceDataResponse +from linebot.v3.audience.models.get_audience_groups_response import GetAudienceGroupsResponse +from linebot.v3.audience.models.get_shared_audience_data_response import GetSharedAudienceDataResponse +from linebot.v3.audience.models.get_shared_audience_groups_response import GetSharedAudienceGroupsResponse +from linebot.v3.audience.models.update_audience_group_description_request import UpdateAudienceGroupDescriptionRequest +from linebot.v3.insight.models.get_friends_demographics_response import GetFriendsDemographicsResponse +from linebot.v3.insight.models.get_message_event_response import GetMessageEventResponse +from linebot.v3.insight.models.get_number_of_followers_response import GetNumberOfFollowersResponse +from linebot.v3.insight.models.get_number_of_message_deliveries_response import GetNumberOfMessageDeliveriesResponse +from linebot.v3.insight.models.get_statistics_per_unit_response import GetStatisticsPerUnitResponse +from linebot.v3.liff.models.add_liff_app_request import AddLiffAppRequest +from linebot.v3.liff.models.add_liff_app_response import AddLiffAppResponse +from linebot.v3.liff.models.get_all_liff_apps_response import GetAllLiffAppsResponse +from linebot.v3.liff.models.update_liff_app_request import UpdateLiffAppRequest +from linebot.v3.messaging.models.bot_info_response import BotInfoResponse +from linebot.v3.messaging.models.broadcast_request import BroadcastRequest +from linebot.v3.messaging.models.coupon_create_request import CouponCreateRequest +from linebot.v3.messaging.models.coupon_create_response import CouponCreateResponse +from linebot.v3.messaging.models.coupon_response import CouponResponse +from linebot.v3.messaging.models.create_rich_menu_alias_request import CreateRichMenuAliasRequest +from linebot.v3.messaging.models.get_aggregation_unit_name_list_response import GetAggregationUnitNameListResponse +from linebot.v3.messaging.models.get_aggregation_unit_usage_response import GetAggregationUnitUsageResponse +from linebot.v3.messaging.models.get_followers_response import GetFollowersResponse +from linebot.v3.messaging.models.get_joined_membership_users_response import GetJoinedMembershipUsersResponse +from linebot.v3.messaging.models.get_membership_subscription_response import GetMembershipSubscriptionResponse +from linebot.v3.messaging.models.get_message_content_transcoding_response import GetMessageContentTranscodingResponse +from linebot.v3.messaging.models.get_webhook_endpoint_response import GetWebhookEndpointResponse +from linebot.v3.messaging.models.group_member_count_response import GroupMemberCountResponse +from linebot.v3.messaging.models.group_summary_response import GroupSummaryResponse +from linebot.v3.messaging.models.group_user_profile_response import GroupUserProfileResponse +from linebot.v3.messaging.models.issue_link_token_response import IssueLinkTokenResponse +from linebot.v3.messaging.models.mark_messages_as_read_by_token_request import MarkMessagesAsReadByTokenRequest +from linebot.v3.messaging.models.mark_messages_as_read_request import MarkMessagesAsReadRequest +from linebot.v3.messaging.models.members_ids_response import MembersIdsResponse +from linebot.v3.messaging.models.membership_list_response import MembershipListResponse +from linebot.v3.messaging.models.message_quota_response import MessageQuotaResponse +from linebot.v3.messaging.models.messaging_api_pager_coupon_list_response import MessagingApiPagerCouponListResponse +from linebot.v3.messaging.models.multicast_request import MulticastRequest +from linebot.v3.messaging.models.narrowcast_progress_response import NarrowcastProgressResponse +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.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 +from linebot.v3.messaging.models.rich_menu_batch_request import RichMenuBatchRequest +from linebot.v3.messaging.models.rich_menu_bulk_link_request import RichMenuBulkLinkRequest +from linebot.v3.messaging.models.rich_menu_bulk_unlink_request import RichMenuBulkUnlinkRequest +from linebot.v3.messaging.models.rich_menu_id_response import RichMenuIdResponse +from linebot.v3.messaging.models.rich_menu_list_response import RichMenuListResponse +from linebot.v3.messaging.models.rich_menu_request import RichMenuRequest +from linebot.v3.messaging.models.rich_menu_response import RichMenuResponse +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.set_webhook_endpoint_request import SetWebhookEndpointRequest +from linebot.v3.messaging.models.show_loading_animation_request import ShowLoadingAnimationRequest +from linebot.v3.messaging.models.test_webhook_endpoint_request import TestWebhookEndpointRequest +from linebot.v3.messaging.models.test_webhook_endpoint_response import TestWebhookEndpointResponse +from linebot.v3.messaging.models.update_rich_menu_alias_request import UpdateRichMenuAliasRequest +from linebot.v3.messaging.models.user_profile_response import UserProfileResponse +from linebot.v3.messaging.models.validate_message_request import ValidateMessageRequest +from linebot.v3.module.models.acquire_chat_control_request import AcquireChatControlRequest +from linebot.v3.module.models.detach_module_request import DetachModuleRequest +from linebot.v3.module.models.get_modules_response import GetModulesResponse +from linebot.v3.moduleattach.models.attach_module_response import AttachModuleResponse +from linebot.v3.shop.models.mission_sticker_request import MissionStickerRequest + + +class LineBotClient: + """A single entry-point client that wraps all LINE API operations. + + The LINE Bot SDK v3 splits API operations across multiple subpackages + (messaging, audience, insight, liff, etc.), each with its own + ``Configuration``, ``ApiClient``, and API class. + ``LineBotClient`` consolidates them so that you can call every + API method through one instance with a single ``channel_access_token``. + + Wrapped subpackages: ``audience``, ``insight``, ``liff``, ``messaging``, ``module``, ``moduleattach``, ``shop``. + + Auto-generated by ``tools/generate_unified_client.py``. + Do not edit manually. + + Usage:: + + from linebot.v3 import LineBotClient + + with LineBotClient(channel_access_token="YOUR_TOKEN") as client: + client.reply_message(...) + """ + + def __init__(self, channel_access_token: str, **kwargs) -> None: + """Create a unified LINE Bot client. + + :param str channel_access_token: Channel access token. + :param kwargs: Additional keyword arguments passed to each Configuration. + """ + self._audience_configuration = AudienceConfiguration( + access_token=channel_access_token, **kwargs + ) + self._audience_api_client = AudienceApiClient( + self._audience_configuration + ) + self._insight_configuration = InsightConfiguration( + access_token=channel_access_token, **kwargs + ) + self._insight_api_client = InsightApiClient( + self._insight_configuration + ) + self._liff_configuration = LiffConfiguration( + access_token=channel_access_token, **kwargs + ) + self._liff_api_client = LiffApiClient( + self._liff_configuration + ) + self._messaging_configuration = MessagingConfiguration( + access_token=channel_access_token, **kwargs + ) + self._messaging_api_client = MessagingApiClient( + self._messaging_configuration + ) + self._module_configuration = ModuleConfiguration( + access_token=channel_access_token, **kwargs + ) + self._module_api_client = ModuleApiClient( + self._module_configuration + ) + self._moduleattach_configuration = ModuleattachConfiguration( + access_token=channel_access_token, **kwargs + ) + self._moduleattach_api_client = ModuleattachApiClient( + self._moduleattach_configuration + ) + self._shop_configuration = ShopConfiguration( + access_token=channel_access_token, **kwargs + ) + self._shop_api_client = ShopApiClient( + self._shop_configuration + ) + + self._manage_audience = ManageAudience(self._audience_api_client) + self._manage_audience_blob = ManageAudienceBlob(self._audience_api_client) + self._insight = Insight(self._insight_api_client) + self._liff = Liff(self._liff_api_client) + self._messaging_api = MessagingApi(self._messaging_api_client) + self._messaging_api_blob = MessagingApiBlob(self._messaging_api_client) + self._line_module = LineModule(self._module_api_client) + self._line_module_attach = LineModuleAttach(self._moduleattach_api_client) + self._shop = Shop(self._shop_api_client) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self) -> None: + """Close all underlying API clients.""" + errors: list[BaseException] = [] + try: + self._audience_api_client.close() + except Exception as e: + errors.append(e) + try: + self._insight_api_client.close() + except Exception as e: + errors.append(e) + try: + self._liff_api_client.close() + except Exception as e: + errors.append(e) + try: + self._messaging_api_client.close() + except Exception as e: + errors.append(e) + try: + self._module_api_client.close() + except Exception as e: + errors.append(e) + try: + self._moduleattach_api_client.close() + except Exception as e: + errors.append(e) + try: + self._shop_api_client.close() + except Exception as e: + errors.append(e) + if errors: + raise errors[0] + + def add_audience_to_audience_group(self, add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest) -> None: + """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) + + :param add_audience_to_audience_group_request: (required) + :type add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest + :return: Returns the result object. + :rtype: None + """ + return self._manage_audience.add_audience_to_audience_group(add_audience_to_audience_group_request) + + def add_audience_to_audience_group_with_http_info(self, add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest) -> ApiResponse: + """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) + + :param add_audience_to_audience_group_request: (required) + :type add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest + :return: Returns the result object. + :rtype: None + """ + return self._manage_audience.add_audience_to_audience_group_with_http_info(add_audience_to_audience_group_request) + + def create_audience_group(self, create_audience_group_request: CreateAudienceGroupRequest) -> CreateAudienceGroupResponse: + """Create audience for uploading user IDs (by JSON) + + :param create_audience_group_request: (required) + :type create_audience_group_request: CreateAudienceGroupRequest + :return: Returns the result object. + :rtype: CreateAudienceGroupResponse + """ + return self._manage_audience.create_audience_group(create_audience_group_request) + + def create_audience_group_with_http_info(self, create_audience_group_request: CreateAudienceGroupRequest) -> ApiResponse: + """Create audience for uploading user IDs (by JSON) + + :param create_audience_group_request: (required) + :type create_audience_group_request: CreateAudienceGroupRequest + :return: Returns the result object. + :rtype: tuple(CreateAudienceGroupResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._manage_audience.create_audience_group_with_http_info(create_audience_group_request) + + def create_click_based_audience_group(self, create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest) -> CreateClickBasedAudienceGroupResponse: + """Create audience for click-based retargeting + + :param create_click_based_audience_group_request: (required) + :type create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest + :return: Returns the result object. + :rtype: CreateClickBasedAudienceGroupResponse + """ + return self._manage_audience.create_click_based_audience_group(create_click_based_audience_group_request) + + def create_click_based_audience_group_with_http_info(self, create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest) -> ApiResponse: + """Create audience for click-based retargeting + + :param create_click_based_audience_group_request: (required) + :type create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest + :return: Returns the result object. + :rtype: tuple(CreateClickBasedAudienceGroupResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._manage_audience.create_click_based_audience_group_with_http_info(create_click_based_audience_group_request) + + def create_imp_based_audience_group(self, create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest) -> CreateImpBasedAudienceGroupResponse: + """Create audience for impression-based retargeting + + :param create_imp_based_audience_group_request: (required) + :type create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest + :return: Returns the result object. + :rtype: CreateImpBasedAudienceGroupResponse + """ + return self._manage_audience.create_imp_based_audience_group(create_imp_based_audience_group_request) + + def create_imp_based_audience_group_with_http_info(self, create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest) -> ApiResponse: + """Create audience for impression-based retargeting + + :param create_imp_based_audience_group_request: (required) + :type create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest + :return: Returns the result object. + :rtype: tuple(CreateImpBasedAudienceGroupResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._manage_audience.create_imp_based_audience_group_with_http_info(create_imp_based_audience_group_request) + + def delete_audience_group(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> None: + """Delete audience + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: None + """ + return self._manage_audience.delete_audience_group(audience_group_id) + + def delete_audience_group_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + """Delete audience + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: None + """ + return self._manage_audience.delete_audience_group_with_http_info(audience_group_id) + + def get_audience_data(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> GetAudienceDataResponse: + """Gets audience data. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: GetAudienceDataResponse + """ + return self._manage_audience.get_audience_data(audience_group_id) + + def get_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + """Gets audience data. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: tuple(GetAudienceDataResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._manage_audience.get_audience_data_with_http_info(audience_group_id) + + def get_audience_groups(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, includes_external_public_groups: Annotated[Optional[StrictBool], Field(description='true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None) -> GetAudienceGroupsResponse: + """Gets data for more than one audience. + + :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) + :type page: int + :param description: The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + :type description: str + :param status: The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + :type status: AudienceGroupStatus + :param size: The number of audiences per page. Default: 20 Max: 40 + :type size: int + :param includes_external_public_groups: true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. + :type includes_external_public_groups: bool + :param create_route: How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + :type create_route: AudienceGroupCreateRoute + :return: Returns the result object. + :rtype: GetAudienceGroupsResponse + """ + return self._manage_audience.get_audience_groups(page, description, status, size, includes_external_public_groups, create_route) + + def get_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, includes_external_public_groups: Annotated[Optional[StrictBool], Field(description='true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None) -> ApiResponse: + """Gets data for more than one audience. + + :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) + :type page: int + :param description: The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + :type description: str + :param status: The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + :type status: AudienceGroupStatus + :param size: The number of audiences per page. Default: 20 Max: 40 + :type size: int + :param includes_external_public_groups: true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. + :type includes_external_public_groups: bool + :param create_route: How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + :type create_route: AudienceGroupCreateRoute + :return: Returns the result object. + :rtype: tuple(GetAudienceGroupsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._manage_audience.get_audience_groups_with_http_info(page, description, status, size, includes_external_public_groups, create_route) + + def get_shared_audience_data(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> GetSharedAudienceDataResponse: + """Gets audience data. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: GetSharedAudienceDataResponse + """ + return self._manage_audience.get_shared_audience_data(audience_group_id) + + def get_shared_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + """Gets audience data. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :return: Returns the result object. + :rtype: tuple(GetSharedAudienceDataResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._manage_audience.get_shared_audience_data_with_http_info(audience_group_id) + + def get_shared_audience_groups(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None, includes_owned_audience_groups: Annotated[Optional[StrictBool], Field(description='true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ')] = None) -> GetSharedAudienceGroupsResponse: + """Gets data for more than one audience, including those shared by the Business Manager. + + :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) + :type page: int + :param description: The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + :type description: str + :param status: The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + :type status: AudienceGroupStatus + :param size: The number of audiences per page. Default: 20 Max: 40 + :type size: int + :param create_route: How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + :type create_route: AudienceGroupCreateRoute + :param includes_owned_audience_groups: true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + :type includes_owned_audience_groups: bool + :return: Returns the result object. + :rtype: GetSharedAudienceGroupsResponse + """ + return self._manage_audience.get_shared_audience_groups(page, description, status, size, create_route, includes_owned_audience_groups) + + def get_shared_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None, includes_owned_audience_groups: Annotated[Optional[StrictBool], Field(description='true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ')] = None) -> ApiResponse: + """Gets data for more than one audience, including those shared by the Business Manager. + + :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) + :type page: int + :param description: The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + :type description: str + :param status: The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + :type status: AudienceGroupStatus + :param size: The number of audiences per page. Default: 20 Max: 40 + :type size: int + :param create_route: How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + :type create_route: AudienceGroupCreateRoute + :param includes_owned_audience_groups: true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + :type includes_owned_audience_groups: bool + :return: Returns the result object. + :rtype: tuple(GetSharedAudienceGroupsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._manage_audience.get_shared_audience_groups_with_http_info(page, description, status, size, create_route, includes_owned_audience_groups) + + def update_audience_group_description(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')], update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest) -> None: + """Renames an existing audience. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :param update_audience_group_description_request: (required) + :type update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest + :return: Returns the result object. + :rtype: None + """ + return self._manage_audience.update_audience_group_description(audience_group_id, update_audience_group_description_request) + + def update_audience_group_description_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')], update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest) -> ApiResponse: + """Renames an existing audience. + + :param audience_group_id: The audience ID. (required) + :type audience_group_id: int + :param update_audience_group_description_request: (required) + :type update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest + :return: Returns the result object. + :rtype: None + """ + return self._manage_audience.update_audience_group_description_with_http_info(audience_group_id, update_audience_group_description_request) + + def add_user_ids_to_audience(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], audience_group_id: Annotated[Optional[StrictInt], Field(description='The audience ID.')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register with the job')] = None) -> None: + """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). + + :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) + :type file: bytearray + :param audience_group_id: The audience ID. + :type audience_group_id: int + :param upload_description: The description to register with the job + :type upload_description: str + :return: Returns the result object. + :rtype: None + """ + return self._manage_audience_blob.add_user_ids_to_audience(file, audience_group_id, upload_description) + + def add_user_ids_to_audience_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], audience_group_id: Annotated[Optional[StrictInt], Field(description='The audience ID.')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register with the job')] = None) -> ApiResponse: + """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). + + :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) + :type file: bytearray + :param audience_group_id: The audience ID. + :type audience_group_id: int + :param upload_description: The description to register with the job + :type upload_description: str + :return: Returns the result object. + :rtype: None + """ + return self._manage_audience_blob.add_user_ids_to_audience_with_http_info(file, audience_group_id, upload_description) + + def create_audience_for_uploading_user_ids(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], description: Annotated[Optional[constr(strict=True, max_length=120)], Field(description="The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 ")] = None, is_ifa_audience: Annotated[Optional[StrictBool], Field(description='To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. ')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register for the job (in `jobs[].description`). ')] = None) -> CreateAudienceGroupResponse: + """Create audience for uploading user IDs (by file). + + :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) + :type file: bytearray + :param description: The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + :type description: str + :param is_ifa_audience: To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. + :type is_ifa_audience: bool + :param upload_description: The description to register for the job (in `jobs[].description`). + :type upload_description: str + :return: Returns the result object. + :rtype: CreateAudienceGroupResponse + """ + return self._manage_audience_blob.create_audience_for_uploading_user_ids(file, description, is_ifa_audience, upload_description) + + def create_audience_for_uploading_user_ids_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], description: Annotated[Optional[constr(strict=True, max_length=120)], Field(description="The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 ")] = None, is_ifa_audience: Annotated[Optional[StrictBool], Field(description='To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. ')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register for the job (in `jobs[].description`). ')] = None) -> ApiResponse: + """Create audience for uploading user IDs (by file). + + :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) + :type file: bytearray + :param description: The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + :type description: str + :param is_ifa_audience: To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. + :type is_ifa_audience: bool + :param upload_description: The description to register for the job (in `jobs[].description`). + :type upload_description: str + :return: Returns the result object. + :rtype: tuple(CreateAudienceGroupResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._manage_audience_blob.create_audience_for_uploading_user_ids_with_http_info(file, description, is_ifa_audience, upload_description) + + def get_friends_demographics(self) -> GetFriendsDemographicsResponse: + """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). + + :return: Returns the result object. + :rtype: GetFriendsDemographicsResponse + """ + return self._insight.get_friends_demographics() + + def get_friends_demographics_with_http_info(self) -> ApiResponse: + """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). + + :return: Returns the result object. + :rtype: tuple(GetFriendsDemographicsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._insight.get_friends_demographics_with_http_info() + + def get_message_event(self, request_id: Annotated[constr(strict=True, min_length=1), Field(..., description='Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. ')]) -> GetMessageEventResponse: + """Get user interaction statistics + + Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. + + :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 + :return: Returns the result object. + :rtype: GetMessageEventResponse + """ + return self._insight.get_message_event(request_id) + + def get_message_event_with_http_info(self, request_id: Annotated[constr(strict=True, min_length=1), Field(..., description='Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. ')]) -> ApiResponse: + """Get user interaction statistics + + Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. + + :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 + :return: Returns the result object. + :rtype: tuple(GetMessageEventResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._insight.get_message_event_with_http_info(request_id) + + def get_number_of_followers(self, var_date: Annotated[Optional[constr(strict=True, max_length=8, min_length=8)], Field(description='Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')] = None) -> GetNumberOfFollowersResponse: + """Get number of followers + + Returns the number of users who have added the LINE Official Account on or before a specified date. + + :param var_date: Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + :type var_date: str + :return: Returns the result object. + :rtype: GetNumberOfFollowersResponse + """ + return self._insight.get_number_of_followers(var_date) + + def get_number_of_followers_with_http_info(self, var_date: Annotated[Optional[constr(strict=True, max_length=8, min_length=8)], Field(description='Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')] = None) -> ApiResponse: + """Get number of followers + + Returns the number of users who have added the LINE Official Account on or before a specified date. + + :param var_date: Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + :type var_date: str + :return: Returns the result object. + :rtype: tuple(GetNumberOfFollowersResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._insight.get_number_of_followers_with_http_info(var_date) + + def get_number_of_message_deliveries(self, var_date: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 ')]) -> GetNumberOfMessageDeliveriesResponse: + """Get number of message deliveries + + Returns the number of messages sent from LINE Official Account on a specified day. + + :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 + :return: Returns the result object. + :rtype: GetNumberOfMessageDeliveriesResponse + """ + return self._insight.get_number_of_message_deliveries(var_date) + + def get_number_of_message_deliveries_with_http_info(self, var_date: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 ')]) -> ApiResponse: + """Get number of message deliveries + + Returns the number of messages sent from LINE Official Account on a specified day. + + :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 + :return: Returns the result object. + :rtype: tuple(GetNumberOfMessageDeliveriesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._insight.get_number_of_message_deliveries_with_http_info(var_date) + + def get_statistics_per_unit(self, custom_aggregation_unit: Annotated[constr(strict=True, max_length=30, min_length=1), Field(..., description='Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. ')], var_from: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 ')], to: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='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 ')]) -> GetStatisticsPerUnitResponse: + """You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. + + :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 + :return: Returns the result object. + :rtype: GetStatisticsPerUnitResponse + """ + return self._insight.get_statistics_per_unit(custom_aggregation_unit, var_from, to) + + def get_statistics_per_unit_with_http_info(self, custom_aggregation_unit: Annotated[constr(strict=True, max_length=30, min_length=1), Field(..., description='Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. ')], var_from: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 ')], to: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='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 ')]) -> ApiResponse: + """You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. + + :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 + :return: Returns the result object. + :rtype: tuple(GetStatisticsPerUnitResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._insight.get_statistics_per_unit_with_http_info(custom_aggregation_unit, var_from, to) + + def add_liff_app(self, add_liff_app_request: AddLiffAppRequest) -> AddLiffAppResponse: + """Create LIFF app + + Adding the LIFF app to a channel + + :param add_liff_app_request: (required) + :type add_liff_app_request: AddLiffAppRequest + :return: Returns the result object. + :rtype: AddLiffAppResponse + """ + return self._liff.add_liff_app(add_liff_app_request) + + def add_liff_app_with_http_info(self, add_liff_app_request: AddLiffAppRequest) -> ApiResponse: + """Create LIFF app + + Adding the LIFF app to a channel + + :param add_liff_app_request: (required) + :type add_liff_app_request: AddLiffAppRequest + :return: Returns the result object. + :rtype: tuple(AddLiffAppResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._liff.add_liff_app_with_http_info(add_liff_app_request) + + def delete_liff_app(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')]) -> None: + """Delete LIFF app from a channel + + Deletes a LIFF app from a channel. + + :param liff_id: ID of the LIFF app to be updated (required) + :type liff_id: str + :return: Returns the result object. + :rtype: None + """ + return self._liff.delete_liff_app(liff_id) + + def delete_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')]) -> ApiResponse: + """Delete LIFF app from a channel + + Deletes a LIFF app from a channel. + + :param liff_id: ID of the LIFF app to be updated (required) + :type liff_id: str + :return: Returns the result object. + :rtype: None + """ + return self._liff.delete_liff_app_with_http_info(liff_id) + + def get_all_liff_apps(self) -> GetAllLiffAppsResponse: + """Get all LIFF apps + + Gets information on all the LIFF apps added to the channel. + + :return: Returns the result object. + :rtype: GetAllLiffAppsResponse + """ + return self._liff.get_all_liff_apps() + + def get_all_liff_apps_with_http_info(self) -> ApiResponse: + """Get all LIFF apps + + Gets information on all the LIFF apps added to the channel. + + :return: Returns the result object. + :rtype: tuple(GetAllLiffAppsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._liff.get_all_liff_apps_with_http_info() + + def update_liff_app(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')], update_liff_app_request: UpdateLiffAppRequest) -> None: + """Update LIFF app from a channel + + Update LIFF app settings + + :param liff_id: ID of the LIFF app to be updated (required) + :type liff_id: str + :param update_liff_app_request: (required) + :type update_liff_app_request: UpdateLiffAppRequest + :return: Returns the result object. + :rtype: None + """ + return self._liff.update_liff_app(liff_id, update_liff_app_request) + + def update_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')], update_liff_app_request: UpdateLiffAppRequest) -> ApiResponse: + """Update LIFF app from a channel + + Update LIFF app settings + + :param liff_id: ID of the LIFF app to be updated (required) + :type liff_id: str + :param update_liff_app_request: (required) + :type update_liff_app_request: UpdateLiffAppRequest + :return: Returns the result object. + :rtype: None + """ + return self._liff.update_liff_app_with_http_info(liff_id, update_liff_app_request) + + 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) -> object: + """Sends a message to multiple users at any time. + + :param broadcast_request: (required) + :type broadcast_request: BroadcastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: object + """ + return self._messaging_api.broadcast(broadcast_request, x_line_retry_key) + + def broadcast_with_http_info(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) -> ApiResponse: + """Sends a message to multiple users at any time. + + :param broadcast_request: (required) + :type broadcast_request: BroadcastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.broadcast_with_http_info(broadcast_request, x_line_retry_key) + + def cancel_default_rich_menu(self) -> None: + """Cancel default rich menu + + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.cancel_default_rich_menu() + + def cancel_default_rich_menu_with_http_info(self) -> ApiResponse: + """Cancel default rich menu + + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.cancel_default_rich_menu_with_http_info() + + def close_coupon(self, coupon_id: StrictStr) -> None: + """Close coupon + + :param coupon_id: (required) + :type coupon_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.close_coupon(coupon_id) + + def close_coupon_with_http_info(self, coupon_id: StrictStr) -> ApiResponse: + """Close coupon + + :param coupon_id: (required) + :type coupon_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.close_coupon_with_http_info(coupon_id) + + def create_coupon(self, coupon_create_request: Optional[CouponCreateRequest] = None) -> CouponCreateResponse: + """Create a new coupon. Define coupon details such as type, title, and validity period. + + :param coupon_create_request: + :type coupon_create_request: CouponCreateRequest + :return: Returns the result object. + :rtype: CouponCreateResponse + """ + return self._messaging_api.create_coupon(coupon_create_request) + + def create_coupon_with_http_info(self, coupon_create_request: Optional[CouponCreateRequest] = None) -> ApiResponse: + """Create a new coupon. Define coupon details such as type, title, and validity period. + + :param coupon_create_request: + :type coupon_create_request: CouponCreateRequest + :return: Returns the result object. + :rtype: tuple(CouponCreateResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.create_coupon_with_http_info(coupon_create_request) + + def create_rich_menu(self, rich_menu_request: RichMenuRequest) -> RichMenuIdResponse: + """Create rich menu + + :param rich_menu_request: (required) + :type rich_menu_request: RichMenuRequest + :return: Returns the result object. + :rtype: RichMenuIdResponse + """ + return self._messaging_api.create_rich_menu(rich_menu_request) + + def create_rich_menu_with_http_info(self, rich_menu_request: RichMenuRequest) -> ApiResponse: + """Create rich menu + + :param rich_menu_request: (required) + :type rich_menu_request: RichMenuRequest + :return: Returns the result object. + :rtype: tuple(RichMenuIdResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.create_rich_menu_with_http_info(rich_menu_request) + + def create_rich_menu_alias(self, create_rich_menu_alias_request: CreateRichMenuAliasRequest) -> None: + """Create rich menu alias + + :param create_rich_menu_alias_request: (required) + :type create_rich_menu_alias_request: CreateRichMenuAliasRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.create_rich_menu_alias(create_rich_menu_alias_request) + + def create_rich_menu_alias_with_http_info(self, create_rich_menu_alias_request: CreateRichMenuAliasRequest) -> ApiResponse: + """Create rich menu alias + + :param create_rich_menu_alias_request: (required) + :type create_rich_menu_alias_request: CreateRichMenuAliasRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.create_rich_menu_alias_with_http_info(create_rich_menu_alias_request) + + def delete_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> None: + """Deletes a rich menu. + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.delete_rich_menu(rich_menu_id) + + def delete_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + """Deletes a rich menu. + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.delete_rich_menu_with_http_info(rich_menu_id) + + def delete_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='Rich menu alias ID that you want to delete.')]) -> None: + """Delete rich menu alias + + :param rich_menu_alias_id: Rich menu alias ID that you want to delete. (required) + :type rich_menu_alias_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.delete_rich_menu_alias(rich_menu_alias_id) + + def delete_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='Rich menu alias ID that you want to delete.')]) -> ApiResponse: + """Delete rich menu alias + + :param rich_menu_alias_id: Rich menu alias ID that you want to delete. (required) + :type rich_menu_alias_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.delete_rich_menu_alias_with_http_info(rich_menu_alias_id) + + def get_aggregation_unit_name_list(self, limit: Annotated[Optional[StrictStr], Field(description='The maximum number of aggregation units you can get per request. ')] = None, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. ")] = None) -> GetAggregationUnitNameListResponse: + """Get name list of units used this month + + :param limit: The maximum number of aggregation units you can get per request. + :type limit: str + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. + :type start: str + :return: Returns the result object. + :rtype: GetAggregationUnitNameListResponse + """ + return self._messaging_api.get_aggregation_unit_name_list(limit, start) + + def get_aggregation_unit_name_list_with_http_info(self, limit: Annotated[Optional[StrictStr], Field(description='The maximum number of aggregation units you can get per request. ')] = None, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. ")] = None) -> ApiResponse: + """Get name list of units used this month + + :param limit: The maximum number of aggregation units you can get per request. + :type limit: str + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. + :type start: str + :return: Returns the result object. + :rtype: tuple(GetAggregationUnitNameListResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_aggregation_unit_name_list_with_http_info(limit, start) + + def get_aggregation_unit_usage(self) -> GetAggregationUnitUsageResponse: + """Get number of units used this month + + :return: Returns the result object. + :rtype: GetAggregationUnitUsageResponse + """ + return self._messaging_api.get_aggregation_unit_usage() + + def get_aggregation_unit_usage_with_http_info(self) -> ApiResponse: + """Get number of units used this month + + :return: Returns the result object. + :rtype: tuple(GetAggregationUnitUsageResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_aggregation_unit_usage_with_http_info() + + def get_bot_info(self) -> BotInfoResponse: + """Get bot info + + :return: Returns the result object. + :rtype: BotInfoResponse + """ + return self._messaging_api.get_bot_info() + + def get_bot_info_with_http_info(self) -> ApiResponse: + """Get bot info + + :return: Returns the result object. + :rtype: tuple(BotInfoResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_bot_info_with_http_info() + + def get_coupon_detail(self, coupon_id: StrictStr) -> CouponResponse: + """Get coupon detail + + :param coupon_id: (required) + :type coupon_id: str + :return: Returns the result object. + :rtype: CouponResponse + """ + return self._messaging_api.get_coupon_detail(coupon_id) + + def get_coupon_detail_with_http_info(self, coupon_id: StrictStr) -> ApiResponse: + """Get coupon detail + + :param coupon_id: (required) + :type coupon_id: str + :return: Returns the result object. + :rtype: tuple(CouponResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_coupon_detail_with_http_info(coupon_id) + + def get_default_rich_menu_id(self) -> RichMenuIdResponse: + """Gets the ID of the default rich menu set with the Messaging API. + + :return: Returns the result object. + :rtype: RichMenuIdResponse + """ + return self._messaging_api.get_default_rich_menu_id() + + def get_default_rich_menu_id_with_http_info(self) -> ApiResponse: + """Gets the ID of the default rich menu set with the Messaging API. + + :return: Returns the result object. + :rtype: tuple(RichMenuIdResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_default_rich_menu_id_with_http_info() + + def get_followers(self, start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. ')] = None, limit: Annotated[Optional[conint(strict=True, le=1000)], Field(description='The maximum number of user IDs to retrieve in a single request.')] = None) -> GetFollowersResponse: + """Get a list of users who added your LINE Official Account as a friend + + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. + :type start: str + :param limit: The maximum number of user IDs to retrieve in a single request. + :type limit: int + :return: Returns the result object. + :rtype: GetFollowersResponse + """ + return self._messaging_api.get_followers(start, limit) + + def get_followers_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. ')] = None, limit: Annotated[Optional[conint(strict=True, le=1000)], Field(description='The maximum number of user IDs to retrieve in a single request.')] = None) -> ApiResponse: + """Get a list of users who added your LINE Official Account as a friend + + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. + :type start: str + :param limit: The maximum number of user IDs to retrieve in a single request. + :type limit: int + :return: Returns the result object. + :rtype: tuple(GetFollowersResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_followers_with_http_info(start, limit) + + def get_group_member_count(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> GroupMemberCountResponse: + """Get number of users in a group chat + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: GroupMemberCountResponse + """ + return self._messaging_api.get_group_member_count(group_id) + + def get_group_member_count_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + """Get number of users in a group chat + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: tuple(GroupMemberCountResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_group_member_count_with_http_info(group_id) + + def get_group_member_profile(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> GroupUserProfileResponse: + """Get group chat member profile + + :param group_id: Group ID (required) + :type group_id: str + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: GroupUserProfileResponse + """ + return self._messaging_api.get_group_member_profile(group_id, user_id) + + def get_group_member_profile_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + """Get group chat member profile + + :param group_id: Group ID (required) + :type group_id: str + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(GroupUserProfileResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_group_member_profile_with_http_info(group_id, user_id) + + def get_group_members_ids(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> MembersIdsResponse: + """Get group chat member user IDs + + :param group_id: Group ID (required) + :type group_id: str + :param start: Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + :type start: str + :return: Returns the result object. + :rtype: MembersIdsResponse + """ + return self._messaging_api.get_group_members_ids(group_id, start) + + def get_group_members_ids_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> ApiResponse: + """Get group chat member user IDs + + :param group_id: Group ID (required) + :type group_id: str + :param start: Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + :type start: str + :return: Returns the result object. + :rtype: tuple(MembersIdsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_group_members_ids_with_http_info(group_id, start) + + def get_group_summary(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> GroupSummaryResponse: + """Get group chat summary + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: GroupSummaryResponse + """ + return self._messaging_api.get_group_summary(group_id) + + def get_group_summary_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + """Get group chat summary + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: tuple(GroupSummaryResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_group_summary_with_http_info(group_id) + + def get_joined_membership_users(self, membership_id: Annotated[StrictInt, Field(..., description='Membership plan ID.')], start: Annotated[Optional[StrictStr], Field(description="A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). ")] = None, limit: Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description='The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. ')] = None) -> GetJoinedMembershipUsersResponse: + """Get a list of user IDs who joined the membership. + + :param membership_id: Membership plan ID. (required) + :type membership_id: int + :param start: A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). + :type start: str + :param limit: The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. + :type limit: int + :return: Returns the result object. + :rtype: GetJoinedMembershipUsersResponse + """ + return self._messaging_api.get_joined_membership_users(membership_id, start, limit) + + def get_joined_membership_users_with_http_info(self, membership_id: Annotated[StrictInt, Field(..., description='Membership plan ID.')], start: Annotated[Optional[StrictStr], Field(description="A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). ")] = None, limit: Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description='The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. ')] = None) -> ApiResponse: + """Get a list of user IDs who joined the membership. + + :param membership_id: Membership plan ID. (required) + :type membership_id: int + :param start: A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). + :type start: str + :param limit: The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. + :type limit: int + :return: Returns the result object. + :rtype: tuple(GetJoinedMembershipUsersResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_joined_membership_users_with_http_info(membership_id, start, limit) + + def get_membership_list(self) -> MembershipListResponse: + """Get a list of memberships. + + :return: Returns the result object. + :rtype: MembershipListResponse + """ + return self._messaging_api.get_membership_list() + + def get_membership_list_with_http_info(self) -> ApiResponse: + """Get a list of memberships. + + :return: Returns the result object. + :rtype: tuple(MembershipListResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_membership_list_with_http_info() + + def get_membership_subscription(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> GetMembershipSubscriptionResponse: + """Get a user's membership subscription. + + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: GetMembershipSubscriptionResponse + """ + return self._messaging_api.get_membership_subscription(user_id) + + def get_membership_subscription_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + """Get a user's membership subscription. + + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(GetMembershipSubscriptionResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_membership_subscription_with_http_info(user_id) + + def get_message_quota(self) -> MessageQuotaResponse: + """Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. + + :return: Returns the result object. + :rtype: MessageQuotaResponse + """ + return self._messaging_api.get_message_quota() + + def get_message_quota_with_http_info(self) -> ApiResponse: + """Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. + + :return: Returns the result object. + :rtype: tuple(MessageQuotaResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_message_quota_with_http_info() + + def get_message_quota_consumption(self) -> QuotaConsumptionResponse: + """Gets the number of messages sent in the current month. + + :return: Returns the result object. + :rtype: QuotaConsumptionResponse + """ + return self._messaging_api.get_message_quota_consumption() + + def get_message_quota_consumption_with_http_info(self) -> ApiResponse: + """Gets the number of messages sent in the current month. + + :return: Returns the result object. + :rtype: tuple(QuotaConsumptionResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_message_quota_consumption_with_http_info() + + def get_narrowcast_progress(self, request_id: Annotated[StrictStr, Field(..., description="The narrowcast message's request ID. Each Messaging API request has a request ID.")]) -> NarrowcastProgressResponse: + """Gets the status of a narrowcast message. + + :param request_id: The narrowcast message's request ID. Each Messaging API request has a request ID. (required) + :type request_id: str + :return: Returns the result object. + :rtype: NarrowcastProgressResponse + """ + return self._messaging_api.get_narrowcast_progress(request_id) + + def get_narrowcast_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description="The narrowcast message's request ID. Each Messaging API request has a request ID.")]) -> ApiResponse: + """Gets the status of a narrowcast message. + + :param request_id: The narrowcast message's request ID. Each Messaging API request has a request ID. (required) + :type request_id: str + :return: Returns the result object. + :rtype: tuple(NarrowcastProgressResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_narrowcast_progress_with_http_info(request_id) + + def get_number_of_sent_broadcast_messages(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')]) -> NumberOfMessagesResponse: + """Get number of sent broadcast messages + + :param var_date: Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: NumberOfMessagesResponse + """ + return self._messaging_api.get_number_of_sent_broadcast_messages(var_date) + + def get_number_of_sent_broadcast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')]) -> ApiResponse: + """Get number of sent broadcast messages + + :param var_date: Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: tuple(NumberOfMessagesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_number_of_sent_broadcast_messages_with_http_info(var_date) + + def get_number_of_sent_multicast_messages(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> NumberOfMessagesResponse: + """Get number of sent multicast messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: NumberOfMessagesResponse + """ + return self._messaging_api.get_number_of_sent_multicast_messages(var_date) + + def get_number_of_sent_multicast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + """Get number of sent multicast messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: tuple(NumberOfMessagesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_number_of_sent_multicast_messages_with_http_info(var_date) + + def get_number_of_sent_push_messages(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> NumberOfMessagesResponse: + """Get number of sent push messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: NumberOfMessagesResponse + """ + return self._messaging_api.get_number_of_sent_push_messages(var_date) + + def get_number_of_sent_push_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + """Get number of sent push messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: tuple(NumberOfMessagesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_number_of_sent_push_messages_with_http_info(var_date) + + def get_number_of_sent_reply_messages(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> NumberOfMessagesResponse: + """Get number of sent reply messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: NumberOfMessagesResponse + """ + return self._messaging_api.get_number_of_sent_reply_messages(var_date) + + def get_number_of_sent_reply_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + """Get number of sent reply messages + + :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: tuple(NumberOfMessagesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_number_of_sent_reply_messages_with_http_info(var_date) + + def get_pnp_message_statistics(self, var_date: Annotated[constr(strict=True), Field(..., description='Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 ')]) -> NumberOfMessagesResponse: + """Get number of sent LINE notification messages + + :param var_date: Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: NumberOfMessagesResponse + """ + return self._messaging_api.get_pnp_message_statistics(var_date) + + def get_pnp_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 ')]) -> ApiResponse: + """Get number of sent LINE notification messages + + :param var_date: Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 (required) + :type var_date: str + :return: Returns the result object. + :rtype: tuple(NumberOfMessagesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_pnp_message_statistics_with_http_info(var_date) + + def get_profile(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> UserProfileResponse: + """Get profile + + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: UserProfileResponse + """ + return self._messaging_api.get_profile(user_id) + + def get_profile_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + """Get profile + + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(UserProfileResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_profile_with_http_info(user_id) + + def get_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> RichMenuResponse: + """Gets a rich menu via a rich menu ID. + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: RichMenuResponse + """ + return self._messaging_api.get_rich_menu(rich_menu_id) + + def get_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + """Gets a rich menu via a rich menu ID. + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: tuple(RichMenuResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_rich_menu_with_http_info(rich_menu_id) + + def get_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID whose information you want to obtain.')]) -> RichMenuAliasResponse: + """Get rich menu alias information + + :param rich_menu_alias_id: The rich menu alias ID whose information you want to obtain. (required) + :type rich_menu_alias_id: str + :return: Returns the result object. + :rtype: RichMenuAliasResponse + """ + return self._messaging_api.get_rich_menu_alias(rich_menu_alias_id) + + def get_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID whose information you want to obtain.')]) -> ApiResponse: + """Get rich menu alias information + + :param rich_menu_alias_id: The rich menu alias ID whose information you want to obtain. (required) + :type rich_menu_alias_id: str + :return: Returns the result object. + :rtype: tuple(RichMenuAliasResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_rich_menu_alias_with_http_info(rich_menu_alias_id) + + def get_rich_menu_alias_list(self) -> RichMenuAliasListResponse: + """Get list of rich menu alias + + :return: Returns the result object. + :rtype: RichMenuAliasListResponse + """ + return self._messaging_api.get_rich_menu_alias_list() + + def get_rich_menu_alias_list_with_http_info(self) -> ApiResponse: + """Get list of rich menu alias + + :return: Returns the result object. + :rtype: tuple(RichMenuAliasListResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_rich_menu_alias_list_with_http_info() + + def get_rich_menu_batch_progress(self, request_id: Annotated[StrictStr, Field(..., description='A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.')]) -> RichMenuBatchProgressResponse: + """Get the status of Replace or unlink a linked rich menus in batches. + + :param request_id: A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. (required) + :type request_id: str + :return: Returns the result object. + :rtype: RichMenuBatchProgressResponse + """ + return self._messaging_api.get_rich_menu_batch_progress(request_id) + + def get_rich_menu_batch_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description='A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.')]) -> ApiResponse: + """Get the status of Replace or unlink a linked rich menus in batches. + + :param request_id: A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. (required) + :type request_id: str + :return: Returns the result object. + :rtype: tuple(RichMenuBatchProgressResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_rich_menu_batch_progress_with_http_info(request_id) + + def get_rich_menu_id_of_user(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> RichMenuIdResponse: + """Get rich menu ID of user + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: RichMenuIdResponse + """ + return self._messaging_api.get_rich_menu_id_of_user(user_id) + + def get_rich_menu_id_of_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> ApiResponse: + """Get rich menu ID of user + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(RichMenuIdResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_rich_menu_id_of_user_with_http_info(user_id) + + def get_rich_menu_list(self) -> RichMenuListResponse: + """Get rich menu list + + :return: Returns the result object. + :rtype: RichMenuListResponse + """ + return self._messaging_api.get_rich_menu_list() + + def get_rich_menu_list_with_http_info(self) -> ApiResponse: + """Get rich menu list + + :return: Returns the result object. + :rtype: tuple(RichMenuListResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_rich_menu_list_with_http_info() + + def get_room_member_count(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> RoomMemberCountResponse: + """Get number of users in a multi-person chat + + :param room_id: Room ID (required) + :type room_id: str + :return: Returns the result object. + :rtype: RoomMemberCountResponse + """ + return self._messaging_api.get_room_member_count(room_id) + + def get_room_member_count_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> ApiResponse: + """Get number of users in a multi-person chat + + :param room_id: Room ID (required) + :type room_id: str + :return: Returns the result object. + :rtype: tuple(RoomMemberCountResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_room_member_count_with_http_info(room_id) + + def get_room_member_profile(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> RoomUserProfileResponse: + """Get multi-person chat member profile + + :param room_id: Room ID (required) + :type room_id: str + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: RoomUserProfileResponse + """ + return self._messaging_api.get_room_member_profile(room_id, user_id) + + def get_room_member_profile_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + """Get multi-person chat member profile + + :param room_id: Room ID (required) + :type room_id: str + :param user_id: User ID (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(RoomUserProfileResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_room_member_profile_with_http_info(room_id, user_id) + + def get_room_members_ids(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> MembersIdsResponse: + """Get multi-person chat member user IDs + + :param room_id: Room ID (required) + :type room_id: str + :param start: Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + :type start: str + :return: Returns the result object. + :rtype: MembersIdsResponse + """ + return self._messaging_api.get_room_members_ids(room_id, start) + + def get_room_members_ids_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> ApiResponse: + """Get multi-person chat member user IDs + + :param room_id: Room ID (required) + :type room_id: str + :param start: Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + :type start: str + :return: Returns the result object. + :rtype: tuple(MembersIdsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_room_members_ids_with_http_info(room_id, start) + + def get_webhook_endpoint(self) -> GetWebhookEndpointResponse: + """Get webhook endpoint information + + :return: Returns the result object. + :rtype: GetWebhookEndpointResponse + """ + return self._messaging_api.get_webhook_endpoint() + + def get_webhook_endpoint_with_http_info(self) -> ApiResponse: + """Get webhook endpoint information + + :return: Returns the result object. + :rtype: tuple(GetWebhookEndpointResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.get_webhook_endpoint_with_http_info() + + def issue_link_token(self, user_id: Annotated[StrictStr, Field(..., description='User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. ')]) -> IssueLinkTokenResponse: + """Issue link token + + :param user_id: User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: IssueLinkTokenResponse + """ + return self._messaging_api.issue_link_token(user_id) + + def issue_link_token_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. ')]) -> ApiResponse: + """Issue link token + + :param user_id: User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: tuple(IssueLinkTokenResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.issue_link_token_with_http_info(user_id) + + def leave_group(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> None: + """Leave group chat + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.leave_group(group_id) + + def leave_group_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + """Leave group chat + + :param group_id: Group ID (required) + :type group_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.leave_group_with_http_info(group_id) + + def leave_room(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> None: + """Leave multi-person chat + + :param room_id: Room ID (required) + :type room_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.leave_room(room_id) + + def leave_room_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> ApiResponse: + """Leave multi-person chat + + :param room_id: Room ID (required) + :type room_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.leave_room_with_http_info(room_id) + + def link_rich_menu_id_to_user(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')], rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> None: + """Link rich menu to user. + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.link_rich_menu_id_to_user(user_id, rich_menu_id) + + def link_rich_menu_id_to_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')], rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + """Link rich menu to user. + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.link_rich_menu_id_to_user_with_http_info(user_id, rich_menu_id) + + def link_rich_menu_id_to_users(self, rich_menu_bulk_link_request: RichMenuBulkLinkRequest) -> None: + """Link rich menu to multiple users + + :param rich_menu_bulk_link_request: (required) + :type rich_menu_bulk_link_request: RichMenuBulkLinkRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.link_rich_menu_id_to_users(rich_menu_bulk_link_request) + + def link_rich_menu_id_to_users_with_http_info(self, rich_menu_bulk_link_request: RichMenuBulkLinkRequest) -> ApiResponse: + """Link rich menu to multiple users + + :param rich_menu_bulk_link_request: (required) + :type rich_menu_bulk_link_request: RichMenuBulkLinkRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.link_rich_menu_id_to_users_with_http_info(rich_menu_bulk_link_request) + + def list_coupon(self, status: Annotated[Optional[conlist(StrictStr, unique_items=True)], Field(description='Filter coupons by their status.')] = None, start: Annotated[Optional[StrictStr], Field(description='Pagination token to retrieve the next page of results.')] = None, limit: Annotated[Optional[conint(strict=True, le=100, ge=1)], Field(description='Maximum number of coupons to return per request.')] = None) -> MessagingApiPagerCouponListResponse: + """Get a paginated list of coupons. + + :param status: Filter coupons by their status. + :type status: List[str] + :param start: Pagination token to retrieve the next page of results. + :type start: str + :param limit: Maximum number of coupons to return per request. + :type limit: int + :return: Returns the result object. + :rtype: MessagingApiPagerCouponListResponse + """ + return self._messaging_api.list_coupon(status, start, limit) + + def list_coupon_with_http_info(self, status: Annotated[Optional[conlist(StrictStr, unique_items=True)], Field(description='Filter coupons by their status.')] = None, start: Annotated[Optional[StrictStr], Field(description='Pagination token to retrieve the next page of results.')] = None, limit: Annotated[Optional[conint(strict=True, le=100, ge=1)], Field(description='Maximum number of coupons to return per request.')] = None) -> ApiResponse: + """Get a paginated list of coupons. + + :param status: Filter coupons by their status. + :type status: List[str] + :param start: Pagination token to retrieve the next page of results. + :type start: str + :param limit: Maximum number of coupons to return per request. + :type limit: int + :return: Returns the result object. + :rtype: tuple(MessagingApiPagerCouponListResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.list_coupon_with_http_info(status, start, limit) + + def mark_messages_as_read(self, mark_messages_as_read_request: MarkMessagesAsReadRequest) -> None: + """Mark messages from users as read + + :param mark_messages_as_read_request: (required) + :type mark_messages_as_read_request: MarkMessagesAsReadRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.mark_messages_as_read(mark_messages_as_read_request) + + def mark_messages_as_read_with_http_info(self, mark_messages_as_read_request: MarkMessagesAsReadRequest) -> ApiResponse: + """Mark messages from users as read + + :param mark_messages_as_read_request: (required) + :type mark_messages_as_read_request: MarkMessagesAsReadRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.mark_messages_as_read_with_http_info(mark_messages_as_read_request) + + def mark_messages_as_read_by_token(self, mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest) -> None: + """Mark messages from users as read by token + + :param mark_messages_as_read_by_token_request: (required) + :type mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.mark_messages_as_read_by_token(mark_messages_as_read_by_token_request) + + def mark_messages_as_read_by_token_with_http_info(self, mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest) -> ApiResponse: + """Mark messages from users as read by token + + :param mark_messages_as_read_by_token_request: (required) + :type mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.mark_messages_as_read_by_token_with_http_info(mark_messages_as_read_by_token_request) + + 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) -> object: + """An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats. + + :param multicast_request: (required) + :type multicast_request: MulticastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: object + """ + return self._messaging_api.multicast(multicast_request, x_line_retry_key) + + def multicast_with_http_info(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) -> ApiResponse: + """An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats. + + :param multicast_request: (required) + :type multicast_request: MulticastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.multicast_with_http_info(multicast_request, x_line_retry_key) + + 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) -> object: + """Send narrowcast message + + :param narrowcast_request: (required) + :type narrowcast_request: NarrowcastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: object + """ + return self._messaging_api.narrowcast(narrowcast_request, x_line_retry_key) + + def narrowcast_with_http_info(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) -> ApiResponse: + """Send narrowcast message + + :param narrowcast_request: (required) + :type narrowcast_request: NarrowcastRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.narrowcast_with_http_info(narrowcast_request, x_line_retry_key) + + 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) -> PushMessageResponse: + """Sends a message to a user, group chat, or multi-person chat at any time. + + :param push_message_request: (required) + :type push_message_request: PushMessageRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: PushMessageResponse + """ + return self._messaging_api.push_message(push_message_request, x_line_retry_key) + + def push_message_with_http_info(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) -> ApiResponse: + """Sends a message to a user, group chat, or multi-person chat at any time. + + :param push_message_request: (required) + :type push_message_request: PushMessageRequest + :param x_line_retry_key: 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. + :type x_line_retry_key: str + :return: Returns the result object. + :rtype: tuple(PushMessageResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.push_message_with_http_info(push_message_request, x_line_retry_key) + + def push_messages_by_phone(self, pnp_messages_request: PnpMessagesRequest, 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) -> None: + """Send LINE notification message + + :param pnp_messages_request: (required) + :type pnp_messages_request: PnpMessagesRequest + :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 + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.push_messages_by_phone(pnp_messages_request, x_line_delivery_tag) + + def push_messages_by_phone_with_http_info(self, pnp_messages_request: PnpMessagesRequest, 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) -> ApiResponse: + """Send LINE notification message + + :param pnp_messages_request: (required) + :type pnp_messages_request: PnpMessagesRequest + :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 + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.push_messages_by_phone_with_http_info(pnp_messages_request, x_line_delivery_tag) + + def reply_message(self, reply_message_request: ReplyMessageRequest) -> ReplyMessageResponse: + """Send reply message + + :param reply_message_request: (required) + :type reply_message_request: ReplyMessageRequest + :return: Returns the result object. + :rtype: ReplyMessageResponse + """ + return self._messaging_api.reply_message(reply_message_request) + + def reply_message_with_http_info(self, reply_message_request: ReplyMessageRequest) -> ApiResponse: + """Send reply message + + :param reply_message_request: (required) + :type reply_message_request: ReplyMessageRequest + :return: Returns the result object. + :rtype: tuple(ReplyMessageResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.reply_message_with_http_info(reply_message_request) + + def rich_menu_batch(self, rich_menu_batch_request: RichMenuBatchRequest) -> None: + """You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu + + :param rich_menu_batch_request: (required) + :type rich_menu_batch_request: RichMenuBatchRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.rich_menu_batch(rich_menu_batch_request) + + def rich_menu_batch_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> ApiResponse: + """You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu + + :param rich_menu_batch_request: (required) + :type rich_menu_batch_request: RichMenuBatchRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.rich_menu_batch_with_http_info(rich_menu_batch_request) + + def set_default_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> None: + """Set default rich menu + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.set_default_rich_menu(rich_menu_id) + + def set_default_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + """Set default rich menu + + :param rich_menu_id: ID of a rich menu (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.set_default_rich_menu_with_http_info(rich_menu_id) + + def set_webhook_endpoint(self, set_webhook_endpoint_request: SetWebhookEndpointRequest) -> None: + """Set webhook endpoint URL + + :param set_webhook_endpoint_request: (required) + :type set_webhook_endpoint_request: SetWebhookEndpointRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.set_webhook_endpoint(set_webhook_endpoint_request) + + def set_webhook_endpoint_with_http_info(self, set_webhook_endpoint_request: SetWebhookEndpointRequest) -> ApiResponse: + """Set webhook endpoint URL + + :param set_webhook_endpoint_request: (required) + :type set_webhook_endpoint_request: SetWebhookEndpointRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.set_webhook_endpoint_with_http_info(set_webhook_endpoint_request) + + def show_loading_animation(self, show_loading_animation_request: ShowLoadingAnimationRequest) -> object: + """Display a loading animation in one-on-one chats between users and LINE Official Accounts. + + :param show_loading_animation_request: (required) + :type show_loading_animation_request: ShowLoadingAnimationRequest + :return: Returns the result object. + :rtype: object + """ + return self._messaging_api.show_loading_animation(show_loading_animation_request) + + def show_loading_animation_with_http_info(self, show_loading_animation_request: ShowLoadingAnimationRequest) -> ApiResponse: + """Display a loading animation in one-on-one chats between users and LINE Official Accounts. + + :param show_loading_animation_request: (required) + :type show_loading_animation_request: ShowLoadingAnimationRequest + :return: Returns the result object. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.show_loading_animation_with_http_info(show_loading_animation_request) + + def test_webhook_endpoint(self, test_webhook_endpoint_request: Optional[TestWebhookEndpointRequest] = None) -> TestWebhookEndpointResponse: + """Test webhook endpoint + + :param test_webhook_endpoint_request: + :type test_webhook_endpoint_request: TestWebhookEndpointRequest + :return: Returns the result object. + :rtype: TestWebhookEndpointResponse + """ + return self._messaging_api.test_webhook_endpoint(test_webhook_endpoint_request) + + def test_webhook_endpoint_with_http_info(self, test_webhook_endpoint_request: Optional[TestWebhookEndpointRequest] = None) -> ApiResponse: + """Test webhook endpoint + + :param test_webhook_endpoint_request: + :type test_webhook_endpoint_request: TestWebhookEndpointRequest + :return: Returns the result object. + :rtype: tuple(TestWebhookEndpointResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api.test_webhook_endpoint_with_http_info(test_webhook_endpoint_request) + + def unlink_rich_menu_id_from_user(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> None: + """Unlink rich menu from user + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.unlink_rich_menu_id_from_user(user_id) + + def unlink_rich_menu_id_from_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> ApiResponse: + """Unlink rich menu from user + + :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) + :type user_id: str + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.unlink_rich_menu_id_from_user_with_http_info(user_id) + + def unlink_rich_menu_id_from_users(self, rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest) -> None: + """Unlink rich menus from multiple users + + :param rich_menu_bulk_unlink_request: (required) + :type rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.unlink_rich_menu_id_from_users(rich_menu_bulk_unlink_request) + + def unlink_rich_menu_id_from_users_with_http_info(self, rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest) -> ApiResponse: + """Unlink rich menus from multiple users + + :param rich_menu_bulk_unlink_request: (required) + :type rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.unlink_rich_menu_id_from_users_with_http_info(rich_menu_bulk_unlink_request) + + def update_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID you want to update.')], update_rich_menu_alias_request: UpdateRichMenuAliasRequest) -> None: + """Update rich menu alias + + :param rich_menu_alias_id: The rich menu alias ID you want to update. (required) + :type rich_menu_alias_id: str + :param update_rich_menu_alias_request: (required) + :type update_rich_menu_alias_request: UpdateRichMenuAliasRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.update_rich_menu_alias(rich_menu_alias_id, update_rich_menu_alias_request) + + def update_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID you want to update.')], update_rich_menu_alias_request: UpdateRichMenuAliasRequest) -> ApiResponse: + """Update rich menu alias + + :param rich_menu_alias_id: The rich menu alias ID you want to update. (required) + :type rich_menu_alias_id: str + :param update_rich_menu_alias_request: (required) + :type update_rich_menu_alias_request: UpdateRichMenuAliasRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.update_rich_menu_alias_with_http_info(rich_menu_alias_id, update_rich_menu_alias_request) + + def validate_broadcast(self, validate_message_request: ValidateMessageRequest) -> None: + """Validate message objects of a broadcast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_broadcast(validate_message_request) + + def validate_broadcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + """Validate message objects of a broadcast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_broadcast_with_http_info(validate_message_request) + + def validate_multicast(self, validate_message_request: ValidateMessageRequest) -> None: + """Validate message objects of a multicast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_multicast(validate_message_request) + + def validate_multicast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + """Validate message objects of a multicast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_multicast_with_http_info(validate_message_request) + + def validate_narrowcast(self, validate_message_request: ValidateMessageRequest) -> None: + """Validate message objects of a narrowcast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_narrowcast(validate_message_request) + + def validate_narrowcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + """Validate message objects of a narrowcast message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_narrowcast_with_http_info(validate_message_request) + + def validate_push(self, validate_message_request: ValidateMessageRequest) -> None: + """Validate message objects of a push message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_push(validate_message_request) + + def validate_push_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + """Validate message objects of a push message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_push_with_http_info(validate_message_request) + + def validate_reply(self, validate_message_request: ValidateMessageRequest) -> None: + """Validate message objects of a reply message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_reply(validate_message_request) + + def validate_reply_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + """Validate message objects of a reply message + + :param validate_message_request: (required) + :type validate_message_request: ValidateMessageRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_reply_with_http_info(validate_message_request) + + def validate_rich_menu_batch_request(self, rich_menu_batch_request: RichMenuBatchRequest) -> None: + """Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. + + :param rich_menu_batch_request: (required) + :type rich_menu_batch_request: RichMenuBatchRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_rich_menu_batch_request(rich_menu_batch_request) + + def validate_rich_menu_batch_request_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> ApiResponse: + """Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. + + :param rich_menu_batch_request: (required) + :type rich_menu_batch_request: RichMenuBatchRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_rich_menu_batch_request_with_http_info(rich_menu_batch_request) + + def validate_rich_menu_object(self, rich_menu_request: RichMenuRequest) -> None: + """Validate rich menu object + + :param rich_menu_request: (required) + :type rich_menu_request: RichMenuRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_rich_menu_object(rich_menu_request) + + def validate_rich_menu_object_with_http_info(self, rich_menu_request: RichMenuRequest) -> ApiResponse: + """Validate rich menu object + + :param rich_menu_request: (required) + :type rich_menu_request: RichMenuRequest + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api.validate_rich_menu_object_with_http_info(rich_menu_request) + + def get_message_content(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> bytearray: + """Download image, video, and audio data sent from users. + + :param message_id: Message ID of video or audio (required) + :type message_id: str + :return: Returns the result object. + :rtype: bytearray + """ + return self._messaging_api_blob.get_message_content(message_id) + + def get_message_content_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> ApiResponse: + """Download image, video, and audio data sent from users. + + :param message_id: Message ID of video or audio (required) + :type message_id: str + :return: Returns the result object. + :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api_blob.get_message_content_with_http_info(message_id) + + def get_message_content_preview(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of image or video')]) -> bytearray: + """Get a preview image of the image or video + + :param message_id: Message ID of image or video (required) + :type message_id: str + :return: Returns the result object. + :rtype: bytearray + """ + return self._messaging_api_blob.get_message_content_preview(message_id) + + def get_message_content_preview_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of image or video')]) -> ApiResponse: + """Get a preview image of the image or video + + :param message_id: Message ID of image or video (required) + :type message_id: str + :return: Returns the result object. + :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api_blob.get_message_content_preview_with_http_info(message_id) + + def get_message_content_transcoding_by_message_id(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> GetMessageContentTranscodingResponse: + """Verify the preparation status of a video or audio for getting + + :param message_id: Message ID of video or audio (required) + :type message_id: str + :return: Returns the result object. + :rtype: GetMessageContentTranscodingResponse + """ + return self._messaging_api_blob.get_message_content_transcoding_by_message_id(message_id) + + def get_message_content_transcoding_by_message_id_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> ApiResponse: + """Verify the preparation status of a video or audio for getting + + :param message_id: Message ID of video or audio (required) + :type message_id: str + :return: Returns the result object. + :rtype: tuple(GetMessageContentTranscodingResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api_blob.get_message_content_transcoding_by_message_id_with_http_info(message_id) + + def get_rich_menu_image(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of the rich menu with the image to be downloaded')]) -> bytearray: + """Download rich menu image. + + :param rich_menu_id: ID of the rich menu with the image to be downloaded (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: bytearray + """ + return self._messaging_api_blob.get_rich_menu_image(rich_menu_id) + + def get_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of the rich menu with the image to be downloaded')]) -> ApiResponse: + """Download rich menu image. + + :param rich_menu_id: ID of the rich menu with the image to be downloaded (required) + :type rich_menu_id: str + :return: Returns the result object. + :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) + """ + return self._messaging_api_blob.get_rich_menu_image_with_http_info(rich_menu_id) + + def set_rich_menu_image(self, rich_menu_id: Annotated[StrictStr, Field(..., description='The ID of the rich menu to attach the image to')], body: Union[StrictBytes, StrictStr]) -> None: + """Upload rich menu image + + :param rich_menu_id: The ID of the rich menu to attach the image to (required) + :type rich_menu_id: str + :param body: (required) + :type body: bytearray + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api_blob.set_rich_menu_image(rich_menu_id, body) + + def set_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='The ID of the rich menu to attach the image to')], body: Union[StrictBytes, StrictStr]) -> ApiResponse: + """Upload rich menu image + + :param rich_menu_id: The ID of the rich menu to attach the image to (required) + :type rich_menu_id: str + :param body: (required) + :type body: bytearray + :return: Returns the result object. + :rtype: None + """ + return self._messaging_api_blob.set_rich_menu_image_with_http_info(rich_menu_id, body) + + def acquire_chat_control(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')], acquire_chat_control_request: Optional[AcquireChatControlRequest] = None) -> None: + """If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. + + :param chat_id: The `userId`, `roomId`, or `groupId` (required) + :type chat_id: str + :param acquire_chat_control_request: + :type acquire_chat_control_request: AcquireChatControlRequest + :return: Returns the result object. + :rtype: None + """ + return self._line_module.acquire_chat_control(chat_id, acquire_chat_control_request) + + def acquire_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')], acquire_chat_control_request: Optional[AcquireChatControlRequest] = None) -> ApiResponse: + """If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. + + :param chat_id: The `userId`, `roomId`, or `groupId` (required) + :type chat_id: str + :param acquire_chat_control_request: + :type acquire_chat_control_request: AcquireChatControlRequest + :return: Returns the result object. + :rtype: None + """ + return self._line_module.acquire_chat_control_with_http_info(chat_id, acquire_chat_control_request) + + def detach_module(self, detach_module_request: Optional[DetachModuleRequest] = None) -> None: + """The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. + + :param detach_module_request: + :type detach_module_request: DetachModuleRequest + :return: Returns the result object. + :rtype: None + """ + return self._line_module.detach_module(detach_module_request) + + def detach_module_with_http_info(self, detach_module_request: Optional[DetachModuleRequest] = None) -> ApiResponse: + """The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. + + :param detach_module_request: + :type detach_module_request: DetachModuleRequest + :return: Returns the result object. + :rtype: None + """ + return self._line_module.detach_module_with_http_info(detach_module_request) + + def get_modules(self, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. ")] = None, limit: Annotated[Optional[conint(strict=True, le=100)], Field(description='Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 ')] = None) -> GetModulesResponse: + """Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. + + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. + :type start: str + :param limit: Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 + :type limit: int + :return: Returns the result object. + :rtype: GetModulesResponse + """ + return self._line_module.get_modules(start, limit) + + def get_modules_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. ")] = None, limit: Annotated[Optional[conint(strict=True, le=100)], Field(description='Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 ')] = None) -> ApiResponse: + """Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. + + :param start: Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. + :type start: str + :param limit: Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 + :type limit: int + :return: Returns the result object. + :rtype: tuple(GetModulesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._line_module.get_modules_with_http_info(start, limit) + + def release_chat_control(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')]) -> None: + """To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. + + :param chat_id: The `userId`, `roomId`, or `groupId` (required) + :type chat_id: str + :return: Returns the result object. + :rtype: None + """ + return self._line_module.release_chat_control(chat_id) + + def release_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')]) -> ApiResponse: + """To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. + + :param chat_id: The `userId`, `roomId`, or `groupId` (required) + :type chat_id: str + :return: Returns the result object. + :rtype: None + """ + return self._line_module.release_chat_control_with_http_info(chat_id) + + def attach_module(self, grant_type: Annotated[StrictStr, Field(..., description='authorization_code')], code: Annotated[StrictStr, Field(..., description='Authorization code received from the LINE Platform.')], redirect_uri: Annotated[StrictStr, Field(..., description='Specify the redirect_uri specified in the URL for authentication and authorization.')], code_verifier: Annotated[Optional[StrictStr], Field(description='Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks.')] = None, client_id: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. ')] = None, client_secret: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. ')] = None, region: Annotated[Optional[StrictStr], Field(description='If you specified a value for region in the URL for authentication and authorization, specify the same value. ')] = None, basic_search_id: Annotated[Optional[StrictStr], Field(description='If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value.')] = None, scope: Annotated[Optional[StrictStr], Field(description='If you specified a value for scope in the URL for authentication and authorization, specify the same value.')] = None, brand_type: Annotated[Optional[StrictStr], Field(description='If you specified a value for brand_type in the URL for authentication and authorization, specify the same value.')] = None) -> AttachModuleResponse: + """Attach by operation of the module channel provider + + :param grant_type: authorization_code (required) + :type grant_type: str + :param code: Authorization code received from the LINE Platform. (required) + :type code: str + :param redirect_uri: Specify the redirect_uri specified in the URL for authentication and authorization. (required) + :type redirect_uri: str + :param code_verifier: Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks. + :type code_verifier: str + :param client_id: Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. + :type client_id: str + :param client_secret: Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. + :type client_secret: str + :param region: If you specified a value for region in the URL for authentication and authorization, specify the same value. + :type region: str + :param basic_search_id: If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value. + :type basic_search_id: str + :param scope: If you specified a value for scope in the URL for authentication and authorization, specify the same value. + :type scope: str + :param brand_type: If you specified a value for brand_type in the URL for authentication and authorization, specify the same value. + :type brand_type: str + :return: Returns the result object. + :rtype: AttachModuleResponse + """ + return self._line_module_attach.attach_module(grant_type, code, redirect_uri, code_verifier, client_id, client_secret, region, basic_search_id, scope, brand_type) + + def attach_module_with_http_info(self, grant_type: Annotated[StrictStr, Field(..., description='authorization_code')], code: Annotated[StrictStr, Field(..., description='Authorization code received from the LINE Platform.')], redirect_uri: Annotated[StrictStr, Field(..., description='Specify the redirect_uri specified in the URL for authentication and authorization.')], code_verifier: Annotated[Optional[StrictStr], Field(description='Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks.')] = None, client_id: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. ')] = None, client_secret: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. ')] = None, region: Annotated[Optional[StrictStr], Field(description='If you specified a value for region in the URL for authentication and authorization, specify the same value. ')] = None, basic_search_id: Annotated[Optional[StrictStr], Field(description='If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value.')] = None, scope: Annotated[Optional[StrictStr], Field(description='If you specified a value for scope in the URL for authentication and authorization, specify the same value.')] = None, brand_type: Annotated[Optional[StrictStr], Field(description='If you specified a value for brand_type in the URL for authentication and authorization, specify the same value.')] = None) -> ApiResponse: + """Attach by operation of the module channel provider + + :param grant_type: authorization_code (required) + :type grant_type: str + :param code: Authorization code received from the LINE Platform. (required) + :type code: str + :param redirect_uri: Specify the redirect_uri specified in the URL for authentication and authorization. (required) + :type redirect_uri: str + :param code_verifier: Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks. + :type code_verifier: str + :param client_id: Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. + :type client_id: str + :param client_secret: Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. + :type client_secret: str + :param region: If you specified a value for region in the URL for authentication and authorization, specify the same value. + :type region: str + :param basic_search_id: If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value. + :type basic_search_id: str + :param scope: If you specified a value for scope in the URL for authentication and authorization, specify the same value. + :type scope: str + :param brand_type: If you specified a value for brand_type in the URL for authentication and authorization, specify the same value. + :type brand_type: str + :return: Returns the result object. + :rtype: tuple(AttachModuleResponse, status_code(int), headers(HTTPHeaderDict)) + """ + return self._line_module_attach.attach_module_with_http_info(grant_type, code, redirect_uri, code_verifier, client_id, client_secret, region, basic_search_id, scope, brand_type) + + def mission_sticker_v3(self, mission_sticker_request: MissionStickerRequest) -> None: + """Sends a mission sticker. + + :param mission_sticker_request: (required) + :type mission_sticker_request: MissionStickerRequest + :return: Returns the result object. + :rtype: None + """ + return self._shop.mission_sticker_v3(mission_sticker_request) + + def mission_sticker_v3_with_http_info(self, mission_sticker_request: MissionStickerRequest) -> ApiResponse: + """Sends a mission sticker. + + :param mission_sticker_request: (required) + :type mission_sticker_request: MissionStickerRequest + :return: Returns the result object. + :rtype: None + """ + return self._shop.mission_sticker_v3_with_http_info(mission_sticker_request) + diff --git a/linebot/v3/messaging/api/async_messaging_api.py b/linebot/v3/messaging/api/async_messaging_api.py index 3c1121ab2..6d31ab772 100644 --- a/linebot/v3/messaging/api/async_messaging_api.py +++ b/linebot/v3/messaging/api/async_messaging_api.py @@ -89,6 +89,9 @@ class AsyncMessagingApi(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/messaging/api/async_messaging_api_blob.py b/linebot/v3/messaging/api/async_messaging_api_blob.py index e2b6f20db..9a93c8756 100644 --- a/linebot/v3/messaging/api/async_messaging_api_blob.py +++ b/linebot/v3/messaging/api/async_messaging_api_blob.py @@ -39,6 +39,9 @@ class AsyncMessagingApiBlob(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/messaging/api/messaging_api.py b/linebot/v3/messaging/api/messaging_api.py index a0df4448e..c592bbcad 100644 --- a/linebot/v3/messaging/api/messaging_api.py +++ b/linebot/v3/messaging/api/messaging_api.py @@ -87,6 +87,9 @@ class MessagingApi(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/messaging/api/messaging_api_blob.py b/linebot/v3/messaging/api/messaging_api_blob.py index 0e2adbb2a..a84f2a1c9 100644 --- a/linebot/v3/messaging/api/messaging_api_blob.py +++ b/linebot/v3/messaging/api/messaging_api_blob.py @@ -37,6 +37,9 @@ class MessagingApiBlob(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/module/api/async_line_module.py b/linebot/v3/module/api/async_line_module.py index 4f001c431..88505d5ab 100644 --- a/linebot/v3/module/api/async_line_module.py +++ b/linebot/v3/module/api/async_line_module.py @@ -41,6 +41,9 @@ class AsyncLineModule(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/module/api/line_module.py b/linebot/v3/module/api/line_module.py index 6df51570f..9d08d5dce 100644 --- a/linebot/v3/module/api/line_module.py +++ b/linebot/v3/module/api/line_module.py @@ -39,6 +39,9 @@ class LineModule(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/moduleattach/api/async_line_module_attach.py b/linebot/v3/moduleattach/api/async_line_module_attach.py index 89f17f3c5..d1b5bca7c 100644 --- a/linebot/v3/moduleattach/api/async_line_module_attach.py +++ b/linebot/v3/moduleattach/api/async_line_module_attach.py @@ -39,6 +39,9 @@ class AsyncLineModuleAttach(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/moduleattach/api/line_module_attach.py b/linebot/v3/moduleattach/api/line_module_attach.py index db4611db9..1f2544c55 100644 --- a/linebot/v3/moduleattach/api/line_module_attach.py +++ b/linebot/v3/moduleattach/api/line_module_attach.py @@ -37,6 +37,9 @@ class LineModuleAttach(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/oauth/api/async_channel_access_token.py b/linebot/v3/oauth/api/async_channel_access_token.py index ab5e6d07e..204a394fe 100644 --- a/linebot/v3/oauth/api/async_channel_access_token.py +++ b/linebot/v3/oauth/api/async_channel_access_token.py @@ -41,6 +41,9 @@ class AsyncChannelAccessToken(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/oauth/api/channel_access_token.py b/linebot/v3/oauth/api/channel_access_token.py index 35c4a9f89..aabb44cb9 100644 --- a/linebot/v3/oauth/api/channel_access_token.py +++ b/linebot/v3/oauth/api/channel_access_token.py @@ -39,6 +39,9 @@ class ChannelAccessToken(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/shop/api/async_shop.py b/linebot/v3/shop/api/async_shop.py index e3e15453e..a9b7ea8ec 100644 --- a/linebot/v3/shop/api/async_shop.py +++ b/linebot/v3/shop/api/async_shop.py @@ -35,6 +35,9 @@ class AsyncShop(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/shop/api/shop.py b/linebot/v3/shop/api/shop.py index 433404d66..a9802e0c6 100644 --- a/linebot/v3/shop/api/shop.py +++ b/linebot/v3/shop/api/shop.py @@ -33,6 +33,9 @@ class Shop(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/webhooks/api/async_dummy.py b/linebot/v3/webhooks/api/async_dummy.py index b62e2ebb7..ae94a1b8d 100644 --- a/linebot/v3/webhooks/api/async_dummy.py +++ b/linebot/v3/webhooks/api/async_dummy.py @@ -35,6 +35,9 @@ class AsyncDummy(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.AsyncLineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/linebot/v3/webhooks/api/dummy.py b/linebot/v3/webhooks/api/dummy.py index b6b7c8ea6..e096f2f86 100644 --- a/linebot/v3/webhooks/api/dummy.py +++ b/linebot/v3/webhooks/api/dummy.py @@ -33,6 +33,9 @@ class Dummy(object): Ref: https://openapi-generator.tech Do not edit the class manually. + + Tip: Use :class:`linebot.v3.LineBotClient` to call every + LINE API method through a single instance. """ def __init__(self, api_client=None): diff --git a/tests/v3/test_async_line_bot_client.py b/tests/v3/test_async_line_bot_client.py new file mode 100644 index 000000000..8c00ea4c7 --- /dev/null +++ b/tests/v3/test_async_line_bot_client.py @@ -0,0 +1,524 @@ +# -*- coding: utf-8 -*- + +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +"""Tests for AsyncLineBotClient. + +Verifies that AsyncLineBotClient correctly delegates to each underlying +async API client and sends proper HTTP requests. +""" + +import json +import unittest + +from pytest_httpserver import HTTPServer + +from linebot.v3 import AsyncLineBotClient +from linebot.v3.messaging import ( + PushMessageRequest, + ReplyMessageRequest, + TextMessage, +) +from linebot.v3.messaging.exceptions import ApiException as MessagingApiException +from linebot.v3.shop.models import MissionStickerRequest + + +class TestAsyncLineBotClientMessagingApi(unittest.IsolatedAsyncioTestCase): + """Test MessagingApi delegation through AsyncLineBotClient.""" + + async def test_push_message(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/push", + method="POST", + ).respond_with_json( + {"sentMessages": [{"id": "msg001", "quoteToken": "qt001"}]}, + status=200 + ) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + req = PushMessageRequest( + to="U123", + messages=[TextMessage(text="hello")] + ) + await client.push_message(push_message_request=req) + + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "POST") + self.assertEqual(request.path, "/v2/bot/message/push") + body = json.loads(request.data.decode("utf-8")) + self.assertEqual(body["to"], "U123") + self.assertEqual(body["messages"][0]["type"], "text") + self.assertEqual(body["messages"][0]["text"], "hello") + + async def test_reply_message(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/reply", + method="POST", + ).respond_with_json( + {"sentMessages": [{"id": "msg002", "quoteToken": "qt002"}]}, + status=200 + ) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + req = ReplyMessageRequest( + replyToken="reply-token-xxx", + messages=[TextMessage(text="hi")] + ) + await client.reply_message(reply_message_request=req) + + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "POST") + body = json.loads(request.data.decode("utf-8")) + self.assertEqual(body["replyToken"], "reply-token-xxx") + self.assertEqual(body["messages"][0]["text"], "hi") + + async def test_get_followers_with_query_params(self): + expected_response = { + "userIds": ["U4af4980629", "U0c229f96c4"], + "next": "yANU9IA..." + } + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/followers/ids", + method="GET", + ).respond_with_json(expected_response, status=200) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = await client.get_followers(start="xBQU2IB", limit=100) + + self.assertEqual(response.user_ids, expected_response["userIds"]) + self.assertEqual(response.next, expected_response["next"]) + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "GET") + self.assertIn(b"start=xBQU2IB", request.query_string) + self.assertIn(b"limit=100", request.query_string) + + async def test_get_followers_without_start(self): + expected_response = {"userIds": ["U4af4980629"]} + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/followers/ids", + method="GET", + ).respond_with_json(expected_response, status=200) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = await client.get_followers() + + self.assertEqual(response.user_ids, ["U4af4980629"]) + request, _ = httpserver.log[0] + self.assertEqual(request.query_string, b"") + + async def test_get_profile(self): + expected_response = { + "displayName": "Test User", + "userId": "U4af4980629", + "pictureUrl": "https://example.com/pic.png", + "statusMessage": "Hello" + } + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/profile/U4af4980629", + method="GET", + ).respond_with_json(expected_response, status=200) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = await client.get_profile(user_id="U4af4980629") + + self.assertEqual(response.display_name, "Test User") + self.assertEqual(response.user_id, "U4af4980629") + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "GET") + self.assertEqual(request.path, "/v2/bot/profile/U4af4980629") + + +class TestAsyncLineBotClientInsight(unittest.IsolatedAsyncioTestCase): + """Test Insight API delegation through AsyncLineBotClient.""" + + async def test_get_number_of_followers(self): + expected_response = { + "status": "ready", + "followers": 123, + "targetedReaches": 100, + "blocks": 5 + } + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/insight/followers", + method="GET", + ).respond_with_json(expected_response, status=200) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = await client.get_number_of_followers(var_date="20240101") + + self.assertEqual(response.followers, 123) + self.assertEqual(response.targeted_reaches, 100) + self.assertEqual(response.blocks, 5) + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertIn(b"date=20240101", request.query_string) + + +class TestAsyncLineBotClientLiff(unittest.IsolatedAsyncioTestCase): + """Test LIFF API delegation through AsyncLineBotClient.""" + + async def test_get_all_liff_apps(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/liff/v1/apps", + method="GET", + ).respond_with_json({"apps": []}, status=200) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = await client.get_all_liff_apps() + + self.assertEqual(response.apps, []) + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "GET") + self.assertEqual(request.path, "/liff/v1/apps") + + +class TestAsyncLineBotClientAudience(unittest.IsolatedAsyncioTestCase): + """Test ManageAudience API delegation through AsyncLineBotClient.""" + + async def test_delete_audience_group(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/audienceGroup/12345", + method="DELETE", + ).respond_with_json({}, status=200) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + await client.delete_audience_group(audience_group_id=12345) + + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "DELETE") + self.assertEqual(request.path, "/v2/bot/audienceGroup/12345") + + +class TestAsyncLineBotClientModule(unittest.IsolatedAsyncioTestCase): + """Test LineModule API delegation through AsyncLineBotClient.""" + + async def test_get_modules(self): + expected_response = { + "bots": [{"userId": "U111", "basicId": "@bot", "displayName": "TestBot"}], + "next": "next-token" + } + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/list", + method="GET", + ).respond_with_json(expected_response, status=200) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + await client.get_modules(start="start-token", limit=20) + + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "GET") + self.assertIn(b"start=start-token", request.query_string) + self.assertIn(b"limit=20", request.query_string) + + +class TestAsyncLineBotClientModuleAttach(unittest.IsolatedAsyncioTestCase): + """Test LineModuleAttach API delegation through AsyncLineBotClient.""" + + async def test_attach_module(self): + expected_response = { + "bot_id": "U1234567890", + "scopes": ["message:send"] + } + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/module/auth/v1/token", + method="POST", + ).respond_with_json(expected_response, status=200) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = await client.attach_module( + grant_type="authorization_code", + code="auth_code", + redirect_uri="https://example.com/callback" + ) + + self.assertEqual(response.bot_id, "U1234567890") + self.assertEqual(response.scopes, ["message:send"]) + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "POST") + self.assertEqual(request.path, "/module/auth/v1/token") + + +class TestAsyncLineBotClientShop(unittest.IsolatedAsyncioTestCase): + """Test Shop API delegation through AsyncLineBotClient.""" + + async def test_mission_sticker_v3(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/shop/v3/mission", + method="POST", + ).respond_with_json({}, status=200) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + req = MissionStickerRequest( + to="U4af4980629", + productId="prod_id", + productType="prod_type", + sendPresentMessage=False + ) + await client.mission_sticker_v3(mission_sticker_request=req) + + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "POST") + self.assertEqual(request.path, "/shop/v3/mission") + body = json.loads(request.data.decode("utf-8")) + self.assertEqual(body["to"], "U4af4980629") + self.assertEqual(body["productId"], "prod_id") + self.assertEqual(body["productType"], "prod_type") + self.assertEqual(body["sendPresentMessage"], False) + + +class TestAsyncLineBotClientAuthorizationHeader(unittest.IsolatedAsyncioTestCase): + """Test that the Authorization header is correctly propagated to all domains.""" + + def _assert_bearer_token(self, httpserver, expected_token): + request, _ = httpserver.log[-1] + self.assertEqual( + request.headers.get("Authorization"), f"Bearer {expected_token}" + ) + + async def test_messaging_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/profile/U123", + method="GET", + ).respond_with_json( + {"displayName": "T", "userId": "U123"}, status=200 + ) + + async with AsyncLineBotClient( + channel_access_token="my-secret-token", + host=httpserver.url_for("/") + ) as client: + await client.get_profile(user_id="U123") + + self._assert_bearer_token(httpserver, "my-secret-token") + + async def test_insight_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/insight/followers", + method="GET", + ).respond_with_json( + {"status": "ready", "followers": 0, "targetedReaches": 0, "blocks": 0}, + status=200 + ) + + async with AsyncLineBotClient( + channel_access_token="insight-token", + host=httpserver.url_for("/") + ) as client: + await client.get_number_of_followers(var_date="20240101") + + self._assert_bearer_token(httpserver, "insight-token") + + async def test_audience_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/audienceGroup/99999", + method="DELETE", + ).respond_with_json({}, status=200) + + async with AsyncLineBotClient( + channel_access_token="audience-token", + host=httpserver.url_for("/") + ) as client: + await client.delete_audience_group(audience_group_id=99999) + + self._assert_bearer_token(httpserver, "audience-token") + + async def test_liff_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/liff/v1/apps", + method="GET", + ).respond_with_json({"apps": []}, status=200) + + async with AsyncLineBotClient( + channel_access_token="liff-token", + host=httpserver.url_for("/") + ) as client: + await client.get_all_liff_apps() + + self._assert_bearer_token(httpserver, "liff-token") + + async def test_module_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/list", + method="GET", + ).respond_with_json({"bots": []}, status=200) + + async with AsyncLineBotClient( + channel_access_token="module-token", + host=httpserver.url_for("/") + ) as client: + await client.get_modules() + + self._assert_bearer_token(httpserver, "module-token") + + async def test_shop_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/shop/v3/mission", + method="POST", + ).respond_with_json({}, status=200) + + async with AsyncLineBotClient( + channel_access_token="shop-token", + host=httpserver.url_for("/") + ) as client: + req = MissionStickerRequest( + to="U123", + productId="p", + productType="t", + sendPresentMessage=False + ) + await client.mission_sticker_v3(mission_sticker_request=req) + + self._assert_bearer_token(httpserver, "shop-token") + + +class TestAsyncLineBotClientWithHttpInfo(unittest.IsolatedAsyncioTestCase): + """Test _with_http_info methods return ApiResponse with status/headers/data.""" + + async def test_push_message_with_http_info(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/push", + method="POST", + ).respond_with_json( + {"sentMessages": [{"id": "msg001", "quoteToken": "qt001"}]}, + status=200 + ) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + req = PushMessageRequest( + to="U123", + messages=[TextMessage(text="hello")] + ) + api_response = await client.push_message_with_http_info( + push_message_request=req + ) + + self.assertEqual(api_response.status_code, 200) + self.assertIsNotNone(api_response.data) + self.assertEqual(api_response.data.sent_messages[0].id, "msg001") + + +class TestAsyncLineBotClientBlobApi(unittest.IsolatedAsyncioTestCase): + """Test MessagingApiBlob delegation through AsyncLineBotClient.""" + + async def test_get_message_content(self): + content = b"fake-binary-content" + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/msg123/content", + method="GET", + ).respond_with_data(content, status=200, content_type="image/jpeg") + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + result = await client.get_message_content(message_id="msg123") + + self.assertEqual(result, content) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "GET") + self.assertEqual(request.path, "/v2/bot/message/msg123/content") + + +class TestAsyncLineBotClientErrors(unittest.IsolatedAsyncioTestCase): + """Test error handling through AsyncLineBotClient.""" + + async def test_api_error_from_messaging(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/push", + method="POST", + ).respond_with_json( + {"message": "Invalid request"}, + status=400 + ) + + async with AsyncLineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + req = PushMessageRequest( + to="U123", + messages=[TextMessage(text="hello")] + ) + with self.assertRaises(MessagingApiException) as ctx: + await client.push_message(push_message_request=req) + + self.assertEqual(ctx.exception.status, 400) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v3/test_line_bot_client.py b/tests/v3/test_line_bot_client.py new file mode 100644 index 000000000..0e0c13bfc --- /dev/null +++ b/tests/v3/test_line_bot_client.py @@ -0,0 +1,647 @@ +# -*- coding: utf-8 -*- + +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +"""Tests for LineBotClient. + +Verifies that LineBotClient correctly delegates to each underlying API client +and sends proper HTTP requests. Uses pytest_httpserver for HTTP mocking. + +Reference: line-bot-sdk-nodejs/test/line-bot-client.spec.ts +""" + +import json +import unittest + +from pytest_httpserver import HTTPServer + +from linebot.v3 import LineBotClient +from linebot.v3.messaging import ( + PushMessageRequest, + ReplyMessageRequest, + TextMessage, +) +from linebot.v3.messaging.exceptions import ApiException as MessagingApiException +from linebot.v3.shop.models import MissionStickerRequest + + +class TestLineBotClientInit(unittest.TestCase): + """Test initialization and context manager.""" + + def test_init(self): + client = LineBotClient(channel_access_token="test-token") + self.assertIsNotNone(client._manage_audience) + self.assertIsNotNone(client._manage_audience_blob) + self.assertIsNotNone(client._insight) + self.assertIsNotNone(client._liff) + self.assertIsNotNone(client._messaging_api) + self.assertIsNotNone(client._messaging_api_blob) + self.assertIsNotNone(client._line_module) + self.assertIsNotNone(client._line_module_attach) + self.assertIsNotNone(client._shop) + client.close() + + def test_context_manager(self): + with LineBotClient(channel_access_token="test-token") as client: + self.assertIsNotNone(client) + + def test_kwargs_forwarded_to_configuration(self): + """Verify that extra kwargs (e.g., host) are forwarded to Configuration.""" + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/profile/U123", + method="GET", + ).respond_with_json( + {"displayName": "T", "userId": "U123"}, status=200 + ) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = client.get_profile(user_id="U123") + + self.assertEqual(response.user_id, "U123") + + +class TestLineBotClientMessagingApi(unittest.TestCase): + """Test MessagingApi delegation through LineBotClient.""" + + def test_push_message(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/push", + method="POST", + ).respond_with_json( + {"sentMessages": [{"id": "msg001", "quoteToken": "qt001"}]}, + status=200 + ) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + req = PushMessageRequest( + to="U123", + messages=[TextMessage(text="hello")] + ) + client.push_message(push_message_request=req) + + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "POST") + self.assertEqual(request.path, "/v2/bot/message/push") + body = json.loads(request.data.decode("utf-8")) + self.assertEqual(body["to"], "U123") + self.assertEqual(body["messages"][0]["type"], "text") + self.assertEqual(body["messages"][0]["text"], "hello") + + def test_reply_message(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/reply", + method="POST", + ).respond_with_json( + {"sentMessages": [{"id": "msg002", "quoteToken": "qt002"}]}, + status=200 + ) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + req = ReplyMessageRequest( + replyToken="reply-token-xxx", + messages=[TextMessage(text="hi")] + ) + client.reply_message(reply_message_request=req) + + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "POST") + body = json.loads(request.data.decode("utf-8")) + self.assertEqual(body["replyToken"], "reply-token-xxx") + self.assertEqual(body["messages"][0]["text"], "hi") + + def test_get_followers_with_query_params(self): + expected_response = { + "userIds": ["U4af4980629", "U0c229f96c4"], + "next": "yANU9IA..." + } + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/followers/ids", + method="GET", + ).respond_with_json(expected_response, status=200) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = client.get_followers(start="xBQU2IB", limit=100) + + self.assertEqual(response.user_ids, expected_response["userIds"]) + self.assertEqual(response.next, expected_response["next"]) + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "GET") + self.assertIn(b"start=xBQU2IB", request.query_string) + self.assertIn(b"limit=100", request.query_string) + + def test_get_followers_without_start(self): + expected_response = {"userIds": ["U4af4980629"]} + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/followers/ids", + method="GET", + ).respond_with_json(expected_response, status=200) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = client.get_followers() + + self.assertEqual(response.user_ids, ["U4af4980629"]) + request, _ = httpserver.log[0] + self.assertEqual(request.query_string, b"") + + def test_get_profile(self): + expected_response = { + "displayName": "Test User", + "userId": "U4af4980629", + "pictureUrl": "https://example.com/pic.png", + "statusMessage": "Hello" + } + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/profile/U4af4980629", + method="GET", + ).respond_with_json(expected_response, status=200) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = client.get_profile(user_id="U4af4980629") + + self.assertEqual(response.display_name, "Test User") + self.assertEqual(response.user_id, "U4af4980629") + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "GET") + self.assertEqual(request.path, "/v2/bot/profile/U4af4980629") + + +class TestLineBotClientInsight(unittest.TestCase): + """Test Insight API delegation through LineBotClient.""" + + def test_get_number_of_followers(self): + expected_response = { + "status": "ready", + "followers": 123, + "targetedReaches": 100, + "blocks": 5 + } + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/insight/followers", + method="GET", + ).respond_with_json(expected_response, status=200) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = client.get_number_of_followers(var_date="20240101") + + self.assertEqual(response.followers, 123) + self.assertEqual(response.targeted_reaches, 100) + self.assertEqual(response.blocks, 5) + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertIn(b"date=20240101", request.query_string) + + +class TestLineBotClientLiff(unittest.TestCase): + """Test LIFF API delegation through LineBotClient.""" + + def test_get_all_liff_apps(self): + expected_response = {"apps": []} + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/liff/v1/apps", + method="GET", + ).respond_with_json(expected_response, status=200) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = client.get_all_liff_apps() + + self.assertEqual(response.apps, []) + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "GET") + self.assertEqual(request.path, "/liff/v1/apps") + + +class TestLineBotClientAudience(unittest.TestCase): + """Test ManageAudience API delegation through LineBotClient.""" + + def test_delete_audience_group(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/audienceGroup/12345", + method="DELETE", + ).respond_with_json({}, status=200) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + client.delete_audience_group(audience_group_id=12345) + + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "DELETE") + self.assertEqual(request.path, "/v2/bot/audienceGroup/12345") + + +class TestLineBotClientModule(unittest.TestCase): + """Test LineModule API delegation through LineBotClient.""" + + def test_get_modules_with_query_params(self): + expected_response = { + "bots": [{"userId": "U111", "basicId": "@bot", "displayName": "TestBot"}], + "next": "next-token" + } + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/list", + method="GET", + ).respond_with_json(expected_response, status=200) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + client.get_modules(start="start-token", limit=20) + + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "GET") + self.assertIn(b"start=start-token", request.query_string) + self.assertIn(b"limit=20", request.query_string) + + def test_get_modules_without_start(self): + expected_response = {"bots": []} + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/list", + method="GET", + ).respond_with_json(expected_response, status=200) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + client.get_modules() + + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertNotIn(b"start=", request.query_string) + + +class TestLineBotClientModuleAttach(unittest.TestCase): + """Test LineModuleAttach API delegation through LineBotClient.""" + + def test_attach_module(self): + expected_response = { + "bot_id": "U1234567890", + "scopes": ["message:send"] + } + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/module/auth/v1/token", + method="POST", + ).respond_with_json(expected_response, status=200) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + response = client.attach_module( + grant_type="authorization_code", + code="auth_code", + redirect_uri="https://example.com/callback" + ) + + self.assertEqual(response.bot_id, "U1234567890") + self.assertEqual(response.scopes, ["message:send"]) + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "POST") + self.assertEqual(request.path, "/module/auth/v1/token") + + +class TestLineBotClientShop(unittest.TestCase): + """Test Shop API delegation through LineBotClient.""" + + def test_mission_sticker_v3(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/shop/v3/mission", + method="POST", + ).respond_with_json({}, status=200) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + req = MissionStickerRequest( + to="U4af4980629", + productId="prod_id", + productType="prod_type", + sendPresentMessage=False + ) + client.mission_sticker_v3(mission_sticker_request=req) + + self.assertEqual(len(httpserver.log), 1) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "POST") + self.assertEqual(request.path, "/shop/v3/mission") + body = json.loads(request.data.decode("utf-8")) + self.assertEqual(body["to"], "U4af4980629") + self.assertEqual(body["productId"], "prod_id") + self.assertEqual(body["productType"], "prod_type") + self.assertEqual(body["sendPresentMessage"], False) + + +class TestLineBotClientAuthorizationHeader(unittest.TestCase): + """Test that the Authorization header is correctly propagated to all domains.""" + + def _assert_bearer_token(self, httpserver, expected_token): + request, _ = httpserver.log[-1] + self.assertEqual( + request.headers.get("Authorization"), f"Bearer {expected_token}" + ) + + def test_messaging_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/profile/U123", + method="GET", + ).respond_with_json( + {"displayName": "T", "userId": "U123"}, status=200 + ) + + with LineBotClient( + channel_access_token="my-secret-token", + host=httpserver.url_for("/") + ) as client: + client.get_profile(user_id="U123") + + self._assert_bearer_token(httpserver, "my-secret-token") + + def test_insight_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/insight/followers", + method="GET", + ).respond_with_json( + {"status": "ready", "followers": 0, "targetedReaches": 0, "blocks": 0}, + status=200 + ) + + with LineBotClient( + channel_access_token="insight-token", + host=httpserver.url_for("/") + ) as client: + client.get_number_of_followers(var_date="20240101") + + self._assert_bearer_token(httpserver, "insight-token") + + def test_audience_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/audienceGroup/99999", + method="DELETE", + ).respond_with_json({}, status=200) + + with LineBotClient( + channel_access_token="audience-token", + host=httpserver.url_for("/") + ) as client: + client.delete_audience_group(audience_group_id=99999) + + self._assert_bearer_token(httpserver, "audience-token") + + def test_liff_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/liff/v1/apps", + method="GET", + ).respond_with_json({"apps": []}, status=200) + + with LineBotClient( + channel_access_token="liff-token", + host=httpserver.url_for("/") + ) as client: + client.get_all_liff_apps() + + self._assert_bearer_token(httpserver, "liff-token") + + def test_module_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/list", + method="GET", + ).respond_with_json({"bots": []}, status=200) + + with LineBotClient( + channel_access_token="module-token", + host=httpserver.url_for("/") + ) as client: + client.get_modules() + + self._assert_bearer_token(httpserver, "module-token") + + def test_shop_api_sends_bearer_token(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/shop/v3/mission", + method="POST", + ).respond_with_json({}, status=200) + + with LineBotClient( + channel_access_token="shop-token", + host=httpserver.url_for("/") + ) as client: + req = MissionStickerRequest( + to="U123", + productId="p", + productType="t", + sendPresentMessage=False + ) + client.mission_sticker_v3(mission_sticker_request=req) + + self._assert_bearer_token(httpserver, "shop-token") + + +class TestLineBotClientWithHttpInfo(unittest.TestCase): + """Test _with_http_info methods return ApiResponse with status/headers/data.""" + + def test_push_message_with_http_info(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/push", + method="POST", + ).respond_with_json( + {"sentMessages": [{"id": "msg001", "quoteToken": "qt001"}]}, + status=200 + ) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + req = PushMessageRequest( + to="U123", + messages=[TextMessage(text="hello")] + ) + api_response = client.push_message_with_http_info( + push_message_request=req + ) + + self.assertEqual(api_response.status_code, 200) + self.assertIsNotNone(api_response.data) + self.assertEqual(api_response.data.sent_messages[0].id, "msg001") + + def test_reply_message_with_http_info(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/reply", + method="POST", + ).respond_with_json( + {"sentMessages": [{"id": "msg002", "quoteToken": "qt002"}]}, + status=200 + ) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + req = ReplyMessageRequest( + replyToken="reply-token-xxx", + messages=[TextMessage(text="hi")] + ) + api_response = client.reply_message_with_http_info( + reply_message_request=req + ) + + self.assertEqual(api_response.status_code, 200) + self.assertIsNotNone(api_response.headers) + + def test_get_profile_with_http_info(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/profile/U123", + method="GET", + ).respond_with_json( + {"displayName": "Test", "userId": "U123"}, status=200 + ) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + api_response = client.get_profile_with_http_info(user_id="U123") + + self.assertEqual(api_response.status_code, 200) + self.assertEqual(api_response.data.user_id, "U123") + self.assertEqual(api_response.data.display_name, "Test") + + +class TestLineBotClientBlobApi(unittest.TestCase): + """Test MessagingApiBlob delegation through LineBotClient.""" + + def test_get_message_content(self): + content = b"fake-binary-content" + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/msg123/content", + method="GET", + ).respond_with_data(content, status=200, content_type="image/jpeg") + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + result = client.get_message_content(message_id="msg123") + + self.assertEqual(result, content) + request, _ = httpserver.log[0] + self.assertEqual(request.method, "GET") + self.assertEqual(request.path, "/v2/bot/message/msg123/content") + + def test_get_message_content_with_http_info(self): + content = b"fake-binary-content" + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/msg456/content", + method="GET", + ).respond_with_data(content, status=200, content_type="video/mp4") + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + api_response = client.get_message_content_with_http_info( + message_id="msg456" + ) + + self.assertEqual(api_response.status_code, 200) + self.assertIsNotNone(api_response.data) + + +class TestLineBotClientErrors(unittest.TestCase): + """Test error handling through LineBotClient.""" + + def test_api_error_from_messaging(self): + with HTTPServer() as httpserver: + httpserver.expect_request( + uri="/v2/bot/message/push", + method="POST", + ).respond_with_json( + {"message": "Invalid request"}, + status=400 + ) + + with LineBotClient( + channel_access_token="test-token", + host=httpserver.url_for("/") + ) as client: + req = PushMessageRequest( + to="U123", + messages=[TextMessage(text="hello")] + ) + with self.assertRaises(MessagingApiException) as ctx: + client.push_message(push_message_request=req) + + self.assertEqual(ctx.exception.status, 400) + + +if __name__ == '__main__': + unittest.main() diff --git a/tools/generate_unified_client.py b/tools/generate_unified_client.py new file mode 100644 index 000000000..12d0ff954 --- /dev/null +++ b/tools/generate_unified_client.py @@ -0,0 +1,850 @@ +"""Generate unified LineBotClient and AsyncLineBotClient classes. + +This script parses all individual API client classes using the ast module +and generates unified client classes that delegate to the underlying clients. + +Client definitions are **auto-discovered** from the generated code so that +adding a new API module requires zero changes to this script. + +Run after generate-code.py: + python3 tools/generate_unified_client.py +""" + +import ast +import os +import re +import sys +from dataclasses import dataclass + + +# Modules to exclude from the unified client. +# - oauth: token management is done before client creation +# - webhooks: models-only module, no real API client +EXCLUDE_MODULES = frozenset({"oauth", "webhooks"}) + + +# --------------------------------------------------------------------------- +# Data Classes +# --------------------------------------------------------------------------- + +@dataclass +class ClientDef: + """Definition of a single API client to include in the unified client.""" + module: str # e.g. "messaging" + sync_file: str # path relative to repo root + sync_class: str # e.g. "MessagingApi" + async_file: str + async_class: str # e.g. "AsyncMessagingApi" + attr_name: str # attribute name on unified client, e.g. "_messaging_api" + base_url: str # e.g. "https://api.line.me" + + +@dataclass +class MethodInfo: + """Extracted information about a public API method.""" + name: str + params_source: str # parameter list source (excluding ``self``) + return_annotation: str # return type as source text + docstring: str | None + + +# --------------------------------------------------------------------------- +# Auto-Discovery +# --------------------------------------------------------------------------- + +def discover_clients(repo_root: str) -> list[ClientDef]: + """Auto-discover API client classes from generated code under ``linebot/v3/``. + + Scans each module directory for sync/async API file pairs, parses them + with AST to extract class names and base URLs. + """ + v3_dir = os.path.join(repo_root, "linebot", "v3") + clients: list[ClientDef] = [] + + for module_name in sorted(os.listdir(v3_dir)): + if module_name.startswith("_") or module_name in EXCLUDE_MODULES: + continue + module_dir = os.path.join(v3_dir, module_name) + api_dir = os.path.join(module_dir, "api") + if not os.path.isdir(api_dir): + continue + # Must have configuration.py to be a proper API module + if not os.path.isfile(os.path.join(module_dir, "configuration.py")): + continue + + for filename in sorted(os.listdir(api_dir)): + if not filename.endswith(".py"): + continue + # Skip async files (handled as counterparts) and __init__.py + if filename.startswith("async_") or filename == "__init__.py": + continue + + sync_path = os.path.join(api_dir, filename) + result = _parse_api_file(sync_path) + if result is None: + continue + sync_class, base_url = result + + # Find async counterpart: async_{filename} + async_path = os.path.join(api_dir, f"async_{filename}") + if not os.path.isfile(async_path): + continue + async_result = _parse_api_file(async_path) + if async_result is None: + continue + async_class = async_result[0] + + attr_name = "_" + _camel_to_snake(sync_class) + + clients.append(ClientDef( + module=module_name, + sync_file=os.path.relpath(sync_path, repo_root), + sync_class=sync_class, + async_file=os.path.relpath(async_path, repo_root), + async_class=async_class, + attr_name=attr_name, + base_url=base_url, + )) + + return clients + + +def _parse_api_file(filepath: str) -> tuple[str, str] | None: + """Parse an API source file and extract the main class name and base URL. + + Looks for a class with ``self.line_base_path = "..."`` in its ``__init__``. + Returns ``(class_name, base_url)`` or ``None``. + """ + with open(filepath, "r") as f: + source = f.read() + + tree = ast.parse(source) + + for node in ast.iter_child_nodes(tree): + if not isinstance(node, ast.ClassDef): + continue + for item in node.body: + if not isinstance(item, (ast.FunctionDef, ast.AsyncFunctionDef)): + continue + if item.name != "__init__": + continue + for stmt in ast.walk(item): + if not isinstance(stmt, ast.Assign): + continue + for target in stmt.targets: + if (isinstance(target, ast.Attribute) + and isinstance(target.value, ast.Name) + and target.value.id == "self" + and target.attr == "line_base_path" + and isinstance(stmt.value, ast.Constant) + and isinstance(stmt.value.value, str)): + return (node.name, stmt.value.value) + + return None + + +def _camel_to_snake(name: str) -> str: + """Convert CamelCase to snake_case. + + ``MessagingApiBlob`` -> ``messaging_api_blob`` + """ + s1 = re.sub(r"([A-Z]+)([A-Z][a-z])", r"\1_\2", name) + return re.sub(r"([a-z\d])([A-Z])", r"\1_\2", s1).lower() + + +def _module_alias(module_name: str) -> str: + """Derive a PascalCase prefix from a module directory name for import aliases. + + ``messaging`` -> ``Messaging``, ``moduleattach`` -> ``Moduleattach``. + """ + return module_name[0].upper() + module_name[1:] + + +# --------------------------------------------------------------------------- +# AST Method Extraction +# --------------------------------------------------------------------------- + +def _extract_params_source( + func: ast.FunctionDef, + exclude_params: frozenset[str] | None = None, +) -> str: + """Extract parameters source (without ``self``) from a function def.""" + parts: list[str] = [] + args = func.args + + all_args = args.args[1:] # skip self + num_defaults = len(args.defaults) + num_args = len(all_args) + + for i, arg in enumerate(all_args): + if exclude_params and arg.arg in exclude_params: + continue + part = arg.arg + if arg.annotation: + part += ": " + ast.unparse(arg.annotation) + default_index = i - (num_args - num_defaults) + if default_index >= 0: + part += " = " + ast.unparse(args.defaults[default_index]) + parts.append(part) + + return ", ".join(parts) + + +def _is_deprecation_wrapper(func_node: ast.FunctionDef) -> bool: + """Return True if the method body contains ``warnings.warn(..., DeprecationWarning)``.""" + for node in ast.walk(func_node): + if not isinstance(node, ast.Call): + continue + if (isinstance(node.func, ast.Attribute) + and node.func.attr == "warn" + and isinstance(node.func.value, ast.Name) + and node.func.value.id == "warnings"): + for arg in node.args: + if isinstance(arg, ast.Name) and arg.id == "DeprecationWarning": + return True + return False + + +def _unwrap_awaitable_union(returns: ast.expr) -> str: + """Unwrap ``Union[T, Awaitable[T]]`` to ``T`` for async method signatures. + + If the return annotation is ``Union[X, Awaitable[X]]``, returns the + unparsed source for ``X``. Otherwise falls back to ``ast.unparse()``. + """ + if (isinstance(returns, ast.Subscript) + and isinstance(returns.value, ast.Name) + and returns.value.id == "Union" + and isinstance(returns.slice, ast.Tuple) + and len(returns.slice.elts) == 2): + second = returns.slice.elts[1] + if (isinstance(second, ast.Subscript) + and isinstance(second.value, ast.Name) + and second.value.id == "Awaitable"): + return ast.unparse(returns.slice.elts[0]) + return ast.unparse(returns) + + +# Regex for ``# noqa: ...`` suffixes. +_NOQA_RE = re.compile(r'\s*#\s*noqa\b.*') + +# Lines that match any of these patterns are dropped entirely. +_DROP_LINE_PATTERNS: list[re.Pattern[str]] = [ + re.compile(r'>>> thread = api\.'), + re.compile(r'>>> result = thread\.get\(\)'), + re.compile(r':param async_req:'), + re.compile(r':type async_req:'), + re.compile(r':param _request_timeout:'), + re.compile(r':param _preload_content:'), + re.compile(r':type _preload_content:'), + re.compile(r':param _return_http_data_only:'), + re.compile(r':type _return_http_data_only:'), + re.compile(r':param _request_auth:'), + re.compile(r':type _request_auth:'), + re.compile(r':type _content_type:'), + re.compile(r'If the method is called asynchronously,'), + re.compile(r'returns the request thread\.'), +] + + +def _clean_docstring_for_unified( + docstring: str | None, + method_name: str, +) -> str | None: + """Clean up a docstring for the unified client. + + Removes fragments that are not relevant to the unified client wrapper: + + * Redundant operationId first line (just repeats the method name). + * ``# noqa: E501`` suffixes. + * ``async_req``-related boilerplate (examples, param docs). + * ``_``-prefixed internal parameter docs (``_request_timeout``, etc.). + * "This method makes a synchronous HTTP request…" block. + * Multi-line continuation of ``_request_timeout`` description. + """ + if not docstring: + return docstring + + lines = docstring.split('\n') + cleaned: list[str] = [] + skip_block = False + + for line in lines: + stripped = line.strip() + + # --- Skip multi-line continuations of a dropped block ---- + if skip_block: + # Continuation lines are indented non-`:` text. A new + # ``:param`` / ``:type`` / ``:return`` / ``:rtype`` or a + # blank line ends the block. + if stripped and not stripped.startswith(':'): + continue + skip_block = False + + # --- Drop the first line if it's just the operationId ---- + if not cleaned: + bare = _NOQA_RE.sub('', stripped) + # operationId matches method_name or its _with_http_info base + if bare == method_name or bare == method_name.removesuffix('_with_http_info'): + continue + + # --- "This method makes a synchronous HTTP request…" block --- + if stripped.startswith('This method makes a synchronous'): + # May span 2 lines; skip until we see a blank or `:` + skip_block = True + continue + + # --- Pattern-based line drops --- + drop = False + for pat in _DROP_LINE_PATTERNS: + if pat.search(stripped): + # :param / :type descriptions can span multiple lines + if stripped.startswith(':param') or stripped.startswith(':type'): + skip_block = True + drop = True + break + if drop: + continue + + # --- Strip ``# noqa`` suffixes --- + line = _NOQA_RE.sub('', line) + cleaned.append(line) + + # Collapse multiple consecutive blank lines + result: list[str] = [] + prev_blank = False + for line in cleaned: + if line.strip() == '': + if prev_blank: + continue + prev_blank = True + else: + prev_blank = False + result.append(line) + + # Strip trailing blank lines + while result and result[-1].strip() == '': + result.pop() + + return '\n'.join(result).strip() or None + + +def extract_methods( + filepath: str, + class_name: str, + *, + is_async: bool = False, +) -> list[MethodInfo]: + """Parse a Python source file and extract public methods from the given class. + + When *is_async* is ``True`` the extracted signatures are additionally + cleaned up for the async unified client: + + * The ``async_req`` parameter is excluded. + * ``Union[T, Awaitable[T]]`` return annotations are unwrapped to ``T``. + + Docstrings are always cleaned for the unified client (both sync and async). + """ + with open(filepath, "r") as f: + source = f.read() + + tree = ast.parse(source) + + target_class: ast.ClassDef | None = None + for node in ast.walk(tree): + if isinstance(node, ast.ClassDef) and node.name == class_name: + target_class = node + break + + if target_class is None: + raise ValueError(f"Class {class_name} not found in {filepath}") + + exclude = frozenset({"async_req"}) if is_async else None + + methods: list[MethodInfo] = [] + for item in target_class.body: + if not isinstance(item, (ast.FunctionDef, ast.AsyncFunctionDef)): + continue + + name = item.name + + # Skip private / dunder methods + if name.startswith("_"): + continue + + # Skip @overload stubs (async files have these) + if any( + (isinstance(dec, ast.Name) and dec.id == "overload") + or (isinstance(dec, ast.Attribute) and dec.attr == "overload") + for dec in item.decorator_list + ): + continue + + # Skip deprecation wrappers (e.g. liff backward-compat aliases) + if _is_deprecation_wrapper(item): + continue + + params_source = _extract_params_source(item, exclude_params=exclude) + + ret_ann = "" + if item.returns: + if is_async: + ret_ann = _unwrap_awaitable_union(item.returns) + else: + ret_ann = ast.unparse(item.returns) + + docstring = ast.get_docstring(item) + docstring = _clean_docstring_for_unified(docstring, name) + + methods.append(MethodInfo( + name=name, + params_source=params_source, + return_annotation=ret_ann, + docstring=docstring, + )) + + return methods + + +# --------------------------------------------------------------------------- +# Import Collection +# --------------------------------------------------------------------------- + +def collect_model_imports(filepath: str) -> list[str]: + """Collect ``from linebot.v3.*.models.* import *`` lines from a source file.""" + imports: list[str] = [] + with open(filepath, "r") as f: + for line in f: + stripped = line.strip() + if stripped.startswith("from linebot.v3.") and ".models." in stripped: + imports.append(stripped) + return imports + + +def collect_typed_imports(filepath: str) -> dict[str, set[str]]: + """Collect typing / pydantic import names, grouped by source module.""" + result: dict[str, set[str]] = {} + with open(filepath, "r") as f: + for line in f: + stripped = line.strip() + for prefix in ("from typing_extensions import ", + "from typing import ", + "from pydantic.v1 import "): + if stripped.startswith(prefix): + module = prefix.replace("from ", "").replace(" import ", "").strip() + after_import = stripped[len(prefix):] + names = result.setdefault(module, set()) + for name in after_import.split(","): + name = name.strip().rstrip(")").split("#")[0].strip() + if name: + names.add(name) + break + return result + + +# --------------------------------------------------------------------------- +# Code Generation Helpers +# --------------------------------------------------------------------------- + +def _format_docstring(docstring: str, indent: str = ' ') -> list[str]: + """Format a multi-line docstring for embedding in generated code. + + The *docstring* is expected to be the already-cleaned output of + ``ast.get_docstring()`` (leading/trailing blank lines stripped, + common indent removed). + """ + if not docstring: + return [] + + doc_lines = docstring.split('\n') + if len(doc_lines) == 1: + return [f'{indent}"""{doc_lines[0]}"""'] + + result: list[str] = [] + result.append(f'{indent}"""{doc_lines[0]}') + for line in doc_lines[1:]: + if line.strip(): + result.append(f'{indent}{line}') + else: + result.append('') + result.append(f'{indent}"""') + return result + + +def _extract_call_args_from_params(params_source: str) -> str: + """Extract call argument names from a parameter source string. + + ``'req : Request, key : Optional[str] = None, **kwargs'`` + -> ``'req, key, **kwargs'`` + """ + if not params_source: + return "" + + parts: list[str] = [] + depth = 0 + current = "" + for ch in params_source + ",": + if ch in "([{": + depth += 1 + current += ch + elif ch in ")]}": + depth -= 1 + current += ch + elif ch == "," and depth == 0: + param = current.strip() + if param: + if param.startswith("**") or param.startswith("*"): + pass # skip *args / **kwargs + else: + name = param.split(":")[0].split("=")[0].strip() + parts.append(name) + current = "" + else: + current += ch + + return ", ".join(parts) + + +def _filter_imports( + candidates: dict[str, set[str]], + body_text: str, +) -> dict[str, set[str]]: + """Return only the import names from *candidates* that appear in *body_text*.""" + result: dict[str, set[str]] = {} + for mod, names in candidates.items(): + used = {n for n in names if re.search(rf'\b{re.escape(n)}\b', body_text)} + if used: + result[mod] = used + return result + + +# --------------------------------------------------------------------------- +# Code Generation +# --------------------------------------------------------------------------- + +def _generate_client( + repo_root: str, + client_defs: list[ClientDef], + unique_modules: list[str], + *, + is_async: bool, +) -> None: + """Generate a unified client file (sync or async). + + The two variants share the vast majority of their logic; the *is_async* + flag controls the handful of differences (class name, context-manager + protocol, ``await`` keywords, etc.). + """ + class_name = "AsyncLineBotClient" if is_async else "LineBotClient" + output_file = "async_line_bot_client.py" if is_async else "line_bot_client.py" + api_client_cls = "AsyncApiClient" if is_async else "ApiClient" + api_client_mod = "async_api_client" if is_async else "api_client" + + # --- Collect methods and imports from underlying API files ------------ + all_model_imports: set[str] = set() + all_typed_imports: dict[str, set[str]] = {} + all_methods: list[tuple[ClientDef, MethodInfo, str]] = [] + + for cdef in client_defs: + filepath = os.path.join( + repo_root, cdef.async_file if is_async else cdef.sync_file + ) + all_model_imports.update(collect_model_imports(filepath)) + for mod, names in collect_typed_imports(filepath).items(): + all_typed_imports.setdefault(mod, set()).update(names) + + target_class = cdef.async_class if is_async else cdef.sync_class + methods = extract_methods(filepath, target_class, is_async=is_async) + for m in methods: + call_args = _extract_call_args_from_params(m.params_source) + all_methods.append((cdef, m, call_args)) + + # Check for duplicate method names (once is enough) + if not is_async: + seen: set[str] = set() + for _, m, _ in all_methods: + if m.name in seen: + print(f"WARNING: Duplicate method name: {m.name}", file=sys.stderr) + seen.add(m.name) + + # --- Build class body lines first (needed for import filtering) ------- + body: list[str] = [] + mod_list = ", ".join(f"``{m}``" for m in unique_modules) + + # Class definition + docstring + body.append(f'class {class_name}:') + if is_async: + body.append(' """Async version of :class:`LineBotClient`.') + body.append('') + body.append(' Wraps all LINE API subpackages into a single async client so that') + body.append(' every API method can be called through one instance.') + body.append(' See :class:`LineBotClient` for details.') + else: + body.append(' """A single entry-point client that wraps all LINE API operations.') + body.append('') + body.append(' The LINE Bot SDK v3 splits API operations across multiple subpackages') + body.append(' (messaging, audience, insight, liff, etc.), each with its own') + body.append(' ``Configuration``, ``ApiClient``, and API class.') + body.append(f' ``{class_name}`` consolidates them so that you can call every') + body.append(' API method through one instance with a single ``channel_access_token``.') + body.append('') + body.append(f' Wrapped subpackages: {mod_list}.') + body.append('') + body.append(' Auto-generated by ``tools/generate_unified_client.py``.') + body.append(' Do not edit manually.') + body.append('') + body.append(' Usage::') + body.append('') + body.append(f' from linebot.v3 import {class_name}') + body.append('') + if is_async: + body.append(f' async with {class_name}(channel_access_token="YOUR_TOKEN") as client:') + body.append(' await client.reply_message(...)') + else: + body.append(f' with {class_name}(channel_access_token="YOUR_TOKEN") as client:') + body.append(' client.reply_message(...)') + body.append(' """') + body.append('') + + # __init__ + body.append(' def __init__(self, channel_access_token: str, **kwargs) -> None:') + init_doc = "Create a unified async LINE Bot client." if is_async else "Create a unified LINE Bot client." + body.append(f' """{init_doc}') + body.append('') + body.append(' :param str channel_access_token: Channel access token.') + body.append(' :param kwargs: Additional keyword arguments passed to each Configuration.') + body.append(' """') + + for mod in unique_modules: + alias = _module_alias(mod) + body.append(f' self._{mod}_configuration = {alias}Configuration(') + body.append(f' access_token=channel_access_token, **kwargs') + body.append(f' )') + body.append(f' self._{mod}_api_client = {alias}{api_client_cls}(') + body.append(f' self._{mod}_configuration') + body.append(f' )') + body.append('') + + for cdef in client_defs: + target_class = cdef.async_class if is_async else cdef.sync_class + body.append( + f' self.{cdef.attr_name} = {target_class}(self._{cdef.module}_api_client)' + ) + body.append('') + + # Context manager + close + if is_async: + body.append(' async def __aenter__(self):') + body.append(' return self') + body.append('') + body.append(' async def __aexit__(self, exc_type, exc_value, traceback):') + body.append(' await self.close()') + body.append('') + body.append(' async def close(self) -> None:') + body.append(' """Close all underlying async API clients."""') + body.append(' errors: list[BaseException] = []') + for mod in unique_modules: + body.append(f' try:') + body.append(f' await self._{mod}_api_client.close()') + body.append(f' except Exception as e:') + body.append(f' errors.append(e)') + else: + body.append(' def __enter__(self):') + body.append(' return self') + body.append('') + body.append(' def __exit__(self, exc_type, exc_value, traceback):') + body.append(' self.close()') + body.append('') + body.append(' def close(self) -> None:') + body.append(' """Close all underlying API clients."""') + body.append(' errors: list[BaseException] = []') + for mod in unique_modules: + body.append(f' try:') + body.append(f' self._{mod}_api_client.close()') + body.append(f' except Exception as e:') + body.append(f' errors.append(e)') + body.append(' if errors:') + body.append(' raise errors[0]') + body.append('') + + # Delegating methods + def_kw = "async def" if is_async else "def" + await_kw = "return await" if is_async else "return" + for cdef, method, call_args in all_methods: + ret_part = f' -> {method.return_annotation}' if method.return_annotation else '' + if method.params_source: + sig = f' {def_kw} {method.name}(self, {method.params_source}){ret_part}:' + else: + sig = f' {def_kw} {method.name}(self){ret_part}:' + body.append(sig) + + if method.docstring: + body.extend(_format_docstring(method.docstring)) + body.append(f' {await_kw} self.{cdef.attr_name}.{method.name}({call_args})') + body.append('') + + # --- Filter imports to only those actually used in the body ----------- + body_text = "\n".join(body) + filtered_typed = _filter_imports(all_typed_imports, body_text) + + # --- Assemble final file: header + imports + body -------------------- + lines: list[str] = [] + lines.append('# coding: utf-8') + lines.append('') + + # Auto-generated comment (no module docstring — it leaks into Sphinx output) + lines.append('# Auto-generated by tools/generate_unified_client.py. Do not edit manually.') + lines.append('') + + # Typing / pydantic imports (filtered to actually used names) + for mod in ("typing", "typing_extensions", "pydantic.v1"): + names = filtered_typed.get(mod, set()) + if names: + lines.append(f'from {mod} import {", ".join(sorted(names))}') + lines.append('') + + # Configuration and ApiClient imports with aliases + for mod in unique_modules: + alias = _module_alias(mod) + lines.append( + f'from linebot.v3.{mod}.configuration import Configuration as {alias}Configuration' + ) + lines.append( + f'from linebot.v3.{mod}.{api_client_mod} import {api_client_cls} as {alias}{api_client_cls}' + ) + lines.append('') + + # API class imports + for cdef in client_defs: + filepath = cdef.async_file if is_async else cdef.sync_file + pkg = filepath.replace("/", ".").replace(".py", "") + target_class = cdef.async_class if is_async else cdef.sync_class + lines.append(f'from {pkg} import {target_class}') + # ApiResponse (identical across modules — import from first discovered) + lines.append(f'from linebot.v3.{unique_modules[0]}.api_response import ApiResponse') + lines.append('') + + # Model imports (sorted, deduplicated) + for imp in sorted(all_model_imports): + lines.append(imp) + lines.append('') + lines.append('') + + # Append class body + lines.extend(body) + + # Write output + output_path = os.path.join(repo_root, "linebot/v3", output_file) + with open(output_path, "w") as f: + f.write("\n".join(lines) + "\n") + print(f"Generated {output_path} ({len(all_methods)} methods)") + + +def inject_docstring_references( + repo_root: str, + client_defs: list[ClientDef], +) -> None: + """Insert a ``.. tip::`` reference to the unified client in each wrapped class's docstring.""" + + # The class docstring in every generated API file ends with: + # Do not edit the class manually. + # """ + # (4-space indent distinguishes it from the module-level docstring whose + # closing ``"""`` sits at column 0.) + OLD_TAIL = ' Do not edit the class manually.\n """' + + def _build_new_tail(unified_class: str) -> str: + return ( + ' Do not edit the class manually.\n' + '\n' + f' Tip: Use :class:`linebot.v3.{unified_class}` to call every\n' + ' LINE API method through a single instance.\n' + ' """' + ) + + count = 0 + processed: set[str] = set() + for cdef in client_defs: + for filepath, unified in ( + (os.path.join(repo_root, cdef.sync_file), "LineBotClient"), + (os.path.join(repo_root, cdef.async_file), "AsyncLineBotClient"), + ): + if filepath in processed: + continue + processed.add(filepath) + + with open(filepath, "r") as f: + content = f.read() + + new_tail = _build_new_tail(unified) + + # Idempotency: already injected + if new_tail in content: + continue + + if OLD_TAIL not in content: + print(f"WARNING: docstring pattern not found in {filepath}", + file=sys.stderr) + continue + + # Replace only the first occurrence (the class docstring) + content = content.replace(OLD_TAIL, new_tail, 1) + with open(filepath, "w") as f: + f.write(content) + count += 1 + + print(f"Injected unified-client references into {count} files") + + + + + +def update_init_file(repo_root: str) -> None: + """Add LineBotClient and AsyncLineBotClient exports to ``linebot/v3/__init__.py``.""" + init_path = os.path.join(repo_root, "linebot/v3/__init__.py") + with open(init_path, "r") as f: + content = f.read() + + sync_import = "from .line_bot_client import LineBotClient # noqa" + async_import = "from .async_line_bot_client import AsyncLineBotClient # noqa" + + if sync_import in content: + return + + with open(init_path, "a") as f: + f.write(f"\n{sync_import}\n{async_import}\n") + + print(f"Updated {init_path}") + + +# --------------------------------------------------------------------------- +# Main +# --------------------------------------------------------------------------- + +def main() -> None: + script_dir = os.path.dirname(os.path.abspath(__file__)) + repo_root = os.path.dirname(script_dir) + + if not os.path.exists(os.path.join(repo_root, "linebot/v3/__init__.py")): + print("Error: Cannot find linebot/v3/__init__.py. " + "Run this script from the repository root or the tools/ directory.", + file=sys.stderr) + sys.exit(1) + + client_defs = discover_clients(repo_root) + unique_modules = list(dict.fromkeys(c.module for c in client_defs)) + + print(f"Discovered {len(client_defs)} API clients across " + f"{len(unique_modules)} modules:") + for cdef in client_defs: + print(f" {cdef.module}: {cdef.sync_class} / {cdef.async_class}") + + _generate_client(repo_root, client_defs, unique_modules, is_async=False) + _generate_client(repo_root, client_defs, unique_modules, is_async=True) + inject_docstring_references(repo_root, client_defs) + update_init_file(repo_root) + + print("Done.") + + +if __name__ == "__main__": + main() From da01ad4947d013f04cbf404a09ca11ae32f06262 Mon Sep 17 00:00:00 2001 From: habara keigo Date: Tue, 14 Apr 2026 16:23:29 +0900 Subject: [PATCH 2/4] Use unified client in example --- examples/aiohttp-echo/app.py | 15 +- examples/fastapi-echo/main.py | 12 +- examples/flask-echo/app.py | 25 +- examples/flask-echo/app_with_handler.py | 23 +- examples/flask-kitchensink/app.py | 1169 +++++++++++------------ examples/rich-menu/app.py | 28 +- examples/simple-server-echo/app.py | 23 +- 7 files changed, 604 insertions(+), 691 deletions(-) diff --git a/examples/aiohttp-echo/app.py b/examples/aiohttp-echo/app.py index aef68abcf..23cc8bf06 100644 --- a/examples/aiohttp-echo/app.py +++ b/examples/aiohttp-echo/app.py @@ -24,12 +24,10 @@ from aiohttp.web_runner import TCPSite from linebot.v3 import ( - WebhookParser + WebhookParser, + AsyncLineBotClient, ) from linebot.v3.messaging import ( - Configuration, - AsyncApiClient, - AsyncMessagingApi, TextMessage, ReplyMessageRequest ) @@ -52,13 +50,9 @@ print('Specify LINE_CHANNEL_ACCESS_TOKEN as environment variable.') sys.exit(1) -configuration = Configuration( - access_token=channel_access_token -) - class Handler: - def __init__(self, line_bot_api: AsyncMessagingApi, parser: WebhookParser): + def __init__(self, line_bot_api: AsyncLineBotClient, parser: WebhookParser): self.line_bot_api = line_bot_api self.parser = parser @@ -87,8 +81,7 @@ async def echo(self, request): async def main(port=8000): - async_api_client = AsyncApiClient(configuration) - line_bot_api = AsyncMessagingApi(async_api_client) + line_bot_api = AsyncLineBotClient(channel_access_token=channel_access_token) parser = WebhookParser(channel_secret) handler = Handler(line_bot_api, parser) diff --git a/examples/fastapi-echo/main.py b/examples/fastapi-echo/main.py index fd542d787..f71285d90 100644 --- a/examples/fastapi-echo/main.py +++ b/examples/fastapi-echo/main.py @@ -17,11 +17,8 @@ from fastapi import Request, FastAPI, HTTPException -from linebot.v3.webhook import WebhookParser +from linebot.v3 import WebhookParser, AsyncLineBotClient from linebot.v3.messaging import ( - AsyncApiClient, - AsyncMessagingApi, - Configuration, ReplyMessageRequest, TextMessage ) @@ -44,13 +41,8 @@ print('Specify LINE_CHANNEL_ACCESS_TOKEN as environment variable.') sys.exit(1) -configuration = Configuration( - access_token=channel_access_token -) - app = FastAPI() -async_api_client = AsyncApiClient(configuration) -line_bot_api = AsyncMessagingApi(async_api_client) +line_bot_api = AsyncLineBotClient(channel_access_token=channel_access_token) parser = WebhookParser(channel_secret) diff --git a/examples/flask-echo/app.py b/examples/flask-echo/app.py index 7eeaecaeb..49d3dd9a2 100644 --- a/examples/flask-echo/app.py +++ b/examples/flask-echo/app.py @@ -18,8 +18,9 @@ from argparse import ArgumentParser from flask import Flask, request, abort -from linebot import ( - WebhookParser +from linebot.v3 import ( + WebhookParser, + LineBotClient, ) from linebot.v3.exceptions import ( InvalidSignatureError @@ -29,9 +30,6 @@ TextMessageContent, ) from linebot.v3.messaging import ( - Configuration, - ApiClient, - MessagingApi, ReplyMessageRequest, TextMessage ) @@ -49,10 +47,7 @@ sys.exit(1) parser = WebhookParser(channel_secret) - -configuration = Configuration( - access_token=channel_access_token -) +line_bot_api = LineBotClient(channel_access_token=channel_access_token) @app.route("/callback", methods=['POST']) @@ -75,14 +70,12 @@ def callback(): continue if not isinstance(event.message, TextMessageContent): continue - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message_with_http_info( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text=event.message.text)] - ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text=event.message.text)] ) + ) return 'OK' diff --git a/examples/flask-echo/app_with_handler.py b/examples/flask-echo/app_with_handler.py index 254926223..5897434a0 100644 --- a/examples/flask-echo/app_with_handler.py +++ b/examples/flask-echo/app_with_handler.py @@ -18,7 +18,8 @@ from flask import Flask, request, abort from linebot.v3 import ( - WebhookHandler + WebhookHandler, + LineBotClient, ) from linebot.v3.exceptions import ( InvalidSignatureError @@ -28,9 +29,6 @@ TextMessageContent, ) from linebot.v3.messaging import ( - Configuration, - ApiClient, - MessagingApi, ReplyMessageRequest, TextMessage ) @@ -48,10 +46,7 @@ sys.exit(1) handler = WebhookHandler(channel_secret) - -configuration = Configuration( - access_token=channel_access_token -) +line_bot_api = LineBotClient(channel_access_token=channel_access_token) @app.route("/callback", methods=['POST']) @@ -74,14 +69,12 @@ def callback(): @handler.add(MessageEvent, message=TextMessageContent) def message_text(event): - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message_with_http_info( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text=event.message.text)] - ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text=event.message.text)] ) + ) if __name__ == "__main__": diff --git a/examples/flask-kitchensink/app.py b/examples/flask-kitchensink/app.py index ecac84ab9..d0cfea277 100644 --- a/examples/flask-kitchensink/app.py +++ b/examples/flask-kitchensink/app.py @@ -25,7 +25,8 @@ from werkzeug.middleware.proxy_fix import ProxyFix from linebot.v3 import ( - WebhookHandler + WebhookHandler, + LineBotClient, ) from linebot.v3.models import ( UnknownEvent @@ -55,10 +56,6 @@ MemberLeftEvent, ) from linebot.v3.messaging import ( - Configuration, - ApiClient, - MessagingApi, - MessagingApiBlob, ReplyMessageRequest, PushMessageRequest, MulticastRequest, @@ -97,11 +94,6 @@ ErrorResponse ) -from linebot.v3.insight import ( - ApiClient as InsightClient, - Insight -) - app = Flask(__name__) app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_host=1, x_proto=1) @@ -117,13 +109,10 @@ sys.exit(1) handler = WebhookHandler(channel_secret) +line_bot_api = LineBotClient(channel_access_token=channel_access_token) static_tmp_path = os.path.join(os.path.dirname(__file__), 'static', 'tmp') -configuration = Configuration( - access_token=channel_access_token -) - # function for create tmp dir for download content def make_static_tmp_dir(): @@ -159,421 +148,391 @@ def callback(): @handler.add(MessageEvent, message=TextMessageContent) def handle_text_message(event): text = event.message.text - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - if text == 'profile': - if isinstance(event.source, UserSource): - profile = line_bot_api.get_profile(user_id=event.source.user_id) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[ - TextMessage(text='Display name: ' + profile.display_name), - TextMessage(text='Status message: ' + str(profile.status_message)) - ] - ) - ) - else: - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text="Bot can't use profile API without user ID")] - ) - ) - elif text == 'emojis': - emojis = [Emoji(index=0, product_id="5ac1bfd5040ab15980c9b435", emoji_id="001"), - Emoji(index=13, product_id="5ac1bfd5040ab15980c9b435", emoji_id="002")] - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text='$ LINE emoji $', emojis=emojis)] - ) - ) - elif text == 'quota': - quota = line_bot_api.get_message_quota() + if text == 'profile': + if isinstance(event.source, UserSource): + profile = line_bot_api.get_profile(user_id=event.source.user_id) line_bot_api.reply_message( ReplyMessageRequest( reply_token=event.reply_token, messages=[ - TextMessage(text='type: ' + quota.type), - TextMessage(text='value: ' + str(quota.value)) + TextMessage(text='Display name: ' + profile.display_name), + TextMessage(text='Status message: ' + str(profile.status_message)) ] ) ) - elif text == 'quota_consumption': - quota_consumption = line_bot_api.get_message_quota_consumption() + else: line_bot_api.reply_message( ReplyMessageRequest( reply_token=event.reply_token, - messages=[ - TextMessage(text='total usage: ' + str(quota_consumption.total_usage)) - ] + messages=[TextMessage(text="Bot can't use profile API without user ID")] ) ) - elif text == 'push': - line_bot_api.push_message( - PushMessageRequest( - to=event.source.user_id, - messages=[TextMessage(text='PUSH!')] - ) + elif text == 'emojis': + emojis = [Emoji(index=0, product_id="5ac1bfd5040ab15980c9b435", emoji_id="001"), + Emoji(index=13, product_id="5ac1bfd5040ab15980c9b435", emoji_id="002")] + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text='$ LINE emoji $', emojis=emojis)] ) - elif text == 'multicast': - line_bot_api.multicast( - MulticastRequest( - to=[event.source.user_id], - messages=[TextMessage(text="THIS IS A MULTICAST MESSAGE, but it's slower than PUSH.")] - ) + ) + elif text == 'quota': + quota = line_bot_api.get_message_quota() + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[ + TextMessage(text='type: ' + quota.type), + TextMessage(text='value: ' + str(quota.value)) + ] ) - elif text == 'broadcast': - line_bot_api.broadcast( - BroadcastRequest( - messages=[TextMessage(text='THIS IS A BROADCAST MESSAGE')] - ) + ) + elif text == 'quota_consumption': + quota_consumption = line_bot_api.get_message_quota_consumption() + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[ + TextMessage(text='total usage: ' + str(quota_consumption.total_usage)) + ] ) - elif text.startswith('broadcast '): # broadcast 20190505 - date = text.split(' ')[1] - app.logger.info("Getting broadcast result: " + date) - result = line_bot_api.get_number_of_sent_broadcast_messages(var_date=date) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[ - TextMessage(text='Number of sent broadcast messages: ' + date), - TextMessage(text='status: ' + str(result.status)), - TextMessage(text='success: ' + str(result.success)), - ] - ) + ) + elif text == 'push': + line_bot_api.push_message( + PushMessageRequest( + to=event.source.user_id, + messages=[TextMessage(text='PUSH!')] ) - elif text == 'bye': - if isinstance(event.source, GroupSource): - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text="Leaving group")] - ) - ) - line_bot_api.leave_group(event.source.group_id) - elif isinstance(event.source, RoomSource): - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text="Leaving room")] - ) - ) - line_bot_api.leave_room(room_id=event.source.room_id) - else: - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[ - TextMessage(text="Bot can't leave from 1:1 chat") - ] - ) - ) - elif text == 'image': - url = request.url_root + '/static/logo.png' - url = url.replace("http", "https") - app.logger.info("url=" + url) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[ - ImageMessage(original_content_url=url, preview_image_url=url) - ] - ) + ) + elif text == 'multicast': + line_bot_api.multicast( + MulticastRequest( + to=[event.source.user_id], + messages=[TextMessage(text="THIS IS A MULTICAST MESSAGE, but it's slower than PUSH.")] ) - elif text == 'confirm': - confirm_template = ConfirmTemplate( - text='Do it?', - actions=[ - MessageAction(label='Yes', text='Yes!'), - MessageAction(label='No', text='No!') - ] + ) + elif text == 'broadcast': + line_bot_api.broadcast( + BroadcastRequest( + messages=[TextMessage(text='THIS IS A BROADCAST MESSAGE')] ) - template_message = TemplateMessage( - alt_text='Confirm alt text', - template=confirm_template + ) + elif text.startswith('broadcast '): # broadcast 20190505 + date = text.split(' ')[1] + app.logger.info("Getting broadcast result: " + date) + result = line_bot_api.get_number_of_sent_broadcast_messages(var_date=date) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[ + TextMessage(text='Number of sent broadcast messages: ' + date), + TextMessage(text='status: ' + str(result.status)), + TextMessage(text='success: ' + str(result.success)), + ] ) + ) + elif text == 'bye': + if isinstance(event.source, GroupSource): line_bot_api.reply_message( ReplyMessageRequest( reply_token=event.reply_token, - messages=[template_message] + messages=[TextMessage(text="Leaving group")] ) ) - elif text == 'buttons': - buttons_template = ButtonsTemplate( - title='My buttons sample', - text='Hello, my buttons', - actions=[ - URIAction(label='Go to line.me', uri='https://line.me'), - PostbackAction(label='ping', data='ping'), - PostbackAction(label='ping with text', data='ping', text='ping'), - MessageAction(label='Translate Rice', text='米') - ]) - template_message = TemplateMessage( - alt_text='Buttons alt text', - template=buttons_template - ) + line_bot_api.leave_group(event.source.group_id) + elif isinstance(event.source, RoomSource): line_bot_api.reply_message( ReplyMessageRequest( reply_token=event.reply_token, - messages=[template_message] + messages=[TextMessage(text="Leaving room")] ) ) - elif text == 'carousel': - carousel_template = CarouselTemplate( - columns=[ - CarouselColumn( - text='hoge1', - title='fuga1', - actions=[ - URIAction(label='Go to line.me', uri='https://line.me'), - PostbackAction(label='ping', data='ping') - ] - ), - CarouselColumn( - text='hoge2', - title='fuga2', - actions=[ - PostbackAction(label='ping with text', data='ping', text='ping'), - MessageAction(label='Translate Rice', text='米') - ] - ) - ] - ) - template_message = TemplateMessage( - alt_text='Carousel alt text', template=carousel_template) + line_bot_api.leave_room(room_id=event.source.room_id) + else: line_bot_api.reply_message( ReplyMessageRequest( reply_token=event.reply_token, - messages=[template_message] + messages=[ + TextMessage(text="Bot can't leave from 1:1 chat") + ] ) ) - elif text == 'image_carousel': - image_carousel_template = ImageCarouselTemplate(columns=[ - ImageCarouselColumn(image_url='https://via.placeholder.com/1024x1024', - action=DatetimePickerAction(label='datetime', - data='datetime_postback', - mode='datetime')), - ImageCarouselColumn(image_url='https://via.placeholder.com/1024x1024', - action=DatetimePickerAction(label='date', - data='date_postback', - mode='date')) + elif text == 'image': + url = request.url_root + '/static/logo.png' + url = url.replace("http", "https") + app.logger.info("url=" + url) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[ + ImageMessage(original_content_url=url, preview_image_url=url) + ] + ) + ) + elif text == 'confirm': + confirm_template = ConfirmTemplate( + text='Do it?', + actions=[ + MessageAction(label='Yes', text='Yes!'), + MessageAction(label='No', text='No!') + ] + ) + template_message = TemplateMessage( + alt_text='Confirm alt text', + template=confirm_template + ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[template_message] + ) + ) + elif text == 'buttons': + buttons_template = ButtonsTemplate( + title='My buttons sample', + text='Hello, my buttons', + actions=[ + URIAction(label='Go to line.me', uri='https://line.me'), + PostbackAction(label='ping', data='ping'), + PostbackAction(label='ping with text', data='ping', text='ping'), + MessageAction(label='Translate Rice', text='米') ]) - template_message = TemplateMessage( - alt_text='ImageCarousel alt text', template=image_carousel_template) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[template_message] - ) + template_message = TemplateMessage( + alt_text='Buttons alt text', + template=buttons_template + ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[template_message] ) - elif text == 'imagemap': - pass - elif text == 'flex': - bubble = FlexBubble( - direction='ltr', - hero=FlexImage( - url='https://example.com/cafe.jpg', - size='full', - aspect_ratio='20:13', - aspect_mode='cover', - action=URIAction(uri='http://example.com', label='label') - ), - body=FlexBox( - layout='vertical', - contents=[ - # title - FlexText(text='Brown Cafe', weight='bold', size='xl'), - # review - FlexBox( - layout='baseline', - margin='md', - contents=[ - FlexIcon(size='sm', url='https://example.com/gold_star.png'), - FlexIcon(size='sm', url='https://example.com/grey_star.png'), - FlexIcon(size='sm', url='https://example.com/gold_star.png'), - FlexIcon(size='sm', url='https://example.com/gold_star.png'), - FlexIcon(size='sm', url='https://example.com/grey_star.png'), - FlexText(text='4.0', size='sm', color='#999999', margin='md', flex=0) - ] - ), - # info - FlexBox( - layout='vertical', - margin='lg', - spacing='sm', - contents=[ - FlexBox( - layout='baseline', - spacing='sm', - contents=[ - FlexText( - text='Place', - color='#aaaaaa', - size='sm', - flex=1 - ), - FlexText( - text='Shinjuku, Tokyo', - wrap=True, - color='#666666', - size='sm', - flex=5 - ) - ], - ), - FlexBox( - layout='baseline', - spacing='sm', - contents=[ - FlexText( - text='Time', - color='#aaaaaa', - size='sm', - flex=1 - ), - FlexText( - text="10:00 - 23:00", - wrap=True, - color='#666666', - size='sm', - flex=5, - ), - ], - ), - ], - ) - ], - ), - footer=FlexBox( - layout='vertical', - spacing='sm', - contents=[ - # callAction - FlexButton( - style='link', - height='sm', - action=URIAction(label='CALL', uri='tel:000000'), - ), - # separator - FlexSeparator(), - # websiteAction - FlexButton( - style='link', - height='sm', - action=URIAction(label='WEBSITE', uri="https://example.com") - ) + ) + elif text == 'carousel': + carousel_template = CarouselTemplate( + columns=[ + CarouselColumn( + text='hoge1', + title='fuga1', + actions=[ + URIAction(label='Go to line.me', uri='https://line.me'), + PostbackAction(label='ping', data='ping') ] ), - ) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[FlexMessage(alt_text="hello", contents=bubble)] + CarouselColumn( + text='hoge2', + title='fuga2', + actions=[ + PostbackAction(label='ping with text', data='ping', text='ping'), + MessageAction(label='Translate Rice', text='米') + ] ) + ] + ) + template_message = TemplateMessage( + alt_text='Carousel alt text', template=carousel_template) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[template_message] ) - elif text == 'flex_update_1': - bubble_string = """ + ) + elif text == 'image_carousel': + image_carousel_template = ImageCarouselTemplate(columns=[ + ImageCarouselColumn(image_url='https://via.placeholder.com/1024x1024', + action=DatetimePickerAction(label='datetime', + data='datetime_postback', + mode='datetime')), + ImageCarouselColumn(image_url='https://via.placeholder.com/1024x1024', + action=DatetimePickerAction(label='date', + data='date_postback', + mode='date')) + ]) + template_message = TemplateMessage( + alt_text='ImageCarousel alt text', template=image_carousel_template) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[template_message] + ) + ) + elif text == 'imagemap': + pass + elif text == 'flex': + bubble = FlexBubble( + direction='ltr', + hero=FlexImage( + url='https://example.com/cafe.jpg', + size='full', + aspect_ratio='20:13', + aspect_mode='cover', + action=URIAction(uri='http://example.com', label='label') + ), + body=FlexBox( + layout='vertical', + contents=[ + # title + FlexText(text='Brown Cafe', weight='bold', size='xl'), + # review + FlexBox( + layout='baseline', + margin='md', + contents=[ + FlexIcon(size='sm', url='https://example.com/gold_star.png'), + FlexIcon(size='sm', url='https://example.com/grey_star.png'), + FlexIcon(size='sm', url='https://example.com/gold_star.png'), + FlexIcon(size='sm', url='https://example.com/gold_star.png'), + FlexIcon(size='sm', url='https://example.com/grey_star.png'), + FlexText(text='4.0', size='sm', color='#999999', margin='md', flex=0) + ] + ), + # info + FlexBox( + layout='vertical', + margin='lg', + spacing='sm', + contents=[ + FlexBox( + layout='baseline', + spacing='sm', + contents=[ + FlexText( + text='Place', + color='#aaaaaa', + size='sm', + flex=1 + ), + FlexText( + text='Shinjuku, Tokyo', + wrap=True, + color='#666666', + size='sm', + flex=5 + ) + ], + ), + FlexBox( + layout='baseline', + spacing='sm', + contents=[ + FlexText( + text='Time', + color='#aaaaaa', + size='sm', + flex=1 + ), + FlexText( + text="10:00 - 23:00", + wrap=True, + color='#666666', + size='sm', + flex=5, + ), + ], + ), + ], + ) + ], + ), + footer=FlexBox( + layout='vertical', + spacing='sm', + contents=[ + # callAction + FlexButton( + style='link', + height='sm', + action=URIAction(label='CALL', uri='tel:000000'), + ), + # separator + FlexSeparator(), + # websiteAction + FlexButton( + style='link', + height='sm', + action=URIAction(label='WEBSITE', uri="https://example.com") + ) + ] + ), + ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[FlexMessage(alt_text="hello", contents=bubble)] + ) + ) + elif text == 'flex_update_1': + bubble_string = """ + { + "type": "bubble", + "body": { + "type": "box", + "layout": "vertical", + "contents": [ + { + "type": "image", + "url": "https://scdn.line-apps.com/n/channel_devcenter/img/flexsnapshot/clip/clip3.jpg", + "position": "relative", + "size": "full", + "aspectMode": "cover", + "aspectRatio": "1:1", + "gravity": "center" + }, { - "type": "bubble", - "body": { "type": "box", - "layout": "vertical", + "layout": "horizontal", "contents": [ - { - "type": "image", - "url": "https://scdn.line-apps.com/n/channel_devcenter/img/flexsnapshot/clip/clip3.jpg", - "position": "relative", - "size": "full", - "aspectMode": "cover", - "aspectRatio": "1:1", - "gravity": "center" - }, { "type": "box", - "layout": "horizontal", + "layout": "vertical", "contents": [ + { + "type": "text", + "text": "Brown Hotel", + "weight": "bold", + "size": "xl", + "color": "#ffffff" + }, { "type": "box", - "layout": "vertical", + "layout": "baseline", + "margin": "md", "contents": [ { - "type": "text", - "text": "Brown Hotel", - "weight": "bold", - "size": "xl", - "color": "#ffffff" + "type": "icon", + "size": "sm", + "url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/review_gold_star_28.png" }, { - "type": "box", - "layout": "baseline", - "margin": "md", - "contents": [ - { - "type": "icon", - "size": "sm", - "url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/review_gold_star_28.png" - }, - { - "type": "icon", - "size": "sm", - "url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/review_gold_star_28.png" - }, - { - "type": "icon", - "size": "sm", - "url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/review_gold_star_28.png" - }, - { - "type": "icon", - "size": "sm", - "url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/review_gold_star_28.png" - }, - { - "type": "icon", - "size": "sm", - "url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/review_gray_star_28.png" - }, - { - "type": "text", - "text": "4.0", - "size": "sm", - "color": "#d6d6d6", - "margin": "md", - "flex": 0 - } - ] - } - ] - }, - { - "type": "box", - "layout": "vertical", - "contents": [ + "type": "icon", + "size": "sm", + "url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/review_gold_star_28.png" + }, { - "type": "text", - "text": "¥62,000", - "color": "#a9a9a9", - "decoration": "line-through", - "align": "end" + "type": "icon", + "size": "sm", + "url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/review_gold_star_28.png" + }, + { + "type": "icon", + "size": "sm", + "url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/review_gold_star_28.png" + }, + { + "type": "icon", + "size": "sm", + "url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/review_gray_star_28.png" }, { "type": "text", - "text": "¥42,000", - "color": "#ebebeb", - "size": "xl", - "align": "end" + "text": "4.0", + "size": "sm", + "color": "#d6d6d6", + "margin": "md", + "flex": 0 } ] } - ], - "position": "absolute", - "offsetBottom": "0px", - "offsetStart": "0px", - "offsetEnd": "0px", - "backgroundColor": "#00000099", - "paddingAll": "20px" + ] }, { "type": "box", @@ -581,185 +540,203 @@ def handle_text_message(event): "contents": [ { "type": "text", - "text": "SALE", - "color": "#ffffff" + "text": "¥62,000", + "color": "#a9a9a9", + "decoration": "line-through", + "align": "end" + }, + { + "type": "text", + "text": "¥42,000", + "color": "#ebebeb", + "size": "xl", + "align": "end" } - ], - "position": "absolute", - "backgroundColor": "#ff2600", - "cornerRadius": "20px", - "paddingAll": "5px", - "offsetTop": "10px", - "offsetEnd": "10px", - "paddingStart": "10px", - "paddingEnd": "10px" + ] } ], - "paddingAll": "0px" - } + "position": "absolute", + "offsetBottom": "0px", + "offsetStart": "0px", + "offsetEnd": "0px", + "backgroundColor": "#00000099", + "paddingAll": "20px" + }, + { + "type": "box", + "layout": "vertical", + "contents": [ + { + "type": "text", + "text": "SALE", + "color": "#ffffff" + } + ], + "position": "absolute", + "backgroundColor": "#ff2600", + "cornerRadius": "20px", + "paddingAll": "5px", + "offsetTop": "10px", + "offsetEnd": "10px", + "paddingStart": "10px", + "paddingEnd": "10px" } - """ - message = FlexMessage(alt_text="hello", contents=FlexContainer.from_json(bubble_string)) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[message] - ) + ], + "paddingAll": "0px" + } + } + """ + message = FlexMessage(alt_text="hello", contents=FlexContainer.from_json(bubble_string)) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[message] ) - elif text == 'quick_reply': - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage( - text='Quick reply', - quick_reply=QuickReply( - items=[ - QuickReplyItem( - action=PostbackAction(label="label1", data="data1") - ), - QuickReplyItem( - action=MessageAction(label="label2", text="text2") - ), - QuickReplyItem( - action=DatetimePickerAction(label="label3", - data="data3", - mode="date") - ), - QuickReplyItem( - action=CameraAction(label="label4") - ), - QuickReplyItem( - action=CameraRollAction(label="label5") - ), - QuickReplyItem( - action=LocationAction(label="label6") - ), - ] - ) - )] - ) + ) + elif text == 'quick_reply': + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage( + text='Quick reply', + quick_reply=QuickReply( + items=[ + QuickReplyItem( + action=PostbackAction(label="label1", data="data1") + ), + QuickReplyItem( + action=MessageAction(label="label2", text="text2") + ), + QuickReplyItem( + action=DatetimePickerAction(label="label3", + data="data3", + mode="date") + ), + QuickReplyItem( + action=CameraAction(label="label4") + ), + QuickReplyItem( + action=CameraRollAction(label="label5") + ), + QuickReplyItem( + action=LocationAction(label="label6") + ), + ] + ) + )] ) - elif text == 'link_token' and isinstance(event.source, UserSource): - link_token_response = line_bot_api.issue_link_token(user_id=event.source.user_id) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text='link_token: ' + link_token_response.link_token)] - ) + ) + elif text == 'link_token' and isinstance(event.source, UserSource): + link_token_response = line_bot_api.issue_link_token(user_id=event.source.user_id) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text='link_token: ' + link_token_response.link_token)] ) - elif text == 'insight_message_delivery': - with InsightClient(configuration) as api_client: - line_bot_insight_api = Insight(api_client) - today = datetime.date.today().strftime("%Y%m%d") - response = line_bot_insight_api.get_number_of_message_deliveries(var_date=today) - if response.status == 'ready': - messages = [ - TextMessage(text='broadcast: ' + str(response.broadcast)), - TextMessage(text='targeting: ' + str(response.targeting)), - ] - else: - messages = [TextMessage(text='status: ' + response.status)] - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=messages - ) + ) + elif text == 'insight_message_delivery': + today = datetime.date.today().strftime("%Y%m%d") + response = line_bot_api.get_number_of_message_deliveries(var_date=today) + if response.status == 'ready': + messages = [ + TextMessage(text='broadcast: ' + str(response.broadcast)), + TextMessage(text='targeting: ' + str(response.targeting)), + ] + else: + messages = [TextMessage(text='status: ' + response.status)] + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=messages ) - elif text == 'insight_followers': - with InsightClient(configuration) as api_client: - line_bot_insight_api = Insight(api_client) - today = datetime.date.today().strftime("%Y%m%d") - response = line_bot_insight_api.get_number_of_followers(var_date=today) - if response.status == 'ready': - messages = [ - TextMessage(text='followers: ' + str(response.followers)), - TextMessage(text='targetedReaches: ' + str(response.targeted_reaches)), - TextMessage(text='blocks: ' + str(response.blocks)), - ] - else: - messages = [TextMessage(text='status: ' + response.status)] - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=messages - ) + ) + elif text == 'insight_followers': + today = datetime.date.today().strftime("%Y%m%d") + response = line_bot_api.get_number_of_followers(var_date=today) + if response.status == 'ready': + messages = [ + TextMessage(text='followers: ' + str(response.followers)), + TextMessage(text='targetedReaches: ' + str(response.targeted_reaches)), + TextMessage(text='blocks: ' + str(response.blocks)), + ] + else: + messages = [TextMessage(text='status: ' + response.status)] + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=messages ) - elif text == 'insight_demographic': - with InsightClient(configuration) as api_client: - line_bot_insight_api = Insight(api_client) - response = line_bot_insight_api.get_friends_demographics() - if response.available: - messages = ["{gender}: {percentage}".format(gender=it.gender, percentage=it.percentage) - for it in response.genders] - else: - messages = [TextMessage(text='available: false')] - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=messages - ) + ) + elif text == 'insight_demographic': + response = line_bot_api.get_friends_demographics() + if response.available: + messages = ["{gender}: {percentage}".format(gender=it.gender, percentage=it.percentage) + for it in response.genders] + else: + messages = [TextMessage(text='available: false')] + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=messages ) - elif text == 'with http info': - response = line_bot_api.reply_message_with_http_info( + ) + elif text == 'with http info': + response = line_bot_api.reply_message_with_http_info( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text='see application log')] + ) + ) + app.logger.info("Got response with http status code: " + str(response.status_code)) + app.logger.info("Got x-line-request-id: " + response.headers['x-line-request-id']) + app.logger.info("Got response with http body: " + str(response.data)) + elif text == 'with http info error': + try: + line_bot_api.reply_message_with_http_info( ReplyMessageRequest( - reply_token=event.reply_token, + reply_token='invalid-reply-token', messages=[TextMessage(text='see application log')] ) ) - app.logger.info("Got response with http status code: " + str(response.status_code)) - app.logger.info("Got x-line-request-id: " + response.headers['x-line-request-id']) - app.logger.info("Got response with http body: " + str(response.data)) - elif text == 'with http info error': - try: - line_bot_api.reply_message_with_http_info( - ReplyMessageRequest( - reply_token='invalid-reply-token', - messages=[TextMessage(text='see application log')] - ) - ) - except ApiException as e: - app.logger.info("Got response with http status code: " + str(e.status)) - app.logger.info("Got x-line-request-id: " + e.headers['x-line-request-id']) - app.logger.info("Got response with http body: " + str(ErrorResponse.from_json(e.body))) - else: - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text=event.message.text)] - ) + except ApiException as e: + app.logger.info("Got response with http status code: " + str(e.status)) + app.logger.info("Got x-line-request-id: " + e.headers['x-line-request-id']) + app.logger.info("Got response with http body: " + str(ErrorResponse.from_json(e.body))) + else: + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text=event.message.text)] ) + ) @handler.add(MessageEvent, message=LocationMessageContent) def handle_location_message(event): - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[LocationMessage( - title='Location', - address=event.message.address, - latitude=event.message.latitude, - longitude=event.message.longitude - )] - ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[LocationMessage( + title='Location', + address=event.message.address, + latitude=event.message.latitude, + longitude=event.message.longitude + )] ) + ) @handler.add(MessageEvent, message=StickerMessageContent) def handle_sticker_message(event): - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[StickerMessage( - package_id=event.message.package_id, - sticker_id=event.message.sticker_id) - ] - ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[StickerMessage( + package_id=event.message.package_id, + sticker_id=event.message.sticker_id) + ] ) + ) # Other Message Type @@ -776,67 +753,57 @@ def handle_content_message(event): else: return - with ApiClient(configuration) as api_client: - line_bot_blob_api = MessagingApiBlob(api_client) - message_content = line_bot_blob_api.get_message_content(message_id=event.message.id) - with tempfile.NamedTemporaryFile(dir=static_tmp_path, prefix=ext + '-', delete=False) as tf: - tf.write(message_content) - tempfile_path = tf.name + message_content = line_bot_api.get_message_content(message_id=event.message.id) + with tempfile.NamedTemporaryFile(dir=static_tmp_path, prefix=ext + '-', delete=False) as tf: + tf.write(message_content) + tempfile_path = tf.name dist_path = tempfile_path + '.' + ext dist_name = os.path.basename(dist_path) os.rename(tempfile_path, dist_path) - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[ - TextMessage(text='Save content.'), - TextMessage(text=request.host_url + os.path.join('static', 'tmp', dist_name)) - ] - ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[ + TextMessage(text='Save content.'), + TextMessage(text=request.host_url + os.path.join('static', 'tmp', dist_name)) + ] ) + ) @handler.add(MessageEvent, message=FileMessageContent) def handle_file_message(event): - with ApiClient(configuration) as api_client: - line_bot_blob_api = MessagingApiBlob(api_client) - message_content = line_bot_blob_api.get_message_content(message_id=event.message.id) - with tempfile.NamedTemporaryFile(dir=static_tmp_path, prefix='file-', delete=False) as tf: - tf.write(message_content) - tempfile_path = tf.name + message_content = line_bot_api.get_message_content(message_id=event.message.id) + with tempfile.NamedTemporaryFile(dir=static_tmp_path, prefix='file-', delete=False) as tf: + tf.write(message_content) + tempfile_path = tf.name dist_path = tempfile_path + '-' + event.message.file_name dist_name = os.path.basename(dist_path) os.rename(tempfile_path, dist_path) - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[ - TextMessage(text='Save file.'), - TextMessage(text=request.host_url + os.path.join('static', 'tmp', dist_name)) - ] - ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[ + TextMessage(text='Save file.'), + TextMessage(text=request.host_url + os.path.join('static', 'tmp', dist_name)) + ] ) + ) @handler.add(FollowEvent) def handle_follow(event): app.logger.info("Got Follow event:" + event.source.user_id) - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text='Got follow event')] - ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text='Got follow event')] ) + ) @handler.add(UnfollowEvent) @@ -846,14 +813,12 @@ def handle_unfollow(event): @handler.add(JoinEvent) def handle_join(event): - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text='Joined this ' + event.source.type)] - ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text='Joined this ' + event.source.type)] ) + ) @handler.add(LeaveEvent) @@ -863,54 +828,48 @@ def handle_leave(): @handler.add(PostbackEvent) def handle_postback(event: PostbackEvent): - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - if event.postback.data == 'ping': - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text='pong')] - ) + if event.postback.data == 'ping': + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text='pong')] ) - elif event.postback.data == 'datetime_postback': - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text=event.postback.params['datetime'])] - ) + ) + elif event.postback.data == 'datetime_postback': + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text=event.postback.params['datetime'])] ) - elif event.postback.data == 'date_postback': - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text=event.postback.params['date'])] - ) + ) + elif event.postback.data == 'date_postback': + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text=event.postback.params['date'])] ) + ) @handler.add(BeaconEvent) def handle_beacon(event: BeaconEvent): - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text='Got beacon event. hwid={}, device_message(hex string)={}'.format( - event.beacon.hwid, event.beacon.dm))] - ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text='Got beacon event. hwid={}, device_message(hex string)={}'.format( + event.beacon.hwid, event.beacon.dm))] ) + ) @handler.add(MemberJoinedEvent) def handle_member_joined(event): - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text='Got memberJoined event. event={}'.format(event))] - ) + line_bot_api.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text='Got memberJoined event. event={}'.format(event))] ) + ) @handler.add(MemberLeftEvent) diff --git a/examples/rich-menu/app.py b/examples/rich-menu/app.py index 3a7e41564..b1568499b 100644 --- a/examples/rich-menu/app.py +++ b/examples/rich-menu/app.py @@ -3,11 +3,8 @@ import os import sys +from linebot.v3 import LineBotClient from linebot.v3.messaging import ( - Configuration, - ApiClient, - MessagingApi, - MessagingApiBlob, RichMenuRequest, RichMenuArea, RichMenuSize, @@ -22,10 +19,6 @@ print('Specify LINE_CHANNEL_ACCESS_TOKEN as environment variable.') sys.exit(1) -configuration = Configuration( - access_token=channel_access_token -) - def rich_menu_object_a_json(): return { @@ -116,10 +109,7 @@ def create_action(action): def main(): - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_blob_api = MessagingApiBlob(api_client) - + with LineBotClient(channel_access_token=channel_access_token) as client: # 2. Create rich menu A (richmenu-a) rich_menu_object_a = rich_menu_object_a_json() areas = [ @@ -143,13 +133,13 @@ def main(): areas=areas ) - rich_menu_a_id = line_bot_api.create_rich_menu( + rich_menu_a_id = client.create_rich_menu( rich_menu_request=rich_menu_to_a_create ).rich_menu_id # 3. Upload image to rich menu A with open('./public/richmenu-a.png', 'rb') as image: - line_bot_blob_api.set_rich_menu_image( + client.set_rich_menu_image( rich_menu_id=rich_menu_a_id, body=bytearray(image.read()), _headers={'Content-Type': 'image/png'} @@ -178,34 +168,34 @@ def main(): areas=areas ) - rich_menu_b_id = line_bot_api.create_rich_menu( + rich_menu_b_id = client.create_rich_menu( rich_menu_request=rich_menu_to_b_create ).rich_menu_id # 5. Upload image to rich menu B with open('./public/richmenu-b.png', 'rb') as image: - line_bot_blob_api.set_rich_menu_image( + client.set_rich_menu_image( rich_menu_id=rich_menu_b_id, body=bytearray(image.read()), _headers={'Content-Type': 'image/png'} ) # 6. Set rich menu A as the default rich menu - line_bot_api.set_default_rich_menu(rich_menu_id=rich_menu_a_id) + client.set_default_rich_menu(rich_menu_id=rich_menu_a_id) # 7. Create rich menu alias A alias_a = CreateRichMenuAliasRequest( rich_menu_alias_id='richmenu-alias-a', rich_menu_id=rich_menu_a_id ) - line_bot_api.create_rich_menu_alias(alias_a) + client.create_rich_menu_alias(alias_a) # 8. Create rich menu alias B alias_b = CreateRichMenuAliasRequest( rich_menu_alias_id='richmenu-alias-b', rich_menu_id=rich_menu_b_id ) - line_bot_api.create_rich_menu_alias(alias_b) + client.create_rich_menu_alias(alias_b) print('success') diff --git a/examples/simple-server-echo/app.py b/examples/simple-server-echo/app.py index 3a8aeb471..97b23bb54 100644 --- a/examples/simple-server-echo/app.py +++ b/examples/simple-server-echo/app.py @@ -19,7 +19,8 @@ from builtins import bytes from linebot.v3 import ( - WebhookParser + WebhookParser, + LineBotClient, ) from linebot.v3.exceptions import ( InvalidSignatureError @@ -29,9 +30,6 @@ TextMessageContent, ) from linebot.v3.messaging import ( - Configuration, - ApiClient, - MessagingApi, ReplyMessageRequest, TextMessage ) @@ -48,10 +46,7 @@ sys.exit(1) parser = WebhookParser(channel_secret) - -configuration = Configuration( - access_token=channel_access_token -) +line_bot_api = LineBotClient(channel_access_token=channel_access_token) def application(environ, start_response): @@ -87,14 +82,12 @@ def application(environ, start_response): if not isinstance(event.message, TextMessageContent): continue - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message_with_http_info( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text=event.message.text)] - ) + line_bot_api.reply_message_with_http_info( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text=event.message.text)] ) + ) start_response('200 OK', []) return create_body('OK') From 47a6acbe86c9d96d167f6c2ef8322a086a7ab5b6 Mon Sep 17 00:00:00 2001 From: habara keigo Date: Tue, 14 Apr 2026 16:30:57 +0900 Subject: [PATCH 3/4] Use unified client in README --- README.rst | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/README.rst b/README.rst index cf1470717..820f80aa8 100644 --- a/README.rst +++ b/README.rst @@ -41,15 +41,13 @@ Usage: from flask import Flask, request, abort from linebot.v3 import ( + LineBotClient, WebhookHandler ) from linebot.v3.exceptions import ( InvalidSignatureError ) from linebot.v3.messaging import ( - Configuration, - ApiClient, - MessagingApi, ReplyMessageRequest, TextMessage ) @@ -60,7 +58,7 @@ Usage: app = Flask(__name__) - configuration = Configuration(access_token='YOUR_CHANNEL_ACCESS_TOKEN') + line_bot_client = LineBotClient(channel_access_token='YOUR_CHANNEL_ACCESS_TOKEN') handler = WebhookHandler('YOUR_CHANNEL_SECRET') @@ -85,14 +83,12 @@ Usage: @handler.add(MessageEvent, message=TextMessageContent) def handle_message(event): - with ApiClient(configuration) as api_client: - line_bot_api = MessagingApi(api_client) - line_bot_api.reply_message_with_http_info( - ReplyMessageRequest( - reply_token=event.reply_token, - messages=[TextMessage(text=event.message.text)] - ) + line_bot_client.reply_message( + ReplyMessageRequest( + reply_token=event.reply_token, + messages=[TextMessage(text=event.message.text)] ) + ) if __name__ == "__main__": app.run() @@ -122,6 +118,7 @@ WebhookParser parser = linebot.v3.WebhookParser( 'YOUR_CHANNEL_SECRET', skip_signature_verification=lambda: False + ) parse(self, body, signature, as_payload=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -141,7 +138,7 @@ If the signature does NOT match, ``InvalidSignatureError`` is raised. payload = parser.parse(body, signature, as_payload=True) for event in payload.events: - do_something(payload.event, payload.destination) + do_something(event, payload.destination) WebhookHandler ~~~~~~~~~~~~~~ @@ -159,6 +156,7 @@ WebhookHandler handler = linebot.v3.WebhookHandler( 'YOUR_CHANNEL_SECRET', skip_signature_verification=lambda: False + ) handle(self, body, signature) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -178,16 +176,16 @@ Add a **handler** method by using this decorator. .. code:: python - @handler.add(MessageEvent, message=TextMessage) + @handler.add(MessageEvent, message=TextMessageContent) def handle_message(event): - line_bot_api.reply_message( + line_bot_client.reply_message( ReplyMessageRequest( reply_token=event.reply_token, messages=[TextMessage(text=event.message.text)] ) ) -When the event is an instance of MessageEvent and event.message is an instance of TextMessage, +When the event is an instance of MessageEvent and event.message is an instance of TextMessageContent, this handler method is called. .. code:: python @@ -286,7 +284,7 @@ Thus, you can send a JSON designed with `Flex Message Simulator Date: Wed, 15 Apr 2026 10:40:15 +0900 Subject: [PATCH 4/4] Fix ApiResponse --- linebot/v3/async_line_bot_client.py | 208 ++++++++++++++-------------- linebot/v3/line_bot_client.py | 208 ++++++++++++++-------------- tools/generate_unified_client.py | 18 ++- 3 files changed, 229 insertions(+), 205 deletions(-) diff --git a/linebot/v3/async_line_bot_client.py b/linebot/v3/async_line_bot_client.py index 31a163162..3fa1b9c83 100644 --- a/linebot/v3/async_line_bot_client.py +++ b/linebot/v3/async_line_bot_client.py @@ -30,7 +30,13 @@ from linebot.v3.module.api.async_line_module import AsyncLineModule from linebot.v3.moduleattach.api.async_line_module_attach import AsyncLineModuleAttach from linebot.v3.shop.api.async_shop import AsyncShop -from linebot.v3.audience.api_response import ApiResponse +from linebot.v3.audience.api_response import ApiResponse as AudienceApiResponse +from linebot.v3.insight.api_response import ApiResponse as InsightApiResponse +from linebot.v3.liff.api_response import ApiResponse as LiffApiResponse +from linebot.v3.messaging.api_response import ApiResponse as MessagingApiResponse +from linebot.v3.module.api_response import ApiResponse as ModuleApiResponse +from linebot.v3.moduleattach.api_response import ApiResponse as ModuleattachApiResponse +from linebot.v3.shop.api_response import ApiResponse as ShopApiResponse from linebot.v3.audience.models.add_audience_to_audience_group_request import AddAudienceToAudienceGroupRequest from linebot.v3.audience.models.audience_group_create_route import AudienceGroupCreateRoute @@ -241,7 +247,7 @@ async def add_audience_to_audience_group(self, add_audience_to_audience_group_re """ return await self._manage_audience.add_audience_to_audience_group(add_audience_to_audience_group_request) - async def add_audience_to_audience_group_with_http_info(self, add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest) -> ApiResponse: + async def add_audience_to_audience_group_with_http_info(self, add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest) -> AudienceApiResponse: """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) :param add_audience_to_audience_group_request: (required) @@ -261,7 +267,7 @@ async def create_audience_group(self, create_audience_group_request: CreateAudie """ return await self._manage_audience.create_audience_group(create_audience_group_request) - async def create_audience_group_with_http_info(self, create_audience_group_request: CreateAudienceGroupRequest) -> ApiResponse: + async def create_audience_group_with_http_info(self, create_audience_group_request: CreateAudienceGroupRequest) -> AudienceApiResponse: """Create audience for uploading user IDs (by JSON) :param create_audience_group_request: (required) @@ -281,7 +287,7 @@ async def create_click_based_audience_group(self, create_click_based_audience_gr """ return await self._manage_audience.create_click_based_audience_group(create_click_based_audience_group_request) - async def create_click_based_audience_group_with_http_info(self, create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest) -> ApiResponse: + async def create_click_based_audience_group_with_http_info(self, create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest) -> AudienceApiResponse: """Create audience for click-based retargeting :param create_click_based_audience_group_request: (required) @@ -301,7 +307,7 @@ async def create_imp_based_audience_group(self, create_imp_based_audience_group_ """ return await self._manage_audience.create_imp_based_audience_group(create_imp_based_audience_group_request) - async def create_imp_based_audience_group_with_http_info(self, create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest) -> ApiResponse: + async def create_imp_based_audience_group_with_http_info(self, create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest) -> AudienceApiResponse: """Create audience for impression-based retargeting :param create_imp_based_audience_group_request: (required) @@ -321,7 +327,7 @@ async def delete_audience_group(self, audience_group_id: Annotated[StrictInt, Fi """ return await self._manage_audience.delete_audience_group(audience_group_id) - async def delete_audience_group_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + async def delete_audience_group_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> AudienceApiResponse: """Delete audience :param audience_group_id: The audience ID. (required) @@ -341,7 +347,7 @@ async def get_audience_data(self, audience_group_id: Annotated[StrictInt, Field( """ return await self._manage_audience.get_audience_data(audience_group_id) - async def get_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + async def get_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> AudienceApiResponse: """Gets audience data. :param audience_group_id: The audience ID. (required) @@ -371,7 +377,7 @@ async def get_audience_groups(self, page: Annotated[conint(strict=True, ge=1), F """ return await self._manage_audience.get_audience_groups(page, description, status, size, includes_external_public_groups, create_route) - async def get_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, includes_external_public_groups: Annotated[Optional[StrictBool], Field(description='true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None) -> ApiResponse: + async def get_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, includes_external_public_groups: Annotated[Optional[StrictBool], Field(description='true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None) -> AudienceApiResponse: """Gets data for more than one audience. :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) @@ -401,7 +407,7 @@ async def get_shared_audience_data(self, audience_group_id: Annotated[StrictInt, """ return await self._manage_audience.get_shared_audience_data(audience_group_id) - async def get_shared_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + async def get_shared_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> AudienceApiResponse: """Gets audience data. :param audience_group_id: The audience ID. (required) @@ -431,7 +437,7 @@ async def get_shared_audience_groups(self, page: Annotated[conint(strict=True, g """ return await self._manage_audience.get_shared_audience_groups(page, description, status, size, create_route, includes_owned_audience_groups) - async def get_shared_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None, includes_owned_audience_groups: Annotated[Optional[StrictBool], Field(description='true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ')] = None) -> ApiResponse: + async def get_shared_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None, includes_owned_audience_groups: Annotated[Optional[StrictBool], Field(description='true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ')] = None) -> AudienceApiResponse: """Gets data for more than one audience, including those shared by the Business Manager. :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) @@ -463,7 +469,7 @@ async def update_audience_group_description(self, audience_group_id: Annotated[S """ return await self._manage_audience.update_audience_group_description(audience_group_id, update_audience_group_description_request) - async def update_audience_group_description_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')], update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest) -> ApiResponse: + async def update_audience_group_description_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')], update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest) -> AudienceApiResponse: """Renames an existing audience. :param audience_group_id: The audience ID. (required) @@ -489,7 +495,7 @@ async def add_user_ids_to_audience(self, file: Annotated[Union[StrictBytes, Stri """ return await self._manage_audience_blob.add_user_ids_to_audience(file, audience_group_id, upload_description) - async def add_user_ids_to_audience_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], audience_group_id: Annotated[Optional[StrictInt], Field(description='The audience ID.')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register with the job')] = None) -> ApiResponse: + async def add_user_ids_to_audience_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], audience_group_id: Annotated[Optional[StrictInt], Field(description='The audience ID.')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register with the job')] = None) -> AudienceApiResponse: """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) @@ -519,7 +525,7 @@ async def create_audience_for_uploading_user_ids(self, file: Annotated[Union[Str """ return await self._manage_audience_blob.create_audience_for_uploading_user_ids(file, description, is_ifa_audience, upload_description) - async def create_audience_for_uploading_user_ids_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], description: Annotated[Optional[constr(strict=True, max_length=120)], Field(description="The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 ")] = None, is_ifa_audience: Annotated[Optional[StrictBool], Field(description='To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. ')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register for the job (in `jobs[].description`). ')] = None) -> ApiResponse: + async def create_audience_for_uploading_user_ids_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], description: Annotated[Optional[constr(strict=True, max_length=120)], Field(description="The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 ")] = None, is_ifa_audience: Annotated[Optional[StrictBool], Field(description='To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. ')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register for the job (in `jobs[].description`). ')] = None) -> AudienceApiResponse: """Create audience for uploading user IDs (by file). :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) @@ -543,7 +549,7 @@ async def get_friends_demographics(self) -> GetFriendsDemographicsResponse: """ return await self._insight.get_friends_demographics() - async def get_friends_demographics_with_http_info(self) -> ApiResponse: + async def get_friends_demographics_with_http_info(self) -> InsightApiResponse: """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). :return: Returns the result object. @@ -563,7 +569,7 @@ async def get_message_event(self, request_id: Annotated[constr(strict=True, min_ """ return await self._insight.get_message_event(request_id) - async def get_message_event_with_http_info(self, request_id: Annotated[constr(strict=True, min_length=1), Field(..., description='Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. ')]) -> ApiResponse: + async def get_message_event_with_http_info(self, request_id: Annotated[constr(strict=True, min_length=1), Field(..., description='Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. ')]) -> InsightApiResponse: """Get user interaction statistics Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. @@ -587,7 +593,7 @@ async def get_number_of_followers(self, var_date: Annotated[Optional[constr(stri """ return await self._insight.get_number_of_followers(var_date) - async def get_number_of_followers_with_http_info(self, var_date: Annotated[Optional[constr(strict=True, max_length=8, min_length=8)], Field(description='Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')] = None) -> ApiResponse: + async def get_number_of_followers_with_http_info(self, var_date: Annotated[Optional[constr(strict=True, max_length=8, min_length=8)], Field(description='Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')] = None) -> InsightApiResponse: """Get number of followers Returns the number of users who have added the LINE Official Account on or before a specified date. @@ -611,7 +617,7 @@ async def get_number_of_message_deliveries(self, var_date: Annotated[constr(stri """ return await self._insight.get_number_of_message_deliveries(var_date) - async def get_number_of_message_deliveries_with_http_info(self, var_date: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 ')]) -> ApiResponse: + async def get_number_of_message_deliveries_with_http_info(self, var_date: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 ')]) -> InsightApiResponse: """Get number of message deliveries Returns the number of messages sent from LINE Official Account on a specified day. @@ -637,7 +643,7 @@ async def get_statistics_per_unit(self, custom_aggregation_unit: Annotated[const """ return await self._insight.get_statistics_per_unit(custom_aggregation_unit, var_from, to) - async def get_statistics_per_unit_with_http_info(self, custom_aggregation_unit: Annotated[constr(strict=True, max_length=30, min_length=1), Field(..., description='Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. ')], var_from: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 ')], to: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='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 ')]) -> ApiResponse: + async def get_statistics_per_unit_with_http_info(self, custom_aggregation_unit: Annotated[constr(strict=True, max_length=30, min_length=1), Field(..., description='Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. ')], var_from: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 ')], to: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='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 ')]) -> InsightApiResponse: """You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. :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) @@ -663,7 +669,7 @@ async def add_liff_app(self, add_liff_app_request: AddLiffAppRequest) -> AddLiff """ return await self._liff.add_liff_app(add_liff_app_request) - async def add_liff_app_with_http_info(self, add_liff_app_request: AddLiffAppRequest) -> ApiResponse: + async def add_liff_app_with_http_info(self, add_liff_app_request: AddLiffAppRequest) -> LiffApiResponse: """Create LIFF app Adding the LIFF app to a channel @@ -687,7 +693,7 @@ async def delete_liff_app(self, liff_id: Annotated[StrictStr, Field(..., descrip """ return await self._liff.delete_liff_app(liff_id) - async def delete_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')]) -> ApiResponse: + async def delete_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')]) -> LiffApiResponse: """Delete LIFF app from a channel Deletes a LIFF app from a channel. @@ -709,7 +715,7 @@ async def get_all_liff_apps(self) -> GetAllLiffAppsResponse: """ return await self._liff.get_all_liff_apps() - async def get_all_liff_apps_with_http_info(self) -> ApiResponse: + async def get_all_liff_apps_with_http_info(self) -> LiffApiResponse: """Get all LIFF apps Gets information on all the LIFF apps added to the channel. @@ -733,7 +739,7 @@ async def update_liff_app(self, liff_id: Annotated[StrictStr, Field(..., descrip """ return await self._liff.update_liff_app(liff_id, update_liff_app_request) - async def update_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')], update_liff_app_request: UpdateLiffAppRequest) -> ApiResponse: + async def update_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')], update_liff_app_request: UpdateLiffAppRequest) -> LiffApiResponse: """Update LIFF app from a channel Update LIFF app settings @@ -759,7 +765,7 @@ async def broadcast(self, broadcast_request: BroadcastRequest, x_line_retry_key: """ return await self._messaging_api.broadcast(broadcast_request, x_line_retry_key) - async def broadcast_with_http_info(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) -> ApiResponse: + async def broadcast_with_http_info(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) -> MessagingApiResponse: """Sends a message to multiple users at any time. :param broadcast_request: (required) @@ -779,7 +785,7 @@ async def cancel_default_rich_menu(self) -> None: """ return await self._messaging_api.cancel_default_rich_menu() - async def cancel_default_rich_menu_with_http_info(self) -> ApiResponse: + async def cancel_default_rich_menu_with_http_info(self) -> MessagingApiResponse: """Cancel default rich menu :return: Returns the result object. @@ -797,7 +803,7 @@ async def close_coupon(self, coupon_id: StrictStr) -> None: """ return await self._messaging_api.close_coupon(coupon_id) - async def close_coupon_with_http_info(self, coupon_id: StrictStr) -> ApiResponse: + async def close_coupon_with_http_info(self, coupon_id: StrictStr) -> MessagingApiResponse: """Close coupon :param coupon_id: (required) @@ -817,7 +823,7 @@ async def create_coupon(self, coupon_create_request: Optional[CouponCreateReques """ return await self._messaging_api.create_coupon(coupon_create_request) - async def create_coupon_with_http_info(self, coupon_create_request: Optional[CouponCreateRequest] = None) -> ApiResponse: + async def create_coupon_with_http_info(self, coupon_create_request: Optional[CouponCreateRequest] = None) -> MessagingApiResponse: """Create a new coupon. Define coupon details such as type, title, and validity period. :param coupon_create_request: @@ -837,7 +843,7 @@ async def create_rich_menu(self, rich_menu_request: RichMenuRequest) -> RichMenu """ return await self._messaging_api.create_rich_menu(rich_menu_request) - async def create_rich_menu_with_http_info(self, rich_menu_request: RichMenuRequest) -> ApiResponse: + async def create_rich_menu_with_http_info(self, rich_menu_request: RichMenuRequest) -> MessagingApiResponse: """Create rich menu :param rich_menu_request: (required) @@ -857,7 +863,7 @@ async def create_rich_menu_alias(self, create_rich_menu_alias_request: CreateRic """ return await self._messaging_api.create_rich_menu_alias(create_rich_menu_alias_request) - async def create_rich_menu_alias_with_http_info(self, create_rich_menu_alias_request: CreateRichMenuAliasRequest) -> ApiResponse: + async def create_rich_menu_alias_with_http_info(self, create_rich_menu_alias_request: CreateRichMenuAliasRequest) -> MessagingApiResponse: """Create rich menu alias :param create_rich_menu_alias_request: (required) @@ -877,7 +883,7 @@ async def delete_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(..., d """ return await self._messaging_api.delete_rich_menu(rich_menu_id) - async def delete_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + async def delete_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> MessagingApiResponse: """Deletes a rich menu. :param rich_menu_id: ID of a rich menu (required) @@ -897,7 +903,7 @@ async def delete_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, """ return await self._messaging_api.delete_rich_menu_alias(rich_menu_alias_id) - async def delete_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='Rich menu alias ID that you want to delete.')]) -> ApiResponse: + async def delete_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='Rich menu alias ID that you want to delete.')]) -> MessagingApiResponse: """Delete rich menu alias :param rich_menu_alias_id: Rich menu alias ID that you want to delete. (required) @@ -919,7 +925,7 @@ async def get_aggregation_unit_name_list(self, limit: Annotated[Optional[StrictS """ return await self._messaging_api.get_aggregation_unit_name_list(limit, start) - async def get_aggregation_unit_name_list_with_http_info(self, limit: Annotated[Optional[StrictStr], Field(description='The maximum number of aggregation units you can get per request. ')] = None, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. ")] = None) -> ApiResponse: + async def get_aggregation_unit_name_list_with_http_info(self, limit: Annotated[Optional[StrictStr], Field(description='The maximum number of aggregation units you can get per request. ')] = None, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. ")] = None) -> MessagingApiResponse: """Get name list of units used this month :param limit: The maximum number of aggregation units you can get per request. @@ -939,7 +945,7 @@ async def get_aggregation_unit_usage(self) -> GetAggregationUnitUsageResponse: """ return await self._messaging_api.get_aggregation_unit_usage() - async def get_aggregation_unit_usage_with_http_info(self) -> ApiResponse: + async def get_aggregation_unit_usage_with_http_info(self) -> MessagingApiResponse: """Get number of units used this month :return: Returns the result object. @@ -955,7 +961,7 @@ async def get_bot_info(self) -> BotInfoResponse: """ return await self._messaging_api.get_bot_info() - async def get_bot_info_with_http_info(self) -> ApiResponse: + async def get_bot_info_with_http_info(self) -> MessagingApiResponse: """Get bot info :return: Returns the result object. @@ -973,7 +979,7 @@ async def get_coupon_detail(self, coupon_id: StrictStr) -> CouponResponse: """ return await self._messaging_api.get_coupon_detail(coupon_id) - async def get_coupon_detail_with_http_info(self, coupon_id: StrictStr) -> ApiResponse: + async def get_coupon_detail_with_http_info(self, coupon_id: StrictStr) -> MessagingApiResponse: """Get coupon detail :param coupon_id: (required) @@ -991,7 +997,7 @@ async def get_default_rich_menu_id(self) -> RichMenuIdResponse: """ return await self._messaging_api.get_default_rich_menu_id() - async def get_default_rich_menu_id_with_http_info(self) -> ApiResponse: + async def get_default_rich_menu_id_with_http_info(self) -> MessagingApiResponse: """Gets the ID of the default rich menu set with the Messaging API. :return: Returns the result object. @@ -1011,7 +1017,7 @@ async def get_followers(self, start: Annotated[Optional[StrictStr], Field(descri """ return await self._messaging_api.get_followers(start, limit) - async def get_followers_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. ')] = None, limit: Annotated[Optional[conint(strict=True, le=1000)], Field(description='The maximum number of user IDs to retrieve in a single request.')] = None) -> ApiResponse: + async def get_followers_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. ')] = None, limit: Annotated[Optional[conint(strict=True, le=1000)], Field(description='The maximum number of user IDs to retrieve in a single request.')] = None) -> MessagingApiResponse: """Get a list of users who added your LINE Official Account as a friend :param start: Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. @@ -1033,7 +1039,7 @@ async def get_group_member_count(self, group_id: Annotated[StrictStr, Field(..., """ return await self._messaging_api.get_group_member_count(group_id) - async def get_group_member_count_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + async def get_group_member_count_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> MessagingApiResponse: """Get number of users in a group chat :param group_id: Group ID (required) @@ -1055,7 +1061,7 @@ async def get_group_member_profile(self, group_id: Annotated[StrictStr, Field(.. """ return await self._messaging_api.get_group_member_profile(group_id, user_id) - async def get_group_member_profile_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + async def get_group_member_profile_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> MessagingApiResponse: """Get group chat member profile :param group_id: Group ID (required) @@ -1079,7 +1085,7 @@ async def get_group_members_ids(self, group_id: Annotated[StrictStr, Field(..., """ return await self._messaging_api.get_group_members_ids(group_id, start) - async def get_group_members_ids_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> ApiResponse: + async def get_group_members_ids_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> MessagingApiResponse: """Get group chat member user IDs :param group_id: Group ID (required) @@ -1101,7 +1107,7 @@ async def get_group_summary(self, group_id: Annotated[StrictStr, Field(..., desc """ return await self._messaging_api.get_group_summary(group_id) - async def get_group_summary_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + async def get_group_summary_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> MessagingApiResponse: """Get group chat summary :param group_id: Group ID (required) @@ -1125,7 +1131,7 @@ async def get_joined_membership_users(self, membership_id: Annotated[StrictInt, """ return await self._messaging_api.get_joined_membership_users(membership_id, start, limit) - async def get_joined_membership_users_with_http_info(self, membership_id: Annotated[StrictInt, Field(..., description='Membership plan ID.')], start: Annotated[Optional[StrictStr], Field(description="A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). ")] = None, limit: Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description='The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. ')] = None) -> ApiResponse: + async def get_joined_membership_users_with_http_info(self, membership_id: Annotated[StrictInt, Field(..., description='Membership plan ID.')], start: Annotated[Optional[StrictStr], Field(description="A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). ")] = None, limit: Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description='The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. ')] = None) -> MessagingApiResponse: """Get a list of user IDs who joined the membership. :param membership_id: Membership plan ID. (required) @@ -1147,7 +1153,7 @@ async def get_membership_list(self) -> MembershipListResponse: """ return await self._messaging_api.get_membership_list() - async def get_membership_list_with_http_info(self) -> ApiResponse: + async def get_membership_list_with_http_info(self) -> MessagingApiResponse: """Get a list of memberships. :return: Returns the result object. @@ -1165,7 +1171,7 @@ async def get_membership_subscription(self, user_id: Annotated[StrictStr, Field( """ return await self._messaging_api.get_membership_subscription(user_id) - async def get_membership_subscription_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + async def get_membership_subscription_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> MessagingApiResponse: """Get a user's membership subscription. :param user_id: User ID (required) @@ -1183,7 +1189,7 @@ async def get_message_quota(self) -> MessageQuotaResponse: """ return await self._messaging_api.get_message_quota() - async def get_message_quota_with_http_info(self) -> ApiResponse: + async def get_message_quota_with_http_info(self) -> MessagingApiResponse: """Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. :return: Returns the result object. @@ -1199,7 +1205,7 @@ async def get_message_quota_consumption(self) -> QuotaConsumptionResponse: """ return await self._messaging_api.get_message_quota_consumption() - async def get_message_quota_consumption_with_http_info(self) -> ApiResponse: + async def get_message_quota_consumption_with_http_info(self) -> MessagingApiResponse: """Gets the number of messages sent in the current month. :return: Returns the result object. @@ -1217,7 +1223,7 @@ async def get_narrowcast_progress(self, request_id: Annotated[StrictStr, Field(. """ return await self._messaging_api.get_narrowcast_progress(request_id) - async def get_narrowcast_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description="The narrowcast message's request ID. Each Messaging API request has a request ID.")]) -> ApiResponse: + async def get_narrowcast_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description="The narrowcast message's request ID. Each Messaging API request has a request ID.")]) -> MessagingApiResponse: """Gets the status of a narrowcast message. :param request_id: The narrowcast message's request ID. Each Messaging API request has a request ID. (required) @@ -1237,7 +1243,7 @@ async def get_number_of_sent_broadcast_messages(self, var_date: Annotated[Strict """ return await self._messaging_api.get_number_of_sent_broadcast_messages(var_date) - async def get_number_of_sent_broadcast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')]) -> ApiResponse: + async def get_number_of_sent_broadcast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')]) -> MessagingApiResponse: """Get number of sent broadcast messages :param var_date: Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 (required) @@ -1257,7 +1263,7 @@ async def get_number_of_sent_multicast_messages(self, var_date: Annotated[Strict """ return await self._messaging_api.get_number_of_sent_multicast_messages(var_date) - async def get_number_of_sent_multicast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + async def get_number_of_sent_multicast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> MessagingApiResponse: """Get number of sent multicast messages :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) @@ -1277,7 +1283,7 @@ async def get_number_of_sent_push_messages(self, var_date: Annotated[StrictStr, """ return await self._messaging_api.get_number_of_sent_push_messages(var_date) - async def get_number_of_sent_push_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + async def get_number_of_sent_push_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> MessagingApiResponse: """Get number of sent push messages :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) @@ -1297,7 +1303,7 @@ async def get_number_of_sent_reply_messages(self, var_date: Annotated[StrictStr, """ return await self._messaging_api.get_number_of_sent_reply_messages(var_date) - async def get_number_of_sent_reply_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + async def get_number_of_sent_reply_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> MessagingApiResponse: """Get number of sent reply messages :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) @@ -1317,7 +1323,7 @@ async def get_pnp_message_statistics(self, var_date: Annotated[constr(strict=Tru """ return await self._messaging_api.get_pnp_message_statistics(var_date) - async def get_pnp_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 ')]) -> ApiResponse: + async def get_pnp_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 ')]) -> MessagingApiResponse: """Get number of sent LINE notification messages :param var_date: Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 (required) @@ -1337,7 +1343,7 @@ async def get_profile(self, user_id: Annotated[StrictStr, Field(..., description """ return await self._messaging_api.get_profile(user_id) - async def get_profile_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + async def get_profile_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> MessagingApiResponse: """Get profile :param user_id: User ID (required) @@ -1357,7 +1363,7 @@ async def get_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(..., desc """ return await self._messaging_api.get_rich_menu(rich_menu_id) - async def get_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + async def get_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> MessagingApiResponse: """Gets a rich menu via a rich menu ID. :param rich_menu_id: ID of a rich menu (required) @@ -1377,7 +1383,7 @@ async def get_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, Fie """ return await self._messaging_api.get_rich_menu_alias(rich_menu_alias_id) - async def get_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID whose information you want to obtain.')]) -> ApiResponse: + async def get_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID whose information you want to obtain.')]) -> MessagingApiResponse: """Get rich menu alias information :param rich_menu_alias_id: The rich menu alias ID whose information you want to obtain. (required) @@ -1395,7 +1401,7 @@ async def get_rich_menu_alias_list(self) -> RichMenuAliasListResponse: """ return await self._messaging_api.get_rich_menu_alias_list() - async def get_rich_menu_alias_list_with_http_info(self) -> ApiResponse: + async def get_rich_menu_alias_list_with_http_info(self) -> MessagingApiResponse: """Get list of rich menu alias :return: Returns the result object. @@ -1413,7 +1419,7 @@ async def get_rich_menu_batch_progress(self, request_id: Annotated[StrictStr, Fi """ return await self._messaging_api.get_rich_menu_batch_progress(request_id) - async def get_rich_menu_batch_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description='A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.')]) -> ApiResponse: + async def get_rich_menu_batch_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description='A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.')]) -> MessagingApiResponse: """Get the status of Replace or unlink a linked rich menus in batches. :param request_id: A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. (required) @@ -1433,7 +1439,7 @@ async def get_rich_menu_id_of_user(self, user_id: Annotated[StrictStr, Field(... """ return await self._messaging_api.get_rich_menu_id_of_user(user_id) - async def get_rich_menu_id_of_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> ApiResponse: + async def get_rich_menu_id_of_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> MessagingApiResponse: """Get rich menu ID of user :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) @@ -1451,7 +1457,7 @@ async def get_rich_menu_list(self) -> RichMenuListResponse: """ return await self._messaging_api.get_rich_menu_list() - async def get_rich_menu_list_with_http_info(self) -> ApiResponse: + async def get_rich_menu_list_with_http_info(self) -> MessagingApiResponse: """Get rich menu list :return: Returns the result object. @@ -1469,7 +1475,7 @@ async def get_room_member_count(self, room_id: Annotated[StrictStr, Field(..., d """ return await self._messaging_api.get_room_member_count(room_id) - async def get_room_member_count_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> ApiResponse: + async def get_room_member_count_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> MessagingApiResponse: """Get number of users in a multi-person chat :param room_id: Room ID (required) @@ -1491,7 +1497,7 @@ async def get_room_member_profile(self, room_id: Annotated[StrictStr, Field(..., """ return await self._messaging_api.get_room_member_profile(room_id, user_id) - async def get_room_member_profile_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + async def get_room_member_profile_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> MessagingApiResponse: """Get multi-person chat member profile :param room_id: Room ID (required) @@ -1515,7 +1521,7 @@ async def get_room_members_ids(self, room_id: Annotated[StrictStr, Field(..., de """ return await self._messaging_api.get_room_members_ids(room_id, start) - async def get_room_members_ids_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> ApiResponse: + async def get_room_members_ids_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> MessagingApiResponse: """Get multi-person chat member user IDs :param room_id: Room ID (required) @@ -1535,7 +1541,7 @@ async def get_webhook_endpoint(self) -> GetWebhookEndpointResponse: """ return await self._messaging_api.get_webhook_endpoint() - async def get_webhook_endpoint_with_http_info(self) -> ApiResponse: + async def get_webhook_endpoint_with_http_info(self) -> MessagingApiResponse: """Get webhook endpoint information :return: Returns the result object. @@ -1553,7 +1559,7 @@ async def issue_link_token(self, user_id: Annotated[StrictStr, Field(..., descri """ return await self._messaging_api.issue_link_token(user_id) - async def issue_link_token_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. ')]) -> ApiResponse: + async def issue_link_token_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. ')]) -> MessagingApiResponse: """Issue link token :param user_id: User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. (required) @@ -1573,7 +1579,7 @@ async def leave_group(self, group_id: Annotated[StrictStr, Field(..., descriptio """ return await self._messaging_api.leave_group(group_id) - async def leave_group_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + async def leave_group_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> MessagingApiResponse: """Leave group chat :param group_id: Group ID (required) @@ -1593,7 +1599,7 @@ async def leave_room(self, room_id: Annotated[StrictStr, Field(..., description= """ return await self._messaging_api.leave_room(room_id) - async def leave_room_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> ApiResponse: + async def leave_room_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> MessagingApiResponse: """Leave multi-person chat :param room_id: Room ID (required) @@ -1615,7 +1621,7 @@ async def link_rich_menu_id_to_user(self, user_id: Annotated[StrictStr, Field(.. """ return await self._messaging_api.link_rich_menu_id_to_user(user_id, rich_menu_id) - async def link_rich_menu_id_to_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')], rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + async def link_rich_menu_id_to_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')], rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> MessagingApiResponse: """Link rich menu to user. :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) @@ -1637,7 +1643,7 @@ async def link_rich_menu_id_to_users(self, rich_menu_bulk_link_request: RichMenu """ return await self._messaging_api.link_rich_menu_id_to_users(rich_menu_bulk_link_request) - async def link_rich_menu_id_to_users_with_http_info(self, rich_menu_bulk_link_request: RichMenuBulkLinkRequest) -> ApiResponse: + async def link_rich_menu_id_to_users_with_http_info(self, rich_menu_bulk_link_request: RichMenuBulkLinkRequest) -> MessagingApiResponse: """Link rich menu to multiple users :param rich_menu_bulk_link_request: (required) @@ -1661,7 +1667,7 @@ async def list_coupon(self, status: Annotated[Optional[conlist(StrictStr, unique """ return await self._messaging_api.list_coupon(status, start, limit) - async def list_coupon_with_http_info(self, status: Annotated[Optional[conlist(StrictStr, unique_items=True)], Field(description='Filter coupons by their status.')] = None, start: Annotated[Optional[StrictStr], Field(description='Pagination token to retrieve the next page of results.')] = None, limit: Annotated[Optional[conint(strict=True, le=100, ge=1)], Field(description='Maximum number of coupons to return per request.')] = None) -> ApiResponse: + async def list_coupon_with_http_info(self, status: Annotated[Optional[conlist(StrictStr, unique_items=True)], Field(description='Filter coupons by their status.')] = None, start: Annotated[Optional[StrictStr], Field(description='Pagination token to retrieve the next page of results.')] = None, limit: Annotated[Optional[conint(strict=True, le=100, ge=1)], Field(description='Maximum number of coupons to return per request.')] = None) -> MessagingApiResponse: """Get a paginated list of coupons. :param status: Filter coupons by their status. @@ -1685,7 +1691,7 @@ async def mark_messages_as_read(self, mark_messages_as_read_request: MarkMessage """ return await self._messaging_api.mark_messages_as_read(mark_messages_as_read_request) - async def mark_messages_as_read_with_http_info(self, mark_messages_as_read_request: MarkMessagesAsReadRequest) -> ApiResponse: + async def mark_messages_as_read_with_http_info(self, mark_messages_as_read_request: MarkMessagesAsReadRequest) -> MessagingApiResponse: """Mark messages from users as read :param mark_messages_as_read_request: (required) @@ -1705,7 +1711,7 @@ async def mark_messages_as_read_by_token(self, mark_messages_as_read_by_token_re """ return await self._messaging_api.mark_messages_as_read_by_token(mark_messages_as_read_by_token_request) - async def mark_messages_as_read_by_token_with_http_info(self, mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest) -> ApiResponse: + async def mark_messages_as_read_by_token_with_http_info(self, mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest) -> MessagingApiResponse: """Mark messages from users as read by token :param mark_messages_as_read_by_token_request: (required) @@ -1727,7 +1733,7 @@ async def multicast(self, multicast_request: MulticastRequest, x_line_retry_key: """ return await self._messaging_api.multicast(multicast_request, x_line_retry_key) - async def multicast_with_http_info(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) -> ApiResponse: + async def multicast_with_http_info(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) -> MessagingApiResponse: """An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats. :param multicast_request: (required) @@ -1751,7 +1757,7 @@ async def narrowcast(self, narrowcast_request: NarrowcastRequest, x_line_retry_k """ return await self._messaging_api.narrowcast(narrowcast_request, x_line_retry_key) - async def narrowcast_with_http_info(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) -> ApiResponse: + async def narrowcast_with_http_info(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) -> MessagingApiResponse: """Send narrowcast message :param narrowcast_request: (required) @@ -1775,7 +1781,7 @@ async def push_message(self, push_message_request: PushMessageRequest, x_line_re """ return await self._messaging_api.push_message(push_message_request, x_line_retry_key) - async def push_message_with_http_info(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) -> ApiResponse: + async def push_message_with_http_info(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) -> MessagingApiResponse: """Sends a message to a user, group chat, or multi-person chat at any time. :param push_message_request: (required) @@ -1799,7 +1805,7 @@ async def push_messages_by_phone(self, pnp_messages_request: PnpMessagesRequest, """ return await self._messaging_api.push_messages_by_phone(pnp_messages_request, x_line_delivery_tag) - async def push_messages_by_phone_with_http_info(self, pnp_messages_request: PnpMessagesRequest, 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) -> ApiResponse: + async def push_messages_by_phone_with_http_info(self, pnp_messages_request: PnpMessagesRequest, 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) -> MessagingApiResponse: """Send LINE notification message :param pnp_messages_request: (required) @@ -1821,7 +1827,7 @@ async def reply_message(self, reply_message_request: ReplyMessageRequest) -> Rep """ return await self._messaging_api.reply_message(reply_message_request) - async def reply_message_with_http_info(self, reply_message_request: ReplyMessageRequest) -> ApiResponse: + async def reply_message_with_http_info(self, reply_message_request: ReplyMessageRequest) -> MessagingApiResponse: """Send reply message :param reply_message_request: (required) @@ -1841,7 +1847,7 @@ async def rich_menu_batch(self, rich_menu_batch_request: RichMenuBatchRequest) - """ return await self._messaging_api.rich_menu_batch(rich_menu_batch_request) - async def rich_menu_batch_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> ApiResponse: + async def rich_menu_batch_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> MessagingApiResponse: """You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu :param rich_menu_batch_request: (required) @@ -1861,7 +1867,7 @@ async def set_default_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(. """ return await self._messaging_api.set_default_rich_menu(rich_menu_id) - async def set_default_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + async def set_default_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> MessagingApiResponse: """Set default rich menu :param rich_menu_id: ID of a rich menu (required) @@ -1881,7 +1887,7 @@ async def set_webhook_endpoint(self, set_webhook_endpoint_request: SetWebhookEnd """ return await self._messaging_api.set_webhook_endpoint(set_webhook_endpoint_request) - async def set_webhook_endpoint_with_http_info(self, set_webhook_endpoint_request: SetWebhookEndpointRequest) -> ApiResponse: + async def set_webhook_endpoint_with_http_info(self, set_webhook_endpoint_request: SetWebhookEndpointRequest) -> MessagingApiResponse: """Set webhook endpoint URL :param set_webhook_endpoint_request: (required) @@ -1901,7 +1907,7 @@ async def show_loading_animation(self, show_loading_animation_request: ShowLoadi """ return await self._messaging_api.show_loading_animation(show_loading_animation_request) - async def show_loading_animation_with_http_info(self, show_loading_animation_request: ShowLoadingAnimationRequest) -> ApiResponse: + async def show_loading_animation_with_http_info(self, show_loading_animation_request: ShowLoadingAnimationRequest) -> MessagingApiResponse: """Display a loading animation in one-on-one chats between users and LINE Official Accounts. :param show_loading_animation_request: (required) @@ -1921,7 +1927,7 @@ async def test_webhook_endpoint(self, test_webhook_endpoint_request: Optional[Te """ return await self._messaging_api.test_webhook_endpoint(test_webhook_endpoint_request) - async def test_webhook_endpoint_with_http_info(self, test_webhook_endpoint_request: Optional[TestWebhookEndpointRequest] = None) -> ApiResponse: + async def test_webhook_endpoint_with_http_info(self, test_webhook_endpoint_request: Optional[TestWebhookEndpointRequest] = None) -> MessagingApiResponse: """Test webhook endpoint :param test_webhook_endpoint_request: @@ -1941,7 +1947,7 @@ async def unlink_rich_menu_id_from_user(self, user_id: Annotated[StrictStr, Fiel """ return await self._messaging_api.unlink_rich_menu_id_from_user(user_id) - async def unlink_rich_menu_id_from_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> ApiResponse: + async def unlink_rich_menu_id_from_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> MessagingApiResponse: """Unlink rich menu from user :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) @@ -1961,7 +1967,7 @@ async def unlink_rich_menu_id_from_users(self, rich_menu_bulk_unlink_request: Ri """ return await self._messaging_api.unlink_rich_menu_id_from_users(rich_menu_bulk_unlink_request) - async def unlink_rich_menu_id_from_users_with_http_info(self, rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest) -> ApiResponse: + async def unlink_rich_menu_id_from_users_with_http_info(self, rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest) -> MessagingApiResponse: """Unlink rich menus from multiple users :param rich_menu_bulk_unlink_request: (required) @@ -1983,7 +1989,7 @@ async def update_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, """ return await self._messaging_api.update_rich_menu_alias(rich_menu_alias_id, update_rich_menu_alias_request) - async def update_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID you want to update.')], update_rich_menu_alias_request: UpdateRichMenuAliasRequest) -> ApiResponse: + async def update_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID you want to update.')], update_rich_menu_alias_request: UpdateRichMenuAliasRequest) -> MessagingApiResponse: """Update rich menu alias :param rich_menu_alias_id: The rich menu alias ID you want to update. (required) @@ -2005,7 +2011,7 @@ async def validate_broadcast(self, validate_message_request: ValidateMessageRequ """ return await self._messaging_api.validate_broadcast(validate_message_request) - async def validate_broadcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + async def validate_broadcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> MessagingApiResponse: """Validate message objects of a broadcast message :param validate_message_request: (required) @@ -2025,7 +2031,7 @@ async def validate_multicast(self, validate_message_request: ValidateMessageRequ """ return await self._messaging_api.validate_multicast(validate_message_request) - async def validate_multicast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + async def validate_multicast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> MessagingApiResponse: """Validate message objects of a multicast message :param validate_message_request: (required) @@ -2045,7 +2051,7 @@ async def validate_narrowcast(self, validate_message_request: ValidateMessageReq """ return await self._messaging_api.validate_narrowcast(validate_message_request) - async def validate_narrowcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + async def validate_narrowcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> MessagingApiResponse: """Validate message objects of a narrowcast message :param validate_message_request: (required) @@ -2065,7 +2071,7 @@ async def validate_push(self, validate_message_request: ValidateMessageRequest) """ return await self._messaging_api.validate_push(validate_message_request) - async def validate_push_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + async def validate_push_with_http_info(self, validate_message_request: ValidateMessageRequest) -> MessagingApiResponse: """Validate message objects of a push message :param validate_message_request: (required) @@ -2085,7 +2091,7 @@ async def validate_reply(self, validate_message_request: ValidateMessageRequest) """ return await self._messaging_api.validate_reply(validate_message_request) - async def validate_reply_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + async def validate_reply_with_http_info(self, validate_message_request: ValidateMessageRequest) -> MessagingApiResponse: """Validate message objects of a reply message :param validate_message_request: (required) @@ -2105,7 +2111,7 @@ async def validate_rich_menu_batch_request(self, rich_menu_batch_request: RichMe """ return await self._messaging_api.validate_rich_menu_batch_request(rich_menu_batch_request) - async def validate_rich_menu_batch_request_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> ApiResponse: + async def validate_rich_menu_batch_request_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> MessagingApiResponse: """Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. :param rich_menu_batch_request: (required) @@ -2125,7 +2131,7 @@ async def validate_rich_menu_object(self, rich_menu_request: RichMenuRequest) -> """ return await self._messaging_api.validate_rich_menu_object(rich_menu_request) - async def validate_rich_menu_object_with_http_info(self, rich_menu_request: RichMenuRequest) -> ApiResponse: + async def validate_rich_menu_object_with_http_info(self, rich_menu_request: RichMenuRequest) -> MessagingApiResponse: """Validate rich menu object :param rich_menu_request: (required) @@ -2145,7 +2151,7 @@ async def get_message_content(self, message_id: Annotated[StrictStr, Field(..., """ return await self._messaging_api_blob.get_message_content(message_id) - async def get_message_content_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> ApiResponse: + async def get_message_content_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> MessagingApiResponse: """Download image, video, and audio data sent from users. :param message_id: Message ID of video or audio (required) @@ -2165,7 +2171,7 @@ async def get_message_content_preview(self, message_id: Annotated[StrictStr, Fie """ return await self._messaging_api_blob.get_message_content_preview(message_id) - async def get_message_content_preview_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of image or video')]) -> ApiResponse: + async def get_message_content_preview_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of image or video')]) -> MessagingApiResponse: """Get a preview image of the image or video :param message_id: Message ID of image or video (required) @@ -2185,7 +2191,7 @@ async def get_message_content_transcoding_by_message_id(self, message_id: Annota """ return await self._messaging_api_blob.get_message_content_transcoding_by_message_id(message_id) - async def get_message_content_transcoding_by_message_id_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> ApiResponse: + async def get_message_content_transcoding_by_message_id_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> MessagingApiResponse: """Verify the preparation status of a video or audio for getting :param message_id: Message ID of video or audio (required) @@ -2205,7 +2211,7 @@ async def get_rich_menu_image(self, rich_menu_id: Annotated[StrictStr, Field(... """ return await self._messaging_api_blob.get_rich_menu_image(rich_menu_id) - async def get_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of the rich menu with the image to be downloaded')]) -> ApiResponse: + async def get_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of the rich menu with the image to be downloaded')]) -> MessagingApiResponse: """Download rich menu image. :param rich_menu_id: ID of the rich menu with the image to be downloaded (required) @@ -2227,7 +2233,7 @@ async def set_rich_menu_image(self, rich_menu_id: Annotated[StrictStr, Field(... """ return await self._messaging_api_blob.set_rich_menu_image(rich_menu_id, body) - async def set_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='The ID of the rich menu to attach the image to')], body: Union[StrictBytes, StrictStr]) -> ApiResponse: + async def set_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='The ID of the rich menu to attach the image to')], body: Union[StrictBytes, StrictStr]) -> MessagingApiResponse: """Upload rich menu image :param rich_menu_id: The ID of the rich menu to attach the image to (required) @@ -2251,7 +2257,7 @@ async def acquire_chat_control(self, chat_id: Annotated[StrictStr, Field(..., de """ return await self._line_module.acquire_chat_control(chat_id, acquire_chat_control_request) - async def acquire_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')], acquire_chat_control_request: Optional[AcquireChatControlRequest] = None) -> ApiResponse: + async def acquire_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')], acquire_chat_control_request: Optional[AcquireChatControlRequest] = None) -> ModuleApiResponse: """If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. :param chat_id: The `userId`, `roomId`, or `groupId` (required) @@ -2273,7 +2279,7 @@ async def detach_module(self, detach_module_request: Optional[DetachModuleReques """ return await self._line_module.detach_module(detach_module_request) - async def detach_module_with_http_info(self, detach_module_request: Optional[DetachModuleRequest] = None) -> ApiResponse: + async def detach_module_with_http_info(self, detach_module_request: Optional[DetachModuleRequest] = None) -> ModuleApiResponse: """The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. :param detach_module_request: @@ -2295,7 +2301,7 @@ async def get_modules(self, start: Annotated[Optional[StrictStr], Field(descript """ return await self._line_module.get_modules(start, limit) - async def get_modules_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. ")] = None, limit: Annotated[Optional[conint(strict=True, le=100)], Field(description='Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 ')] = None) -> ApiResponse: + async def get_modules_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. ")] = None, limit: Annotated[Optional[conint(strict=True, le=100)], Field(description='Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 ')] = None) -> ModuleApiResponse: """Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. :param start: Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. @@ -2317,7 +2323,7 @@ async def release_chat_control(self, chat_id: Annotated[StrictStr, Field(..., de """ return await self._line_module.release_chat_control(chat_id) - async def release_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')]) -> ApiResponse: + async def release_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')]) -> ModuleApiResponse: """To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. :param chat_id: The `userId`, `roomId`, or `groupId` (required) @@ -2355,7 +2361,7 @@ async def attach_module(self, grant_type: Annotated[StrictStr, Field(..., descri """ return await self._line_module_attach.attach_module(grant_type, code, redirect_uri, code_verifier, client_id, client_secret, region, basic_search_id, scope, brand_type) - async def attach_module_with_http_info(self, grant_type: Annotated[StrictStr, Field(..., description='authorization_code')], code: Annotated[StrictStr, Field(..., description='Authorization code received from the LINE Platform.')], redirect_uri: Annotated[StrictStr, Field(..., description='Specify the redirect_uri specified in the URL for authentication and authorization.')], code_verifier: Annotated[Optional[StrictStr], Field(description='Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks.')] = None, client_id: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. ')] = None, client_secret: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. ')] = None, region: Annotated[Optional[StrictStr], Field(description='If you specified a value for region in the URL for authentication and authorization, specify the same value. ')] = None, basic_search_id: Annotated[Optional[StrictStr], Field(description='If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value.')] = None, scope: Annotated[Optional[StrictStr], Field(description='If you specified a value for scope in the URL for authentication and authorization, specify the same value.')] = None, brand_type: Annotated[Optional[StrictStr], Field(description='If you specified a value for brand_type in the URL for authentication and authorization, specify the same value.')] = None) -> ApiResponse: + async def attach_module_with_http_info(self, grant_type: Annotated[StrictStr, Field(..., description='authorization_code')], code: Annotated[StrictStr, Field(..., description='Authorization code received from the LINE Platform.')], redirect_uri: Annotated[StrictStr, Field(..., description='Specify the redirect_uri specified in the URL for authentication and authorization.')], code_verifier: Annotated[Optional[StrictStr], Field(description='Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks.')] = None, client_id: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. ')] = None, client_secret: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. ')] = None, region: Annotated[Optional[StrictStr], Field(description='If you specified a value for region in the URL for authentication and authorization, specify the same value. ')] = None, basic_search_id: Annotated[Optional[StrictStr], Field(description='If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value.')] = None, scope: Annotated[Optional[StrictStr], Field(description='If you specified a value for scope in the URL for authentication and authorization, specify the same value.')] = None, brand_type: Annotated[Optional[StrictStr], Field(description='If you specified a value for brand_type in the URL for authentication and authorization, specify the same value.')] = None) -> ModuleattachApiResponse: """Attach by operation of the module channel provider :param grant_type: authorization_code (required) @@ -2393,7 +2399,7 @@ async def mission_sticker_v3(self, mission_sticker_request: MissionStickerReques """ return await self._shop.mission_sticker_v3(mission_sticker_request) - async def mission_sticker_v3_with_http_info(self, mission_sticker_request: MissionStickerRequest) -> ApiResponse: + async def mission_sticker_v3_with_http_info(self, mission_sticker_request: MissionStickerRequest) -> ShopApiResponse: """Sends a mission sticker. :param mission_sticker_request: (required) diff --git a/linebot/v3/line_bot_client.py b/linebot/v3/line_bot_client.py index 30c75e471..01d02033d 100644 --- a/linebot/v3/line_bot_client.py +++ b/linebot/v3/line_bot_client.py @@ -30,7 +30,13 @@ from linebot.v3.module.api.line_module import LineModule from linebot.v3.moduleattach.api.line_module_attach import LineModuleAttach from linebot.v3.shop.api.shop import Shop -from linebot.v3.audience.api_response import ApiResponse +from linebot.v3.audience.api_response import ApiResponse as AudienceApiResponse +from linebot.v3.insight.api_response import ApiResponse as InsightApiResponse +from linebot.v3.liff.api_response import ApiResponse as LiffApiResponse +from linebot.v3.messaging.api_response import ApiResponse as MessagingApiResponse +from linebot.v3.module.api_response import ApiResponse as ModuleApiResponse +from linebot.v3.moduleattach.api_response import ApiResponse as ModuleattachApiResponse +from linebot.v3.shop.api_response import ApiResponse as ShopApiResponse from linebot.v3.audience.models.add_audience_to_audience_group_request import AddAudienceToAudienceGroupRequest from linebot.v3.audience.models.audience_group_create_route import AudienceGroupCreateRoute @@ -245,7 +251,7 @@ def add_audience_to_audience_group(self, add_audience_to_audience_group_request: """ return self._manage_audience.add_audience_to_audience_group(add_audience_to_audience_group_request) - def add_audience_to_audience_group_with_http_info(self, add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest) -> ApiResponse: + def add_audience_to_audience_group_with_http_info(self, add_audience_to_audience_group_request: AddAudienceToAudienceGroupRequest) -> AudienceApiResponse: """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) :param add_audience_to_audience_group_request: (required) @@ -265,7 +271,7 @@ def create_audience_group(self, create_audience_group_request: CreateAudienceGro """ return self._manage_audience.create_audience_group(create_audience_group_request) - def create_audience_group_with_http_info(self, create_audience_group_request: CreateAudienceGroupRequest) -> ApiResponse: + def create_audience_group_with_http_info(self, create_audience_group_request: CreateAudienceGroupRequest) -> AudienceApiResponse: """Create audience for uploading user IDs (by JSON) :param create_audience_group_request: (required) @@ -285,7 +291,7 @@ def create_click_based_audience_group(self, create_click_based_audience_group_re """ return self._manage_audience.create_click_based_audience_group(create_click_based_audience_group_request) - def create_click_based_audience_group_with_http_info(self, create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest) -> ApiResponse: + def create_click_based_audience_group_with_http_info(self, create_click_based_audience_group_request: CreateClickBasedAudienceGroupRequest) -> AudienceApiResponse: """Create audience for click-based retargeting :param create_click_based_audience_group_request: (required) @@ -305,7 +311,7 @@ def create_imp_based_audience_group(self, create_imp_based_audience_group_reques """ return self._manage_audience.create_imp_based_audience_group(create_imp_based_audience_group_request) - def create_imp_based_audience_group_with_http_info(self, create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest) -> ApiResponse: + def create_imp_based_audience_group_with_http_info(self, create_imp_based_audience_group_request: CreateImpBasedAudienceGroupRequest) -> AudienceApiResponse: """Create audience for impression-based retargeting :param create_imp_based_audience_group_request: (required) @@ -325,7 +331,7 @@ def delete_audience_group(self, audience_group_id: Annotated[StrictInt, Field(.. """ return self._manage_audience.delete_audience_group(audience_group_id) - def delete_audience_group_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + def delete_audience_group_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> AudienceApiResponse: """Delete audience :param audience_group_id: The audience ID. (required) @@ -345,7 +351,7 @@ def get_audience_data(self, audience_group_id: Annotated[StrictInt, Field(..., d """ return self._manage_audience.get_audience_data(audience_group_id) - def get_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + def get_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> AudienceApiResponse: """Gets audience data. :param audience_group_id: The audience ID. (required) @@ -375,7 +381,7 @@ def get_audience_groups(self, page: Annotated[conint(strict=True, ge=1), Field(. """ return self._manage_audience.get_audience_groups(page, description, status, size, includes_external_public_groups, create_route) - def get_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, includes_external_public_groups: Annotated[Optional[StrictBool], Field(description='true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None) -> ApiResponse: + def get_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, includes_external_public_groups: Annotated[Optional[StrictBool], Field(description='true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None) -> AudienceApiResponse: """Gets data for more than one audience. :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) @@ -405,7 +411,7 @@ def get_shared_audience_data(self, audience_group_id: Annotated[StrictInt, Field """ return self._manage_audience.get_shared_audience_data(audience_group_id) - def get_shared_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> ApiResponse: + def get_shared_audience_data_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')]) -> AudienceApiResponse: """Gets audience data. :param audience_group_id: The audience ID. (required) @@ -435,7 +441,7 @@ def get_shared_audience_groups(self, page: Annotated[conint(strict=True, ge=1), """ return self._manage_audience.get_shared_audience_groups(page, description, status, size, create_route, includes_owned_audience_groups) - def get_shared_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None, includes_owned_audience_groups: Annotated[Optional[StrictBool], Field(description='true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ')] = None) -> ApiResponse: + def get_shared_audience_groups_with_http_info(self, page: Annotated[conint(strict=True, ge=1), Field(..., description='The page to return when getting (paginated) results. Must be 1 or higher.')], description: Annotated[Optional[StrictStr], Field(description='The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. ')] = None, status: Annotated[Optional[AudienceGroupStatus], Field(description='The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ')] = None, size: Annotated[Optional[conint(strict=True, le=40)], Field(description='The number of audiences per page. Default: 20 Max: 40 ')] = None, create_route: Annotated[Optional[AudienceGroupCreateRoute], Field(description='How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. ')] = None, includes_owned_audience_groups: Annotated[Optional[StrictBool], Field(description='true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ')] = None) -> AudienceApiResponse: """Gets data for more than one audience, including those shared by the Business Manager. :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) @@ -467,7 +473,7 @@ def update_audience_group_description(self, audience_group_id: Annotated[StrictI """ return self._manage_audience.update_audience_group_description(audience_group_id, update_audience_group_description_request) - def update_audience_group_description_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')], update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest) -> ApiResponse: + def update_audience_group_description_with_http_info(self, audience_group_id: Annotated[StrictInt, Field(..., description='The audience ID.')], update_audience_group_description_request: UpdateAudienceGroupDescriptionRequest) -> AudienceApiResponse: """Renames an existing audience. :param audience_group_id: The audience ID. (required) @@ -493,7 +499,7 @@ def add_user_ids_to_audience(self, file: Annotated[Union[StrictBytes, StrictStr] """ return self._manage_audience_blob.add_user_ids_to_audience(file, audience_group_id, upload_description) - def add_user_ids_to_audience_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], audience_group_id: Annotated[Optional[StrictInt], Field(description='The audience ID.')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register with the job')] = None) -> ApiResponse: + def add_user_ids_to_audience_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], audience_group_id: Annotated[Optional[StrictInt], Field(description='The audience ID.')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register with the job')] = None) -> AudienceApiResponse: """Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) @@ -523,7 +529,7 @@ def create_audience_for_uploading_user_ids(self, file: Annotated[Union[StrictByt """ return self._manage_audience_blob.create_audience_for_uploading_user_ids(file, description, is_ifa_audience, upload_description) - def create_audience_for_uploading_user_ids_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], description: Annotated[Optional[constr(strict=True, max_length=120)], Field(description="The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 ")] = None, is_ifa_audience: Annotated[Optional[StrictBool], Field(description='To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. ')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register for the job (in `jobs[].description`). ')] = None) -> ApiResponse: + def create_audience_for_uploading_user_ids_with_http_info(self, file: Annotated[Union[StrictBytes, StrictStr], Field(..., description='A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 ')], description: Annotated[Optional[constr(strict=True, max_length=120)], Field(description="The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 ")] = None, is_ifa_audience: Annotated[Optional[StrictBool], Field(description='To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. ')] = None, upload_description: Annotated[Optional[StrictStr], Field(description='The description to register for the job (in `jobs[].description`). ')] = None) -> AudienceApiResponse: """Create audience for uploading user IDs (by file). :param file: A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 (required) @@ -547,7 +553,7 @@ def get_friends_demographics(self) -> GetFriendsDemographicsResponse: """ return self._insight.get_friends_demographics() - def get_friends_demographics_with_http_info(self) -> ApiResponse: + def get_friends_demographics_with_http_info(self) -> InsightApiResponse: """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). :return: Returns the result object. @@ -567,7 +573,7 @@ def get_message_event(self, request_id: Annotated[constr(strict=True, min_length """ return self._insight.get_message_event(request_id) - def get_message_event_with_http_info(self, request_id: Annotated[constr(strict=True, min_length=1), Field(..., description='Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. ')]) -> ApiResponse: + def get_message_event_with_http_info(self, request_id: Annotated[constr(strict=True, min_length=1), Field(..., description='Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. ')]) -> InsightApiResponse: """Get user interaction statistics Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. @@ -591,7 +597,7 @@ def get_number_of_followers(self, var_date: Annotated[Optional[constr(strict=Tru """ return self._insight.get_number_of_followers(var_date) - def get_number_of_followers_with_http_info(self, var_date: Annotated[Optional[constr(strict=True, max_length=8, min_length=8)], Field(description='Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')] = None) -> ApiResponse: + def get_number_of_followers_with_http_info(self, var_date: Annotated[Optional[constr(strict=True, max_length=8, min_length=8)], Field(description='Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')] = None) -> InsightApiResponse: """Get number of followers Returns the number of users who have added the LINE Official Account on or before a specified date. @@ -615,7 +621,7 @@ def get_number_of_message_deliveries(self, var_date: Annotated[constr(strict=Tru """ return self._insight.get_number_of_message_deliveries(var_date) - def get_number_of_message_deliveries_with_http_info(self, var_date: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 ')]) -> ApiResponse: + def get_number_of_message_deliveries_with_http_info(self, var_date: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 ')]) -> InsightApiResponse: """Get number of message deliveries Returns the number of messages sent from LINE Official Account on a specified day. @@ -641,7 +647,7 @@ def get_statistics_per_unit(self, custom_aggregation_unit: Annotated[constr(stri """ return self._insight.get_statistics_per_unit(custom_aggregation_unit, var_from, to) - def get_statistics_per_unit_with_http_info(self, custom_aggregation_unit: Annotated[constr(strict=True, max_length=30, min_length=1), Field(..., description='Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. ')], var_from: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 ')], to: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='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 ')]) -> ApiResponse: + def get_statistics_per_unit_with_http_info(self, custom_aggregation_unit: Annotated[constr(strict=True, max_length=30, min_length=1), Field(..., description='Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. ')], var_from: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 ')], to: Annotated[constr(strict=True, max_length=8, min_length=8), Field(..., description='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 ')]) -> InsightApiResponse: """You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. :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) @@ -667,7 +673,7 @@ def add_liff_app(self, add_liff_app_request: AddLiffAppRequest) -> AddLiffAppRes """ return self._liff.add_liff_app(add_liff_app_request) - def add_liff_app_with_http_info(self, add_liff_app_request: AddLiffAppRequest) -> ApiResponse: + def add_liff_app_with_http_info(self, add_liff_app_request: AddLiffAppRequest) -> LiffApiResponse: """Create LIFF app Adding the LIFF app to a channel @@ -691,7 +697,7 @@ def delete_liff_app(self, liff_id: Annotated[StrictStr, Field(..., description=' """ return self._liff.delete_liff_app(liff_id) - def delete_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')]) -> ApiResponse: + def delete_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')]) -> LiffApiResponse: """Delete LIFF app from a channel Deletes a LIFF app from a channel. @@ -713,7 +719,7 @@ def get_all_liff_apps(self) -> GetAllLiffAppsResponse: """ return self._liff.get_all_liff_apps() - def get_all_liff_apps_with_http_info(self) -> ApiResponse: + def get_all_liff_apps_with_http_info(self) -> LiffApiResponse: """Get all LIFF apps Gets information on all the LIFF apps added to the channel. @@ -737,7 +743,7 @@ def update_liff_app(self, liff_id: Annotated[StrictStr, Field(..., description=' """ return self._liff.update_liff_app(liff_id, update_liff_app_request) - def update_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')], update_liff_app_request: UpdateLiffAppRequest) -> ApiResponse: + def update_liff_app_with_http_info(self, liff_id: Annotated[StrictStr, Field(..., description='ID of the LIFF app to be updated')], update_liff_app_request: UpdateLiffAppRequest) -> LiffApiResponse: """Update LIFF app from a channel Update LIFF app settings @@ -763,7 +769,7 @@ def broadcast(self, broadcast_request: BroadcastRequest, x_line_retry_key: Annot """ return self._messaging_api.broadcast(broadcast_request, x_line_retry_key) - def broadcast_with_http_info(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) -> ApiResponse: + def broadcast_with_http_info(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) -> MessagingApiResponse: """Sends a message to multiple users at any time. :param broadcast_request: (required) @@ -783,7 +789,7 @@ def cancel_default_rich_menu(self) -> None: """ return self._messaging_api.cancel_default_rich_menu() - def cancel_default_rich_menu_with_http_info(self) -> ApiResponse: + def cancel_default_rich_menu_with_http_info(self) -> MessagingApiResponse: """Cancel default rich menu :return: Returns the result object. @@ -801,7 +807,7 @@ def close_coupon(self, coupon_id: StrictStr) -> None: """ return self._messaging_api.close_coupon(coupon_id) - def close_coupon_with_http_info(self, coupon_id: StrictStr) -> ApiResponse: + def close_coupon_with_http_info(self, coupon_id: StrictStr) -> MessagingApiResponse: """Close coupon :param coupon_id: (required) @@ -821,7 +827,7 @@ def create_coupon(self, coupon_create_request: Optional[CouponCreateRequest] = N """ return self._messaging_api.create_coupon(coupon_create_request) - def create_coupon_with_http_info(self, coupon_create_request: Optional[CouponCreateRequest] = None) -> ApiResponse: + def create_coupon_with_http_info(self, coupon_create_request: Optional[CouponCreateRequest] = None) -> MessagingApiResponse: """Create a new coupon. Define coupon details such as type, title, and validity period. :param coupon_create_request: @@ -841,7 +847,7 @@ def create_rich_menu(self, rich_menu_request: RichMenuRequest) -> RichMenuIdResp """ return self._messaging_api.create_rich_menu(rich_menu_request) - def create_rich_menu_with_http_info(self, rich_menu_request: RichMenuRequest) -> ApiResponse: + def create_rich_menu_with_http_info(self, rich_menu_request: RichMenuRequest) -> MessagingApiResponse: """Create rich menu :param rich_menu_request: (required) @@ -861,7 +867,7 @@ def create_rich_menu_alias(self, create_rich_menu_alias_request: CreateRichMenuA """ return self._messaging_api.create_rich_menu_alias(create_rich_menu_alias_request) - def create_rich_menu_alias_with_http_info(self, create_rich_menu_alias_request: CreateRichMenuAliasRequest) -> ApiResponse: + def create_rich_menu_alias_with_http_info(self, create_rich_menu_alias_request: CreateRichMenuAliasRequest) -> MessagingApiResponse: """Create rich menu alias :param create_rich_menu_alias_request: (required) @@ -881,7 +887,7 @@ def delete_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(..., descrip """ return self._messaging_api.delete_rich_menu(rich_menu_id) - def delete_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + def delete_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> MessagingApiResponse: """Deletes a rich menu. :param rich_menu_id: ID of a rich menu (required) @@ -901,7 +907,7 @@ def delete_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, Field( """ return self._messaging_api.delete_rich_menu_alias(rich_menu_alias_id) - def delete_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='Rich menu alias ID that you want to delete.')]) -> ApiResponse: + def delete_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='Rich menu alias ID that you want to delete.')]) -> MessagingApiResponse: """Delete rich menu alias :param rich_menu_alias_id: Rich menu alias ID that you want to delete. (required) @@ -923,7 +929,7 @@ def get_aggregation_unit_name_list(self, limit: Annotated[Optional[StrictStr], F """ return self._messaging_api.get_aggregation_unit_name_list(limit, start) - def get_aggregation_unit_name_list_with_http_info(self, limit: Annotated[Optional[StrictStr], Field(description='The maximum number of aggregation units you can get per request. ')] = None, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. ")] = None) -> ApiResponse: + def get_aggregation_unit_name_list_with_http_info(self, limit: Annotated[Optional[StrictStr], Field(description='The maximum number of aggregation units you can get per request. ')] = None, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. ")] = None) -> MessagingApiResponse: """Get name list of units used this month :param limit: The maximum number of aggregation units you can get per request. @@ -943,7 +949,7 @@ def get_aggregation_unit_usage(self) -> GetAggregationUnitUsageResponse: """ return self._messaging_api.get_aggregation_unit_usage() - def get_aggregation_unit_usage_with_http_info(self) -> ApiResponse: + def get_aggregation_unit_usage_with_http_info(self) -> MessagingApiResponse: """Get number of units used this month :return: Returns the result object. @@ -959,7 +965,7 @@ def get_bot_info(self) -> BotInfoResponse: """ return self._messaging_api.get_bot_info() - def get_bot_info_with_http_info(self) -> ApiResponse: + def get_bot_info_with_http_info(self) -> MessagingApiResponse: """Get bot info :return: Returns the result object. @@ -977,7 +983,7 @@ def get_coupon_detail(self, coupon_id: StrictStr) -> CouponResponse: """ return self._messaging_api.get_coupon_detail(coupon_id) - def get_coupon_detail_with_http_info(self, coupon_id: StrictStr) -> ApiResponse: + def get_coupon_detail_with_http_info(self, coupon_id: StrictStr) -> MessagingApiResponse: """Get coupon detail :param coupon_id: (required) @@ -995,7 +1001,7 @@ def get_default_rich_menu_id(self) -> RichMenuIdResponse: """ return self._messaging_api.get_default_rich_menu_id() - def get_default_rich_menu_id_with_http_info(self) -> ApiResponse: + def get_default_rich_menu_id_with_http_info(self) -> MessagingApiResponse: """Gets the ID of the default rich menu set with the Messaging API. :return: Returns the result object. @@ -1015,7 +1021,7 @@ def get_followers(self, start: Annotated[Optional[StrictStr], Field(description= """ return self._messaging_api.get_followers(start, limit) - def get_followers_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. ')] = None, limit: Annotated[Optional[conint(strict=True, le=1000)], Field(description='The maximum number of user IDs to retrieve in a single request.')] = None) -> ApiResponse: + def get_followers_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. ')] = None, limit: Annotated[Optional[conint(strict=True, le=1000)], Field(description='The maximum number of user IDs to retrieve in a single request.')] = None) -> MessagingApiResponse: """Get a list of users who added your LINE Official Account as a friend :param start: Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. @@ -1037,7 +1043,7 @@ def get_group_member_count(self, group_id: Annotated[StrictStr, Field(..., descr """ return self._messaging_api.get_group_member_count(group_id) - def get_group_member_count_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + def get_group_member_count_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> MessagingApiResponse: """Get number of users in a group chat :param group_id: Group ID (required) @@ -1059,7 +1065,7 @@ def get_group_member_profile(self, group_id: Annotated[StrictStr, Field(..., des """ return self._messaging_api.get_group_member_profile(group_id, user_id) - def get_group_member_profile_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + def get_group_member_profile_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> MessagingApiResponse: """Get group chat member profile :param group_id: Group ID (required) @@ -1083,7 +1089,7 @@ def get_group_members_ids(self, group_id: Annotated[StrictStr, Field(..., descri """ return self._messaging_api.get_group_members_ids(group_id, start) - def get_group_members_ids_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> ApiResponse: + def get_group_members_ids_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> MessagingApiResponse: """Get group chat member user IDs :param group_id: Group ID (required) @@ -1105,7 +1111,7 @@ def get_group_summary(self, group_id: Annotated[StrictStr, Field(..., descriptio """ return self._messaging_api.get_group_summary(group_id) - def get_group_summary_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + def get_group_summary_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> MessagingApiResponse: """Get group chat summary :param group_id: Group ID (required) @@ -1129,7 +1135,7 @@ def get_joined_membership_users(self, membership_id: Annotated[StrictInt, Field( """ return self._messaging_api.get_joined_membership_users(membership_id, start, limit) - def get_joined_membership_users_with_http_info(self, membership_id: Annotated[StrictInt, Field(..., description='Membership plan ID.')], start: Annotated[Optional[StrictStr], Field(description="A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). ")] = None, limit: Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description='The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. ')] = None) -> ApiResponse: + def get_joined_membership_users_with_http_info(self, membership_id: Annotated[StrictInt, Field(..., description='Membership plan ID.')], start: Annotated[Optional[StrictStr], Field(description="A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). ")] = None, limit: Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description='The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. ')] = None) -> MessagingApiResponse: """Get a list of user IDs who joined the membership. :param membership_id: Membership plan ID. (required) @@ -1151,7 +1157,7 @@ def get_membership_list(self) -> MembershipListResponse: """ return self._messaging_api.get_membership_list() - def get_membership_list_with_http_info(self) -> ApiResponse: + def get_membership_list_with_http_info(self) -> MessagingApiResponse: """Get a list of memberships. :return: Returns the result object. @@ -1169,7 +1175,7 @@ def get_membership_subscription(self, user_id: Annotated[StrictStr, Field(..., d """ return self._messaging_api.get_membership_subscription(user_id) - def get_membership_subscription_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + def get_membership_subscription_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> MessagingApiResponse: """Get a user's membership subscription. :param user_id: User ID (required) @@ -1187,7 +1193,7 @@ def get_message_quota(self) -> MessageQuotaResponse: """ return self._messaging_api.get_message_quota() - def get_message_quota_with_http_info(self) -> ApiResponse: + def get_message_quota_with_http_info(self) -> MessagingApiResponse: """Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. :return: Returns the result object. @@ -1203,7 +1209,7 @@ def get_message_quota_consumption(self) -> QuotaConsumptionResponse: """ return self._messaging_api.get_message_quota_consumption() - def get_message_quota_consumption_with_http_info(self) -> ApiResponse: + def get_message_quota_consumption_with_http_info(self) -> MessagingApiResponse: """Gets the number of messages sent in the current month. :return: Returns the result object. @@ -1221,7 +1227,7 @@ def get_narrowcast_progress(self, request_id: Annotated[StrictStr, Field(..., de """ return self._messaging_api.get_narrowcast_progress(request_id) - def get_narrowcast_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description="The narrowcast message's request ID. Each Messaging API request has a request ID.")]) -> ApiResponse: + def get_narrowcast_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description="The narrowcast message's request ID. Each Messaging API request has a request ID.")]) -> MessagingApiResponse: """Gets the status of a narrowcast message. :param request_id: The narrowcast message's request ID. Each Messaging API request has a request ID. (required) @@ -1241,7 +1247,7 @@ def get_number_of_sent_broadcast_messages(self, var_date: Annotated[StrictStr, F """ return self._messaging_api.get_number_of_sent_broadcast_messages(var_date) - def get_number_of_sent_broadcast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')]) -> ApiResponse: + def get_number_of_sent_broadcast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 ')]) -> MessagingApiResponse: """Get number of sent broadcast messages :param var_date: Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 (required) @@ -1261,7 +1267,7 @@ def get_number_of_sent_multicast_messages(self, var_date: Annotated[StrictStr, F """ return self._messaging_api.get_number_of_sent_multicast_messages(var_date) - def get_number_of_sent_multicast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + def get_number_of_sent_multicast_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> MessagingApiResponse: """Get number of sent multicast messages :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) @@ -1281,7 +1287,7 @@ def get_number_of_sent_push_messages(self, var_date: Annotated[StrictStr, Field( """ return self._messaging_api.get_number_of_sent_push_messages(var_date) - def get_number_of_sent_push_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + def get_number_of_sent_push_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> MessagingApiResponse: """Get number of sent push messages :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) @@ -1301,7 +1307,7 @@ def get_number_of_sent_reply_messages(self, var_date: Annotated[StrictStr, Field """ return self._messaging_api.get_number_of_sent_reply_messages(var_date) - def get_number_of_sent_reply_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> ApiResponse: + def get_number_of_sent_reply_messages_with_http_info(self, var_date: Annotated[StrictStr, Field(..., description='Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 ')]) -> MessagingApiResponse: """Get number of sent reply messages :param var_date: Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 (required) @@ -1321,7 +1327,7 @@ def get_pnp_message_statistics(self, var_date: Annotated[constr(strict=True), Fi """ return self._messaging_api.get_pnp_message_statistics(var_date) - def get_pnp_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 ')]) -> ApiResponse: + def get_pnp_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 ')]) -> MessagingApiResponse: """Get number of sent LINE notification messages :param var_date: Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 (required) @@ -1341,7 +1347,7 @@ def get_profile(self, user_id: Annotated[StrictStr, Field(..., description='User """ return self._messaging_api.get_profile(user_id) - def get_profile_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + def get_profile_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> MessagingApiResponse: """Get profile :param user_id: User ID (required) @@ -1361,7 +1367,7 @@ def get_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(..., descriptio """ return self._messaging_api.get_rich_menu(rich_menu_id) - def get_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + def get_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> MessagingApiResponse: """Gets a rich menu via a rich menu ID. :param rich_menu_id: ID of a rich menu (required) @@ -1381,7 +1387,7 @@ def get_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, Field(... """ return self._messaging_api.get_rich_menu_alias(rich_menu_alias_id) - def get_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID whose information you want to obtain.')]) -> ApiResponse: + def get_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID whose information you want to obtain.')]) -> MessagingApiResponse: """Get rich menu alias information :param rich_menu_alias_id: The rich menu alias ID whose information you want to obtain. (required) @@ -1399,7 +1405,7 @@ def get_rich_menu_alias_list(self) -> RichMenuAliasListResponse: """ return self._messaging_api.get_rich_menu_alias_list() - def get_rich_menu_alias_list_with_http_info(self) -> ApiResponse: + def get_rich_menu_alias_list_with_http_info(self) -> MessagingApiResponse: """Get list of rich menu alias :return: Returns the result object. @@ -1417,7 +1423,7 @@ def get_rich_menu_batch_progress(self, request_id: Annotated[StrictStr, Field(.. """ return self._messaging_api.get_rich_menu_batch_progress(request_id) - def get_rich_menu_batch_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description='A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.')]) -> ApiResponse: + def get_rich_menu_batch_progress_with_http_info(self, request_id: Annotated[StrictStr, Field(..., description='A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.')]) -> MessagingApiResponse: """Get the status of Replace or unlink a linked rich menus in batches. :param request_id: A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. (required) @@ -1437,7 +1443,7 @@ def get_rich_menu_id_of_user(self, user_id: Annotated[StrictStr, Field(..., desc """ return self._messaging_api.get_rich_menu_id_of_user(user_id) - def get_rich_menu_id_of_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> ApiResponse: + def get_rich_menu_id_of_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> MessagingApiResponse: """Get rich menu ID of user :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) @@ -1455,7 +1461,7 @@ def get_rich_menu_list(self) -> RichMenuListResponse: """ return self._messaging_api.get_rich_menu_list() - def get_rich_menu_list_with_http_info(self) -> ApiResponse: + def get_rich_menu_list_with_http_info(self) -> MessagingApiResponse: """Get rich menu list :return: Returns the result object. @@ -1473,7 +1479,7 @@ def get_room_member_count(self, room_id: Annotated[StrictStr, Field(..., descrip """ return self._messaging_api.get_room_member_count(room_id) - def get_room_member_count_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> ApiResponse: + def get_room_member_count_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> MessagingApiResponse: """Get number of users in a multi-person chat :param room_id: Room ID (required) @@ -1495,7 +1501,7 @@ def get_room_member_profile(self, room_id: Annotated[StrictStr, Field(..., descr """ return self._messaging_api.get_room_member_profile(room_id, user_id) - def get_room_member_profile_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> ApiResponse: + def get_room_member_profile_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], user_id: Annotated[StrictStr, Field(..., description='User ID')]) -> MessagingApiResponse: """Get multi-person chat member profile :param room_id: Room ID (required) @@ -1519,7 +1525,7 @@ def get_room_members_ids(self, room_id: Annotated[StrictStr, Field(..., descript """ return self._messaging_api.get_room_members_ids(room_id, start) - def get_room_members_ids_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> ApiResponse: + def get_room_members_ids_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')], start: Annotated[Optional[StrictStr], Field(description='Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. ')] = None) -> MessagingApiResponse: """Get multi-person chat member user IDs :param room_id: Room ID (required) @@ -1539,7 +1545,7 @@ def get_webhook_endpoint(self) -> GetWebhookEndpointResponse: """ return self._messaging_api.get_webhook_endpoint() - def get_webhook_endpoint_with_http_info(self) -> ApiResponse: + def get_webhook_endpoint_with_http_info(self) -> MessagingApiResponse: """Get webhook endpoint information :return: Returns the result object. @@ -1557,7 +1563,7 @@ def issue_link_token(self, user_id: Annotated[StrictStr, Field(..., description= """ return self._messaging_api.issue_link_token(user_id) - def issue_link_token_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. ')]) -> ApiResponse: + def issue_link_token_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. ')]) -> MessagingApiResponse: """Issue link token :param user_id: User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. (required) @@ -1577,7 +1583,7 @@ def leave_group(self, group_id: Annotated[StrictStr, Field(..., description='Gro """ return self._messaging_api.leave_group(group_id) - def leave_group_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> ApiResponse: + def leave_group_with_http_info(self, group_id: Annotated[StrictStr, Field(..., description='Group ID')]) -> MessagingApiResponse: """Leave group chat :param group_id: Group ID (required) @@ -1597,7 +1603,7 @@ def leave_room(self, room_id: Annotated[StrictStr, Field(..., description='Room """ return self._messaging_api.leave_room(room_id) - def leave_room_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> ApiResponse: + def leave_room_with_http_info(self, room_id: Annotated[StrictStr, Field(..., description='Room ID')]) -> MessagingApiResponse: """Leave multi-person chat :param room_id: Room ID (required) @@ -1619,7 +1625,7 @@ def link_rich_menu_id_to_user(self, user_id: Annotated[StrictStr, Field(..., des """ return self._messaging_api.link_rich_menu_id_to_user(user_id, rich_menu_id) - def link_rich_menu_id_to_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')], rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + def link_rich_menu_id_to_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')], rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> MessagingApiResponse: """Link rich menu to user. :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) @@ -1641,7 +1647,7 @@ def link_rich_menu_id_to_users(self, rich_menu_bulk_link_request: RichMenuBulkLi """ return self._messaging_api.link_rich_menu_id_to_users(rich_menu_bulk_link_request) - def link_rich_menu_id_to_users_with_http_info(self, rich_menu_bulk_link_request: RichMenuBulkLinkRequest) -> ApiResponse: + def link_rich_menu_id_to_users_with_http_info(self, rich_menu_bulk_link_request: RichMenuBulkLinkRequest) -> MessagingApiResponse: """Link rich menu to multiple users :param rich_menu_bulk_link_request: (required) @@ -1665,7 +1671,7 @@ def list_coupon(self, status: Annotated[Optional[conlist(StrictStr, unique_items """ return self._messaging_api.list_coupon(status, start, limit) - def list_coupon_with_http_info(self, status: Annotated[Optional[conlist(StrictStr, unique_items=True)], Field(description='Filter coupons by their status.')] = None, start: Annotated[Optional[StrictStr], Field(description='Pagination token to retrieve the next page of results.')] = None, limit: Annotated[Optional[conint(strict=True, le=100, ge=1)], Field(description='Maximum number of coupons to return per request.')] = None) -> ApiResponse: + def list_coupon_with_http_info(self, status: Annotated[Optional[conlist(StrictStr, unique_items=True)], Field(description='Filter coupons by their status.')] = None, start: Annotated[Optional[StrictStr], Field(description='Pagination token to retrieve the next page of results.')] = None, limit: Annotated[Optional[conint(strict=True, le=100, ge=1)], Field(description='Maximum number of coupons to return per request.')] = None) -> MessagingApiResponse: """Get a paginated list of coupons. :param status: Filter coupons by their status. @@ -1689,7 +1695,7 @@ def mark_messages_as_read(self, mark_messages_as_read_request: MarkMessagesAsRea """ return self._messaging_api.mark_messages_as_read(mark_messages_as_read_request) - def mark_messages_as_read_with_http_info(self, mark_messages_as_read_request: MarkMessagesAsReadRequest) -> ApiResponse: + def mark_messages_as_read_with_http_info(self, mark_messages_as_read_request: MarkMessagesAsReadRequest) -> MessagingApiResponse: """Mark messages from users as read :param mark_messages_as_read_request: (required) @@ -1709,7 +1715,7 @@ def mark_messages_as_read_by_token(self, mark_messages_as_read_by_token_request: """ return self._messaging_api.mark_messages_as_read_by_token(mark_messages_as_read_by_token_request) - def mark_messages_as_read_by_token_with_http_info(self, mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest) -> ApiResponse: + def mark_messages_as_read_by_token_with_http_info(self, mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest) -> MessagingApiResponse: """Mark messages from users as read by token :param mark_messages_as_read_by_token_request: (required) @@ -1731,7 +1737,7 @@ def multicast(self, multicast_request: MulticastRequest, x_line_retry_key: Annot """ return self._messaging_api.multicast(multicast_request, x_line_retry_key) - def multicast_with_http_info(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) -> ApiResponse: + def multicast_with_http_info(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) -> MessagingApiResponse: """An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats. :param multicast_request: (required) @@ -1755,7 +1761,7 @@ def narrowcast(self, narrowcast_request: NarrowcastRequest, x_line_retry_key: An """ return self._messaging_api.narrowcast(narrowcast_request, x_line_retry_key) - def narrowcast_with_http_info(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) -> ApiResponse: + def narrowcast_with_http_info(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) -> MessagingApiResponse: """Send narrowcast message :param narrowcast_request: (required) @@ -1779,7 +1785,7 @@ def push_message(self, push_message_request: PushMessageRequest, x_line_retry_ke """ return self._messaging_api.push_message(push_message_request, x_line_retry_key) - def push_message_with_http_info(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) -> ApiResponse: + def push_message_with_http_info(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) -> MessagingApiResponse: """Sends a message to a user, group chat, or multi-person chat at any time. :param push_message_request: (required) @@ -1803,7 +1809,7 @@ def push_messages_by_phone(self, pnp_messages_request: PnpMessagesRequest, x_lin """ return self._messaging_api.push_messages_by_phone(pnp_messages_request, x_line_delivery_tag) - def push_messages_by_phone_with_http_info(self, pnp_messages_request: PnpMessagesRequest, 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) -> ApiResponse: + def push_messages_by_phone_with_http_info(self, pnp_messages_request: PnpMessagesRequest, 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) -> MessagingApiResponse: """Send LINE notification message :param pnp_messages_request: (required) @@ -1825,7 +1831,7 @@ def reply_message(self, reply_message_request: ReplyMessageRequest) -> ReplyMess """ return self._messaging_api.reply_message(reply_message_request) - def reply_message_with_http_info(self, reply_message_request: ReplyMessageRequest) -> ApiResponse: + def reply_message_with_http_info(self, reply_message_request: ReplyMessageRequest) -> MessagingApiResponse: """Send reply message :param reply_message_request: (required) @@ -1845,7 +1851,7 @@ def rich_menu_batch(self, rich_menu_batch_request: RichMenuBatchRequest) -> None """ return self._messaging_api.rich_menu_batch(rich_menu_batch_request) - def rich_menu_batch_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> ApiResponse: + def rich_menu_batch_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> MessagingApiResponse: """You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu :param rich_menu_batch_request: (required) @@ -1865,7 +1871,7 @@ def set_default_rich_menu(self, rich_menu_id: Annotated[StrictStr, Field(..., de """ return self._messaging_api.set_default_rich_menu(rich_menu_id) - def set_default_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> ApiResponse: + def set_default_rich_menu_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of a rich menu')]) -> MessagingApiResponse: """Set default rich menu :param rich_menu_id: ID of a rich menu (required) @@ -1885,7 +1891,7 @@ def set_webhook_endpoint(self, set_webhook_endpoint_request: SetWebhookEndpointR """ return self._messaging_api.set_webhook_endpoint(set_webhook_endpoint_request) - def set_webhook_endpoint_with_http_info(self, set_webhook_endpoint_request: SetWebhookEndpointRequest) -> ApiResponse: + def set_webhook_endpoint_with_http_info(self, set_webhook_endpoint_request: SetWebhookEndpointRequest) -> MessagingApiResponse: """Set webhook endpoint URL :param set_webhook_endpoint_request: (required) @@ -1905,7 +1911,7 @@ def show_loading_animation(self, show_loading_animation_request: ShowLoadingAnim """ return self._messaging_api.show_loading_animation(show_loading_animation_request) - def show_loading_animation_with_http_info(self, show_loading_animation_request: ShowLoadingAnimationRequest) -> ApiResponse: + def show_loading_animation_with_http_info(self, show_loading_animation_request: ShowLoadingAnimationRequest) -> MessagingApiResponse: """Display a loading animation in one-on-one chats between users and LINE Official Accounts. :param show_loading_animation_request: (required) @@ -1925,7 +1931,7 @@ def test_webhook_endpoint(self, test_webhook_endpoint_request: Optional[TestWebh """ return self._messaging_api.test_webhook_endpoint(test_webhook_endpoint_request) - def test_webhook_endpoint_with_http_info(self, test_webhook_endpoint_request: Optional[TestWebhookEndpointRequest] = None) -> ApiResponse: + def test_webhook_endpoint_with_http_info(self, test_webhook_endpoint_request: Optional[TestWebhookEndpointRequest] = None) -> MessagingApiResponse: """Test webhook endpoint :param test_webhook_endpoint_request: @@ -1945,7 +1951,7 @@ def unlink_rich_menu_id_from_user(self, user_id: Annotated[StrictStr, Field(..., """ return self._messaging_api.unlink_rich_menu_id_from_user(user_id) - def unlink_rich_menu_id_from_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> ApiResponse: + def unlink_rich_menu_id_from_user_with_http_info(self, user_id: Annotated[StrictStr, Field(..., description='User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.')]) -> MessagingApiResponse: """Unlink rich menu from user :param user_id: User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. (required) @@ -1965,7 +1971,7 @@ def unlink_rich_menu_id_from_users(self, rich_menu_bulk_unlink_request: RichMenu """ return self._messaging_api.unlink_rich_menu_id_from_users(rich_menu_bulk_unlink_request) - def unlink_rich_menu_id_from_users_with_http_info(self, rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest) -> ApiResponse: + def unlink_rich_menu_id_from_users_with_http_info(self, rich_menu_bulk_unlink_request: RichMenuBulkUnlinkRequest) -> MessagingApiResponse: """Unlink rich menus from multiple users :param rich_menu_bulk_unlink_request: (required) @@ -1987,7 +1993,7 @@ def update_rich_menu_alias(self, rich_menu_alias_id: Annotated[StrictStr, Field( """ return self._messaging_api.update_rich_menu_alias(rich_menu_alias_id, update_rich_menu_alias_request) - def update_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID you want to update.')], update_rich_menu_alias_request: UpdateRichMenuAliasRequest) -> ApiResponse: + def update_rich_menu_alias_with_http_info(self, rich_menu_alias_id: Annotated[StrictStr, Field(..., description='The rich menu alias ID you want to update.')], update_rich_menu_alias_request: UpdateRichMenuAliasRequest) -> MessagingApiResponse: """Update rich menu alias :param rich_menu_alias_id: The rich menu alias ID you want to update. (required) @@ -2009,7 +2015,7 @@ def validate_broadcast(self, validate_message_request: ValidateMessageRequest) - """ return self._messaging_api.validate_broadcast(validate_message_request) - def validate_broadcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + def validate_broadcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> MessagingApiResponse: """Validate message objects of a broadcast message :param validate_message_request: (required) @@ -2029,7 +2035,7 @@ def validate_multicast(self, validate_message_request: ValidateMessageRequest) - """ return self._messaging_api.validate_multicast(validate_message_request) - def validate_multicast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + def validate_multicast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> MessagingApiResponse: """Validate message objects of a multicast message :param validate_message_request: (required) @@ -2049,7 +2055,7 @@ def validate_narrowcast(self, validate_message_request: ValidateMessageRequest) """ return self._messaging_api.validate_narrowcast(validate_message_request) - def validate_narrowcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + def validate_narrowcast_with_http_info(self, validate_message_request: ValidateMessageRequest) -> MessagingApiResponse: """Validate message objects of a narrowcast message :param validate_message_request: (required) @@ -2069,7 +2075,7 @@ def validate_push(self, validate_message_request: ValidateMessageRequest) -> Non """ return self._messaging_api.validate_push(validate_message_request) - def validate_push_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + def validate_push_with_http_info(self, validate_message_request: ValidateMessageRequest) -> MessagingApiResponse: """Validate message objects of a push message :param validate_message_request: (required) @@ -2089,7 +2095,7 @@ def validate_reply(self, validate_message_request: ValidateMessageRequest) -> No """ return self._messaging_api.validate_reply(validate_message_request) - def validate_reply_with_http_info(self, validate_message_request: ValidateMessageRequest) -> ApiResponse: + def validate_reply_with_http_info(self, validate_message_request: ValidateMessageRequest) -> MessagingApiResponse: """Validate message objects of a reply message :param validate_message_request: (required) @@ -2109,7 +2115,7 @@ def validate_rich_menu_batch_request(self, rich_menu_batch_request: RichMenuBatc """ return self._messaging_api.validate_rich_menu_batch_request(rich_menu_batch_request) - def validate_rich_menu_batch_request_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> ApiResponse: + def validate_rich_menu_batch_request_with_http_info(self, rich_menu_batch_request: RichMenuBatchRequest) -> MessagingApiResponse: """Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. :param rich_menu_batch_request: (required) @@ -2129,7 +2135,7 @@ def validate_rich_menu_object(self, rich_menu_request: RichMenuRequest) -> None: """ return self._messaging_api.validate_rich_menu_object(rich_menu_request) - def validate_rich_menu_object_with_http_info(self, rich_menu_request: RichMenuRequest) -> ApiResponse: + def validate_rich_menu_object_with_http_info(self, rich_menu_request: RichMenuRequest) -> MessagingApiResponse: """Validate rich menu object :param rich_menu_request: (required) @@ -2149,7 +2155,7 @@ def get_message_content(self, message_id: Annotated[StrictStr, Field(..., descri """ return self._messaging_api_blob.get_message_content(message_id) - def get_message_content_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> ApiResponse: + def get_message_content_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> MessagingApiResponse: """Download image, video, and audio data sent from users. :param message_id: Message ID of video or audio (required) @@ -2169,7 +2175,7 @@ def get_message_content_preview(self, message_id: Annotated[StrictStr, Field(... """ return self._messaging_api_blob.get_message_content_preview(message_id) - def get_message_content_preview_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of image or video')]) -> ApiResponse: + def get_message_content_preview_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of image or video')]) -> MessagingApiResponse: """Get a preview image of the image or video :param message_id: Message ID of image or video (required) @@ -2189,7 +2195,7 @@ def get_message_content_transcoding_by_message_id(self, message_id: Annotated[St """ return self._messaging_api_blob.get_message_content_transcoding_by_message_id(message_id) - def get_message_content_transcoding_by_message_id_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> ApiResponse: + def get_message_content_transcoding_by_message_id_with_http_info(self, message_id: Annotated[StrictStr, Field(..., description='Message ID of video or audio')]) -> MessagingApiResponse: """Verify the preparation status of a video or audio for getting :param message_id: Message ID of video or audio (required) @@ -2209,7 +2215,7 @@ def get_rich_menu_image(self, rich_menu_id: Annotated[StrictStr, Field(..., desc """ return self._messaging_api_blob.get_rich_menu_image(rich_menu_id) - def get_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of the rich menu with the image to be downloaded')]) -> ApiResponse: + def get_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='ID of the rich menu with the image to be downloaded')]) -> MessagingApiResponse: """Download rich menu image. :param rich_menu_id: ID of the rich menu with the image to be downloaded (required) @@ -2231,7 +2237,7 @@ def set_rich_menu_image(self, rich_menu_id: Annotated[StrictStr, Field(..., desc """ return self._messaging_api_blob.set_rich_menu_image(rich_menu_id, body) - def set_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='The ID of the rich menu to attach the image to')], body: Union[StrictBytes, StrictStr]) -> ApiResponse: + def set_rich_menu_image_with_http_info(self, rich_menu_id: Annotated[StrictStr, Field(..., description='The ID of the rich menu to attach the image to')], body: Union[StrictBytes, StrictStr]) -> MessagingApiResponse: """Upload rich menu image :param rich_menu_id: The ID of the rich menu to attach the image to (required) @@ -2255,7 +2261,7 @@ def acquire_chat_control(self, chat_id: Annotated[StrictStr, Field(..., descript """ return self._line_module.acquire_chat_control(chat_id, acquire_chat_control_request) - def acquire_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')], acquire_chat_control_request: Optional[AcquireChatControlRequest] = None) -> ApiResponse: + def acquire_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')], acquire_chat_control_request: Optional[AcquireChatControlRequest] = None) -> ModuleApiResponse: """If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. :param chat_id: The `userId`, `roomId`, or `groupId` (required) @@ -2277,7 +2283,7 @@ def detach_module(self, detach_module_request: Optional[DetachModuleRequest] = N """ return self._line_module.detach_module(detach_module_request) - def detach_module_with_http_info(self, detach_module_request: Optional[DetachModuleRequest] = None) -> ApiResponse: + def detach_module_with_http_info(self, detach_module_request: Optional[DetachModuleRequest] = None) -> ModuleApiResponse: """The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. :param detach_module_request: @@ -2299,7 +2305,7 @@ def get_modules(self, start: Annotated[Optional[StrictStr], Field(description="V """ return self._line_module.get_modules(start, limit) - def get_modules_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. ")] = None, limit: Annotated[Optional[conint(strict=True, le=100)], Field(description='Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 ')] = None) -> ApiResponse: + def get_modules_with_http_info(self, start: Annotated[Optional[StrictStr], Field(description="Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. ")] = None, limit: Annotated[Optional[conint(strict=True, le=100)], Field(description='Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 ')] = None) -> ModuleApiResponse: """Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. :param start: Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. @@ -2321,7 +2327,7 @@ def release_chat_control(self, chat_id: Annotated[StrictStr, Field(..., descript """ return self._line_module.release_chat_control(chat_id) - def release_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')]) -> ApiResponse: + def release_chat_control_with_http_info(self, chat_id: Annotated[StrictStr, Field(..., description='The `userId`, `roomId`, or `groupId`')]) -> ModuleApiResponse: """To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. :param chat_id: The `userId`, `roomId`, or `groupId` (required) @@ -2359,7 +2365,7 @@ def attach_module(self, grant_type: Annotated[StrictStr, Field(..., description= """ return self._line_module_attach.attach_module(grant_type, code, redirect_uri, code_verifier, client_id, client_secret, region, basic_search_id, scope, brand_type) - def attach_module_with_http_info(self, grant_type: Annotated[StrictStr, Field(..., description='authorization_code')], code: Annotated[StrictStr, Field(..., description='Authorization code received from the LINE Platform.')], redirect_uri: Annotated[StrictStr, Field(..., description='Specify the redirect_uri specified in the URL for authentication and authorization.')], code_verifier: Annotated[Optional[StrictStr], Field(description='Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks.')] = None, client_id: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. ')] = None, client_secret: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. ')] = None, region: Annotated[Optional[StrictStr], Field(description='If you specified a value for region in the URL for authentication and authorization, specify the same value. ')] = None, basic_search_id: Annotated[Optional[StrictStr], Field(description='If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value.')] = None, scope: Annotated[Optional[StrictStr], Field(description='If you specified a value for scope in the URL for authentication and authorization, specify the same value.')] = None, brand_type: Annotated[Optional[StrictStr], Field(description='If you specified a value for brand_type in the URL for authentication and authorization, specify the same value.')] = None) -> ApiResponse: + def attach_module_with_http_info(self, grant_type: Annotated[StrictStr, Field(..., description='authorization_code')], code: Annotated[StrictStr, Field(..., description='Authorization code received from the LINE Platform.')], redirect_uri: Annotated[StrictStr, Field(..., description='Specify the redirect_uri specified in the URL for authentication and authorization.')], code_verifier: Annotated[Optional[StrictStr], Field(description='Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks.')] = None, client_id: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. ')] = None, client_secret: Annotated[Optional[StrictStr], Field(description='Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. ')] = None, region: Annotated[Optional[StrictStr], Field(description='If you specified a value for region in the URL for authentication and authorization, specify the same value. ')] = None, basic_search_id: Annotated[Optional[StrictStr], Field(description='If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value.')] = None, scope: Annotated[Optional[StrictStr], Field(description='If you specified a value for scope in the URL for authentication and authorization, specify the same value.')] = None, brand_type: Annotated[Optional[StrictStr], Field(description='If you specified a value for brand_type in the URL for authentication and authorization, specify the same value.')] = None) -> ModuleattachApiResponse: """Attach by operation of the module channel provider :param grant_type: authorization_code (required) @@ -2397,7 +2403,7 @@ def mission_sticker_v3(self, mission_sticker_request: MissionStickerRequest) -> """ return self._shop.mission_sticker_v3(mission_sticker_request) - def mission_sticker_v3_with_http_info(self, mission_sticker_request: MissionStickerRequest) -> ApiResponse: + def mission_sticker_v3_with_http_info(self, mission_sticker_request: MissionStickerRequest) -> ShopApiResponse: """Sends a mission sticker. :param mission_sticker_request: (required) diff --git a/tools/generate_unified_client.py b/tools/generate_unified_client.py index 12d0ff954..5bdc0dd03 100644 --- a/tools/generate_unified_client.py +++ b/tools/generate_unified_client.py @@ -670,7 +670,13 @@ def _generate_client( def_kw = "async def" if is_async else "def" await_kw = "return await" if is_async else "return" for cdef, method, call_args in all_methods: - ret_part = f' -> {method.return_annotation}' if method.return_annotation else '' + # Replace bare ``ApiResponse`` with the module-specific alias so the + # return annotation matches the type actually returned at runtime. + ret_ann = method.return_annotation + if ret_ann: + module_alias = _module_alias(cdef.module) + ret_ann = re.sub(r'\bApiResponse\b', f'{module_alias}ApiResponse', ret_ann) + ret_part = f' -> {ret_ann}' if ret_ann else '' if method.params_source: sig = f' {def_kw} {method.name}(self, {method.params_source}){ret_part}:' else: @@ -719,8 +725,14 @@ def _generate_client( pkg = filepath.replace("/", ".").replace(".py", "") target_class = cdef.async_class if is_async else cdef.sync_class lines.append(f'from {pkg} import {target_class}') - # ApiResponse (identical across modules — import from first discovered) - lines.append(f'from linebot.v3.{unique_modules[0]}.api_response import ApiResponse') + # ApiResponse — each subpackage defines its own distinct class; import + # each with a module-specific alias so _with_http_info wrappers annotate + # the correct runtime type. + for mod in unique_modules: + alias = _module_alias(mod) + lines.append( + f'from linebot.v3.{mod}.api_response import ApiResponse as {alias}ApiResponse' + ) lines.append('') # Model imports (sorted, deduplicated)