Package software.xdev.brevo.api
Class WebhooksApi
java.lang.Object
software.xdev.brevo.client.BaseApi
software.xdev.brevo.api.WebhooksApi
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateWebhook(CreateWebhook createWebhook) Create a webhookcreateWebhook(CreateWebhook createWebhook, Map<String, String> additionalHeaders) Create a webhookvoiddeleteWebhook(Long webhookId) Delete a webhookvoiddeleteWebhook(Long webhookId, Map<String, String> additionalHeaders) Delete a webhookexportWebhooksHistory(ExportWebhooksHistory exportWebhooksHistory) Export all webhook events This endpoint will submit a request to get the history of webhooks in the CSV file.exportWebhooksHistory(ExportWebhooksHistory exportWebhooksHistory, Map<String, String> additionalHeaders) Export all webhook events This endpoint will submit a request to get the history of webhooks in the CSV file.getWebhook(Long webhookId) Get a webhook detailsgetWebhook(Long webhookId, Map<String, String> additionalHeaders) Get a webhook detailsgetWebhooks(String type, String sort) Get all webhooksGet all webhooks<T> TinvokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String, String> additionalHeaders) Directly invoke the API for the given URL.voidupdateWebhook(Long webhookId, UpdateWebhook updateWebhook) Update a webhookvoidupdateWebhook(Long webhookId, UpdateWebhook updateWebhook, Map<String, String> additionalHeaders) Update a webhookMethods inherited from class software.xdev.brevo.client.BaseApi
getApiClient, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, setApiClient
-
Constructor Details
-
WebhooksApi
public WebhooksApi() -
WebhooksApi
-
-
Method Details
-
createWebhook
Create a webhook- Parameters:
createWebhook- Values to create a webhook (required)- Returns:
- CreateModel
- Throws:
ApiException- if fails to make API call
-
createWebhook
public CreateModel createWebhook(@Nonnull CreateWebhook createWebhook, Map<String, String> additionalHeaders) throws ApiExceptionCreate a webhook- Parameters:
createWebhook- Values to create a webhook (required)additionalHeaders- additionalHeaders for this call- Returns:
- CreateModel
- Throws:
ApiException- if fails to make API call
-
deleteWebhook
Delete a webhook- Parameters:
webhookId- Id of the webhook (required)- Throws:
ApiException- if fails to make API call
-
deleteWebhook
public void deleteWebhook(@Nonnull Long webhookId, Map<String, String> additionalHeaders) throws ApiExceptionDelete a webhook- Parameters:
webhookId- Id of the webhook (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
exportWebhooksHistory
public CreatedProcessId exportWebhooksHistory(@Nonnull ExportWebhooksHistory exportWebhooksHistory) throws ApiException Export all webhook events This endpoint will submit a request to get the history of webhooks in the CSV file. The link to download the CSV file will be sent to the webhook that was provided in the notifyURL.- Parameters:
exportWebhooksHistory- Values to submit for webhooks history (required)- Returns:
- CreatedProcessId
- Throws:
ApiException- if fails to make API call
-
exportWebhooksHistory
public CreatedProcessId exportWebhooksHistory(@Nonnull ExportWebhooksHistory exportWebhooksHistory, Map<String, String> additionalHeaders) throws ApiExceptionExport all webhook events This endpoint will submit a request to get the history of webhooks in the CSV file. The link to download the CSV file will be sent to the webhook that was provided in the notifyURL.- Parameters:
exportWebhooksHistory- Values to submit for webhooks history (required)additionalHeaders- additionalHeaders for this call- Returns:
- CreatedProcessId
- Throws:
ApiException- if fails to make API call
-
getWebhook
Get a webhook details- Parameters:
webhookId- Id of the webhook (required)- Returns:
- GetWebhook
- Throws:
ApiException- if fails to make API call
-
getWebhook
public GetWebhook getWebhook(@Nonnull Long webhookId, Map<String, String> additionalHeaders) throws ApiExceptionGet a webhook details- Parameters:
webhookId- Id of the webhook (required)additionalHeaders- additionalHeaders for this call- Returns:
- GetWebhook
- Throws:
ApiException- if fails to make API call
-
getWebhooks
Get all webhooks- Parameters:
type- Filter on webhook type (optional, default to transactional)sort- Sort the results in the ascending/descending order of webhook creation (optional, default to desc)- Returns:
- GetWebhooks
- Throws:
ApiException- if fails to make API call
-
getWebhooks
public GetWebhooks getWebhooks(@Nullable String type, @Nullable String sort, Map<String, String> additionalHeaders) throws ApiExceptionGet all webhooks- Parameters:
type- Filter on webhook type (optional, default to transactional)sort- Sort the results in the ascending/descending order of webhook creation (optional, default to desc)additionalHeaders- additionalHeaders for this call- Returns:
- GetWebhooks
- Throws:
ApiException- if fails to make API call
-
updateWebhook
public void updateWebhook(@Nonnull Long webhookId, @Nonnull UpdateWebhook updateWebhook) throws ApiException Update a webhook- Parameters:
webhookId- Id of the webhook (required)updateWebhook- Values to update a webhook (required)- Throws:
ApiException- if fails to make API call
-
updateWebhook
public void updateWebhook(@Nonnull Long webhookId, @Nonnull UpdateWebhook updateWebhook, Map<String, String> additionalHeaders) throws ApiExceptionUpdate a webhook- Parameters:
webhookId- Id of the webhook (required)updateWebhook- Values to update a webhook (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
invokeAPI
public <T> T invokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiExceptionDescription copied from class:BaseApiDirectly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.- Specified by:
invokeAPIin classBaseApi- Parameters:
url- The URL for the request, either full URL or only the path.method- The HTTP method for the request.request- The request object.returnType- The return type.additionalHeaders- Additional headers for the request.- Returns:
- The API response in the specified type.
- Throws:
ApiException- if fails to make API call.
-