Class MessageRequest

java.lang.Object
com.bandwidth.sdk.model.MessageRequest

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.6.0") public class MessageRequest extends Object
MessageRequest
  • Field Details

  • Constructor Details

    • MessageRequest

      public MessageRequest()
  • Method Details

    • 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
    • setTo

      public void setTo(Set<String> 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
    • setMedia

      public void setMedia(List<URI> 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 property
      value - 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
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class 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