diff --git a/line-openapi b/line-openapi index 9488f69f..360cf19a 160000 --- a/line-openapi +++ b/line-openapi @@ -1 +1 @@ -Subproject commit 9488f69f56b16650e3b20d700efad5f1d5c5635a +Subproject commit 360cf19a22f7810db52357d827636a31f29c0d91 diff --git a/linebot/v3/messaging/__init__.py b/linebot/v3/messaging/__init__.py index cd9987bf..19338cb0 100644 --- a/linebot/v3/messaging/__init__.py +++ b/linebot/v3/messaging/__init__.py @@ -153,6 +153,7 @@ from linebot.v3.messaging.models.location_message import LocationMessage from linebot.v3.messaging.models.lottery_acquisition_condition_request import LotteryAcquisitionConditionRequest from linebot.v3.messaging.models.lottery_acquisition_condition_response import LotteryAcquisitionConditionResponse +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 import Membership diff --git a/linebot/v3/messaging/api/async_messaging_api.py b/linebot/v3/messaging/api/async_messaging_api.py index 03823cb7..c0dce7a5 100644 --- a/linebot/v3/messaging/api/async_messaging_api.py +++ b/linebot/v3/messaging/api/async_messaging_api.py @@ -40,6 +40,7 @@ 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 @@ -7222,6 +7223,162 @@ def mark_messages_as_read_with_http_info(self, mark_messages_as_read_request : M collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) + @overload + async def mark_messages_as_read_by_token(self, mark_messages_as_read_by_token_request : MarkMessagesAsReadByTokenRequest, **kwargs) -> None: # noqa: E501 + ... + + @overload + def mark_messages_as_read_by_token(self, mark_messages_as_read_by_token_request : MarkMessagesAsReadByTokenRequest, async_req: Optional[bool]=True, **kwargs) -> None: # noqa: E501 + ... + + @validate_arguments + def mark_messages_as_read_by_token(self, mark_messages_as_read_by_token_request : MarkMessagesAsReadByTokenRequest, async_req: Optional[bool]=None, **kwargs) -> Union[None, Awaitable[None]]: # noqa: E501 + """mark_messages_as_read_by_token # noqa: E501 + + Mark messages from users as read by token # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.mark_messages_as_read_by_token(mark_messages_as_read_by_token_request, async_req=True) + >>> result = thread.get() + + :param mark_messages_as_read_by_token_request: (required) + :type mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the mark_messages_as_read_by_token_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + if async_req is not None: + kwargs['async_req'] = async_req + return self.mark_messages_as_read_by_token_with_http_info(mark_messages_as_read_by_token_request, **kwargs) # noqa: E501 + + @validate_arguments + def mark_messages_as_read_by_token_with_http_info(self, mark_messages_as_read_by_token_request : MarkMessagesAsReadByTokenRequest, **kwargs) -> ApiResponse: # noqa: E501 + """mark_messages_as_read_by_token # noqa: E501 + + Mark messages from users as read by token # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.mark_messages_as_read_by_token_with_http_info(mark_messages_as_read_by_token_request, async_req=True) + >>> result = thread.get() + + :param mark_messages_as_read_by_token_request: (required) + :type mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _host = self.line_base_path + _params = locals() + + _all_params = [ + 'mark_messages_as_read_by_token_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method mark_messages_as_read_by_token" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['mark_messages_as_read_by_token_request'] is not None: + _body_params = _params['mark_messages_as_read_by_token_request'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Bearer'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/v2/bot/chat/markAsRead', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @overload 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, **kwargs) -> object: # noqa: E501 ... diff --git a/linebot/v3/messaging/api/messaging_api.py b/linebot/v3/messaging/api/messaging_api.py index 646d5e61..356df42b 100644 --- a/linebot/v3/messaging/api/messaging_api.py +++ b/linebot/v3/messaging/api/messaging_api.py @@ -38,6 +38,7 @@ 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 @@ -6750,6 +6751,152 @@ def mark_messages_as_read_with_http_info(self, mark_messages_as_read_request : M collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) + @validate_arguments + def mark_messages_as_read_by_token(self, mark_messages_as_read_by_token_request : MarkMessagesAsReadByTokenRequest, **kwargs) -> None: # noqa: E501 + """mark_messages_as_read_by_token # noqa: E501 + + Mark messages from users as read by token # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.mark_messages_as_read_by_token(mark_messages_as_read_by_token_request, async_req=True) + >>> result = thread.get() + + :param mark_messages_as_read_by_token_request: (required) + :type mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the mark_messages_as_read_by_token_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.mark_messages_as_read_by_token_with_http_info(mark_messages_as_read_by_token_request, **kwargs) # noqa: E501 + + @validate_arguments + def mark_messages_as_read_by_token_with_http_info(self, mark_messages_as_read_by_token_request : MarkMessagesAsReadByTokenRequest, **kwargs) -> ApiResponse: # noqa: E501 + """mark_messages_as_read_by_token # noqa: E501 + + Mark messages from users as read by token # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.mark_messages_as_read_by_token_with_http_info(mark_messages_as_read_by_token_request, async_req=True) + >>> result = thread.get() + + :param mark_messages_as_read_by_token_request: (required) + :type mark_messages_as_read_by_token_request: MarkMessagesAsReadByTokenRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _host = self.line_base_path + _params = locals() + + _all_params = [ + 'mark_messages_as_read_by_token_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method mark_messages_as_read_by_token" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['mark_messages_as_read_by_token_request'] is not None: + _body_params = _params['mark_messages_as_read_by_token_request'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Bearer'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/v2/bot/chat/markAsRead', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @validate_arguments def multicast(self, multicast_request : MulticastRequest, x_line_retry_key : Annotated[Optional[StrictStr], Field(description="Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. ")] = None, **kwargs) -> object: # noqa: E501 """multicast # noqa: E501 diff --git a/linebot/v3/messaging/docs/MessagingApi.md b/linebot/v3/messaging/docs/MessagingApi.md index 90400038..24866c24 100644 --- a/linebot/v3/messaging/docs/MessagingApi.md +++ b/linebot/v3/messaging/docs/MessagingApi.md @@ -51,6 +51,7 @@ Method | HTTP request | Description [**link_rich_menu_id_to_users**](MessagingApi.md#link_rich_menu_id_to_users) | **POST** /v2/bot/richmenu/bulk/link | [**list_coupon**](MessagingApi.md#list_coupon) | **GET** /v2/bot/coupon | [**mark_messages_as_read**](MessagingApi.md#mark_messages_as_read) | **POST** /v2/bot/message/markAsRead | +[**mark_messages_as_read_by_token**](MessagingApi.md#mark_messages_as_read_by_token) | **POST** /v2/bot/chat/markAsRead | [**multicast**](MessagingApi.md#multicast) | **POST** /v2/bot/message/multicast | [**narrowcast**](MessagingApi.md#narrowcast) | **POST** /v2/bot/message/narrowcast | [**push_message**](MessagingApi.md#push_message) | **POST** /v2/bot/message/push | @@ -3577,6 +3578,80 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **mark_messages_as_read_by_token** +> mark_messages_as_read_by_token(mark_messages_as_read_by_token_request) + + + +Mark messages from users as read by token + +### Example + +* Bearer Authentication (Bearer): +```python +import time +import os +import linebot.v3.messaging +from linebot.v3.messaging.models.mark_messages_as_read_by_token_request import MarkMessagesAsReadByTokenRequest +from linebot.v3.messaging.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.line.me +# See configuration.py for a list of all supported configuration parameters. +configuration = linebot.v3.messaging.Configuration( + host = "https://api.line.me" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: Bearer +configuration = linebot.v3.messaging.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with linebot.v3.messaging.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = linebot.v3.messaging.MessagingApi(api_client) + mark_messages_as_read_by_token_request = {"markAsReadToken":"nz0x74mZT2mRn..."} # MarkMessagesAsReadByTokenRequest | + + try: + api_instance.mark_messages_as_read_by_token(mark_messages_as_read_by_token_request) + except Exception as e: + print("Exception when calling MessagingApi->mark_messages_as_read_by_token: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **mark_messages_as_read_by_token_request** | [**MarkMessagesAsReadByTokenRequest**](MarkMessagesAsReadByTokenRequest.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | An invalid markAsReadToken is specified. Tokens must be used by the bot that received them via Webhook. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **multicast** > object multicast(multicast_request, x_line_retry_key=x_line_retry_key) diff --git a/linebot/v3/messaging/models/__init__.py b/linebot/v3/messaging/models/__init__.py index 81fb143d..2ae5adc2 100644 --- a/linebot/v3/messaging/models/__init__.py +++ b/linebot/v3/messaging/models/__init__.py @@ -132,6 +132,7 @@ from linebot.v3.messaging.models.location_message import LocationMessage from linebot.v3.messaging.models.lottery_acquisition_condition_request import LotteryAcquisitionConditionRequest from linebot.v3.messaging.models.lottery_acquisition_condition_response import LotteryAcquisitionConditionResponse +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 import Membership diff --git a/linebot/v3/messaging/models/mark_messages_as_read_by_token_request.py b/linebot/v3/messaging/models/mark_messages_as_read_by_token_request.py new file mode 100644 index 00000000..8c09c0eb --- /dev/null +++ b/linebot/v3/messaging/models/mark_messages_as_read_by_token_request.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + LINE Messaging API + + This document describes LINE Messaging API. # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + + +from pydantic.v1 import BaseModel, Field, StrictStr + +class MarkMessagesAsReadByTokenRequest(BaseModel): + """ + MarkMessagesAsReadByTokenRequest + https://developers.line.biz/en/reference/messaging-api/#mark-as-read-request-body + """ + mark_as_read_token: StrictStr = Field(..., alias="markAsReadToken", description="Token used to mark messages as read.") + + __properties = ["markAsReadToken"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MarkMessagesAsReadByTokenRequest: + """Create an instance of MarkMessagesAsReadByTokenRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MarkMessagesAsReadByTokenRequest: + """Create an instance of MarkMessagesAsReadByTokenRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MarkMessagesAsReadByTokenRequest.parse_obj(obj) + + _obj = MarkMessagesAsReadByTokenRequest.parse_obj({ + "mark_as_read_token": obj.get("markAsReadToken") + }) + return _obj + diff --git a/linebot/v3/webhooks/models/audio_message_content.py b/linebot/v3/webhooks/models/audio_message_content.py index 1c6e1453..cb39817b 100644 --- a/linebot/v3/webhooks/models/audio_message_content.py +++ b/linebot/v3/webhooks/models/audio_message_content.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic.v1 import Field, StrictInt +from pydantic.v1 import Field, StrictInt, StrictStr from linebot.v3.webhooks.models.content_provider import ContentProvider from linebot.v3.webhooks.models.message_content import MessageContent @@ -29,9 +29,10 @@ class AudioMessageContent(MessageContent): """ content_provider: ContentProvider = Field(..., alias="contentProvider") duration: Optional[StrictInt] = Field(None, description="Length of audio file (milliseconds)") + mark_as_read_token: Optional[StrictStr] = Field(None, alias="markAsReadToken", description="Token used to mark the message as read. ") type: str = "audio" - __properties = ["type", "id", "contentProvider", "duration"] + __properties = ["type", "id", "contentProvider", "duration", "markAsReadToken"] class Config: """Pydantic configuration""" @@ -75,7 +76,8 @@ def from_dict(cls, obj: dict) -> AudioMessageContent: "type": obj.get("type"), "id": obj.get("id"), "content_provider": ContentProvider.from_dict(obj.get("contentProvider")) if obj.get("contentProvider") is not None else None, - "duration": obj.get("duration") + "duration": obj.get("duration"), + "mark_as_read_token": obj.get("markAsReadToken") }) return _obj diff --git a/linebot/v3/webhooks/models/file_message_content.py b/linebot/v3/webhooks/models/file_message_content.py index 0f181c8f..c268d098 100644 --- a/linebot/v3/webhooks/models/file_message_content.py +++ b/linebot/v3/webhooks/models/file_message_content.py @@ -18,7 +18,7 @@ import json - +from typing import Optional from pydantic.v1 import Field, StrictInt, StrictStr from linebot.v3.webhooks.models.message_content import MessageContent @@ -28,9 +28,10 @@ class FileMessageContent(MessageContent): """ file_name: StrictStr = Field(..., alias="fileName", description="File name") file_size: StrictInt = Field(..., alias="fileSize", description="File size in bytes") + mark_as_read_token: Optional[StrictStr] = Field(None, alias="markAsReadToken", description="Token used to mark the message as read. ") type: str = "file" - __properties = ["type", "id", "fileName", "fileSize"] + __properties = ["type", "id", "fileName", "fileSize", "markAsReadToken"] class Config: """Pydantic configuration""" @@ -71,7 +72,8 @@ def from_dict(cls, obj: dict) -> FileMessageContent: "type": obj.get("type"), "id": obj.get("id"), "file_name": obj.get("fileName"), - "file_size": obj.get("fileSize") + "file_size": obj.get("fileSize"), + "mark_as_read_token": obj.get("markAsReadToken") }) return _obj diff --git a/linebot/v3/webhooks/models/image_message_content.py b/linebot/v3/webhooks/models/image_message_content.py index ab2409c0..f719af0f 100644 --- a/linebot/v3/webhooks/models/image_message_content.py +++ b/linebot/v3/webhooks/models/image_message_content.py @@ -31,9 +31,10 @@ class ImageMessageContent(MessageContent): content_provider: ContentProvider = Field(..., alias="contentProvider") image_set: Optional[ImageSet] = Field(None, alias="imageSet") quote_token: StrictStr = Field(..., alias="quoteToken", description="Quote token to quote this message. ") + mark_as_read_token: Optional[StrictStr] = Field(None, alias="markAsReadToken", description="Token used to mark the message as read. ") type: str = "image" - __properties = ["type", "id", "contentProvider", "imageSet", "quoteToken"] + __properties = ["type", "id", "contentProvider", "imageSet", "quoteToken", "markAsReadToken"] class Config: """Pydantic configuration""" @@ -81,7 +82,8 @@ def from_dict(cls, obj: dict) -> ImageMessageContent: "id": obj.get("id"), "content_provider": ContentProvider.from_dict(obj.get("contentProvider")) if obj.get("contentProvider") is not None else None, "image_set": ImageSet.from_dict(obj.get("imageSet")) if obj.get("imageSet") is not None else None, - "quote_token": obj.get("quoteToken") + "quote_token": obj.get("quoteToken"), + "mark_as_read_token": obj.get("markAsReadToken") }) return _obj diff --git a/linebot/v3/webhooks/models/location_message_content.py b/linebot/v3/webhooks/models/location_message_content.py index 08268270..96f2ce17 100644 --- a/linebot/v3/webhooks/models/location_message_content.py +++ b/linebot/v3/webhooks/models/location_message_content.py @@ -30,9 +30,10 @@ class LocationMessageContent(MessageContent): address: Optional[StrictStr] = Field(None, description="Address") latitude: Union[StrictFloat, StrictInt] = Field(..., description="Latitude") longitude: Union[StrictFloat, StrictInt] = Field(..., description="Longitude") + mark_as_read_token: Optional[StrictStr] = Field(None, alias="markAsReadToken", description="Token used to mark the message as read. ") type: str = "location" - __properties = ["type", "id", "title", "address", "latitude", "longitude"] + __properties = ["type", "id", "title", "address", "latitude", "longitude", "markAsReadToken"] class Config: """Pydantic configuration""" @@ -75,7 +76,8 @@ def from_dict(cls, obj: dict) -> LocationMessageContent: "title": obj.get("title"), "address": obj.get("address"), "latitude": obj.get("latitude"), - "longitude": obj.get("longitude") + "longitude": obj.get("longitude"), + "mark_as_read_token": obj.get("markAsReadToken") }) return _obj diff --git a/linebot/v3/webhooks/models/sticker_message_content.py b/linebot/v3/webhooks/models/sticker_message_content.py index e6f32651..3a52cc9a 100644 --- a/linebot/v3/webhooks/models/sticker_message_content.py +++ b/linebot/v3/webhooks/models/sticker_message_content.py @@ -33,10 +33,11 @@ class StickerMessageContent(MessageContent): keywords: Optional[conlist(StrictStr, max_items=15)] = Field(None, description="Array of up to 15 keywords describing the sticker. If a sticker has 16 or more keywords, a random selection of 15 keywords will be returned. The keyword selection is random for each event, so different keywords may be returned for the same sticker. ") text: Optional[constr(strict=True, max_length=100)] = Field(None, description="Any text entered by the user. This property is only included for message stickers. Max character limit: 100 ") quote_token: StrictStr = Field(..., alias="quoteToken", description="Quote token to quote this message. ") - quoted_message_id: Optional[StrictStr] = Field(None, alias="quotedMessageId", description="Message ID of a quoted message. Only included when the received message quotes a past message. ") + quoted_message_id: Optional[StrictStr] = Field(None, alias="quotedMessageId", description="Message ID of a quoted message. Only included when the received message quotes a past message. ") + mark_as_read_token: Optional[StrictStr] = Field(None, alias="markAsReadToken", description="Token used to mark the message as read. ") type: str = "sticker" - __properties = ["type", "id", "packageId", "stickerId", "stickerResourceType", "keywords", "text", "quoteToken", "quotedMessageId"] + __properties = ["type", "id", "packageId", "stickerId", "stickerResourceType", "keywords", "text", "quoteToken", "quotedMessageId", "markAsReadToken"] @validator('sticker_resource_type') def sticker_resource_type_validate_enum(cls, value): @@ -89,7 +90,8 @@ def from_dict(cls, obj: dict) -> StickerMessageContent: "keywords": obj.get("keywords"), "text": obj.get("text"), "quote_token": obj.get("quoteToken"), - "quoted_message_id": obj.get("quotedMessageId") + "quoted_message_id": obj.get("quotedMessageId"), + "mark_as_read_token": obj.get("markAsReadToken") }) return _obj diff --git a/linebot/v3/webhooks/models/text_message_content.py b/linebot/v3/webhooks/models/text_message_content.py index f63a040a..bf91b0c6 100644 --- a/linebot/v3/webhooks/models/text_message_content.py +++ b/linebot/v3/webhooks/models/text_message_content.py @@ -33,9 +33,10 @@ class TextMessageContent(MessageContent): mention: Optional[Mention] = None quote_token: StrictStr = Field(..., alias="quoteToken", description="Quote token to quote this message. ") quoted_message_id: Optional[StrictStr] = Field(None, alias="quotedMessageId", description="Message ID of a quoted message. Only included when the received message quotes a past message.") + mark_as_read_token: Optional[StrictStr] = Field(None, alias="markAsReadToken", description="Token used to mark the message as read. ") type: str = "text" - __properties = ["type", "id", "text", "emojis", "mention", "quoteToken", "quotedMessageId"] + __properties = ["type", "id", "text", "emojis", "mention", "quoteToken", "quotedMessageId", "markAsReadToken"] class Config: """Pydantic configuration""" @@ -89,7 +90,8 @@ def from_dict(cls, obj: dict) -> TextMessageContent: "emojis": [Emoji.from_dict(_item) for _item in obj.get("emojis")] if obj.get("emojis") is not None else None, "mention": Mention.from_dict(obj.get("mention")) if obj.get("mention") is not None else None, "quote_token": obj.get("quoteToken"), - "quoted_message_id": obj.get("quotedMessageId") + "quoted_message_id": obj.get("quotedMessageId"), + "mark_as_read_token": obj.get("markAsReadToken") }) return _obj diff --git a/linebot/v3/webhooks/models/video_message_content.py b/linebot/v3/webhooks/models/video_message_content.py index 659c0183..5542f200 100644 --- a/linebot/v3/webhooks/models/video_message_content.py +++ b/linebot/v3/webhooks/models/video_message_content.py @@ -30,9 +30,10 @@ class VideoMessageContent(MessageContent): duration: Optional[StrictInt] = Field(None, description="Length of video file (milliseconds)") content_provider: ContentProvider = Field(..., alias="contentProvider") quote_token: StrictStr = Field(..., alias="quoteToken", description="Quote token to quote this message. ") + mark_as_read_token: Optional[StrictStr] = Field(None, alias="markAsReadToken", description="Token used to mark the message as read. ") type: str = "video" - __properties = ["type", "id", "duration", "contentProvider", "quoteToken"] + __properties = ["type", "id", "duration", "contentProvider", "quoteToken", "markAsReadToken"] class Config: """Pydantic configuration""" @@ -77,7 +78,8 @@ def from_dict(cls, obj: dict) -> VideoMessageContent: "id": obj.get("id"), "duration": obj.get("duration"), "content_provider": ContentProvider.from_dict(obj.get("contentProvider")) if obj.get("contentProvider") is not None else None, - "quote_token": obj.get("quoteToken") + "quote_token": obj.get("quoteToken"), + "mark_as_read_token": obj.get("markAsReadToken") }) return _obj