Package com.cloudconvert.resource
Class AbstractWebhooksResource<WRAR extends AbstractResult<WebhookResponse>,WRPAR extends AbstractResult<Pageable<WebhookResponse>>,VAR extends AbstractResult<java.lang.Void>>
java.lang.Object
com.cloudconvert.resource.AbstractResource
com.cloudconvert.resource.AbstractWebhooksResource<WRAR,WRPAR,VAR>
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
AsyncWebhookResource,WebhookResource
public abstract class AbstractWebhooksResource<WRAR extends AbstractResult<WebhookResponse>,WRPAR extends AbstractResult<Pageable<WebhookResponse>>,VAR extends AbstractResult<java.lang.Void>> extends AbstractResource
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHMAC_SHA256static java.lang.StringPATH_SEGMENT_WEBHOOKSFields inherited from class com.cloudconvert.resource.AbstractResource
BEARER, HEADER_AUTHORIZATION, HEADER_USER_AGENT, INPUT_STREAM_TYPE_REFERENCE, JOB_RESPONSE_PAGEABLE_TYPE_REFERENCE, JOB_RESPONSE_TYPE_REFERENCE, MAP_STRING_TO_OBJECT_TYPE_REFERENCE, OPERATION_RESPONSE_PAGEABLE_TYPE_REFERENCE, TASK_RESPONSE_PAGEABLE_TYPE_REFERENCE, TASK_RESPONSE_TYPE_REFERENCE, USER_RESPONSE_TYPE_REFERENCE, V2, VALUE_USER_AGENT, VOID_TYPE_REFERENCE, WEBHOOKS_RESPONSE_PAGEABLE_TYPE_REFERENCE, WEBHOOKS_RESPONSE_TYPE_REFERENCE -
Constructor Summary
Constructors Constructor Description AbstractWebhooksResource(SettingsProvider settingsProvider, ObjectMapperProvider objectMapperProvider) -
Method Summary
Modifier and Type Method Description abstract WRARcreate(@NotNull WebhookRequest webhookRequest)Create a webhook.abstract VARdelete(@NotNull java.lang.String webhookId)Delete a webhook.protected org.apache.http.client.methods.HttpUriRequestgetCreateHttpUriRequest(@NotNull WebhookRequest webhookRequest)protected org.apache.http.client.methods.HttpUriRequestgetDeleteHttpUriRequest(@NotNull java.lang.String webhookId)protected org.apache.http.client.methods.HttpUriRequestgetListHttpUriRequest(@NotNull java.util.Map<Filter,java.lang.String> filters, @Nullable Pagination pagination)abstract WRPARlist()List all webhooks.abstract WRPARlist(@NotNull java.util.Map<Filter,java.lang.String> filters)List all webhooks.abstract WRPARlist(@NotNull java.util.Map<Filter,java.lang.String> filters, @Nullable Pagination pagination)List all webhooks.booleanverify(@NotNull java.lang.String payload, @NotNull java.lang.String signature)Verify webhook signatureMethods inherited from class com.cloudconvert.resource.AbstractResource
getHttpEntity, getHttpEntity, getHttpUriRequest, getHttpUriRequest, getUri, getUri, requestToMap
-
Field Details
-
HMAC_SHA256
public static final java.lang.String HMAC_SHA256- See Also:
- Constant Field Values
-
PATH_SEGMENT_WEBHOOKS
public static final java.lang.String PATH_SEGMENT_WEBHOOKS- See Also:
- Constant Field Values
-
-
Constructor Details
-
AbstractWebhooksResource
public AbstractWebhooksResource(SettingsProvider settingsProvider, ObjectMapperProvider objectMapperProvider)
-
-
Method Details
-
create
public abstract WRAR create(@NotNull @NotNull WebhookRequest webhookRequest) throws java.io.IOException, java.net.URISyntaxExceptionCreate a webhook. Requires the webhook.write scope.- Parameters:
webhookRequest-WebhookRequest- Returns:
AbstractWebhooksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
getCreateHttpUriRequest
protected org.apache.http.client.methods.HttpUriRequest getCreateHttpUriRequest(@NotNull @NotNull WebhookRequest webhookRequest) throws java.io.IOException, java.net.URISyntaxException- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
list
List all webhooks. Requires the webhook.read scope.- Returns:
AbstractWebhooksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
list
public abstract WRPAR list(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters) throws java.io.IOException, java.net.URISyntaxExceptionList all webhooks. Requires the webhook.read scope.- Parameters:
filters- (optional) Filters: - url - The result will be filtered to include only webhooks with a specific URL.- Returns:
AbstractWebhooksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
list
public abstract WRPAR list(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters, @Nullable @Nullable Pagination pagination) throws java.io.IOException, java.net.URISyntaxExceptionList all webhooks. Requires the webhook.read scope.- Parameters:
filters- (optional) Filters: - url - The result will be filtered to include only webhooks with a specific URL.pagination- (optional) Pagination: - per_page - Number of tasks per page, defaults to 100. - page - The result page to show.- Returns:
AbstractWebhooksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
getListHttpUriRequest
protected org.apache.http.client.methods.HttpUriRequest getListHttpUriRequest(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters, @Nullable @Nullable Pagination pagination) throws java.net.URISyntaxException- Throws:
java.net.URISyntaxException
-
delete
public abstract VAR delete(@NotNull @NotNull java.lang.String webhookId) throws java.io.IOException, java.net.URISyntaxExceptionDelete a webhook. Requires the webhook.write scope.- Parameters:
webhookId- webhook id- Returns:
- VR
- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
getDeleteHttpUriRequest
protected org.apache.http.client.methods.HttpUriRequest getDeleteHttpUriRequest(@NotNull @NotNull java.lang.String webhookId) throws java.net.URISyntaxException- Throws:
java.net.URISyntaxException
-
verify
public boolean verify(@NotNull @NotNull java.lang.String payload, @NotNull @NotNull java.lang.String signature) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmExceptionVerify webhook signature- Parameters:
payload- payloadsignature- signature- Returns:
- Throws:
java.security.InvalidKeyExceptionjava.security.NoSuchAlgorithmException
-