com.twilio.sdk.resource.instance
Class Message

java.lang.Object
  extended by com.twilio.sdk.resource.Resource<C>
      extended by com.twilio.sdk.resource.InstanceResource<TwilioRestClient>
          extended by com.twilio.sdk.resource.instance.Message

public class Message
extends InstanceResource<TwilioRestClient>


Constructor Summary
Message(TwilioRestClient client)
          Instantiates a new message.
Message(TwilioRestClient client, Map<String,Object> properties)
          Instantiates a new message.
Message(TwilioRestClient client, String sid)
          Instantiates a new message.
 
Method Summary
 boolean delete()
          Delete this Message.
 String getAccountSid()
          Gets the account sid.
 String getApiVersion()
          Gets the api version.
 String getBody()
          Gets the body.
 Date getDateCreated()
          Gets the date created.
 Date getDateSent()
          Gets the date sent.
 Date getDateUpdated()
          Gets the date updated.
 String getDirection()
          Gets the direction.
 Integer getErrorCode()
          Gets the error code for this message.
 String getErrorMessage()
          Gets the error message for this message.
 String getFrom()
          Gets the from.
 MediaList getMedia()
          Returns the a list of media.
 Media getMedia(String mediaSid)
          Returns the a list of media.
 int getNumMedia()
          Gets the number of media associated with the message.
 int getNumSegments()
          Gets the number of segments used to deliver this message.
 String getPrice()
          Gets the price.
 String getPriceUnit()
          Gets the price.
 String getSid()
          Gets the sid.
 String getStatus()
          Gets the status.
 String getTo()
          Gets the to.
 Message redact()
          Redact the body of this Message.
 
Methods inherited from class com.twilio.sdk.resource.InstanceResource
getObject, getProperty, update, update
 
Methods inherited from class com.twilio.sdk.resource.Resource
setRequestAccountSid
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message

public Message(TwilioRestClient client)
Instantiates a new message.

Parameters:
client - the client

Message

public Message(TwilioRestClient client,
               String sid)
Instantiates a new message.

Parameters:
client - the client
sid - the sid

Message

public Message(TwilioRestClient client,
               Map<String,Object> properties)
Instantiates a new message.

Parameters:
client - the client
properties - the properties
Method Detail

getSid

public String getSid()
Gets the sid.

Returns:
the sid

getMedia

public MediaList getMedia()
Returns the a list of media.

Returns:
the MediaList associated with this message

getMedia

public Media getMedia(String mediaSid)
Returns the a list of media.

Parameters:
mediaSid - the sid of a media instance associated with this message
Returns:
the MediaList associated with this message

getDateCreated

public Date getDateCreated()
Gets the date created.

Returns:
the date created

getDateUpdated

public Date getDateUpdated()
Gets the date updated.

Returns:
the date updated

getDateSent

public Date getDateSent()
Gets the date sent.

Returns:
the date sent

getAccountSid

public String getAccountSid()
Gets the account sid.

Returns:
the account sid

getTo

public String getTo()
Gets the to.

Returns:
the to

getFrom

public String getFrom()
Gets the from.

Returns:
the from

getBody

public String getBody()
Gets the body.

Returns:
the body

getStatus

public String getStatus()
Gets the status.

Returns:
the status

getPrice

public String getPrice()
Gets the price.

Returns:
the price

getPriceUnit

public String getPriceUnit()
Gets the price.

Returns:
the price

getNumSegments

public int getNumSegments()
Gets the number of segments used to deliver this message.

Returns:
the number of segments

getNumMedia

public int getNumMedia()
Gets the number of media associated with the message.

Returns:
the number of segments

getDirection

public String getDirection()
Gets the direction.

Returns:
the direction

getApiVersion

public String getApiVersion()
Gets the api version.

Returns:
the api version

getErrorCode

public Integer getErrorCode()
Gets the error code for this message. If there is no error for the message this code will be null.

Returns:
the error code

getErrorMessage

public String getErrorMessage()
Gets the error message for this message. If there is no error for this message this error message will be null.

Returns:
the error message

delete

public boolean delete()
               throws TwilioRestException
Delete this Message. This will remove it from this Account.

Returns:
true, if successful
Throws:
TwilioRestException - if there is an error in the request

redact

public Message redact()
               throws TwilioRestException
Redact the body of this Message.

Returns:
The redacted Message object
Throws:
TwilioRestException


Copyright © 2011 Twilio, Inc. All Rights Reserved.