Package jenkins.plugins.slack
Class StandardSlackService
java.lang.Object
jenkins.plugins.slack.StandardSlackService
- All Implemented Interfaces:
SlackService
-
Constructor Summary
ConstructorsConstructorDescriptionStandardSlackService(String baseUrl, String teamDomain, boolean botUser, String roomId, boolean replyBroadcast, String populatedToken) Deprecated.StandardSlackService(String baseUrl, String teamDomain, String authTokenCredentialId, boolean botUser, String roomId) Deprecated.StandardSlackService(String baseUrl, String teamDomain, String token, String authTokenCredentialId, boolean botUser, String roomId) Deprecated.StandardSlackService(String baseUrl, String teamDomain, String token, String authTokenCredentialId, boolean botUser, String roomId, boolean replyBroadcast) Deprecated.StandardSlackService(StandardSlackServiceBuilder standardSlackServiceBuilder) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddReaction(String channelId, String timestamp, String emojiName) Add an emoji reaction to a messagestatic StandardSlackServiceBuilderbuilder()protected org.apache.hc.client5.http.impl.classic.CloseableHttpClientbooleanbooleanbooleanbooleanbooleanbooleanpublish(SlackRequest slackRequest) booleanremoveReaction(String channelId, String timestamp, String emojiName) Remove an emoji reaction from a message.booleanupload(FilePath workspace, String artifactIncludes, TaskListener log) Make an HTTP POST upload to the Slack API
-
Constructor Details
-
StandardSlackService
@Deprecated public StandardSlackService(String baseUrl, String teamDomain, String authTokenCredentialId, boolean botUser, String roomId) Deprecated.- Parameters:
baseUrl- is a base URLteamDomain- is a teamDomainauthTokenCredentialId-botUser- is a bot UserroomId- is a room Id
-
StandardSlackService
@Deprecated public StandardSlackService(String baseUrl, String teamDomain, String token, String authTokenCredentialId, boolean botUser, String roomId) Deprecated.- Parameters:
baseUrl- is a base URLteamDomain- is a teamDomaintoken- is a tokenauthTokenCredentialId-botUser- is a bot UserroomId- is a room Id
-
StandardSlackService
@Deprecated public StandardSlackService(String baseUrl, String teamDomain, String token, String authTokenCredentialId, boolean botUser, String roomId, boolean replyBroadcast) Deprecated.- Parameters:
baseUrl- is a base URLteamDomain- is a teamDomaintoken- is a tokenauthTokenCredentialId-botUser- is a bot UserroomId- is a room IdreplyBroadcast- is a replyBroadcast
-
StandardSlackService
@Deprecated public StandardSlackService(String baseUrl, String teamDomain, boolean botUser, String roomId, boolean replyBroadcast, String populatedToken) Deprecated.- Parameters:
baseUrl- is a base URLteamDomain- is a teamDomainbotUser- is a bot UserroomId- is a room IdreplyBroadcast- is replayBroadcastpopulatedToken- is populated Token
-
StandardSlackService
Default constructor- Parameters:
standardSlackServiceBuilder- is a StandardSlackServiceBuilder
-
-
Method Details
-
builder
-
getResponseString
- Specified by:
getResponseStringin interfaceSlackService
-
publish
- Specified by:
publishin interfaceSlackService
-
upload
Make an HTTP POST upload to the Slack API- Specified by:
uploadin interfaceSlackService- Parameters:
workspace- - job workspaceartifactIncludes- - includes comma-separated Ant-style globs as perUtil.createFileSet(File, String, String)using/as a path separator;log- - print log stream- Returns:
- boolean indicating whether the API request succeeded
-
publish
- Specified by:
publishin interfaceSlackService
-
publish
- Specified by:
publishin interfaceSlackService
-
publish
- Specified by:
publishin interfaceSlackService
-
publish
- Specified by:
publishin interfaceSlackService
-
publish
public boolean publish(String message, net.sf.json.JSONArray attachments, String color, String timestamp) - Specified by:
publishin interfaceSlackService
-
addReaction
Add an emoji reaction to a message- Specified by:
addReactionin interfaceSlackService- Parameters:
channelId- - Slack's internal channel id (i.e. what's returned in a `chat.postMessage` response)timestamp- - Timestamp identifying the messageemojiName- - The name of the emoji to add in reaction to the message (no colons)- Returns:
- boolean indicating whether the API request succeeded
-
removeReaction
Remove an emoji reaction from a message.- Specified by:
removeReactionin interfaceSlackService- Parameters:
channelId- - Slack's internal channel id (i.e. what's returned in a `chat.postMessage` response)timestamp- - Timestamp identifying the messageemojiName- - The name of the emoji to add in reaction to the message (no colons)- Returns:
- boolean indicating whether the API request succeeded
-
getHttpClient
protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient getHttpClient()
-
StandardSlackService(String, String, boolean, String, boolean, String)instead}