Class ContentMessage.Builder
- java.lang.Object
-
- com.courier.api.resources.send.types.ContentMessage.Builder
-
- All Implemented Interfaces:
ContentMessage._FinalStage,ContentMessage.ContentStage
- Enclosing class:
- ContentMessage
public static final class ContentMessage.Builder extends java.lang.Object implements ContentMessage.ContentStage, ContentMessage._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentMessage._FinalStagebrandId(java.lang.String brandId)ContentMessage._FinalStagebrandId(java.util.Optional<java.lang.String> brandId)ContentMessagebuild()ContentMessage._FinalStagechannels(java.util.Map<java.lang.String,Channel> channels)"Define run-time configuration for one or more channels.ContentMessage._FinalStagechannels(java.util.Optional<java.util.Map<java.lang.String,Channel>> channels)ContentMessage._FinalStagecontent(Content content)Describes the content of the message in a way that will work for email, push, chat, or any channel.ContentMessage._FinalStagecontext(MessageContext context)Context to load with this recipient.ContentMessage._FinalStagecontext(java.util.Optional<MessageContext> context)ContentMessage._FinalStagedata(java.util.Map<java.lang.String,java.lang.Object> data)An arbitrary object that includes any data you want to pass to the message.ContentMessage._FinalStagedata(java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> data)ContentMessage._FinalStagedelay(Delay delay)Defines the time to wait before delivering the message.ContentMessage._FinalStagedelay(java.util.Optional<Delay> delay)ContentMessage._FinalStageexpiry(Expiry expiry)"Expiry allows you to set an absolute or relative time in which a message expires.ContentMessage._FinalStageexpiry(java.util.Optional<Expiry> expiry)ContentMessage.Builderfrom(ContentMessage other)ContentMessage._FinalStagemetadata(MessageMetadata metadata)Metadata such as utm tracking attached with the notification through this channel.ContentMessage._FinalStagemetadata(java.util.Optional<MessageMetadata> metadata)ContentMessage._FinalStageproviders(java.util.Map<java.lang.String,MessageProvidersType> providers)An object whose keys are valid provider identifiers which map to an object.ContentMessage._FinalStageproviders(java.util.Optional<java.util.Map<java.lang.String,MessageProvidersType>> providers)ContentMessage._FinalStagerouting(Routing routing)ContentMessage._FinalStagerouting(java.util.Optional<Routing> routing)ContentMessage._FinalStagetimeout(Timeout timeout)Time in ms to attempt the channel before failing over to the next available channel.ContentMessage._FinalStagetimeout(java.util.Optional<Timeout> timeout)ContentMessage._FinalStageto(MessageRecipient to)The recipient or a list of recipients of the messageContentMessage._FinalStageto(java.util.Optional<MessageRecipient> to)
-
-
-
Method Detail
-
from
public ContentMessage.Builder from(ContentMessage other)
- Specified by:
fromin interfaceContentMessage.ContentStage
-
content
public ContentMessage._FinalStage content(Content content)
Describes the content of the message in a way that will work for email, push, chat, or any channel. Either this or template must be specified.
- Specified by:
contentin interfaceContentMessage.ContentStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
to
public ContentMessage._FinalStage to(MessageRecipient to)
The recipient or a list of recipients of the message
- Specified by:
toin interfaceContentMessage._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
to
public ContentMessage._FinalStage to(java.util.Optional<MessageRecipient> to)
- Specified by:
toin interfaceContentMessage._FinalStage
-
expiry
public ContentMessage._FinalStage expiry(Expiry expiry)
"Expiry allows you to set an absolute or relative time in which a message expires. Note: This is only valid for the Courier Inbox channel as of 12-08-2022."
- Specified by:
expiryin interfaceContentMessage._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
expiry
public ContentMessage._FinalStage expiry(java.util.Optional<Expiry> expiry)
- Specified by:
expiryin interfaceContentMessage._FinalStage
-
delay
public ContentMessage._FinalStage delay(Delay delay)
Defines the time to wait before delivering the message.
- Specified by:
delayin interfaceContentMessage._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
delay
public ContentMessage._FinalStage delay(java.util.Optional<Delay> delay)
- Specified by:
delayin interfaceContentMessage._FinalStage
-
timeout
public ContentMessage._FinalStage timeout(Timeout timeout)
Time in ms to attempt the channel before failing over to the next available channel.
- Specified by:
timeoutin interfaceContentMessage._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
timeout
public ContentMessage._FinalStage timeout(java.util.Optional<Timeout> timeout)
- Specified by:
timeoutin interfaceContentMessage._FinalStage
-
routing
public ContentMessage._FinalStage routing(Routing routing)
- Specified by:
routingin interfaceContentMessage._FinalStage
-
routing
public ContentMessage._FinalStage routing(java.util.Optional<Routing> routing)
- Specified by:
routingin interfaceContentMessage._FinalStage
-
providers
public ContentMessage._FinalStage providers(java.util.Map<java.lang.String,MessageProvidersType> providers)
An object whose keys are valid provider identifiers which map to an object.
- Specified by:
providersin interfaceContentMessage._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
providers
public ContentMessage._FinalStage providers(java.util.Optional<java.util.Map<java.lang.String,MessageProvidersType>> providers)
- Specified by:
providersin interfaceContentMessage._FinalStage
-
metadata
public ContentMessage._FinalStage metadata(MessageMetadata metadata)
Metadata such as utm tracking attached with the notification through this channel.
- Specified by:
metadatain interfaceContentMessage._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metadata
public ContentMessage._FinalStage metadata(java.util.Optional<MessageMetadata> metadata)
- Specified by:
metadatain interfaceContentMessage._FinalStage
-
context
public ContentMessage._FinalStage context(MessageContext context)
Context to load with this recipient. Will override any context set on message.context.
- Specified by:
contextin interfaceContentMessage._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
context
public ContentMessage._FinalStage context(java.util.Optional<MessageContext> context)
- Specified by:
contextin interfaceContentMessage._FinalStage
-
channels
public ContentMessage._FinalStage channels(java.util.Map<java.lang.String,Channel> channels)
"Define run-time configuration for one or more channels. If you don't specify channels, the default configuration for each channel will be used. Valid ChannelId's are: email, sms, push, inbox, direct_message, banner, and webhook."
- Specified by:
channelsin interfaceContentMessage._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
channels
public ContentMessage._FinalStage channels(java.util.Optional<java.util.Map<java.lang.String,Channel>> channels)
- Specified by:
channelsin interfaceContentMessage._FinalStage
-
brandId
public ContentMessage._FinalStage brandId(java.lang.String brandId)
- Specified by:
brandIdin interfaceContentMessage._FinalStage
-
brandId
public ContentMessage._FinalStage brandId(java.util.Optional<java.lang.String> brandId)
- Specified by:
brandIdin interfaceContentMessage._FinalStage
-
data
public ContentMessage._FinalStage data(java.util.Map<java.lang.String,java.lang.Object> data)
An arbitrary object that includes any data you want to pass to the message. The data will populate the corresponding template or elements variables.
- Specified by:
datain interfaceContentMessage._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
data
public ContentMessage._FinalStage data(java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> data)
- Specified by:
datain interfaceContentMessage._FinalStage
-
build
public ContentMessage build()
- Specified by:
buildin interfaceContentMessage._FinalStage
-
-