Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions json-logs/samples/api/agents.sessions.rename.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ok": false,
"warning": "",
"error": "",
"needed": "",
"provided": "",
"title": ""
}
10 changes: 10 additions & 0 deletions json-logs/samples/api/agents.sessions.setStatus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ok": false,
"warning": "",
"error": "",
"needed": "",
"provided": "",
"status": "",
"agent_status": "",
"title": ""
}
2 changes: 2 additions & 0 deletions metadata/web-api/rate_limit_tiers.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
"admin.workflows.permissions.lookup": "Tier2",
"admin.workflows.search": "Tier2",
"admin.workflows.unpublish": "Tier2",
"agents.sessions.rename": "Tier3",
"agents.sessions.setStatus": "Tier3",
"api.test": "Tier4",
"apps.connections.open": "Tier1",
"apps.event.authorizations.list": "Tier4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import com.slack.api.methods.request.admin.users.*;
import com.slack.api.methods.request.admin.users.unsupported_versions.AdminUsersUnsupportedVersionsExportRequest;
import com.slack.api.methods.request.admin.workflows.*;
import com.slack.api.methods.request.agents.sessions.AgentsSessionsRenameRequest;
import com.slack.api.methods.request.agents.sessions.AgentsSessionsSetStatusRequest;
import com.slack.api.methods.request.api.ApiTestRequest;
import com.slack.api.methods.request.apps.AppsUninstallRequest;
import com.slack.api.methods.request.apps.connections.AppsConnectionsOpenRequest;
Expand Down Expand Up @@ -177,6 +179,8 @@
import com.slack.api.methods.response.admin.users.*;
import com.slack.api.methods.response.admin.users.unsupported_versions.AdminUsersUnsupportedVersionsExportResponse;
import com.slack.api.methods.response.admin.workflows.*;
import com.slack.api.methods.response.agents.sessions.AgentsSessionsRenameResponse;
import com.slack.api.methods.response.agents.sessions.AgentsSessionsSetStatusResponse;
import com.slack.api.methods.response.api.ApiTestResponse;
import com.slack.api.methods.response.apps.AppsUninstallResponse;
import com.slack.api.methods.response.apps.connections.AppsConnectionsOpenResponse;
Expand Down Expand Up @@ -794,6 +798,18 @@ CompletableFuture<AdminConversationsWhitelistListGroupsLinkedToChannelResponse>

CompletableFuture<AdminWorkflowsUnpublishResponse> adminWorkflowsUnpublish(RequestConfigurator<AdminWorkflowsUnpublishRequest.AdminWorkflowsUnpublishRequestBuilder> req);

// ------------------------------
// agents.sessions
// ------------------------------

CompletableFuture<AgentsSessionsRenameResponse> agentsSessionsRename(AgentsSessionsRenameRequest req);

CompletableFuture<AgentsSessionsRenameResponse> agentsSessionsRename(RequestConfigurator<AgentsSessionsRenameRequest.AgentsSessionsRenameRequestBuilder> req);

CompletableFuture<AgentsSessionsSetStatusResponse> agentsSessionsSetStatus(AgentsSessionsSetStatusRequest req);

CompletableFuture<AgentsSessionsSetStatusResponse> agentsSessionsSetStatus(RequestConfigurator<AgentsSessionsSetStatusRequest.AgentsSessionsSetStatusRequestBuilder> req);

// ------------------------------
// api
// ------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ private Methods() {
public static final String ADMIN_WORKFLOWS_SEARCH = "admin.workflows.search";
public static final String ADMIN_WORKFLOWS_UNPUBLISH = "admin.workflows.unpublish";

// ------------------------------
// agents.sessions
// ------------------------------

public static final String AGENTS_SESSIONS_RENAME = "agents.sessions.rename";
public static final String AGENTS_SESSIONS_SET_STATUS = "agents.sessions.setStatus";

// ------------------------------
// api
// ------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import com.slack.api.methods.request.admin.users.*;
import com.slack.api.methods.request.admin.users.unsupported_versions.AdminUsersUnsupportedVersionsExportRequest;
import com.slack.api.methods.request.admin.workflows.*;
import com.slack.api.methods.request.agents.sessions.AgentsSessionsRenameRequest;
import com.slack.api.methods.request.agents.sessions.AgentsSessionsSetStatusRequest;
import com.slack.api.methods.request.api.ApiTestRequest;
import com.slack.api.methods.request.apps.AppsUninstallRequest;
import com.slack.api.methods.request.apps.connections.AppsConnectionsOpenRequest;
Expand Down Expand Up @@ -190,6 +192,8 @@
import com.slack.api.methods.response.admin.users.*;
import com.slack.api.methods.response.admin.users.unsupported_versions.AdminUsersUnsupportedVersionsExportResponse;
import com.slack.api.methods.response.admin.workflows.*;
import com.slack.api.methods.response.agents.sessions.AgentsSessionsRenameResponse;
import com.slack.api.methods.response.agents.sessions.AgentsSessionsSetStatusResponse;
import com.slack.api.methods.response.api.ApiTestResponse;
import com.slack.api.methods.response.apps.AppsUninstallResponse;
import com.slack.api.methods.response.apps.connections.AppsConnectionsOpenResponse;
Expand Down Expand Up @@ -1131,6 +1135,24 @@ AdminWorkflowsUnpublishResponse adminWorkflowsUnpublish(
RequestConfigurator<AdminWorkflowsUnpublishRequest.AdminWorkflowsUnpublishRequestBuilder> req)
throws IOException, SlackApiException;

// ------------------------------
// agents.sessions
// ------------------------------

AgentsSessionsRenameResponse agentsSessionsRename(AgentsSessionsRenameRequest req)
throws IOException, SlackApiException;

AgentsSessionsRenameResponse agentsSessionsRename(
RequestConfigurator<AgentsSessionsRenameRequest.AgentsSessionsRenameRequestBuilder> req)
throws IOException, SlackApiException;

AgentsSessionsSetStatusResponse agentsSessionsSetStatus(AgentsSessionsSetStatusRequest req)
throws IOException, SlackApiException;

AgentsSessionsSetStatusResponse agentsSessionsSetStatus(
RequestConfigurator<AgentsSessionsSetStatusRequest.AgentsSessionsSetStatusRequestBuilder> req)
throws IOException, SlackApiException;

// ------------------------------
// api
// ------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ public static void setRateLimitTier(String methodName, MethodsRateLimitTier tier
setRateLimitTier(APPS_MANIFEST_VALIDATE, Tier3);
setRateLimitTier(TOOLING_TOKENS_ROTATE, Tier1); // TODO: change this when the "special" tier is clearly explained in the document

setRateLimitTier(AGENTS_SESSIONS_RENAME, Tier3);
setRateLimitTier(AGENTS_SESSIONS_SET_STATUS, Tier3);

setRateLimitTier(API_TEST, Tier4);
setRateLimitTier(APPS_CONNECTIONS_OPEN, Tier1);
setRateLimitTier(APPS_UNINSTALL, Tier1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
import com.slack.api.methods.request.admin.users.*;
import com.slack.api.methods.request.admin.users.unsupported_versions.AdminUsersUnsupportedVersionsExportRequest;
import com.slack.api.methods.request.admin.workflows.*;
import com.slack.api.methods.request.agents.sessions.AgentsSessionsRenameRequest;
import com.slack.api.methods.request.agents.sessions.AgentsSessionsSetStatusRequest;
import com.slack.api.methods.request.api.ApiTestRequest;
import com.slack.api.methods.request.apps.AppsUninstallRequest;
import com.slack.api.methods.request.apps.connections.AppsConnectionsOpenRequest;
Expand Down Expand Up @@ -1048,6 +1050,27 @@ public static FormBody.Builder toForm(AdminWorkflowsUnpublishRequest req) {
return form;
}

public static FormBody.Builder toForm(AgentsSessionsRenameRequest req) {
FormBody.Builder form = new FormBody.Builder();
setIfNotNull("channel_id", req.getChannelId(), form);
setIfNotNull("title", req.getTitle(), form);
setIfNotNull("thread_ts", req.getThreadTs(), form);
return form;
}

public static FormBody.Builder toForm(AgentsSessionsSetStatusRequest req) {
FormBody.Builder form = new FormBody.Builder();
setIfNotNull("channel_id", req.getChannelId(), form);
setIfNotNull("status", req.getStatus(), form);
setIfNotNull("thread_ts", req.getThreadTs(), form);
setIfNotNull("title", req.getTitle(), form);
setIfNotNull("initiator_user_id", req.getInitiatorUserId(), form);
setIfNotNull("icon_emoji", req.getIconEmoji(), form);
setIfNotNull("icon_url", req.getIconUrl(), form);
setIfNotNull("username", req.getUsername(), form);
return form;
}

public static FormBody.Builder toForm(ApiTestRequest req) {
FormBody.Builder form = new FormBody.Builder();
setIfNotNull("foo", req.getFoo(), form);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
import com.slack.api.methods.request.admin.users.*;
import com.slack.api.methods.request.admin.users.unsupported_versions.AdminUsersUnsupportedVersionsExportRequest;
import com.slack.api.methods.request.admin.workflows.*;
import com.slack.api.methods.request.agents.sessions.AgentsSessionsRenameRequest;
import com.slack.api.methods.request.agents.sessions.AgentsSessionsSetStatusRequest;
import com.slack.api.methods.request.api.ApiTestRequest;
import com.slack.api.methods.request.apps.AppsUninstallRequest;
import com.slack.api.methods.request.apps.connections.AppsConnectionsOpenRequest;
Expand Down Expand Up @@ -182,6 +184,8 @@
import com.slack.api.methods.response.admin.users.*;
import com.slack.api.methods.response.admin.users.unsupported_versions.AdminUsersUnsupportedVersionsExportResponse;
import com.slack.api.methods.response.admin.workflows.*;
import com.slack.api.methods.response.agents.sessions.AgentsSessionsRenameResponse;
import com.slack.api.methods.response.agents.sessions.AgentsSessionsSetStatusResponse;
import com.slack.api.methods.response.api.ApiTestResponse;
import com.slack.api.methods.response.apps.AppsUninstallResponse;
import com.slack.api.methods.response.apps.connections.AppsConnectionsOpenResponse;
Expand Down Expand Up @@ -1317,6 +1321,26 @@ public CompletableFuture<AdminWorkflowsUnpublishResponse> adminWorkflowsUnpublis
return adminWorkflowsUnpublish(req.configure(AdminWorkflowsUnpublishRequest.builder()).build());
}

@Override
public CompletableFuture<AgentsSessionsRenameResponse> agentsSessionsRename(AgentsSessionsRenameRequest req) {
return executor.execute(AGENTS_SESSIONS_RENAME, toMap(req), () -> methods.agentsSessionsRename(req));
}

@Override
public CompletableFuture<AgentsSessionsRenameResponse> agentsSessionsRename(RequestConfigurator<AgentsSessionsRenameRequest.AgentsSessionsRenameRequestBuilder> req) {
return agentsSessionsRename(req.configure(AgentsSessionsRenameRequest.builder()).build());
}

@Override
public CompletableFuture<AgentsSessionsSetStatusResponse> agentsSessionsSetStatus(AgentsSessionsSetStatusRequest req) {
return executor.execute(AGENTS_SESSIONS_SET_STATUS, toMap(req), () -> methods.agentsSessionsSetStatus(req));
}

@Override
public CompletableFuture<AgentsSessionsSetStatusResponse> agentsSessionsSetStatus(RequestConfigurator<AgentsSessionsSetStatusRequest.AgentsSessionsSetStatusRequestBuilder> req) {
return agentsSessionsSetStatus(req.configure(AgentsSessionsSetStatusRequest.builder()).build());
}

@Override
public CompletableFuture<ApiTestResponse> apiTest(ApiTestRequest req) {
return executor.execute(API_TEST, toMap(req), () -> methods.apiTest(req));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import com.slack.api.methods.request.admin.users.*;
import com.slack.api.methods.request.admin.users.unsupported_versions.AdminUsersUnsupportedVersionsExportRequest;
import com.slack.api.methods.request.admin.workflows.*;
import com.slack.api.methods.request.agents.sessions.AgentsSessionsRenameRequest;
import com.slack.api.methods.request.agents.sessions.AgentsSessionsSetStatusRequest;
import com.slack.api.methods.request.api.ApiTestRequest;
import com.slack.api.methods.request.apps.AppsUninstallRequest;
import com.slack.api.methods.request.apps.connections.AppsConnectionsOpenRequest;
Expand Down Expand Up @@ -192,6 +194,8 @@
import com.slack.api.methods.response.admin.users.*;
import com.slack.api.methods.response.admin.users.unsupported_versions.AdminUsersUnsupportedVersionsExportResponse;
import com.slack.api.methods.response.admin.workflows.*;
import com.slack.api.methods.response.agents.sessions.AgentsSessionsRenameResponse;
import com.slack.api.methods.response.agents.sessions.AgentsSessionsSetStatusResponse;
import com.slack.api.methods.response.api.ApiTestResponse;
import com.slack.api.methods.response.apps.AppsUninstallResponse;
import com.slack.api.methods.response.apps.connections.AppsConnectionsOpenResponse;
Expand Down Expand Up @@ -1358,6 +1362,26 @@ public AdminUsersSessionListResponse adminUsersSessionList(RequestConfigurator<A
return adminUsersSessionList(req.configure(AdminUsersSessionListRequest.builder()).build());
}

@Override
public AgentsSessionsRenameResponse agentsSessionsRename(AgentsSessionsRenameRequest req) throws IOException, SlackApiException {
return postFormWithTokenAndParseResponse(toForm(req), Methods.AGENTS_SESSIONS_RENAME, getToken(req), AgentsSessionsRenameResponse.class);
}

@Override
public AgentsSessionsRenameResponse agentsSessionsRename(RequestConfigurator<AgentsSessionsRenameRequest.AgentsSessionsRenameRequestBuilder> req) throws IOException, SlackApiException {
return agentsSessionsRename(req.configure(AgentsSessionsRenameRequest.builder()).build());
}

@Override
public AgentsSessionsSetStatusResponse agentsSessionsSetStatus(AgentsSessionsSetStatusRequest req) throws IOException, SlackApiException {
return postFormWithTokenAndParseResponse(toForm(req), Methods.AGENTS_SESSIONS_SET_STATUS, getToken(req), AgentsSessionsSetStatusResponse.class);
}

@Override
public AgentsSessionsSetStatusResponse agentsSessionsSetStatus(RequestConfigurator<AgentsSessionsSetStatusRequest.AgentsSessionsSetStatusRequestBuilder> req) throws IOException, SlackApiException {
return agentsSessionsSetStatus(req.configure(AgentsSessionsSetStatusRequest.builder()).build());
}

@Override
public ApiTestResponse apiTest(ApiTestRequest req) throws IOException, SlackApiException {
return postFormAndParseResponse(toForm(req), Methods.API_TEST, ApiTestResponse.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.slack.api.methods.request.agents.sessions;

import com.slack.api.methods.SlackApiRequest;
import lombok.Builder;
import lombok.Data;

/**
* https://docs.slack.dev/reference/methods/agents.sessions.rename
*/
@Data
@Builder
public class AgentsSessionsRenameRequest implements SlackApiRequest {

private String token;

/**
* ID of the channel containing the agent session.
*/
private String channelId;

/**
* New title for the agent session (1-200 characters). For a session channel, this also renames the channel.
*/
private String title;

/**
* Timestamp of the thread root message the session is scoped to. Required for thread-based sessions in regular
* channels and DMs. Must be omitted for session channels.
*/
private String threadTs;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package com.slack.api.methods.request.agents.sessions;

import com.slack.api.methods.SlackApiRequest;
import lombok.Builder;
import lombok.Data;

/**
* https://docs.slack.dev/reference/methods/agents.sessions.setStatus
*/
@Data
@Builder
public class AgentsSessionsSetStatusRequest implements SlackApiRequest {

private String token;

/**
* ID of the channel containing the agent session.
*/
private String channelId;

/**
* The lifecycle status to set. Acceptable values: active, processing, suspended, closed.
*/
private String status;

/**
* Timestamp of the thread root message the session is scoped to. Required for thread-based sessions in regular
* channels and DMs. Must be omitted for session channels.
*/
private String threadTs;

/**
* Title for the agent session (max 200 characters). Only used when creating a new session; ignored if the session
* already exists. To rename an existing session, use agents.sessions.rename.
*/
private String title;

/**
* The user who initiated the session. Only used when creating a new session; ignored if the session already
* exists. Must be a member of the channel.
*/
private String initiatorUserId;

/**
* Emoji to use as the agent's icon. Takes priority over icon_url. Remains in effect until you clear it (pass null)
* or set a new value. Requires the chat:write.customize scope.
*/
private String iconEmoji;

/**
* URL to an image to use as the agent's icon. Remains in effect until you clear it (pass null) or set a new value.
* Requires the chat:write.customize scope.
*/
private String iconUrl;

/**
* Display name override for the agent (max 200 characters). Remains in effect until you clear it (pass null) or set
* a new value. Requires the chat:write.customize scope.
*/
private String username;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.slack.api.methods.response.agents.sessions;

import com.slack.api.methods.SlackApiTextResponse;
import lombok.Data;

import java.util.List;
import java.util.Map;

@Data
public class AgentsSessionsRenameResponse implements SlackApiTextResponse {

private boolean ok;
private String warning;
private String error;
private String needed;
private String provided;

private String title;

private transient Map<String, List<String>> httpResponseHeaders;
}
Loading
Loading