Skip to content

Commit 1d65bec

Browse files
authored
Support multi image metadata (#694)
1 parent 8d51a76 commit 1d65bec

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

line-bot-model/src/main/java/com/linecorp/bot/model/event/message/ImageMessageContent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ public static class ImageMessageContentBuilder {
3838

3939
String id;
4040
ContentProvider contentProvider;
41+
ImageSet imageSet;
4142
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright 2021 LINE Corporation
3+
*
4+
* LINE Corporation licenses this file to you under the Apache License,
5+
* version 2.0 (the "License"); you may not use this file except in compliance
6+
* with the License. You may obtain a copy of the License at:
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
package com.linecorp.bot.model.event.message;
18+
19+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
20+
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
21+
22+
import lombok.Builder;
23+
import lombok.Value;
24+
25+
@Value
26+
@Builder(toBuilder = true)
27+
@JsonDeserialize(builder = ImageSet.ImageSetBuilder.class)
28+
public class ImageSet {
29+
@JsonPOJOBuilder(withPrefix = "")
30+
public static class ImageSetBuilder {
31+
// Providing builder instead of public constructor. Class body is filled by lombok.
32+
}
33+
34+
/**
35+
* Image set ID. Only included when multiple images are sent simultaneously.
36+
*/
37+
String id;
38+
39+
/**
40+
* An index starting from 1, indicating the image number in a set of images sent simultaneously.
41+
* Only included when multiple images are sent simultaneously.
42+
*/
43+
Integer index;
44+
45+
/**
46+
* The total number of images sent simultaneously.
47+
* Only included when multiple images are sent simultaneously.
48+
*/
49+
Integer total;
50+
}

0 commit comments

Comments
 (0)