All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.jamesnetherton.zulip.client.api.user.request.GetUserAttachmentsApiRequest Maven / Gradle / Ivy

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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy