TDLightTelegramBots/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/GetUserProfilePhotos.java

60 lines
1.8 KiB
Java
Raw Normal View History

2018-07-08 01:41:21 +02:00
package org.telegram.telegrambots.meta.api.methods;
2016-01-14 01:14:53 +01:00
import com.fasterxml.jackson.annotation.JsonProperty;
2020-11-01 23:46:36 +01:00
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
2018-07-08 01:41:21 +02:00
import org.telegram.telegrambots.meta.api.objects.UserProfilePhotos;
import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException;
2016-01-14 01:14:53 +01:00
/**
* @author Ruben Bermudez
* @version 1.0
2019-06-08 21:33:28 +02:00
* Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
2016-01-14 01:14:53 +01:00
*/
2020-11-01 23:46:36 +01:00
@EqualsAndHashCode(callSuper = false)
@Getter
@Setter
@ToString
2023-05-30 03:33:18 +02:00
@NoArgsConstructor(force = true)
2020-11-01 23:46:36 +01:00
@RequiredArgsConstructor
@AllArgsConstructor
@Builder
2016-01-14 01:14:53 +01:00
public class GetUserProfilePhotos extends BotApiMethod<UserProfilePhotos> {
public static final String PATH = "getuserprofilephotos";
2016-04-11 02:53:53 +02:00
private static final String USERID_FIELD = "user_id";
private static final String OFFSET_FIELD = "offset";
private static final String LIMIT_FIELD = "limit";
@JsonProperty(USERID_FIELD)
2020-11-01 23:46:36 +01:00
@NonNull
2021-03-09 11:59:28 +01:00
private Long userId; ///< Unique identifier of the target user
2016-01-14 01:14:53 +01:00
/**
2020-11-01 23:46:36 +01:00
* Optional. Sequential number of the first photo to be returned. By default, all photos are returned.
2016-01-14 01:14:53 +01:00
*/
@JsonProperty(OFFSET_FIELD)
2016-01-14 01:14:53 +01:00
private Integer offset;
/**
* Optional. Limits the number of photos to be retrieved. Values between 1100 are accepted. Defaults to 100.
*/
@JsonProperty(LIMIT_FIELD)
2016-01-14 01:14:53 +01:00
private Integer limit;
@Override
public String getMethod() {
2016-01-14 01:14:53 +01:00
return PATH;
}
@Override
public UserProfilePhotos deserializeResponse(String answer) throws TelegramApiRequestException {
2022-06-16 19:36:20 +02:00
return deserializeResponse(answer, UserProfilePhotos.class);
}
2016-01-14 01:14:53 +01:00
}