com.github.jamesnetherton.zulip.client.api.user.request.GetUserAttachmentsApiRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zulip-java-client Show documentation
Show all versions of zulip-java-client Show documentation
Java client for the Zulip REST API
The newest version!
package com.github.jamesnetherton.zulip.client.api.user.request;
import static com.github.jamesnetherton.zulip.client.api.user.request.UserRequestConstants.ATTACHMENTS;
import com.github.jamesnetherton.zulip.client.api.core.ExecutableApiRequest;
import com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest;
import com.github.jamesnetherton.zulip.client.api.user.UserAttachment;
import com.github.jamesnetherton.zulip.client.api.user.response.GetUserAttachmentsApiResponse;
import com.github.jamesnetherton.zulip.client.exception.ZulipClientException;
import com.github.jamesnetherton.zulip.client.http.ZulipHttpClient;
import java.util.List;
/**
* Zulip API request builder for getting information about files uploaded by the user.
*
* @see https://zulip.com/api/update-user-group-members
*/
public class GetUserAttachmentsApiRequest extends ZulipApiRequest implements ExecutableApiRequest> {
/**
* Constructs a {@link GetUserAttachmentsApiRequest}.
*
* @param client The Zulip HTTP client
*/
public GetUserAttachmentsApiRequest(ZulipHttpClient client) {
super(client);
}
/**
* Executes the Zulip API request for getting information about files uploaded by the user.
*
* @return List if {@link UserAttachment} objects
* @throws ZulipClientException if the request was not successful
*/
@Override
public List execute() throws ZulipClientException {
return client().get(ATTACHMENTS, getParams(), GetUserAttachmentsApiResponse.class).getAttachments();
}
}