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.Builder
accountSid(String accountSid)
Sets the Twilio Account SID required for API access.TwilioNotificationChannel.Builder
authToken(String authToken)
Sets the Twilio Auth Token required for API access.TwilioNotificationChannel
build()
Builds and returns a TwilioNotificationChannel configured with this builder's settings.TwilioNotificationChannel.Builder
chatMotor(ChatMotor chatMotor)
Sets theChatMotor
for sending notifications.TwilioNotificationChannel.Builder
fromPhoneNumber(String fromPhoneNumber)
Sets the Twilio phone number from which the message will be sent.TwilioNotificationChannel.Builder
logger(org.slf4j.Logger logger)
Sets theLogger
instance for logging operations within the treatment process.TwilioNotificationChannel.Builder
messageText(String messageText)
Sets the message text to send to all phone numbers.TwilioNotificationChannel.Builder
phoneNumbers(List<String> phoneNumbers)
Sets the list of phone numbers to notify.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
chatMotor
Sets theChatMotor
for sending notifications.- Parameters:
chatMotor
- the ChatMotor instance to use for sending notifications- Returns:
- this builder for chaining
-
logger
Sets theLogger
instance 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
-