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

com.github.jamesnetherton.zulip.client.api.server.request.GetLinkifiersApiRequest Maven / Gradle / Ivy

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy