com.mailgun.api.v3.MailgunRoutesApi Maven / Gradle / Ivy
Show all versions of mailgun-java Show documentation
package com.mailgun.api.v3;
import com.mailgun.api.MailgunApi;
import com.mailgun.model.ResponseWithMessage;
import com.mailgun.model.routes.Route;
import com.mailgun.model.routes.RoutesListResponse;
import com.mailgun.model.routes.RoutesPageRequest;
import com.mailgun.model.routes.RoutesRequest;
import com.mailgun.model.routes.RoutesResponse;
import com.mailgun.model.routes.SingleRouteResponse;
import feign.Headers;
import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
import feign.Response;
/**
*
* Mailgun Routes Api
*
*
* Mailgun Routes are a powerful way to handle the incoming traffic.
*
*
* See
* user-manual/Routes
* section in the User Manual to learn more about how they work.
*
*
* This API allows you to work with routes programmatically.
*
* Routes are comprised of the following arguments:
*
*
* A filter (when to do something).
* A priority (in what order).
* An action (what to do).
*
*
* @see Routes
*/
@Headers("Accept: application/json")
public interface MailgunRoutesApi extends MailgunApi {
/**
*
* Fetches the list of routes (limit to 100 entries).
*
* Note: that routes are defined globally, per account, not per domain as most of other API calls.
*
* @return {@link RoutesListResponse}
*/
@RequestLine("GET /routes")
RoutesListResponse getRoutesList();
/**
*
* Fetches the list of routes (limit to 100 entries).
*
* Note: that routes are defined globally, per account, not per domain as most of other API calls.
*
* @return {@link Response}
*/
@RequestLine("GET /routes")
Response getRoutesListFeignResponse();
/**
*
* Fetches the list of routes.
*
* Note: that routes are defined globally, per account, not per domain as most of other API calls.
*
* @param pageRequest {@link RoutesPageRequest}
* @return {@link RoutesListResponse}
*/
@RequestLine("GET /routes")
RoutesListResponse getRoutesList(@QueryMap RoutesPageRequest pageRequest);
/**
*
* Fetches the list of routes.
*
* Note: that routes are defined globally, per account, not per domain as most of other API calls.
*
* @param pageRequest {@link RoutesPageRequest}
* @return {@link Response}
*/
@RequestLine("GET /routes")
Response getRoutesListFeignResponse(@QueryMap RoutesPageRequest pageRequest);
/**
*
* Returns a single route object based on its ID.
*
*
* @param id ID of the route
* @return {@link SingleRouteResponse}
*/
@RequestLine("GET /routes/{id}")
SingleRouteResponse getSingleRoute(@Param("id") String id);
/**
*
* Returns a single route object based on its ID.
*
*
* @param id ID of the route
* @return {@link Response}
*/
@RequestLine("GET /routes/{id}")
Response getSingleRouteFeignResponse(@Param("id") String id);
/**
*
* Creates a new route.
*
*
* @param request {@link RoutesRequest}
* @return {@link RoutesResponse}
*/
@Headers("Content-Type: multipart/form-data")
@RequestLine("POST /routes")
RoutesResponse createRoute(RoutesRequest request);
/**
*
* Creates a new route.
*
*
* @param request {@link RoutesRequest}
* @return {@link Response}
*/
@Headers("Content-Type: multipart/form-data")
@RequestLine("POST /routes")
Response createRouteFeignResponse(RoutesRequest request);
/**
*
* Updates a given route by ID.
*
* All parameters are optional: this API call only updates the specified fields leaving others unchanged.
*
* @param id ID of the route
* @param request {@link RoutesRequest}
* @return {@link Route}
*/
@Headers("Content-Type: multipart/form-data")
@RequestLine("PUT /routes/{id}")
Route updateRoute(@Param("id") String id, RoutesRequest request);
/**
*
* Updates a given route by ID.
*
* All parameters are optional: this API call only updates the specified fields leaving others unchanged.
*
* @param id ID of the route
* @param request {@link RoutesRequest}
* @return {@link Response}
*/
@Headers("Content-Type: multipart/form-data")
@RequestLine("PUT /routes/{id}")
Response updateRouteFeignResponse(@Param("id") String id, RoutesRequest request);
/**
*
* Deletes a route based on the id.
*
*
* @param id ID of the route
* @return {@link ResponseWithMessage}
*/
@RequestLine("DELETE /routes/{id}")
ResponseWithMessage deleteRoute(@Param("id") String id);
/**
*
* Deletes a route based on the id.
*
*
* @param id ID of the route
* @return {@link Response}
*/
@RequestLine("DELETE /routes/{id}")
Response deleteRouteFeignResponse(@Param("id") String id);
}