Package com.bandwidth.sdk.model
Class MessageRequest
- java.lang.Object
-
- com.bandwidth.sdk.model.MessageRequest
-
@Generated("org.openapitools.codegen.languages.JavaClientCodegen") public class MessageRequest extends Object
MessageRequest
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MessageRequest.CustomTypeAdapterFactory
-
Field Summary
Fields Modifier and Type Field Description static HashSet<String>
openapiFields
static HashSet<String>
openapiRequiredFields
static String
SERIALIZED_NAME_APPLICATION_ID
static String
SERIALIZED_NAME_EXPIRATION
static String
SERIALIZED_NAME_FROM
static String
SERIALIZED_NAME_MEDIA
static String
SERIALIZED_NAME_PRIORITY
static String
SERIALIZED_NAME_TAG
static String
SERIALIZED_NAME_TEXT
static String
SERIALIZED_NAME_TO
-
Constructor Summary
Constructors Constructor Description MessageRequest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageRequest
addMediaItem(URI mediaItem)
MessageRequest
addToItem(String toItem)
MessageRequest
applicationId(String applicationId)
boolean
equals(Object o)
MessageRequest
expiration(OffsetDateTime expiration)
MessageRequest
from(String from)
static MessageRequest
fromJson(String jsonString)
Create an instance of MessageRequest given an JSON stringMap<String,Object>
getAdditionalProperties()
Return the additional (undeclared) property.Object
getAdditionalProperty(String key)
Return the additional (undeclared) property with the specified name.String
getApplicationId()
The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard.OffsetDateTime
getExpiration()
A string with the date/time value that the message will automatically expire by.String
getFrom()
Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message.List<URI>
getMedia()
A list of URLs to include as media attachments as part of the message.PriorityEnum
getPriority()
Get priorityString
getTag()
A custom string that will be included in callback events of the message.String
getText()
The contents of the text message.Set<String>
getTo()
The phone number(s) the message should be sent to in E164 format.int
hashCode()
MessageRequest
media(List<URI> media)
MessageRequest
priority(PriorityEnum priority)
MessageRequest
putAdditionalProperty(String key, Object value)
Set the additional (undeclared) property with the specified name and value.void
setApplicationId(String applicationId)
void
setExpiration(OffsetDateTime expiration)
void
setFrom(String from)
void
setMedia(List<URI> media)
void
setPriority(PriorityEnum priority)
void
setTag(String tag)
void
setText(String text)
void
setTo(Set<String> to)
MessageRequest
tag(String tag)
MessageRequest
text(String text)
MessageRequest
to(Set<String> to)
String
toJson()
Convert an instance of MessageRequest to an JSON stringString
toString()
static void
validateJsonElement(com.google.gson.JsonElement jsonElement)
Validates the JSON Element and throws an exception if issues found
-
-
-
Field Detail
-
SERIALIZED_NAME_APPLICATION_ID
public static final String SERIALIZED_NAME_APPLICATION_ID
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_TO
public static final String SERIALIZED_NAME_TO
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_FROM
public static final String SERIALIZED_NAME_FROM
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_TEXT
public static final String SERIALIZED_NAME_TEXT
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_MEDIA
public static final String SERIALIZED_NAME_MEDIA
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_TAG
public static final String SERIALIZED_NAME_TAG
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_PRIORITY
public static final String SERIALIZED_NAME_PRIORITY
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_EXPIRATION
public static final String SERIALIZED_NAME_EXPIRATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
applicationId
public MessageRequest applicationId(String applicationId)
-
getApplicationId
@Nonnull public String getApplicationId()
The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard.- Returns:
- applicationId
-
setApplicationId
public void setApplicationId(String applicationId)
-
to
public MessageRequest to(Set<String> to)
-
addToItem
public MessageRequest addToItem(String toItem)
-
getTo
@Nonnull public Set<String> getTo()
The phone number(s) the message should be sent to in E164 format.- Returns:
- to
-
from
public MessageRequest from(String from)
-
getFrom
@Nonnull public String getFrom()
Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter.- Returns:
- from
-
setFrom
public void setFrom(String from)
-
text
public MessageRequest text(String text)
-
getText
@Nullable public String getText()
The contents of the text message. Must be 2048 characters or less.- Returns:
- text
-
setText
public void setText(String text)
-
media
public MessageRequest media(List<URI> media)
-
addMediaItem
public MessageRequest addMediaItem(URI mediaItem)
-
getMedia
@Nullable public List<URI> getMedia()
A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters.- Returns:
- media
-
tag
public MessageRequest tag(String tag)
-
getTag
@Nullable public String getTag()
A custom string that will be included in callback events of the message. Max 1024 characters.- Returns:
- tag
-
setTag
public void setTag(String tag)
-
priority
public MessageRequest priority(PriorityEnum priority)
-
getPriority
@Nullable public PriorityEnum getPriority()
Get priority- Returns:
- priority
-
setPriority
public void setPriority(PriorityEnum priority)
-
expiration
public MessageRequest expiration(OffsetDateTime expiration)
-
getExpiration
@Nullable public OffsetDateTime getExpiration()
A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS.- Returns:
- expiration
-
setExpiration
public void setExpiration(OffsetDateTime expiration)
-
putAdditionalProperty
public MessageRequest putAdditionalProperty(String key, Object value)
Set the additional (undeclared) property with the specified name and value. If the property does not already exist, create it otherwise replace it.- Parameters:
key
- name of the propertyvalue
- value of the property- Returns:
- the MessageRequest instance itself
-
getAdditionalProperties
public Map<String,Object> getAdditionalProperties()
Return the additional (undeclared) property.- Returns:
- a map of objects
-
getAdditionalProperty
public Object getAdditionalProperty(String key)
Return the additional (undeclared) property with the specified name.- Parameters:
key
- name of the property- Returns:
- an object
-
validateJsonElement
public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
Validates the JSON Element and throws an exception if issues found- Parameters:
jsonElement
- JSON Element- Throws:
IOException
- if the JSON Element is invalid with respect to MessageRequest
-
fromJson
public static MessageRequest fromJson(String jsonString) throws IOException
Create an instance of MessageRequest given an JSON string- Parameters:
jsonString
- JSON string- Returns:
- An instance of MessageRequest
- Throws:
IOException
- if the JSON string is invalid with respect to MessageRequest
-
toJson
public String toJson()
Convert an instance of MessageRequest to an JSON string- Returns:
- JSON string
-
-