-
Notifications
You must be signed in to change notification settings - Fork 948
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add missing duration field in VideoMessageContent class. Close #568 * Use Integer type to consistency with AudioMessageContent. * fix javadoc * Support videoPlayComplete event. * resolve conflict
- Loading branch information
Showing
6 changed files
with
152 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
line-bot-model/src/main/java/com/linecorp/bot/model/event/VideoPlayCompleteEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright 2020 LINE Corporation | ||
* | ||
* LINE Corporation licenses this file to you 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: | ||
* | ||
* http://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. | ||
*/ | ||
|
||
package com.linecorp.bot.model.event; | ||
|
||
import java.time.Instant; | ||
|
||
import com.fasterxml.jackson.annotation.JsonTypeName; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; | ||
|
||
import com.linecorp.bot.model.event.source.Source; | ||
|
||
import lombok.Builder; | ||
import lombok.Value; | ||
|
||
/** | ||
* Event for when a user finishes viewing a video at least once with the specified trackingId sent by the LINE | ||
* Official Account. | ||
*/ | ||
@JsonTypeName("videoPlayComplete") | ||
@Value | ||
@Builder(toBuilder = true) | ||
@JsonDeserialize(builder = VideoPlayCompleteEvent.VideoPlayCompleteEventBuilder.class) | ||
public class VideoPlayCompleteEvent implements Event, ReplyEvent { | ||
@JsonPOJOBuilder(withPrefix = "") | ||
public static class VideoPlayCompleteEventBuilder { | ||
// Providing builder instead of public constructor. Class body is filled by lombok. | ||
} | ||
|
||
/** | ||
* Token for replying to this event. | ||
*/ | ||
String replyToken; | ||
|
||
/** | ||
* JSON object which contains the source of the event. | ||
*/ | ||
Source source; | ||
|
||
/** | ||
* Time of the event. | ||
*/ | ||
Instant timestamp; | ||
|
||
/** | ||
* Channel state. | ||
* <dl> | ||
* <dt>active</dt> | ||
* <dd>The channel is active. You can send a reply message or push message from the bot server that received | ||
* this webhook event.</dd> | ||
* <dt>standby (under development)</dt> | ||
* <dd>The channel is waiting. The bot server that received this webhook event shouldn't send any messages. | ||
* </dd> | ||
* </dl> | ||
*/ | ||
EventMode mode; | ||
|
||
VideoPlayComplete videoPlayComplete; | ||
|
||
@Value | ||
@Builder(toBuilder = true) | ||
@JsonDeserialize(builder = VideoPlayCompleteEvent.VideoPlayComplete.VideoPlayCompleteBuilder.class) | ||
public static class VideoPlayComplete { | ||
@JsonPOJOBuilder(withPrefix = "") | ||
public static class VideoPlayCompleteBuilder { | ||
// Providing builder instead of public constructor. Class body is filled by lombok. | ||
} | ||
|
||
/** | ||
* ID used to identify a video. Returns the same value as the trackingId assigned to the video message. | ||
*/ | ||
String trackingId; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
line-bot-model/src/test/resources/callback/video-play-complete.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"destination": "Uab012345678901234567890123456789", | ||
"events": [ | ||
{ | ||
"replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", | ||
"type": "videoPlayComplete", | ||
"timestamp": 1462629479859, | ||
"mode": "active", | ||
"source": { | ||
"type": "user", | ||
"userId": "U4af4980629..." | ||
}, | ||
"videoPlayComplete": { | ||
"trackingId": "track_id" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters