Class WhatsAppTemplateMessageBuilderImpl
- java.lang.Object
-
- com.flowable.engage.external.system.whatsapp.WhatsAppTemplateMessageBuilderImpl
-
- All Implemented Interfaces:
WhatsAppTemplateMessageBuilder
public class WhatsAppTemplateMessageBuilderImpl extends Object implements WhatsAppTemplateMessageBuilder
- Author:
- Filip Hrisafov, Anatolii Balakiriev
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WhatsAppTemplateMessageBuilderImpl.ButtonComponentBuilderImpl
static class
WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
protected static class
WhatsAppTemplateMessageBuilderImpl.Type
-
Nested classes/interfaces inherited from interface com.flowable.engage.external.system.whatsapp.api.WhatsAppTemplateMessageBuilder
WhatsAppTemplateMessageBuilder.ButtonComponentBuilder, WhatsAppTemplateMessageBuilder.ComponentBuilder
-
-
Field Summary
Fields Modifier and Type Field Description protected WhatsAppOutboundTemplateMessageDto
templateMessage
protected WhatsAppJmsExternalConversationSystemAdapter
whatsAppJmsExternalConversationSystemAdapter
-
Constructor Summary
Constructors Constructor Description WhatsAppTemplateMessageBuilderImpl(WhatsAppJmsExternalConversationSystemAdapter whatsAppJmsExternalConversationSystemAdapter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WhatsAppTemplateMessageBuilder
addTemplateTextParameter(String parameter)
Add a positional text parameter to the body.WhatsAppTemplateMessageBuilder
addTemplateTextParameters(Collection<String> parameters)
Add positional text parameters to the body.WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
body()
Initiates creation of the body.WhatsAppTemplateMessageBuilder
businessAccountId(String businessAccountId)
The id of the business account that should be used when sending out the message.WhatsAppTemplateMessageBuilderImpl.ButtonComponentBuilderImpl
button()
Initiates creation of the button.WhatsAppTemplateMessageBuilder
externalUserId(String externalUserId)
The id of the recipient of the message.WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
footer()
Initiates creation of the footer.WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
header()
Initiates creation of the header.WhatsAppTemplateMessageBuilder
language(String language)
The language of the template that should be used.WhatsAppTemplateMessageBuilder
mediaHeader(String mediaId)
The content item ID for the media header.WhatsAppTemplateMessageBuilder
messageId(String messageId)
The id of the reference message within the Engage system.void
send()
Perform the send of the template message.WhatsAppTemplateMessageBuilder
templateId(String templateId)
The id of the template that is registered on the WhatsApp sideWhatsAppTemplateMessageBuilder
timeToLive(Duration timeToLive)
Time To Live (TTL) duration.
-
-
-
Field Detail
-
whatsAppJmsExternalConversationSystemAdapter
protected final WhatsAppJmsExternalConversationSystemAdapter whatsAppJmsExternalConversationSystemAdapter
-
templateMessage
protected final WhatsAppOutboundTemplateMessageDto templateMessage
-
-
Constructor Detail
-
WhatsAppTemplateMessageBuilderImpl
public WhatsAppTemplateMessageBuilderImpl(WhatsAppJmsExternalConversationSystemAdapter whatsAppJmsExternalConversationSystemAdapter)
-
-
Method Detail
-
timeToLive
public WhatsAppTemplateMessageBuilder timeToLive(Duration timeToLive)
Description copied from interface:WhatsAppTemplateMessageBuilder
Time To Live (TTL) duration.- Specified by:
timeToLive
in interfaceWhatsAppTemplateMessageBuilder
-
templateId
public WhatsAppTemplateMessageBuilder templateId(String templateId)
Description copied from interface:WhatsAppTemplateMessageBuilder
The id of the template that is registered on the WhatsApp side- Specified by:
templateId
in interfaceWhatsAppTemplateMessageBuilder
-
language
public WhatsAppTemplateMessageBuilder language(String language)
Description copied from interface:WhatsAppTemplateMessageBuilder
The language of the template that should be used.- Specified by:
language
in interfaceWhatsAppTemplateMessageBuilder
-
addTemplateTextParameter
public WhatsAppTemplateMessageBuilder addTemplateTextParameter(String parameter)
Description copied from interface:WhatsAppTemplateMessageBuilder
Add a positional text parameter to the body.Short circuit for calling
WhatsAppTemplateMessageBuilder.body()
, thenWhatsAppTemplateMessageBuilder.ComponentBuilder.addTextParameter(String)
and thenWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
Note: The parameter must be added in the correct order according to the template message.
- Specified by:
addTemplateTextParameter
in interfaceWhatsAppTemplateMessageBuilder
-
addTemplateTextParameters
public WhatsAppTemplateMessageBuilder addTemplateTextParameters(Collection<String> parameters)
Description copied from interface:WhatsAppTemplateMessageBuilder
Add positional text parameters to the body.Short circuit for calling
WhatsAppTemplateMessageBuilder.body()
, thenWhatsAppTemplateMessageBuilder.ComponentBuilder.addTextParameter(String)
and thenWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
Note: The parameters must be added in the correct order according to the template message.
- Specified by:
addTemplateTextParameters
in interfaceWhatsAppTemplateMessageBuilder
-
externalUserId
public WhatsAppTemplateMessageBuilder externalUserId(String externalUserId)
Description copied from interface:WhatsAppTemplateMessageBuilder
The id of the recipient of the message. This is the id of the user within the WhatsApp system.- Specified by:
externalUserId
in interfaceWhatsAppTemplateMessageBuilder
-
businessAccountId
public WhatsAppTemplateMessageBuilder businessAccountId(String businessAccountId)
Description copied from interface:WhatsAppTemplateMessageBuilder
The id of the business account that should be used when sending out the message.- Specified by:
businessAccountId
in interfaceWhatsAppTemplateMessageBuilder
-
messageId
public WhatsAppTemplateMessageBuilder messageId(String messageId)
Description copied from interface:WhatsAppTemplateMessageBuilder
The id of the reference message within the Engage system. It is used in order to correlate the WhatsApp message and the Engage message.- Specified by:
messageId
in interfaceWhatsAppTemplateMessageBuilder
-
send
public void send()
Description copied from interface:WhatsAppTemplateMessageBuilder
Perform the send of the template message.- Specified by:
send
in interfaceWhatsAppTemplateMessageBuilder
-
header
public WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl header()
Description copied from interface:WhatsAppTemplateMessageBuilder
Initiates creation of the header. After you are done building this component - callWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
method to build and add it to the parent builder.- Specified by:
header
in interfaceWhatsAppTemplateMessageBuilder
- Returns:
- header-specific builder.
-
mediaHeader
public WhatsAppTemplateMessageBuilder mediaHeader(String mediaId)
Description copied from interface:WhatsAppTemplateMessageBuilder
The content item ID for the media header.- Specified by:
mediaHeader
in interfaceWhatsAppTemplateMessageBuilder
- Parameters:
mediaId
- the media header
-
body
public WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl body()
Description copied from interface:WhatsAppTemplateMessageBuilder
Initiates creation of the body. After you are done building this component - callWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
method to build and add it to the parent builder.- Specified by:
body
in interfaceWhatsAppTemplateMessageBuilder
- Returns:
- body-specific builder.
-
footer
public WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl footer()
Description copied from interface:WhatsAppTemplateMessageBuilder
Initiates creation of the footer. After you are done building this component - callWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
method to build and add it to the parent builder.- Specified by:
footer
in interfaceWhatsAppTemplateMessageBuilder
- Returns:
- footer-specific builder.
-
button
public WhatsAppTemplateMessageBuilderImpl.ButtonComponentBuilderImpl button()
Description copied from interface:WhatsAppTemplateMessageBuilder
Initiates creation of the button. After you are done building this component - callWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
method to build and add it to the parent builder.- Specified by:
button
in interfaceWhatsAppTemplateMessageBuilder
- Returns:
- button-specific builder.
-
-