Record Class SendPoll
java.lang.Object
java.lang.Record
org.teleight.teleightbots.api.methods.SendPoll
- All Implemented Interfaces:
ApiMethod<Message>, MultiPartApiMethod<Message>, MultiPartApiMethodMessage
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 PollType type, boolean allowsMultipleAnswers, boolean allowsRevoting, boolean shuffleOptions, boolean allowAddingOptions, boolean hideResultsUntilCloses, boolean membersOnly, @Nullable String[] countryCodes, int[] correctOptionIds, @Nullable String explanation, @Nullable ParseMode explanationParseMode, @Nullable MessageEntity[] explanationEntities, @Nullable InputPollMedia explanationMedia, int openPeriod, long closeDate, boolean isClosed, @Nullable String description, @Nullable ParseMode descriptionParseMode, @Nullable MessageEntity[] descriptionEntities, @Nullable InputPollMedia media, boolean disableNotification, boolean protectContent, boolean allowPaidBroadcast, String messageEffectId, @Nullable ReplyParameters replyParameters, @Nullable ReplyKeyboard replyMarkup)
extends Record
implements MultiPartApiMethodMessage
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface 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 PollType type, boolean allowsMultipleAnswers, boolean allowsRevoting, boolean shuffleOptions, boolean allowAddingOptions, boolean hideResultsUntilCloses, boolean membersOnly, @Nullable String[] countryCodes, int[] correctOptionIds, @Nullable String explanation, @Nullable ParseMode explanationParseMode, @Nullable MessageEntity[] explanationEntities, @Nullable InputPollMedia explanationMedia, int openPeriod, long closeDate, boolean isClosed, @Nullable String description, @Nullable ParseMode descriptionParseMode, @Nullable MessageEntity[] descriptionEntities, @Nullable InputPollMedia media, 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 theallowAddingOptionsrecord component.booleanReturns the value of theallowPaidBroadcastrecord component.booleanReturns the value of theallowsMultipleAnswersrecord component.booleanReturns the value of theallowsRevotingrecord component.@Nullable StringReturns the value of thebusinessConnectionIdrecord component.@NotNull StringchatId()Returns the value of thechatIdrecord component.longReturns the value of thecloseDaterecord component.int[]Returns the value of thecorrectOptionIdsrecord component.@Nullable String[]Returns the value of thecountryCodesrecord component.@Nullable StringReturns the value of thedescriptionrecord component.@Nullable MessageEntity[]Returns the value of thedescriptionEntitiesrecord component.@Nullable ParseModeReturns the value of thedescriptionParseModerecord component.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 InputPollMediaReturns the value of theexplanationMediarecord component.@Nullable ParseModeReturns the value of theexplanationParseModerecord component.@NotNull StringReturns the endpoint URL for the Telegram Bot API method.Gets the parameters of the multipart API method.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehideResultsUntilClosesrecord component.booleanReturns the value of theisAnonymousrecord component.booleanisClosed()Returns the value of theisClosedrecord component.@Nullable InputPollMediamedia()Returns the value of themediarecord component.booleanReturns the value of themembersOnlyrecord component.Returns the value of themessageEffectIdrecord component.intReturns the value of themessageThreadIdrecord component.static @NotNull SendPoll.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.booleanReturns the value of theshuffleOptionsrecord component.final StringtoString()Returns a string representation of this record class.@Nullable PollTypetype()Returns the value of thetyperecord component.Methods inherited from interface ApiMethod
deserializeResponse, deserializeResponseArray, deserializeResponseSerializableMethods inherited from interface MultiPartApiMethodMessage
deserializeResponse
-
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 PollType type, boolean allowsMultipleAnswers, boolean allowsRevoting, boolean shuffleOptions, boolean allowAddingOptions, boolean hideResultsUntilCloses, boolean membersOnly, @Nullable @Nullable String[] countryCodes, int[] correctOptionIds, @Nullable @Nullable String explanation, @Nullable @Nullable ParseMode explanationParseMode, @Nullable @Nullable MessageEntity[] explanationEntities, @Nullable @Nullable InputPollMedia explanationMedia, int openPeriod, long closeDate, boolean isClosed, @Nullable @Nullable String description, @Nullable @Nullable ParseMode descriptionParseMode, @Nullable @Nullable MessageEntity[] descriptionEntities, @Nullable @Nullable InputPollMedia media, 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 componentallowsRevoting- the value for theallowsRevotingrecord componentshuffleOptions- the value for theshuffleOptionsrecord componentallowAddingOptions- the value for theallowAddingOptionsrecord componenthideResultsUntilCloses- the value for thehideResultsUntilClosesrecord componentmembersOnly- the value for themembersOnlyrecord componentcountryCodes- the value for thecountryCodesrecord componentcorrectOptionIds- the value for thecorrectOptionIdsrecord componentexplanation- the value for theexplanationrecord componentexplanationParseMode- the value for theexplanationParseModerecord componentexplanationEntities- the value for theexplanationEntitiesrecord componentexplanationMedia- the value for theexplanationMediarecord componentopenPeriod- the value for theopenPeriodrecord componentcloseDate- the value for thecloseDaterecord componentisClosed- the value for theisClosedrecord componentdescription- the value for thedescriptionrecord componentdescriptionParseMode- the value for thedescriptionParseModerecord componentdescriptionEntities- the value for thedescriptionEntitiesrecord componentmedia- the value for themediarecord 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 SendPoll.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<Message>- Returns:
- the endpoint URL
-
getParameters
Description copied from interface:MultiPartApiMethodGets the parameters of the multipart API method.- Specified by:
getParametersin interfaceMultiPartApiMethod<Message>- Returns:
- a map containing the parameters of the multipart API method
-
toBuilder
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
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
-
allowsRevoting
public boolean allowsRevoting()Returns the value of theallowsRevotingrecord component.- Returns:
- the value of the
allowsRevotingrecord component
-
shuffleOptions
public boolean shuffleOptions()Returns the value of theshuffleOptionsrecord component.- Returns:
- the value of the
shuffleOptionsrecord component
-
allowAddingOptions
public boolean allowAddingOptions()Returns the value of theallowAddingOptionsrecord component.- Returns:
- the value of the
allowAddingOptionsrecord component
-
hideResultsUntilCloses
public boolean hideResultsUntilCloses()Returns the value of thehideResultsUntilClosesrecord component.- Returns:
- the value of the
hideResultsUntilClosesrecord component
-
membersOnly
public boolean membersOnly()Returns the value of themembersOnlyrecord component.- Returns:
- the value of the
membersOnlyrecord component
-
countryCodes
Returns the value of thecountryCodesrecord component.- Returns:
- the value of the
countryCodesrecord component
-
correctOptionIds
public int[] correctOptionIds()Returns the value of thecorrectOptionIdsrecord component.- Returns:
- the value of the
correctOptionIdsrecord 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
-
explanationMedia
Returns the value of theexplanationMediarecord component.- Returns:
- the value of the
explanationMediarecord component
-
openPeriod
public int openPeriod()Returns the value of theopenPeriodrecord component.- Returns:
- the value of the
openPeriodrecord component
-
closeDate
public long 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
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
descriptionParseMode
Returns the value of thedescriptionParseModerecord component.- Returns:
- the value of the
descriptionParseModerecord component
-
descriptionEntities
Returns the value of thedescriptionEntitiesrecord component.- Returns:
- the value of the
descriptionEntitiesrecord component
-
media
Returns the value of themediarecord component.- Returns:
- the value of the
mediarecord 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
-