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,
Map<String,Object> params)
Factory method to send a message from a params object, given a client instance
|
static Message |
create(Map<String,Object> params)
Convenience factory method to send a message, given a set of params
|
static Message |
create(String to,
String from,
String text)
Convenience factory method to send a message, given the to number, the from number and the text
|
static Message |
create(String to,
String from,
String text,
MediaFile media)
Convenience factory method to send MMS messages.
|
static Message |
create(String to,
String from,
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 |
get(BandwidthClient client,
String id)
Gets information about a previously sent or received message.
|
static Message |
get(String id)
Gets information about a previously sent or received message.
|
Long |
getCallbackTimeout() |
String |
getCallbackUrl() |
String |
getDirection() |
String |
getFallbackUrl() |
String |
getFrom() |
String |
getMessageId() |
String |
getReceiptRequested() |
String |
getState() |
String |
getText() |
Date |
getTime() |
String |
getTo() |
protected 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) |
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(String id) throws Exception
id
- message idIOException
- unexpected errorException
public static Message get(BandwidthClient client, String id) throws Exception
client
- the client.id
- message idIOException
- unexpected errorException
public static ResourceList<Message> list() throws Exception
IOException
- unexpected errorException
public static ResourceList<Message> list(int page, int size) throws Exception
page
- the pagesize
- the page sizeIOException
- unexpected errorException
public static ResourceList<Message> list(BandwidthClient client, int page, int size) throws Exception
client
- the client.page
- the pagesize
- the page sizeIOException
- unexpected errorException
public static Message create(String to, String from, String text) throws Exception
to
- the from numberfrom
- the to numbertext
- the textIOException
- unexpected errorException
public static Message create(String to, String from, String text, ReceiptRequest receiptRequest) throws Exception
to
- the from numberfrom
- the to numbertext
- the textreceiptRequest
- the receipt request optionIOException
- unexpected errorException
public static Message create(String to, String from, String text, MediaFile media) throws Exception
to
- the from numberfrom
- the to numbertext
- the textmedia
- the mediaException
- error.public static Message create(Map<String,Object> params) throws Exception
params
- the paramsIOException
- unexpected errorException
public static Message create(BandwidthClient client, Map<String,Object> params) throws Exception
client
- the clientparams
- the paramsIOException
- unexpected errorException
protected void setUp(org.json.simple.JSONObject jsonObject)
setUp
in class ResourceBase
protected String getUri()
public String getMessageId()
public String getFrom()
public String getTo()
public String getState()
public String getDirection()
public String getCallbackUrl()
public String getFallbackUrl()
public String getText()
public Date getTime()
public Long getCallbackTimeout()
public String getReceiptRequested()
Copyright © 2015. All Rights Reserved.