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

com.mailgun.api.v3.MailgunWebhooksApi Maven / Gradle / Ivy

Go to download

The Mailgun SDK for Java enables Java developers to work with Mailgun API efficiently.

The newest version!
package com.mailgun.api.v3;

import com.mailgun.api.MailgunApi;
import com.mailgun.enums.WebhookName;
import com.mailgun.expanders.EnumExpander;
import com.mailgun.model.webhooks.WebhookDetailsResult;
import com.mailgun.model.webhooks.WebhookListResult;
import com.mailgun.model.webhooks.WebhookRequest;
import com.mailgun.model.webhooks.WebhookResult;
import com.mailgun.model.webhooks.WebhookUpdateRequest;
import feign.Headers;
import feign.Param;
import feign.RequestLine;
import feign.Response;

/**
 * 

* Webhooks API allows you to create, access, and delete webhooks programmatically. *

* * @see Webhooks */ @Headers("Accept: application/json") public interface MailgunWebhooksApi extends MailgunApi { /** *

* Returns a list of webhooks set for the specified domain. *

* * @param domain Name of the domain * @return {@link WebhookListResult} */ @RequestLine("GET /domains/{domain}/webhooks") WebhookListResult getAllWebhooks(@Param("domain") String domain); /** *

* Returns a list of webhooks set for the specified domain. *

* * @param domain Name of the domain * @return {@link Response} */ @RequestLine("GET /domains/{domain}/webhooks") Response getAllWebhooksFeignResponse(@Param("domain") String domain); /** *

* Return details about a webhook specified in the URL. *

* * @param domain Name of the domain * @param webhookName Name of the webhook. * @return {@link WebhookDetailsResult} */ @RequestLine("GET /domains/{domain}/webhooks/{name}") WebhookDetailsResult getWebhookDetails(@Param("domain") String domain, @Param(value = "name", expander = EnumExpander.class) WebhookName webhookName); /** *

* Return details about a webhook specified in the URL. *

* * @param domain Name of the domain * @param webhookName Name of the webhook. * @return {@link Response} */ @RequestLine("GET /domains/{domain}/webhooks/{name}") Response getWebhookDetailsFeignResponse(@Param("domain") String domain, @Param(value = "name", expander = EnumExpander.class) WebhookName webhookName); /** *

* Creates a new webhook. *

* Warning: When adding a Clicked or Opened webhook, ensure that you also have tracking enabled. * * @param domain Name of the domain * @param request {@link WebhookRequest} * @return {@link WebhookResult} */ @Headers("Content-Type: multipart/form-data") @RequestLine("POST /domains/{domain}/webhooks") WebhookResult createNewWebhook(@Param("domain") String domain, WebhookRequest request); /** *

* Creates a new webhook. * Warning: When adding a Clicked or Opened webhook, ensure that you also have tracking enabled. *

* * @param domain Name of the domain * @param request {@link WebhookRequest} * @return {@link Response} */ @Headers("Content-Type: multipart/form-data") @RequestLine("POST /domains/{domain}/webhooks") Response createNewWebhookFeignResponse(@Param("domain") String domain, WebhookRequest request); /** *

* Updates an existing webhook. *

* * @param domain Name of the domain * @param webhookName Name of the webhook. * @param request {@link WebhookUpdateRequest} * @return {@link WebhookResult} */ @Headers("Content-Type: multipart/form-data") @RequestLine("PUT /domains/{domain}/webhooks/{name}") WebhookResult updateWebhook(@Param("domain") String domain, @Param(value = "name", expander = EnumExpander.class) WebhookName webhookName, WebhookUpdateRequest request); /** *

* Updates an existing webhook. *

* * @param domain Name of the domain * @param webhookName Name of the webhook. * @param request {@link WebhookUpdateRequest} * @return {@link Response} */ @Headers("Content-Type: multipart/form-data") @RequestLine("PUT /domains/{domain}/webhooks/{name}") Response updateWebhookFeignResponse(@Param("domain") String domain, @Param(value = "name", expander = EnumExpander.class) WebhookName webhookName, WebhookUpdateRequest request); /** *

* Deletes an existing webhook. *

* * @param domain Name of the domain * @param webhookName Name of the webhook. * @return {@link WebhookResult} */ @RequestLine("DELETE /domains/{domain}/webhooks/{name}") WebhookResult deleteWebhook(@Param("domain") String domain, @Param(value = "name", expander = EnumExpander.class) WebhookName webhookName); /** *

* Deletes an existing webhook. *

* * @param domain Name of the domain * @param webhookName Name of the webhook. * @return {@link Response} */ @RequestLine("DELETE /domains/{domain}/webhooks/{name}") Response deleteWebhookFeignResponse(@Param("domain") String domain, @Param(value = "name", expander = EnumExpander.class) WebhookName webhookName); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy