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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion line-openapi
1 change: 1 addition & 0 deletions linebot/messaging_api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ model_location_action.go
model_location_message.go
model_lottery_acquisition_condition_request.go
model_lottery_acquisition_condition_response.go
model_mark_messages_as_read_by_token_request.go
model_mark_messages_as_read_request.go
model_members_ids_response.go
model_membership.go
Expand Down
67 changes: 67 additions & 0 deletions linebot/messaging_api/api_messaging_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3306,6 +3306,73 @@ func (client *MessagingApiAPI) MarkMessagesAsReadWithHttpInfo(

}

// MarkMessagesAsReadByToken
//
// Mark messages from users as read by token
// Parameters:
// markMessagesAsReadByTokenRequest

// https://developers.line.biz/en/reference/messaging-api/#mark-as-read
func (client *MessagingApiAPI) MarkMessagesAsReadByToken(

markMessagesAsReadByTokenRequest *MarkMessagesAsReadByTokenRequest,

) (struct{}, error) {
_, body, error := client.MarkMessagesAsReadByTokenWithHttpInfo(

markMessagesAsReadByTokenRequest,
)
return body, error
}

// MarkMessagesAsReadByToken
// If you want to take advantage of the HTTPResponse object for status codes and headers, use this signature.
//
// Mark messages from users as read by token
// Parameters:
// markMessagesAsReadByTokenRequest

// https://developers.line.biz/en/reference/messaging-api/#mark-as-read
func (client *MessagingApiAPI) MarkMessagesAsReadByTokenWithHttpInfo(

markMessagesAsReadByTokenRequest *MarkMessagesAsReadByTokenRequest,

) (*http.Response, struct{}, error) {
path := "/v2/bot/chat/markAsRead"

var buf bytes.Buffer
enc := json.NewEncoder(&buf)
if err := enc.Encode(markMessagesAsReadByTokenRequest); err != nil {
return nil, struct{}{}, err
}
req, err := http.NewRequest(http.MethodPost, client.Url(path), &buf)
if err != nil {
return nil, struct{}{}, err
}
req.Header.Set("Content-Type", "application/json; charset=UTF-8")

res, err := client.Do(req)

if err != nil {
return res, struct{}{}, err
}

if res.StatusCode/100 != 2 {
bodyBytes, err := io.ReadAll(res.Body)
bodyReader := bytes.NewReader(bodyBytes)
if err != nil {
return res, struct{}{}, fmt.Errorf("failed to read response body: %w", err)
}
res.Body = io.NopCloser(bodyReader)
return res, struct{}{}, fmt.Errorf("unexpected status code: %d, %s", res.StatusCode, string(bodyBytes))
}

defer res.Body.Close()

return res, struct{}{}, nil

}

// Multicast
//
// An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* LINE Messaging API
* This document describes LINE Messaging API.
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

//go:generate python3 ../../generate-code.py
package messaging_api

// MarkMessagesAsReadByTokenRequest
// MarkMessagesAsReadByTokenRequest
// https://developers.line.biz/en/reference/messaging-api/#mark-as-read-request-body
type MarkMessagesAsReadByTokenRequest struct {

/**
* Token used to mark messages as read. (Required)
*/
MarkAsReadToken string `json:"markAsReadToken"`
}
5 changes: 5 additions & 0 deletions linebot/webhook/model_audio_message_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ type AudioMessageContent struct {
* Length of audio file (milliseconds)
*/
Duration int64 `json:"duration"`

/**
* Token used to mark the message as read.
*/
MarkAsReadToken string `json:"markAsReadToken,omitempty"`
}

// MarshalJSON customizes the JSON serialization of the AudioMessageContent struct.
Expand Down
5 changes: 5 additions & 0 deletions linebot/webhook/model_file_message_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ type FileMessageContent struct {
* File size in bytes (Required)
*/
FileSize int32 `json:"fileSize"`

/**
* Token used to mark the message as read.
*/
MarkAsReadToken string `json:"markAsReadToken,omitempty"`
}

// MarshalJSON customizes the JSON serialization of the FileMessageContent struct.
Expand Down
5 changes: 5 additions & 0 deletions linebot/webhook/model_image_message_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ type ImageMessageContent struct {
* Quote token to quote this message. (Required)
*/
QuoteToken string `json:"quoteToken"`

/**
* Token used to mark the message as read.
*/
MarkAsReadToken string `json:"markAsReadToken,omitempty"`
}

// MarshalJSON customizes the JSON serialization of the ImageMessageContent struct.
Expand Down
5 changes: 5 additions & 0 deletions linebot/webhook/model_location_message_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ type LocationMessageContent struct {
* Longitude (Required)
*/
Longitude float64 `json:"longitude"`

/**
* Token used to mark the message as read.
*/
MarkAsReadToken string `json:"markAsReadToken,omitempty"`
}

// MarshalJSON customizes the JSON serialization of the LocationMessageContent struct.
Expand Down
5 changes: 5 additions & 0 deletions linebot/webhook/model_sticker_message_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ type StickerMessageContent struct {
* Message ID of a quoted message. Only included when the received message quotes a past message.
*/
QuotedMessageId string `json:"quotedMessageId,omitempty"`

/**
* Token used to mark the message as read.
*/
MarkAsReadToken string `json:"markAsReadToken,omitempty"`
}

// MarshalJSON customizes the JSON serialization of the StickerMessageContent struct.
Expand Down
5 changes: 5 additions & 0 deletions linebot/webhook/model_text_message_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ type TextMessageContent struct {
* Message ID of a quoted message. Only included when the received message quotes a past message.
*/
QuotedMessageId string `json:"quotedMessageId,omitempty"`

/**
* Token used to mark the message as read.
*/
MarkAsReadToken string `json:"markAsReadToken,omitempty"`
}

// MarshalJSON customizes the JSON serialization of the TextMessageContent struct.
Expand Down
5 changes: 5 additions & 0 deletions linebot/webhook/model_video_message_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ type VideoMessageContent struct {
* Quote token to quote this message. (Required)
*/
QuoteToken string `json:"quoteToken"`

/**
* Token used to mark the message as read.
*/
MarkAsReadToken string `json:"markAsReadToken,omitempty"`
}

// MarshalJSON customizes the JSON serialization of the VideoMessageContent struct.
Expand Down