public class Message extends ResourceBase
client, id, properties
dateFormat
Constructor and Description |
---|
Message(BandwidthClient client,
org.json.simple.JSONObject jsonObject) |
Modifier and Type | Method and Description |
---|---|
static Message |
create(BandwidthClient client,
java.util.Map<java.lang.String,java.lang.Object> params)
Factory method to send a message from a params object, given a client instance
|
static Message |
create(java.util.Map<java.lang.String,java.lang.Object> params)
Convenience factory method to send a message, given a set of params
|
static Message |
create(java.lang.String to,
java.lang.String from,
java.lang.String text)
Convenience factory method to send a message, given the to number, the from number and the text
|
static Message |
create(java.lang.String to,
java.lang.String from,
java.lang.String text,
MediaFile media)
Convenience factory method to send MMS messages.
|
static Message |
create(java.lang.String to,
java.lang.String from,
java.lang.String text,
ReceiptRequest receiptRequest)
Convenience factory method to send a message with receipt, given the to number, the from number and the text
|
static Message |
create(java.lang.String to,
java.lang.String from,
java.lang.String text,
java.lang.String media)
Convenience factory method to send MMS messages.
|
static Message |
get(BandwidthClient client,
java.lang.String id)
Gets information about a previously sent or received message.
|
static Message |
get(java.lang.String id)
Gets information about a previously sent or received message.
|
java.lang.Long |
getCallbackTimeout() |
java.lang.String |
getCallbackUrl() |
java.lang.String |
getDirection() |
java.lang.String |
getFallbackUrl() |
java.lang.String |
getFrom() |
java.lang.String |
getMessageId() |
java.lang.String |
getReceiptRequested() |
java.lang.String |
getState() |
java.lang.String |
getText() |
java.util.Date |
getTime() |
java.lang.String |
getTo() |
protected java.lang.String |
getUri() |
static ResourceList<Message> |
list()
Factory method for Message list, returns a list of Message objects with default page, size
|
static ResourceList<Message> |
list(BandwidthClient client,
int page,
int size)
Factory method for Message list, returns a list of Message objects with page, size preference
|
static ResourceList<Message> |
list(int page,
int size)
Factory method for Message list, returns a list of Message objects with page, size preference
|
protected void |
setUp(org.json.simple.JSONObject jsonObject) |
java.lang.String |
toString() |
getClient, getId, getProperties, setId, toJSONArray, toJSONObject
getProperty, getPropertyAsBoolean, getPropertyAsDate, getPropertyAsDouble, getPropertyAsLong, getPropertyAsString, getPropertyAsStringArray, putProperty, toMap, updateProperties
public Message(BandwidthClient client, org.json.simple.JSONObject jsonObject)
public static Message get(java.lang.String id) throws java.lang.Exception
id
- message idjava.io.IOException
- unexpected errorjava.lang.Exception
public static Message get(BandwidthClient client, java.lang.String id) throws java.lang.Exception
client
- the client.id
- message idjava.io.IOException
- unexpected errorjava.lang.Exception
public static ResourceList<Message> list() throws java.lang.Exception
java.io.IOException
- unexpected errorjava.lang.Exception
public static ResourceList<Message> list(int page, int size) throws java.lang.Exception
page
- the pagesize
- the page sizejava.io.IOException
- unexpected errorjava.lang.Exception
public static ResourceList<Message> list(BandwidthClient client, int page, int size) throws java.lang.Exception
client
- the client.page
- the pagesize
- the page sizejava.io.IOException
- unexpected errorjava.lang.Exception
public static Message create(java.lang.String to, java.lang.String from, java.lang.String text) throws java.lang.Exception
to
- the from numberfrom
- the to numbertext
- the textjava.io.IOException
- unexpected errorjava.lang.Exception
public static Message create(java.lang.String to, java.lang.String from, java.lang.String text, ReceiptRequest receiptRequest) throws java.lang.Exception
to
- the from numberfrom
- the to numbertext
- the textreceiptRequest
- the receipt request optionjava.io.IOException
- unexpected errorjava.lang.Exception
public static Message create(java.lang.String to, java.lang.String from, java.lang.String text, java.lang.String media) throws java.lang.Exception
to
- the from numberfrom
- the to numbertext
- the textmedia
- the url of the media item to sendjava.lang.Exception
- error.public static Message create(java.lang.String to, java.lang.String from, java.lang.String text, MediaFile media) throws java.lang.Exception
to
- the from numberfrom
- the to numbertext
- the textmedia
- the mediajava.lang.Exception
- error.public static Message create(java.util.Map<java.lang.String,java.lang.Object> params) throws java.lang.Exception
params
- the paramsjava.io.IOException
- unexpected errorjava.lang.Exception
public static Message create(BandwidthClient client, java.util.Map<java.lang.String,java.lang.Object> params) throws java.lang.Exception
client
- the clientparams
- the paramsjava.io.IOException
- unexpected errorjava.lang.Exception
protected void setUp(org.json.simple.JSONObject jsonObject)
setUp
in class ResourceBase
protected java.lang.String getUri()
public java.lang.String getMessageId()
public java.lang.String getFrom()
public java.lang.String getTo()
public java.lang.String getState()
public java.lang.String getDirection()
public java.lang.String getCallbackUrl()
public java.lang.String getFallbackUrl()
public java.lang.String getText()
public java.util.Date getTime()
public java.lang.Long getCallbackTimeout()
public java.lang.String getReceiptRequested()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2019. All Rights Reserved.