Class WebhookImpl

java.lang.Object
pw.chew.clickup4j.internal.entities.WebhookImpl
All Implemented Interfaces:
Webhook

public class WebhookImpl extends Object implements Webhook
  • Constructor Details

    • WebhookImpl

      public WebhookImpl(@NotNull @NotNull org.json.JSONObject data, @NotNull @NotNull ClickUp4j api)
  • Method Details

    • getId

      @NotNull public @NotNull String getId()
      Description copied from interface: Webhook
      The ID of the webhook.
      Specified by:
      getId in interface Webhook
      Returns:
      never-null webhook ID
    • getUserId

      public int getUserId()
      Description copied from interface: Webhook
      The user ID of the user who created the webhook.
      Specified by:
      getUserId in interface Webhook
      Returns:
      user ID
    • getWorkspaceId

      public int getWorkspaceId()
      Description copied from interface: Webhook
      The workspace this webhook belongs to.
      Specified by:
      getWorkspaceId in interface Webhook
      Returns:
      workspace ID
    • getEndpoint

      @NotNull public @NotNull String getEndpoint()
      Description copied from interface: Webhook
      The endpoint ClickUp will send webhooks to.
      Specified by:
      getEndpoint in interface Webhook
      Returns:
      endpoint URL
    • getClientId

      @NotNull public @NotNull String getClientId()
      Description copied from interface: Webhook
      The client id of the webhook.
      Specified by:
      getClientId in interface Webhook
      Returns:
      client ID
    • getEvents

      @NotNull public @NotNull List<String> getEvents()
      Description copied from interface: Webhook
      The events this webhook is listening for.
      Specified by:
      getEvents in interface Webhook
      Returns:
      never-null, but potentially empty, list of events
    • getTaskId

      @Nullable public @Nullable String getTaskId()
      Description copied from interface: Webhook
      Returns the Task ID of the task this webhook is listening for.
      This may be null, meaning the webhook is either listening elsewhere, or globally.
      Specified by:
      getTaskId in interface Webhook
      Returns:
      task ID, or null
    • getListId

      @Nullable public @Nullable String getListId()
      Description copied from interface: Webhook
      Returns the TaskList ID of the list this webhook is listening for.
      This may be null, meaning the webhook is either listening elsewhere, or globally.
      Specified by:
      getListId in interface Webhook
      Returns:
      list ID, or null
    • getFolderId

      @Nullable public @Nullable String getFolderId()
      Description copied from interface: Webhook
      Returns the folder ID of the folder this webhook is listening for.
      This may be null, meaning the webhook is either listening elsewhere, or globally.
      Specified by:
      getFolderId in interface Webhook
      Returns:
      folder ID, or null
    • getSpaceId

      @Nullable public @Nullable String getSpaceId()
      Description copied from interface: Webhook
      Returns the Space ID of the list this webhook is listening for.
      This may be null, meaning the webhook is either listening elsewhere, or globally.
      Specified by:
      getSpaceId in interface Webhook
      Returns:
      space ID, or null
    • getHealth

      public Webhook.Health getHealth()
      Description copied from interface: Webhook
      Returns the Health of the webhook.
      This is one of the enum constants: active, failing, or suspended.
      If the webhook is failing, you can see the fail count with Webhook.getFailCount().
      Specified by:
      getHealth in interface Webhook
      Returns:
      never-null health
    • getFailCount

      public int getFailCount()
      Description copied from interface: Webhook
      Returns the number of times the webhook has failed.
      0 means the webhook is active.
      Specified by:
      getFailCount in interface Webhook
      Returns:
      fail count
    • getSecret

      @NotNull public @NotNull String getSecret()
      Description copied from interface: Webhook
      Returns the secret of the webhook, to be used when verifying the webhook.
      Specified by:
      getSecret in interface Webhook
      Returns:
      never-null secret
    • delete

      public Requester<Void> delete()
      Description copied from interface: Webhook
      Delete this webhook.
      Specified by:
      delete in interface Webhook
      Returns:
      nothing
    • getClickUp4j

      @NotNull public @NotNull ClickUp4j getClickUp4j()
      Description copied from interface: Webhook
      This ClickUp4j instance.
      Specified by:
      getClickUp4j in interface Webhook
      Returns:
      never-null instance