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 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

  • Method Details

    • create

      public abstract WRAR create​(@NotNull @NotNull WebhookRequest webhookRequest) throws java.io.IOException, java.net.URISyntaxException
      Create a webhook. Requires the webhook.write scope.
      Parameters:
      webhookRequest - WebhookRequest
      Returns:
      AbstractWebhooksResource
      Throws:
      java.io.IOException
      java.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.IOException
      java.net.URISyntaxException
    • list

      public abstract WRPAR list() throws java.io.IOException, java.net.URISyntaxException
      List all webhooks. Requires the webhook.read scope.
      Returns:
      AbstractWebhooksResource
      Throws:
      java.io.IOException
      java.net.URISyntaxException
    • list

      public abstract WRPAR list​(@NotNull @NotNull java.util.Map<Filter,​java.lang.String> filters) throws java.io.IOException, java.net.URISyntaxException
      List 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.IOException
      java.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.URISyntaxException
      List 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.IOException
      java.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.URISyntaxException
      Delete a webhook. Requires the webhook.write scope.
      Parameters:
      webhookId - webhook id
      Returns:
      VR
      Throws:
      java.io.IOException
      java.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.NoSuchAlgorithmException
      Verify webhook signature
      Parameters:
      payload - payload
      signature - signature
      Returns:
      Throws:
      java.security.InvalidKeyException
      java.security.NoSuchAlgorithmException