Package pw.chew.clickup4j.internal
Class ClickUp4jImpl
java.lang.Object
pw.chew.clickup4j.internal.ClickUp4jImpl
- All Implemented Interfaces:
ClickUp4j
-
Constructor Summary
ConstructorDescriptionClickUp4jImpl
(String token, okhttp3.OkHttpClient client, WebhookServer webhookServer, String webhookEndpoint) -
Method Summary
Modifier and TypeMethodDescriptionokhttp3.OkHttpClient
Returns the OkHttpClient used for requests.getToken()
Gets the token currently being used for requests.retrieveGoal
(String goalId) Retrieve a specificgoal
by ID.retrieveGoals
(String workspaceId) Retrieves the currently logged-in User.retrieveSpace
(@NotNull String spaceId) Retrieves a space by ID.retrieveTask
(@NotNull String taskId) Retrieves a single task by ID.retrieveTasks
(@NotNull String listId) Returns a list of tasks in a specified list ID.retrieveWebhooks
(String workspaceId) Retrieves a list of workspaces the currently authenticated user can access.void
startWebhookServer
(String workspaceId) Starts a webhook server with the settings provided from theClickUp4jBuilder
.void
Shuts down the webhook server.
-
Constructor Details
-
ClickUp4jImpl
public ClickUp4jImpl(String token, okhttp3.OkHttpClient client, WebhookServer webhookServer, String webhookEndpoint)
-
-
Method Details
-
getToken
Description copied from interface:ClickUp4j
Gets the token currently being used for requests. -
getHttpClient
public okhttp3.OkHttpClient getHttpClient()Description copied from interface:ClickUp4j
Returns the OkHttpClient used for requests.- Specified by:
getHttpClient
in interfaceClickUp4j
- Returns:
- the OkHttpClient
-
retrieveTasks
Description copied from interface:ClickUp4j
Returns a list of tasks in a specified list ID.- Specified by:
retrieveTasks
in interfaceClickUp4j
- Parameters:
listId
- the list ID- Returns:
- the list of tasks
-
retrieveTask
Description copied from interface:ClickUp4j
Retrieves a single task by ID. This can be from any workspace the user has access to.
This will NOT return values for the custom fields.
Custom IDs are not supported with this method.- Specified by:
retrieveTask
in interfaceClickUp4j
- Parameters:
taskId
- the task ID- Returns:
- the task
-
retrieveSpace
Description copied from interface:ClickUp4j
Retrieves a space by ID. This can be from any workspace the user has access to.- Specified by:
retrieveSpace
in interfaceClickUp4j
- Parameters:
spaceId
- the space ID- Returns:
- the space
-
retrieveWorkspaces
Description copied from interface:ClickUp4j
Retrieves a list of workspaces the currently authenticated user can access.- Specified by:
retrieveWorkspaces
in interfaceClickUp4j
- Returns:
- the list of workspaces
-
retrieveGoal
Description copied from interface:ClickUp4j
Retrieve a specificgoal
by ID.- Specified by:
retrieveGoal
in interfaceClickUp4j
- Parameters:
goalId
- the goal ID- Returns:
- the goal
-
retrieveGoals
Description copied from interface:ClickUp4j
- Specified by:
retrieveGoals
in interfaceClickUp4j
- Parameters:
workspaceId
- the workspace ID- Returns:
- the list of goals
-
retrieveSelfUser
Description copied from interface:ClickUp4j
Retrieves the currently logged-in User.
The user is workspace agnostic.- Specified by:
retrieveSelfUser
in interfaceClickUp4j
- Returns:
- the user
-
retrieveWebhooks
Description copied from interface:ClickUp4j
- Specified by:
retrieveWebhooks
in interfaceClickUp4j
- Parameters:
workspaceId
- the workspace ID- Returns:
- the list of webhooks
-
startWebhookServer
Description copied from interface:ClickUp4j
Starts a webhook server with the settings provided from theClickUp4jBuilder
.
This method will do the following:- Retrieve existing webhooks
- If a webhook with the endpoint exists, do nothing.
- Otherwise, create a new webhook with the endpoint.
Be sure to stop the server when you're done withClickUp4j.stopWebhookServer()
.- Specified by:
startWebhookServer
in interfaceClickUp4j
- Parameters:
workspaceId
- the workspace ID
-
stopWebhookServer
public void stopWebhookServer()Description copied from interface:ClickUp4j
Shuts down the webhook server.
This method will also delete the webhook from ClickUp.- Specified by:
stopWebhookServer
in interfaceClickUp4j
-