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 classWhatsAppTemplateMessageBuilderImpl.ButtonComponentBuilderImplstatic classWhatsAppTemplateMessageBuilderImpl.ComponentBuilderImplprotected static classWhatsAppTemplateMessageBuilderImpl.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 WhatsAppOutboundTemplateMessageDtotemplateMessageprotected WhatsAppJmsExternalConversationSystemAdapterwhatsAppJmsExternalConversationSystemAdapter
-
Constructor Summary
Constructors Constructor Description WhatsAppTemplateMessageBuilderImpl(WhatsAppJmsExternalConversationSystemAdapter whatsAppJmsExternalConversationSystemAdapter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WhatsAppTemplateMessageBuilderaddTemplateTextParameter(String parameter)Add a positional text parameter to the body.WhatsAppTemplateMessageBuilderaddTemplateTextParameters(Collection<String> parameters)Add positional text parameters to the body.WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImplbody()Initiates creation of the body.WhatsAppTemplateMessageBuilderbusinessAccountId(String businessAccountId)The id of the business account that should be used when sending out the message.WhatsAppTemplateMessageBuilderImpl.ButtonComponentBuilderImplbutton()Initiates creation of the button.WhatsAppTemplateMessageBuilderexternalUserId(String externalUserId)The id of the recipient of the message.WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImplfooter()Initiates creation of the footer.WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImplheader()Initiates creation of the header.WhatsAppTemplateMessageBuilderlanguage(String language)The language of the template that should be used.WhatsAppTemplateMessageBuildermediaHeader(String mediaId)The content item ID for the media header.WhatsAppTemplateMessageBuildermessageId(String messageId)The id of the reference message within the Engage system.voidsend()Perform the send of the template message.WhatsAppTemplateMessageBuildertemplateId(String templateId)The id of the template that is registered on the WhatsApp sideWhatsAppTemplateMessageBuildertimeToLive(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:WhatsAppTemplateMessageBuilderTime To Live (TTL) duration.- Specified by:
timeToLivein interfaceWhatsAppTemplateMessageBuilder
-
templateId
public WhatsAppTemplateMessageBuilder templateId(String templateId)
Description copied from interface:WhatsAppTemplateMessageBuilderThe id of the template that is registered on the WhatsApp side- Specified by:
templateIdin interfaceWhatsAppTemplateMessageBuilder
-
language
public WhatsAppTemplateMessageBuilder language(String language)
Description copied from interface:WhatsAppTemplateMessageBuilderThe language of the template that should be used.- Specified by:
languagein interfaceWhatsAppTemplateMessageBuilder
-
addTemplateTextParameter
public WhatsAppTemplateMessageBuilder addTemplateTextParameter(String parameter)
Description copied from interface:WhatsAppTemplateMessageBuilderAdd 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:
addTemplateTextParameterin interfaceWhatsAppTemplateMessageBuilder
-
addTemplateTextParameters
public WhatsAppTemplateMessageBuilder addTemplateTextParameters(Collection<String> parameters)
Description copied from interface:WhatsAppTemplateMessageBuilderAdd 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:
addTemplateTextParametersin interfaceWhatsAppTemplateMessageBuilder
-
externalUserId
public WhatsAppTemplateMessageBuilder externalUserId(String externalUserId)
Description copied from interface:WhatsAppTemplateMessageBuilderThe id of the recipient of the message. This is the id of the user within the WhatsApp system.- Specified by:
externalUserIdin interfaceWhatsAppTemplateMessageBuilder
-
businessAccountId
public WhatsAppTemplateMessageBuilder businessAccountId(String businessAccountId)
Description copied from interface:WhatsAppTemplateMessageBuilderThe id of the business account that should be used when sending out the message.- Specified by:
businessAccountIdin interfaceWhatsAppTemplateMessageBuilder
-
messageId
public WhatsAppTemplateMessageBuilder messageId(String messageId)
Description copied from interface:WhatsAppTemplateMessageBuilderThe 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:
messageIdin interfaceWhatsAppTemplateMessageBuilder
-
send
public void send()
Description copied from interface:WhatsAppTemplateMessageBuilderPerform the send of the template message.- Specified by:
sendin interfaceWhatsAppTemplateMessageBuilder
-
header
public WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl header()
Description copied from interface:WhatsAppTemplateMessageBuilderInitiates 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:
headerin interfaceWhatsAppTemplateMessageBuilder- Returns:
- header-specific builder.
-
mediaHeader
public WhatsAppTemplateMessageBuilder mediaHeader(String mediaId)
Description copied from interface:WhatsAppTemplateMessageBuilderThe content item ID for the media header.- Specified by:
mediaHeaderin interfaceWhatsAppTemplateMessageBuilder- Parameters:
mediaId- the media header
-
body
public WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl body()
Description copied from interface:WhatsAppTemplateMessageBuilderInitiates 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:
bodyin interfaceWhatsAppTemplateMessageBuilder- Returns:
- body-specific builder.
-
footer
public WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl footer()
Description copied from interface:WhatsAppTemplateMessageBuilderInitiates 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:
footerin interfaceWhatsAppTemplateMessageBuilder- Returns:
- footer-specific builder.
-
button
public WhatsAppTemplateMessageBuilderImpl.ButtonComponentBuilderImpl button()
Description copied from interface:WhatsAppTemplateMessageBuilderInitiates 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:
buttonin interfaceWhatsAppTemplateMessageBuilder- Returns:
- button-specific builder.
-
-