Package com.cloudconvert.resource
Class AbstractWebhooksResource<WRAR extends AbstractResult<WebhookResponse>,WRPAR extends AbstractResult<Pageable<WebhookResponse>>,VAR extends AbstractResult<Void>>
java.lang.Object
com.cloudconvert.resource.AbstractResource
com.cloudconvert.resource.AbstractWebhooksResource<WRAR,WRPAR,VAR>
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
AsyncWebhookResource,WebhookResource
public abstract class AbstractWebhooksResource<WRAR extends AbstractResult<WebhookResponse>,WRPAR extends AbstractResult<Pageable<WebhookResponse>>,VAR extends AbstractResult<Void>>
extends AbstractResource
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionAbstractWebhooksResource(SettingsProvider settingsProvider, ObjectMapperProvider objectMapperProvider) -
Method Summary
Modifier and TypeMethodDescriptionabstract WRARcreate(@NotNull WebhookRequest webhookRequest) Create a webhook.abstract VARDelete a webhook.protected org.apache.http.client.methods.HttpUriRequestgetCreateHttpUriRequest(@NotNull WebhookRequest webhookRequest) protected org.apache.http.client.methods.HttpUriRequestgetDeleteHttpUriRequest(@NotNull String webhookId) protected org.apache.http.client.methods.HttpUriRequestgetListHttpUriRequest(@NotNull Map<Filter, String> filters, @Nullable Pagination pagination) abstract WRPARlist()List all webhooks.abstract WRPARList all webhooks.abstract WRPARlist(@NotNull Map<Filter, String> filters, @Nullable Pagination pagination) List all webhooks.booleanVerify webhook signatureMethods inherited from class com.cloudconvert.resource.AbstractResource
getHttpEntity, getHttpEntity, getHttpUriRequest, getHttpUriRequest, getJson, getSyncUri, getSyncUri, getUri, getUri, requestToMap
-
Field Details
-
HMAC_SHA256
- See Also:
-
PATH_SEGMENT_WEBHOOKS
- See Also:
-
-
Constructor Details
-
AbstractWebhooksResource
public AbstractWebhooksResource(SettingsProvider settingsProvider, ObjectMapperProvider objectMapperProvider)
-
-
Method Details
-
create
public abstract WRAR create(@NotNull @NotNull WebhookRequest webhookRequest) throws IOException, URISyntaxException, CloudConvertClientException, CloudConvertServerException Create a webhook. Requires the webhook.write scope.- Parameters:
webhookRequest-WebhookRequest- Returns:
AbstractWebhooksResource- Throws:
IOExceptionURISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
getCreateHttpUriRequest
protected org.apache.http.client.methods.HttpUriRequest getCreateHttpUriRequest(@NotNull @NotNull WebhookRequest webhookRequest) throws IOException, URISyntaxException - Throws:
IOExceptionURISyntaxException
-
list
public abstract WRPAR list() throws IOException, URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionList all webhooks. Requires the webhook.read scope. -
list
public abstract WRPAR list(@NotNull @NotNull Map<Filter, String> filters) throws IOException, URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionList 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:
IOExceptionURISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
list
public abstract WRPAR list(@NotNull @NotNull Map<Filter, String> filters, @Nullable @Nullable Pagination pagination) throws IOException, URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionList 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:
IOExceptionURISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
getListHttpUriRequest
protected org.apache.http.client.methods.HttpUriRequest getListHttpUriRequest(@NotNull @NotNull Map<Filter, String> filters, @Nullable @Nullable Pagination pagination) throws URISyntaxException- Throws:
URISyntaxException
-
delete
public abstract VAR delete(@NotNull @NotNull String webhookId) throws IOException, URISyntaxException, CloudConvertClientException, CloudConvertServerException Delete a webhook. Requires the webhook.write scope.- Parameters:
webhookId- webhook id- Returns:
- VR
- Throws:
IOExceptionURISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
getDeleteHttpUriRequest
protected org.apache.http.client.methods.HttpUriRequest getDeleteHttpUriRequest(@NotNull @NotNull String webhookId) throws URISyntaxException - Throws:
URISyntaxException
-
verify
public boolean verify(@NotNull @NotNull String payload, @NotNull @NotNull String signature) throws InvalidKeyException, NoSuchAlgorithmException Verify webhook signature- Parameters:
payload- payloadsignature- signature- Returns:
- Throws:
InvalidKeyExceptionNoSuchAlgorithmException
-