Package com.chatmotorapi.api.notify
Class TwilioNotificationChannel.Builder
java.lang.Object
com.chatmotorapi.api.notify.TwilioNotificationChannel.Builder
- Enclosing class:
- TwilioNotificationChannel
public static class TwilioNotificationChannel.Builder extends Object
Builder class for TwilioNotificationChannel. This class follows the builder pattern
to configure and create instances of TwilioNotificationChannel.
-
Constructor Summary
Constructors Constructor Description Builder() -
Method Summary
Modifier and Type Method Description TwilioNotificationChannel.BuilderaccountSid(String accountSid)Sets the Twilio Account SID required for API access.TwilioNotificationChannel.BuilderauthToken(String authToken)Sets the Twilio Auth Token required for API access.TwilioNotificationChannelbuild()Builds and returns a TwilioNotificationChannel configured with this builder's settings.TwilioNotificationChannel.BuilderchatMotor(ChatMotor chatMotor)Sets theChatMotorfor sending notifications.TwilioNotificationChannel.BuilderfromPhoneNumber(String fromPhoneNumber)Sets the Twilio phone number from which the message will be sent.TwilioNotificationChannel.Builderlogger(org.slf4j.Logger logger)Sets theLoggerinstance for logging operations within the treatment process.TwilioNotificationChannel.BuildermessageText(String messageText)Sets the message text to send to all phone numbers.TwilioNotificationChannel.BuilderphoneNumbers(List<String> phoneNumbers)Sets the list of phone numbers to notify.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
chatMotor
Sets theChatMotorfor sending notifications.- Parameters:
chatMotor- the ChatMotor instance to use for sending notifications- Returns:
- this builder for chaining
-
logger
Sets theLoggerinstance for logging operations within the treatment process. Default value of Logger isTwilioNotificationChannel.class.getName()if not provided.- Parameters:
logger- the Logger to use- Returns:
- this builder for chaining
-
accountSid
Sets the Twilio Account SID required for API access.- Parameters:
accountSid- the Twilio Account SID- Returns:
- this Builder instance for chaining
-
authToken
Sets the Twilio Auth Token required for API access.- Parameters:
authToken- the Twilio Auth Token- Returns:
- this Builder instance for chaining
-
phoneNumbers
Sets the list of phone numbers to notify.- Parameters:
phoneNumbers- the list of phone numbers- Returns:
- this Builder instance for chaining
-
messageText
Sets the message text to send to all phone numbers.- Parameters:
messageText- the message text- Returns:
- this Builder instance for chaining
-
fromPhoneNumber
Sets the Twilio phone number from which the message will be sent.- Parameters:
fromPhoneNumber- the Twilio phone number- Returns:
- this Builder instance for chaining
-
build
Builds and returns a TwilioNotificationChannel configured with this builder's settings.- Returns:
- a new SmsFailoverNotifier instance
-