com.github.jamesnetherton.zulip.client.api.server.request.GetLinkifiersApiRequest 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.server.request;
import static com.github.jamesnetherton.zulip.client.api.server.request.ServerRequestConstants.REALM_LINKIFIERS;
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.server.Linkifier;
import com.github.jamesnetherton.zulip.client.api.server.response.GetLinkifiersApiResponse;
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 all linkifiers.
*
* @see https://zulip.com/api/get-linkifiers
*/
public class GetLinkifiersApiRequest extends ZulipApiRequest implements ExecutableApiRequest> {
/**
* Constructs a {@link GetLinkifiersApiRequest}.
*
* @param client The Zulip HTTP client
*/
public GetLinkifiersApiRequest(ZulipHttpClient client) {
super(client);
}
/**
* Executes the Zulip API request for getting all linkifiers.
*
* @return List of {@link Linkifier} objects
* @throws ZulipClientException if the request was not successful
*/
@Override
public List execute() throws ZulipClientException {
GetLinkifiersApiResponse response = client().get(REALM_LINKIFIERS, getParams(), GetLinkifiersApiResponse.class);
return response.getLinkifiers();
}
}