Package api.longpoll.bots.methods.impl
Class VkMethod<VkResponse>
java.lang.Object
api.longpoll.bots.methods.impl.VkMethod<VkResponse>
- Type Parameters:
VkResponse- VK API response type.
- Direct Known Subclasses:
AddAddress,AddCallbackServer,CheckLink,CloseComments,CreateChat,CreateComment,Delete,Delete,DeleteAddress,DeleteCallbackServer,DeleteChatPhoto,DeleteComment,DeleteConversation,DisableOnline,Edit,EditAddress,EditCallbackServer,EditChat,EditOrder,EnableOnline,Execute,Get,Get,GetBanned,GetByConversationMessageId,GetById,GetById,GetById,GetCallbackConfirmationCode,GetCallbackServers,GetCallbackSettings,GetChatUploadServer,GetConversationMembers,GetConversations,GetConversationsById,GetGroupOrders,GetHistory,GetHistoryAttachments,GetImportantMessages,GetInviteLink,GetLinkStats,GetLongPollServer,GetLongPollSettings,GetMembers,GetMessagesUploadServer,GetMessagesUploadServer,GetOnlineStatus,GetOrderById,GetOrderItems,GetOwnerCoverPhotoUploadServer,GetPhotoUploadServer,GetReplies,GetServerTime,GetShortLink,GetStats,GetTokenPermissions,GetUpdates,GetVideoUploadServer,GetViewers,GetWallUploadServer,HideAllReplies,HideReply,IsMember,IsMessagesFromGroupAllowed,MarkAsAnsweredConversation,MarkAsImportantConversation,MarkAsRead,OpenComments,Pin,RemoveChatUser,ResolveScreenName,Restore,RestoreComment,Save,Save,SaveMessagesPhoto,SaveOwnerCoverPhoto,Search,SearchConversations,Send,SendEventAnswer,SetActivity,SetCallbackSettings,SetChatPhoto,SetLongPollSettings,SetSettings,Unpin,UploadMethod
Executes generic HTTP request to VK API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds URL parameter to HTTP request.execute()Executes request to VK API.Executes request to VK API asynchronously.protected abstract Class<VkResponse>Gets a class of VK API response.protected okhttp3.RequestBodySupplies new request body.Setslangparameter.
-
Constructor Details
-
VkMethod
-
VkMethod
-
-
Method Details
-
executeAsync
Executes request to VK API asynchronously.- Returns:
- VK API response wrapped to CompletableFuture
-
execute
Executes request to VK API.- Returns:
- VK API response.
- Throws:
VkApiException- if errors occur.
-
getResponseClass
Gets a class of VK API response. This value is used during deserialization of received JSON.- Returns:
- a class of VK API response.
-
newRequestBody
protected okhttp3.RequestBody newRequestBody()Supplies new request body.- Returns:
- request body.
-
addParam
Adds URL parameter to HTTP request.- Parameters:
key- URL parameter key.value- URL parameter value.- Returns:
- current instance.
-
setLang
Setslangparameter.- Parameters:
lang- lang value.- Returns:
- current instance.
-