Record Class SendPoll
java.lang.Object
java.lang.Record
org.teleight.teleightbots.api.methods.SendPoll
public record SendPoll(@Nullable String businessConnectionId, @NotNull String chatId, int messageThreadId, @NotNull String question, @Nullable ParseMode questionParseMode, @Nullable MessageEntity[] questionEntities, @NotNull InputPollOption[] options, boolean isAnonymous, @Nullable String type, boolean allowsMultipleAnswers, int correctOptionId, @Nullable String explanation, @Nullable ParseMode explanationParseMode, @Nullable MessageEntity[] explanationEntities, int openPeriod, int closeDate, boolean isClosed, boolean disableNotification, boolean protectContent, boolean allowPaidBroadcast, String messageEffectId, @Nullable ReplyParameters replyParameters, @Nullable ReplyKeyboard replyMarkup)
extends Record
implements ApiMethod<Poll>
-
Field Summary
Fields inherited from interface org.teleight.teleightbots.api.ApiMethod
OBJECT_MAPPER -
Constructor Summary
ConstructorsConstructorDescriptionSendPoll(@Nullable String businessConnectionId, @NotNull String chatId, int messageThreadId, @NotNull String question, @Nullable ParseMode questionParseMode, @Nullable MessageEntity[] questionEntities, @NotNull InputPollOption[] options, boolean isAnonymous, @Nullable String type, boolean allowsMultipleAnswers, int correctOptionId, @Nullable String explanation, @Nullable ParseMode explanationParseMode, @Nullable MessageEntity[] explanationEntities, int openPeriod, int closeDate, boolean isClosed, boolean disableNotification, boolean protectContent, boolean allowPaidBroadcast, String messageEffectId, @Nullable ReplyParameters replyParameters, @Nullable ReplyKeyboard replyMarkup) Creates an instance of aSendPollrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallowPaidBroadcastrecord component.booleanReturns the value of theallowsMultipleAnswersrecord component.@Nullable StringReturns the value of thebusinessConnectionIdrecord component.@NotNull StringchatId()Returns the value of thechatIdrecord component.intReturns the value of thecloseDaterecord component.intReturns the value of thecorrectOptionIdrecord component.@NotNull PolldeserializeResponse(@NotNull String answer) Deserializes the response from the Telegram Bot API.booleanReturns the value of thedisableNotificationrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable StringReturns the value of theexplanationrecord component.@Nullable MessageEntity[]Returns the value of theexplanationEntitiesrecord component.@Nullable ParseModeReturns the value of theexplanationParseModerecord component.@NotNull StringReturns the endpoint URL for the Telegram Bot API method.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisAnonymousrecord component.booleanisClosed()Returns the value of theisClosedrecord component.Returns the value of themessageEffectIdrecord component.intReturns the value of themessageThreadIdrecord component.static @NotNull lombok.BuilderofBuilder(String chatId, String question, InputPollOption[] options) intReturns the value of theopenPeriodrecord component.@NotNull InputPollOption[]options()Returns the value of theoptionsrecord component.booleanReturns the value of theprotectContentrecord component.@NotNull Stringquestion()Returns the value of thequestionrecord component.@Nullable MessageEntity[]Returns the value of thequestionEntitiesrecord component.@Nullable ParseModeReturns the value of thequestionParseModerecord component.@Nullable ReplyKeyboardReturns the value of thereplyMarkuprecord component.@Nullable ReplyParametersReturns the value of thereplyParametersrecord component.final StringtoString()Returns a string representation of this record class.@Nullable Stringtype()Returns the value of thetyperecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.teleight.teleightbots.api.ApiMethod
deserializeResponse, deserializeResponseArray, deserializeResponseSerializable
-
Constructor Details
-
SendPoll
public SendPoll(@Nullable @Nullable String businessConnectionId, @NotNull @NotNull String chatId, int messageThreadId, @NotNull @NotNull String question, @Nullable @Nullable ParseMode questionParseMode, @Nullable @Nullable MessageEntity[] questionEntities, @NotNull @NotNull InputPollOption[] options, boolean isAnonymous, @Nullable @Nullable String type, boolean allowsMultipleAnswers, int correctOptionId, @Nullable @Nullable String explanation, @Nullable @Nullable ParseMode explanationParseMode, @Nullable @Nullable MessageEntity[] explanationEntities, int openPeriod, int closeDate, boolean isClosed, boolean disableNotification, boolean protectContent, boolean allowPaidBroadcast, String messageEffectId, @Nullable @Nullable ReplyParameters replyParameters, @Nullable @Nullable ReplyKeyboard replyMarkup) Creates an instance of aSendPollrecord class.- Parameters:
businessConnectionId- the value for thebusinessConnectionIdrecord componentchatId- the value for thechatIdrecord componentmessageThreadId- the value for themessageThreadIdrecord componentquestion- the value for thequestionrecord componentquestionParseMode- the value for thequestionParseModerecord componentquestionEntities- the value for thequestionEntitiesrecord componentoptions- the value for theoptionsrecord componentisAnonymous- the value for theisAnonymousrecord componenttype- the value for thetyperecord componentallowsMultipleAnswers- the value for theallowsMultipleAnswersrecord componentcorrectOptionId- the value for thecorrectOptionIdrecord componentexplanation- the value for theexplanationrecord componentexplanationParseMode- the value for theexplanationParseModerecord componentexplanationEntities- the value for theexplanationEntitiesrecord componentopenPeriod- the value for theopenPeriodrecord componentcloseDate- the value for thecloseDaterecord componentisClosed- the value for theisClosedrecord componentdisableNotification- the value for thedisableNotificationrecord componentprotectContent- the value for theprotectContentrecord componentallowPaidBroadcast- the value for theallowPaidBroadcastrecord componentmessageEffectId- the value for themessageEffectIdrecord componentreplyParameters- the value for thereplyParametersrecord componentreplyMarkup- the value for thereplyMarkuprecord component
-
-
Method Details
-
ofBuilder
@NotNull public static @NotNull lombok.Builder ofBuilder(String chatId, String question, InputPollOption[] options) -
getEndpointURL
Description copied from interface:ApiMethodReturns the endpoint URL for the Telegram Bot API method.- Specified by:
getEndpointURLin interfaceApiMethod<Poll>- Returns:
- the endpoint URL
-
deserializeResponse
@NotNull public @NotNull Poll deserializeResponse(@NotNull @NotNull String answer) throws TelegramRequestException Description copied from interface:ApiMethodDeserializes the response from the Telegram Bot API.- Specified by:
deserializeResponsein interfaceApiMethod<Poll>- Parameters:
answer- the response from the Telegram Bot API- Returns:
- the deserialized response
- Throws:
TelegramRequestException- if an error occurs while deserializing the response
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
businessConnectionId
Returns the value of thebusinessConnectionIdrecord component.- Returns:
- the value of the
businessConnectionIdrecord component
-
chatId
Returns the value of thechatIdrecord component.- Returns:
- the value of the
chatIdrecord component
-
messageThreadId
public int messageThreadId()Returns the value of themessageThreadIdrecord component.- Returns:
- the value of the
messageThreadIdrecord component
-
question
Returns the value of thequestionrecord component.- Returns:
- the value of the
questionrecord component
-
questionParseMode
Returns the value of thequestionParseModerecord component.- Returns:
- the value of the
questionParseModerecord component
-
questionEntities
Returns the value of thequestionEntitiesrecord component.- Returns:
- the value of the
questionEntitiesrecord component
-
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-
isAnonymous
public boolean isAnonymous()Returns the value of theisAnonymousrecord component.- Returns:
- the value of the
isAnonymousrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
allowsMultipleAnswers
public boolean allowsMultipleAnswers()Returns the value of theallowsMultipleAnswersrecord component.- Returns:
- the value of the
allowsMultipleAnswersrecord component
-
correctOptionId
public int correctOptionId()Returns the value of thecorrectOptionIdrecord component.- Returns:
- the value of the
correctOptionIdrecord component
-
explanation
Returns the value of theexplanationrecord component.- Returns:
- the value of the
explanationrecord component
-
explanationParseMode
Returns the value of theexplanationParseModerecord component.- Returns:
- the value of the
explanationParseModerecord component
-
explanationEntities
Returns the value of theexplanationEntitiesrecord component.- Returns:
- the value of the
explanationEntitiesrecord component
-
openPeriod
public int openPeriod()Returns the value of theopenPeriodrecord component.- Returns:
- the value of the
openPeriodrecord component
-
closeDate
public int closeDate()Returns the value of thecloseDaterecord component.- Returns:
- the value of the
closeDaterecord component
-
isClosed
public boolean isClosed()Returns the value of theisClosedrecord component.- Returns:
- the value of the
isClosedrecord component
-
disableNotification
public boolean disableNotification()Returns the value of thedisableNotificationrecord component.- Returns:
- the value of the
disableNotificationrecord component
-
protectContent
public boolean protectContent()Returns the value of theprotectContentrecord component.- Returns:
- the value of the
protectContentrecord component
-
allowPaidBroadcast
public boolean allowPaidBroadcast()Returns the value of theallowPaidBroadcastrecord component.- Returns:
- the value of the
allowPaidBroadcastrecord component
-
messageEffectId
Returns the value of themessageEffectIdrecord component.- Returns:
- the value of the
messageEffectIdrecord component
-
replyParameters
Returns the value of thereplyParametersrecord component.- Returns:
- the value of the
replyParametersrecord component
-
replyMarkup
Returns the value of thereplyMarkuprecord component.- Returns:
- the value of the
replyMarkuprecord component
-