TDLightTelegramBots/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/ChosenInlineQuery.java
2020-10-31 17:43:32 +00:00

53 lines
1.9 KiB
Java

package org.telegram.telegrambots.meta.api.objects.inlinequery;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;
import org.telegram.telegrambots.meta.api.objects.Location;
import org.telegram.telegrambots.meta.api.objects.User;
/**
* @author Ruben Bermudez
* @version 1.0
* Represents a result of an inline query that was chosen by the user and sent to their chat
* partner.
*/
@Data
@RequiredArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ChosenInlineQuery implements BotApiObject {
private static final String RESULTID_FIELD = "result_id";
private static final String FROM_FIELD = "from";
private static final String LOCATION_FIELD = "location";
private static final String INLINE_MESSAGE_ID_FIELD = "inline_message_id";
private static final String QUERY_FIELD = "query";
@JsonProperty(RESULTID_FIELD)
@NonNull
private String resultId; ///< The unique identifier for the result that was chosen.
@JsonProperty(FROM_FIELD)
@NonNull
private User from; ///< The user that chose the result.
@JsonProperty(LOCATION_FIELD)
private Location location; ///< Optional. Sender location, only for bots that require user location
/**
* Optional.
* Identifier of the sent inline message.
* Available only if there is an inline keyboard attached to the message.
* Will be also received in callback queries and can be used to edit the message.
*/
@JsonProperty(INLINE_MESSAGE_ID_FIELD)
private String inlineMessageId;
@JsonProperty(QUERY_FIELD)
@NonNull
private String query; ///< The query that was used to obtain the result.
}