
com.vk.api.sdk.queries.messages.MessagesGetHistoryQuery Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
Java library for VK API interaction, includes OAuth 2.0 authorization and API methods.
The newest version!
// Autogenerated from vk-api-schema. Please don't edit it manually.
package com.vk.api.sdk.queries.messages;
import com.vk.api.sdk.client.AbstractQueryBuilder;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.GroupActor;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.annotations.ApiParam;
import com.vk.api.sdk.objects.messages.GetHistoryRev;
import com.vk.api.sdk.objects.messages.responses.GetHistoryResponse;
import com.vk.api.sdk.objects.users.Fields;
import java.util.Arrays;
import java.util.List;
/**
* Query for Messages.getHistory method
*/
public class MessagesGetHistoryQuery extends AbstractQueryBuilder {
/**
* Creates a AbstractQueryBuilder instance that can be used to build group api request with various parameters
*
* @param client VK API client
* @param actor actor with access token
*/
public MessagesGetHistoryQuery(VkApiClient client, GroupActor actor) {
super(client, "messages.getHistory", GetHistoryResponse.class);
accessToken(actor.getAccessToken());
groupId(actor.getGroupId());
}
/**
* Creates a AbstractQueryBuilder instance that can be used to build user api request with various parameters
*
* @param client VK API client
* @param actor actor with access token
*/
public MessagesGetHistoryQuery(VkApiClient client, UserActor actor) {
super(client, "messages.getHistory", GetHistoryResponse.class);
accessToken(actor.getAccessToken());
}
/**
* Offset needed to return a specific subset of messages.
*
* @param value value of "offset" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
@ApiParam("offset")
public MessagesGetHistoryQuery offset(Integer value) {
return unsafeParam("offset", value);
}
/**
* Number of messages to return.
*
* @param value value of "count" parameter. Maximum is 200. Minimum is 0. By default 20.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
@ApiParam("count")
public MessagesGetHistoryQuery count(Integer value) {
return unsafeParam("count", value);
}
/**
* ID of the user whose message history you want to return.
*
* @param value value of "user id" parameter. Entity - owner
*
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
@ApiParam("user_id")
public MessagesGetHistoryQuery userId(Long value) {
return unsafeParam("user_id", value);
}
/**
* Set peer id
*
* @param value value of "peer id" parameter. Entity - peer
*
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
@ApiParam("peer_id")
public MessagesGetHistoryQuery peerId(Long value) {
return unsafeParam("peer_id", value);
}
/**
* Starting message ID from which to return history.
*
* @param value value of "start message id" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
@ApiParam("start_message_id")
public MessagesGetHistoryQuery startMessageId(Integer value) {
return unsafeParam("start_message_id", value);
}
/**
* Sort order: '1' - return messages in chronological order. '0' - return messages in reverse chronological order.
*
* @param value value of "rev" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
@ApiParam("rev")
public MessagesGetHistoryQuery rev(GetHistoryRev value) {
return unsafeParam("rev", value);
}
/**
* Information whether the response should be extended
*
* @param value value of "extended" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
@ApiParam("extended")
public MessagesGetHistoryQuery extended(Boolean value) {
return unsafeParam("extended", value);
}
/**
* Group ID (for group messages with group access token)
*
* @param value value of "group id" parameter. Minimum is 0. Entity - owner
*
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
@ApiParam("group_id")
public MessagesGetHistoryQuery groupId(Long value) {
return unsafeParam("group_id", value);
}
/**
* fields
* Profile fields to return.
*
* @param value value of "fields" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
@ApiParam("fields")
public MessagesGetHistoryQuery fields(Fields... value) {
return unsafeParam("fields", value);
}
/**
* Profile fields to return.
*
* @param value value of "fields" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
@ApiParam("fields")
public MessagesGetHistoryQuery fields(List value) {
return unsafeParam("fields", value);
}
@Override
protected MessagesGetHistoryQuery getThis() {
return this;
}
@Override
protected List essentialKeys() {
return Arrays.asList("access_token");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy