You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.6 KiB
64 lines
1.6 KiB
|
11 years ago
|
package org.telegram.methods;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author Ruben Bermudez
|
||
|
|
* @version 1.0
|
||
|
|
* @brief Use this method to receive incoming updates using long polling (wiki).
|
||
|
|
* An Array of Update objects is returned.
|
||
|
|
* @date 20 of June of 2015
|
||
|
|
*/
|
||
|
|
public class GetUpdates {
|
||
|
|
public static final String PATH = "getupdates";
|
||
|
|
|
||
|
|
public static final String OFFSET_FIELD = "offset";
|
||
|
|
/**
|
||
|
|
* Optional Identifier of the first update to be returned.
|
||
|
|
* Must be greater by one than the highest among the identifiers of previously received updates.
|
||
|
|
* By default, updates starting with the earliest unconfirmed update are returned.
|
||
|
|
*/
|
||
|
|
private Integer offset;
|
||
|
|
public static final String LIMIT_FIELD = "limit";
|
||
|
|
/**
|
||
|
|
* Optional Limits the number of updates to be retrieved.
|
||
|
|
* Values between 1—100 are accepted. Defaults to 100
|
||
|
|
*/
|
||
|
|
private Integer limit;
|
||
|
|
public static final String TIMEOUT_FIELD = "timeout";
|
||
|
|
/**
|
||
|
|
* Optional Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling
|
||
|
|
*/
|
||
|
|
private Integer timeout;
|
||
|
|
|
||
|
|
public GetUpdates() {
|
||
|
|
super();
|
||
|
|
}
|
||
|
|
|
||
|
|
public Integer getOffset() {
|
||
|
|
return offset;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setOffset(Integer offset) {
|
||
|
|
this.offset = offset;
|
||
|
|
}
|
||
|
|
|
||
|
|
public Integer getLimit() {
|
||
|
|
return limit;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setLimit(Integer limit) {
|
||
|
|
this.limit = limit;
|
||
|
|
}
|
||
|
|
|
||
|
|
public Integer getTimeout() {
|
||
|
|
return timeout;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setTimeout(Integer timeout) {
|
||
|
|
this.timeout = timeout;
|
||
|
|
}
|
||
|
|
|
||
|
|
public String getUrlParams() {
|
||
|
|
return "?" + OFFSET_FIELD + "=" + offset ;
|
||
|
|
}
|
||
|
|
}
|