/*
 * Copyright 2016 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.message;

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.message.quickreply.QuickReply;
import com.linecorp.bot.model.message.sender.Sender;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NonNull;
import lombok.Value;

@Value
@Builder(toBuilder = true)
@JsonTypeName("text")
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@JsonDeserialize(builder = TextMessage.TextMessageBuilder.class)
public class TextMessage implements Message {
    @NonNull String text;
    QuickReply quickReply;
    Sender sender;

    /**
     * Constructor without {@link #quickReply} parameter.
     *
     * <p>If you want use {@link QuickReply}, please use {@link #builder()} instead.
     */
    public TextMessage(final String text) {
        this(text, null, null);
    }

    public TextMessage(final @NonNull String text, final QuickReply quickReply) {
        this(text, quickReply, null);
    }

    @JsonPOJOBuilder(withPrefix = "")
    public static class TextMessageBuilder {
    }
}

@@ -668,16 +668,154 @@
 ssage;%0A%0A
+import java.util.List;%0A%0Aimport com.fasterxml.jackson.annotation.JsonInclude;%0Aimport com.fasterxml.jackson.annotation.JsonInclude.Include;%0A
 import c
@@ -860,16 +860,16 @@
 peName;%0A
-
 import c
@@ -1527,16 +1527,133 @@
 ender;%0A%0A
+    /**%0A     * Included LINE emoji information.%0A     */%0A    @JsonInclude(Include.NON_NULL)%0A    List%3CSticon%3E sticon;%0A%0A
     /**%0A
@@ -1878,16 +1878,22 @@
 t, null,
+ null,
  null);%0A
@@ -2011,16 +2011,22 @@
 ckReply,
+ null,
  null);%0A
@@ -2070,16 +2070,16 @@
 x = %22%22)%0A
-
     publ
@@ -2120,11 +2120,1324 @@
  %7B%0A    %7D
+%0A%0A    @Value%0A    @Builder(toBuilder = true)%0A    @JsonDeserialize(builder = Sticon.SticonBuilder.class)%0A    public static class Sticon %7B%0A        /**%0A         * Index position for a character in text, with the first character being at position 0.%0A         *%0A         * %3Cp%3EThe specified position must correspond to a $ character,%0A         * which serves as a placeholder for the LINE emoji.%0A         * If you specify a position that doesn't contain a $ character, the API returns HTTP 400 Bad request.%0A         * See the %3Ca href=%22https://developers.line.biz/en/reference/messaging-api/#text-message%22%3Etext message example%3C/a%3E for details.%0A         */%0A        int index;%0A%0A        /**%0A         * Product ID for a set of LINE emoji.%0A         *%0A         * @see %3Ca href=%22https://d.line-scdn.net/r/devcenter/Default_sticon_list.pdf%22%3ELINE Available Sticon List%3C/a%3E%0A         */%0A        String productId;%0A%0A        /**%0A         * ID for a LINE emoji inside a set.%0A         *%0A         * @see %3Ca href=%22https://d.line-scdn.net/r/devcenter/Default_sticon_list.pdf%22%3ELINE Available Sticon List%3C/a%3E%0A         */%0A        String sticonId;%0A%0A        @JsonPOJOBuilder(withPrefix = %22%22)%0A        public static class SticonBuilder %7B%0A            // Providing builder instead of public constructor. Class body is filled by lombok.%0A        %7D%0A    %7D
 %0A%7D%0A

Support LINE emoji in messages