public class MicrosoftTeamsFunctions extends BaseFunctions
Constructor and Description |
---|
MicrosoftTeamsFunctions(boolean isExecute,
LogFunctions pFLOG) |
Modifier and Type | Method and Description |
---|---|
void |
cleanup() |
java.lang.String |
getGroovyKey() |
FlexTeamsMessage |
makePipelineStageCompletedMessage(java.lang.Object pPayload,
boolean pIsUserMessage)
Generates a formatted message for the Pipeline Stage Complete Event for Teams messaging.
|
java.lang.String |
makePipelineStageCompletedMessageForWebhook(java.lang.Object pPayload)
Generates a formatted message for the Pipeline Stage Complete Event for Teams messaging.
|
java.lang.String |
makeSnapshotCompleteMessage(java.lang.Object pPayload)
Generates a formatted message for the Snapshot Complete Event for Teams messaging.
|
FlexTeamsMessage |
makeSnapshotCompleteMessage(java.lang.Object pPayload,
boolean isUserMessage)
Generates a formatted message for the Snapshot Complete Event for Teams messaging.
|
java.lang.String |
makeTaskCompletedMessage(java.lang.Object pPayload,
boolean approved) |
FlexTeamsMessage |
makeTaskCreatedMessage(java.lang.Object pPayload,
boolean pIsUserMessage)
Generates a formatted message for the Task Created Event for Teams messaging.
|
java.lang.String |
makeTaskCreatedMessageForWebhook(java.lang.Object pPayload,
java.lang.String pFullUpdateTaskIncomingWebhookUrl)
Generates a formatted message for the Task Created Event for Teams messaging.
|
FlexTeamsMessage |
makeWorkflowCompletedMessage(java.lang.Object pPayload,
boolean pIsUserMessage)
Generates a formatted message for the Workflow Completed Event for Teams messaging.
|
java.lang.String |
makeWorkflowCompletedMessageForWebhook(java.lang.Object pPayload)
Generates a formatted message for the Workflow Completed Event for Teams messaging.
|
void |
sendTeamsMessage(java.lang.String pTeamsMessagingAccountCode,
java.lang.String pTeamName,
java.lang.String pChannelName,
java.lang.String pMessageText,
java.lang.String pIconURL)
Sends a Microsoft Teams message to a team channel.
|
void |
sendTeamsMessage(java.lang.String pTeamsMessagingAccountCode,
TeamChannelMessageRequestPojo pTeamsMessageRequest,
java.lang.String pTeamName,
java.lang.String pChannelName)
Sends a Microsoft Teams message to a team channel.
|
void |
sendTeamsWebhookMessage(java.lang.String pWebhookUrl,
java.lang.String pJson)
Sends a Microsoft Teams message to a team channel.
|
void |
sendTeamsWebhookMessage(java.lang.String pWebhookUrl,
java.lang.String pMessageTitle,
java.lang.String pMessageText,
java.lang.String pIconURL)
Sends a Microsoft Teams message to an Incoming Webhook assiciated to a team channel.
|
void |
sendUserTeamsMessage(java.lang.String pTeamsMessagingAccountCode,
java.lang.String pChatName,
java.lang.String pMessageText)
Sends a Microsoft Teams message to a user channel.
|
void |
sendUserTeamsMessage(java.lang.String pTeamsMessagingAccountCode,
UserMessageRequestPojo pUserMessageRequest,
java.lang.String pChatName)
Sends a Microsoft Teams message to a user channel.
|
void |
updateTask(java.lang.Object pQueryParameters,
java.util.HashMap pHeaders,
java.lang.String pTeamsMessagingAccountCode)
Approves or rejects a task from an incoming Slack webhook payload.
|
approveTask, approveTaskByEmails, decryptIntegrationInstance, doSimpleGet, findIntegrationInstance, getLogFunctions, getServerBaseUrl, rejectTask, rejectTaskByEmails
public MicrosoftTeamsFunctions(boolean isExecute, LogFunctions pFLOG)
public void sendTeamsMessage(java.lang.String pTeamsMessagingAccountCode, java.lang.String pTeamName, java.lang.String pChannelName, java.lang.String pMessageText, java.lang.String pIconURL) throws FlexCheckedException, FlexNotFoundException
pTeamsMessagingAccountCode
- The messaging account code for the Teams account.pTeamName
- Name of the team that will receive the message.pChannelName
- Name of the channel that the message will be sent to.pMessageText
- The text for the message content. Can be plain text or html.pIconURL
- The URL for the icon of the sender of the message.FlexNotFoundException
- When no Teams Account found for given codeFlexCheckedException
- All other exceptionspublic void sendTeamsMessage(java.lang.String pTeamsMessagingAccountCode, TeamChannelMessageRequestPojo pTeamsMessageRequest, java.lang.String pTeamName, java.lang.String pChannelName) throws FlexCheckedException, FlexNotFoundException
pTeamsMessagingAccountCode
- The messaging account code for the Teams account.pTeamsMessageRequest
- TeamChannelMessageRequestPojo containing required information.pTeamName
- Name of the team that will receive the message.pChannelName
- Name of the channel that the message will be sent to.FlexNotFoundException
- When no Teams Account found for given codeFlexCheckedException
- All other exceptionspublic void sendUserTeamsMessage(java.lang.String pTeamsMessagingAccountCode, java.lang.String pChatName, java.lang.String pMessageText) throws FlexCheckedException, FlexNotFoundException
pTeamsMessagingAccountCode
- The Messaging account code for the Teams account.pChatName
- Name of the chat that the message will be sent to.pMessageText
- The text for the message content. Can be plain text or html.FlexNotFoundException
- When no Teams Account found for given codeFlexCheckedException
- All other exceptionspublic void sendUserTeamsMessage(java.lang.String pTeamsMessagingAccountCode, UserMessageRequestPojo pUserMessageRequest, java.lang.String pChatName) throws FlexCheckedException, FlexNotFoundException
pTeamsMessagingAccountCode
- The Messaging account code for the Teams accountpUserMessageRequest
- The UserMessageRequestPojo containing all of the required information.pChatName
- Name of the chat that the message will be sent to.FlexNotFoundException
- When no Teams Account found for given codeFlexCheckedException
- All other exceptionspublic FlexTeamsMessage makeSnapshotCompleteMessage(java.lang.Object pPayload, boolean isUserMessage) throws FlexCheckedException
pPayload
- Event payload for the Snapshot Complete Event. Typically (EVENT.payload).isUserMessage
- Delegates the type of message that will be generated. Pass true if sending a message to a user channel, false if sending to a team channel.FlexCheckedException
public FlexTeamsMessage makePipelineStageCompletedMessage(java.lang.Object pPayload, boolean pIsUserMessage) throws FlexCheckedException
pPayload
- Event payload for the Snapshot Complete Event. Typically (EVENT.payload).pIsUserMessage
- Delegates the type of message that will be generated. Pass true if sending a message to a user channel, false if sending to a team channel.FlexCheckedException
public FlexTeamsMessage makeTaskCreatedMessage(java.lang.Object pPayload, boolean pIsUserMessage) throws FlexCheckedException
pPayload
- The task created payload.pIsUserMessage
- Delegates the type of message that will be generated. Pass true if sending a message to a user channel, false if sending to a team channelFlexCheckedException
public FlexTeamsMessage makeWorkflowCompletedMessage(java.lang.Object pPayload, boolean pIsUserMessage) throws FlexCheckedException
pPayload
- The workflow completed payload.pIsUserMessage
- Delegates the type of message that will be generated. Pass true if sending a message to a user channel, false if sending to a team channelFlexCheckedException
public java.lang.String getGroovyKey()
getGroovyKey
in class BaseFunctions
public void cleanup()
cleanup
in class BaseFunctions
public void sendTeamsWebhookMessage(java.lang.String pWebhookUrl, java.lang.String pMessageTitle, java.lang.String pMessageText, java.lang.String pIconURL) throws FlexCheckedException
pWebhookUrl
- - The URL to send the message topMessageTitle
- - Optional Title of the messagepMessageText
- The text for the message content. Can be plain text or html.pIconURL
- The URL for the icon of the sender of the message.FlexCheckedException
- All exceptionspublic void sendTeamsWebhookMessage(java.lang.String pWebhookUrl, java.lang.String pJson) throws FlexCheckedException
pWebhookUrl
- pJson
- FlexNotFoundException
- When no Teams Account found for given codeFlexCheckedException
- All other exceptionspublic java.lang.String makeSnapshotCompleteMessage(java.lang.Object pPayload) throws FlexCheckedException
pPayload
- Event payload for the Snapshot Complete Event. Typically (EVENT.payload).isUserMessage
- Delegates the type of message that will be generated. Pass true if sending a message to a user channel, false if sending to a team channel.FlexCheckedException
public java.lang.String makePipelineStageCompletedMessageForWebhook(java.lang.Object pPayload) throws FlexCheckedException
pPayload
- Event payload for the Snapshot Complete Event. Typically (EVENT.payload).FlexCheckedException
public java.lang.String makeTaskCreatedMessageForWebhook(java.lang.Object pPayload, java.lang.String pFullUpdateTaskIncomingWebhookUrl) throws FlexCheckedException
pPayload
- The task created payload.pHostOverride
- If you want to have webhooks come back through a proxy, specify it here. If null, the Server Base URL will be used.FlexCheckedException
public java.lang.String makeTaskCompletedMessage(java.lang.Object pPayload, boolean approved) throws FlexCheckedException
FlexCheckedException
public java.lang.String makeWorkflowCompletedMessageForWebhook(java.lang.Object pPayload) throws FlexCheckedException
pPayload
- The workflow completed payload.FlexCheckedException
public void updateTask(java.lang.Object pQueryParameters, java.util.HashMap pHeaders, java.lang.String pTeamsMessagingAccountCode) throws FlexCheckedException
pQueryParameters
- - The Query Parameters that came in to the Webhook - QUERY_PARAMSpHeaders
- pTeamsMessagingAccountCode
- - The messaging account code for the Teams account.FlexCheckedException