com.mailgun.api.v3.MailgunIPsApi 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.ips.IPResult;
import com.mailgun.model.ips.IPsResult;
import feign.Headers;
import feign.Param;
import feign.RequestLine;
import feign.Response;
/**
*
* The IP API endpoint allows you to access information regarding the IPs allocated to your Mailgun account
* that are used for outbound sending.
*
*
* @see IPs
*/
@Headers("Accept: application/json")
public interface MailgunIPsApi extends MailgunApi {
/**
*
* Returns a list of IPs assigned to your account.
*
*
* @return {@link IPsResult}
*/
@RequestLine("GET /ips")
IPsResult getAllIPs();
/**
*
* Returns a list of IPs assigned to your account.
*
*
* @return {@link Response}
*/
@RequestLine("GET /ips")
Response getAllIPsFeignResponse();
/**
*
* Return only dedicated IPs if param
dedicated
set to true
, otherwise return all IPs.
*
*
* @param dedicated dedicated IPs
* @return {@link IPsResult}
*/
@RequestLine("GET /ips?dedicated={dedicated}")
IPsResult getDedicatedIPs(@Param("dedicated") boolean dedicated);
/**
*
* Return only dedicated IPs if param
dedicated
set to true
, otherwise return all IPs.
*
*
* @param dedicated dedicated IPs
* @return {@link Response}
*/
@RequestLine("GET /ips?dedicated={dedicated}")
Response getDedicatedIPsFeignResponse(@Param("dedicated") boolean dedicated);
/**
*
* Returns information about the specified IP.
*
*
* @param ip specified IP
* @return {@link IPResult}
*/
@RequestLine("GET /ips/{ip}")
IPResult getSpecifiedIP(@Param("ip") String ip);
/**
*
* Returns information about the specified IP.
*
*
* @param ip specified IP
* @return {@link Response}
*/
@RequestLine("GET /ips/{ip}")
Response getSpecifiedIPFeignResponse(@Param("ip") String ip);
/**
*
* Returns a list of IPs currently assigned to the specified domain.
*
*
* @param domain Name of the domain
* @return {@link IPsResult}
*/
@RequestLine("GET /domains/{domain}/ips")
IPsResult getDomainIPs(@Param("domain") String domain);
/**
*
* Returns a list of IPs currently assigned to the specified domain.
*
*
* @param domain Name of the domain
* @return {@link Response}
*/
@RequestLine("GET /domains/{domain}/ips")
Response getDomainIPsFeignResponse(@Param("domain") String domain);
/**
*
* Assign a dedicated IP to the domain specified.
*
*
* Note: Only dedicated IPs can be assigned to a domain.
*
*
* @param domain Name of the domain
* @param ip IP address that should be assigned to the domain pool.
* @return {@link ResponseWithMessage}
*/
@Headers("Content-Type: multipart/form-data")
@RequestLine("POST /domains/{domain}/ips")
ResponseWithMessage assignIPToDomain(@Param("domain") String domain, @Param("ip") String ip);
/**
*
* Assign a dedicated IP to the domain specified.
*
*
* Note: Only dedicated IPs can be assigned to a domain.
*
*
* @param domain Name of the domain
* @param ip IP address that should be assigned to the domain pool.
* @return {@link Response}
*/
@Headers("Content-Type: multipart/form-data")
@RequestLine("POST /domains/{domain}/ips")
Response assignIPToDomainFeignResponse(@Param("domain") String domain, @Param("ip") String ip);
/**
*
* Unassign an IP from the domain specified.
*
*
* @param domain Name of the domain
* @param ip IP address that should be unassign.
* @return {@link ResponseWithMessage}
*/
@RequestLine("DELETE /domains/{domain}/ips/{ip}")
ResponseWithMessage unassignIPFromDomain(@Param("domain") String domain, @Param("ip") String ip);
/**
*
* Unassign an IP from the domain specified.
*
*
* @param domain Name of the domain
* @param ip IP address that should be unassign.
* @return {@link Response}
*/
@RequestLine("DELETE /domains/{domain}/ips/{ip}")
Response unassignIPFromDomainFeignResponse(@Param("domain") String domain, @Param("ip") String ip);
}