Interface TelegramRequest
-
- All Known Implementing Classes:
AbstractTelegramRequest
,AddSticker
,AnswerCallbackQuery
,AnswerInlineQuery
,AnswerPreCheckoutQuery
,AnswerShippingQuery
,CreateNewStickerSet
,DeleteChatPhoto
,DeleteChatStickerSet
,DeleteMessage
,DeleteSticker
,DeleteWebhook
,EditMessageCaption
,EditMessageLiveLocation
,EditMessageMedia
,EditMessageReplyMarkup
,EditMessageRequest
,EditTextMessage
,ExportChatInviteLink
,ForwardMessage
,GetChat
,GetChatAdministrators
,GetChatMember
,GetChatMembersCount
,GetFile
,GetGameHighScores
,GetMe
,GetStickerSet
,GetUpdates
,GetUserProfilePhotos
,GetWebhookInfo
,InputFileMessageRequest
,InputFileMessageUpdate
,KickChatMember
,LeaveChat
,PinChatMessage
,PromoteChatMember
,QueryTelegramRequest
,RestrictChatMember
,SendableChatRequest
,SendableInlineRequest
,SendableInputFileInlineRequest
,SendableMessageRequest
,SendAnimation
,SendAudio
,SendChatAction
,SendContact
,SendDocument
,SendGame
,SendInvoice
,SendLocation
,SendMediaGroup
,SendPhoto
,SendSticker
,SendText
,SendVenue
,SendVideo
,SendVideoNote
,SendVoice
,SetChatDescription
,SetChatPhoto
,SetChatStickerSet
,SetChatTitle
,SetGameScore
,SetStickerPosition
,SetWebhook
,StopMessageLiveLocation
,UnbanChatMember
,UnpinChatMessage
,UpdatableChatRequest
,UpdateTelegramRequest
,UploadStickerFile
,UserAdminChatRequest
public interface TelegramRequest
-
-
Field Summary
Fields Modifier and Type Field Description static okhttp3.MediaType
JSON_MEDIA_TYPE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default okhttp3.Request.Builder
build(TelegramBot bot)
java.lang.String
getEndPoint()
Get the appropriate endpoint for this request.void
handleException(java.io.IOException ex)
Handle an exception in the case that an I/O error occuredvoid
handleResponse(okhttp3.Response response)
Handle the response from the server, call any relevant callbacks and do error validationjava.lang.String
serialize()
Use GSON to properly serialize the request to send to Telegram's servers.
-
-
-
Method Detail
-
serialize
java.lang.String serialize()
Use GSON to properly serialize the request to send to Telegram's servers. This method exists if there are any special cases or pre-processing required.- Returns:
- the serialized JSON string
-
build
default okhttp3.Request.Builder build(TelegramBot bot)
-
getEndPoint
java.lang.String getEndPoint()
Get the appropriate endpoint for this request.- Returns:
- The endpoint
-
handleResponse
void handleResponse(okhttp3.Response response) throws java.io.IOException
Handle the response from the server, call any relevant callbacks and do error validation- Parameters:
response
- The response- Throws:
java.io.IOException
- If any I/O error occurred
-
handleException
void handleException(java.io.IOException ex)
Handle an exception in the case that an I/O error occured- Parameters:
ex
- The exception
-
-