Package com.slack.api.bolt.context
Class Context
- java.lang.Object
-
- com.slack.api.bolt.context.Context
-
- Direct Known Subclasses:
ActionContext
,AttachmentActionContext
,BlockSuggestionContext
,DefaultContext
,DialogCancellationContext
,DialogSubmissionContext
,DialogSuggestionContext
,EventContext
,GlobalShortcutContext
,MessageShortcutContext
,OAuthCallbackContext
,SlashCommandContext
,ViewSubmissionContext
,WorkflowStepEditContext
,WorkflowStepExecuteContext
,WorkflowStepSaveContext
public abstract class Context extends Object
Represents a context behind a request from Slack API.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>
additionalValues
protected String
botId
bot_id associated with this request.protected String
botToken
A bot token associated with this request.protected String
botUserId
Bot user's user_id associated with this request.protected String
enterpriseId
Organization ID for Enterprise Grid.org.slf4j.Logger
logger
protected String
requestUserId
An install user's user_id associated with this request.protected String
requestUserToken
An install user's access token associated with this request.protected Slack
slack
protected String
teamId
Workspace ID.
-
Constructor Summary
Constructors Constructor Description Context()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Response
ack()
Response
ack(com.google.gson.JsonElement json)
Response
ackWithJson(Object obj)
AsyncMethodsClient
asyncClient()
MethodsClient
client()
Map<String,String>
getAdditionalValues()
String
getBotId()
bot_id associated with this request.String
getBotToken()
A bot token associated with this request.String
getBotUserId()
Bot user's user_id associated with this request.String
getEnterpriseId()
Organization ID for Enterprise Grid.org.slf4j.Logger
getLogger()
String
getRequestUserId()
An install user's user_id associated with this request.String
getRequestUserToken()
An install user's access token associated with this request.Slack
getSlack()
String
getTeamId()
Workspace ID.ChatPostMessageResponse
say(BuilderConfigurator<ChatPostMessageRequest.ChatPostMessageRequestBuilder> request)
void
setBotId(String botId)
bot_id associated with this request.void
setBotToken(String botToken)
A bot token associated with this request.void
setBotUserId(String botUserId)
Bot user's user_id associated with this request.void
setEnterpriseId(String enterpriseId)
Organization ID for Enterprise Grid.void
setRequestUserId(String requestUserId)
An install user's user_id associated with this request.void
setRequestUserToken(String requestUserToken)
An install user's access token associated with this request.void
setSlack(Slack slack)
void
setTeamId(String teamId)
Workspace ID.com.google.gson.JsonElement
toJson(Object obj)
String
toString()
-
-
-
Field Detail
-
slack
protected Slack slack
-
logger
public final org.slf4j.Logger logger
-
enterpriseId
protected String enterpriseId
Organization ID for Enterprise Grid.
-
teamId
protected String teamId
Workspace ID.
-
botToken
protected String botToken
A bot token associated with this request. The format must be starting with `xoxb-`.
-
botId
protected String botId
bot_id associated with this request.
-
botUserId
protected String botUserId
Bot user's user_id associated with this request.
-
requestUserId
protected String requestUserId
An install user's user_id associated with this request.
-
requestUserToken
protected String requestUserToken
An install user's access token associated with this request.
-
-
Method Detail
-
client
public MethodsClient client()
-
asyncClient
public AsyncMethodsClient asyncClient()
-
say
public ChatPostMessageResponse say(BuilderConfigurator<ChatPostMessageRequest.ChatPostMessageRequestBuilder> request) throws IOException, SlackApiException
- Throws:
IOException
SlackApiException
-
ack
public Response ack()
-
ack
public Response ack(com.google.gson.JsonElement json)
-
toJson
public com.google.gson.JsonElement toJson(Object obj)
-
getSlack
public Slack getSlack()
-
getLogger
public org.slf4j.Logger getLogger()
-
getEnterpriseId
public String getEnterpriseId()
Organization ID for Enterprise Grid.
-
getTeamId
public String getTeamId()
Workspace ID.
-
getBotToken
public String getBotToken()
A bot token associated with this request. The format must be starting with `xoxb-`.
-
getBotId
public String getBotId()
bot_id associated with this request.
-
getBotUserId
public String getBotUserId()
Bot user's user_id associated with this request.
-
getRequestUserId
public String getRequestUserId()
An install user's user_id associated with this request.
-
getRequestUserToken
public String getRequestUserToken()
An install user's access token associated with this request.
-
setSlack
public void setSlack(Slack slack)
-
setEnterpriseId
public void setEnterpriseId(String enterpriseId)
Organization ID for Enterprise Grid.
-
setTeamId
public void setTeamId(String teamId)
Workspace ID.
-
setBotToken
public void setBotToken(String botToken)
A bot token associated with this request. The format must be starting with `xoxb-`.
-
setBotId
public void setBotId(String botId)
bot_id associated with this request.
-
setBotUserId
public void setBotUserId(String botUserId)
Bot user's user_id associated with this request.
-
setRequestUserId
public void setRequestUserId(String requestUserId)
An install user's user_id associated with this request.
-
setRequestUserToken
public void setRequestUserToken(String requestUserToken)
An install user's access token associated with this request.
-
-