Class MessageRepository
- java.lang.Object
-
- io.github.signalwirecommunity.repository.MessageRepository
-
- All Implemented Interfaces:
MessageInterface
public class MessageRepository extends java.lang.Object implements MessageInterface
-
-
Constructor Summary
Constructors Constructor Description MessageRepository(java.lang.String projectID, java.lang.String apiToken, java.lang.String spaceUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NewMessageResponse
create(java.lang.String to, java.lang.String from, java.lang.String body)
Create a new phone number with the below parametersNewMessageResponse
create(java.lang.String to, java.lang.String from, java.lang.String body, java.lang.String mediaUrl, java.lang.String statusCallback, java.lang.String validityPeriod)
Create a new message with the following paramsSuccessResponse
delete(java.lang.String sid)
Delete a message from a space by SIDMessage
get(java.lang.String sid)
Get the item of a particular message by SIDMessages
getMessages()
Get all the messages for the projectId providedMessages
getMessages(java.lang.String dateSent, java.lang.String from, java.lang.String to, java.lang.String status, java.lang.String pageSize)
Get all messages using the following parametersNewMessageResponse
update(java.lang.String sid, java.lang.String body)
Update a message by SID
-
-
-
Method Detail
-
getMessages
public Messages getMessages()
Get all the messages for the projectId provided- Specified by:
getMessages
in interfaceMessageInterface
- Returns:
- Messages
-
getMessages
public Messages getMessages(java.lang.String dateSent, java.lang.String from, java.lang.String to, java.lang.String status, java.lang.String pageSize)
Get all messages using the following parameters- Specified by:
getMessages
in interfaceMessageInterface
- Parameters:
dateSent
- date message was sentfrom
- Phone number sending the message (E164 format)to
- Destination phone numberstatus
- Status of the phone number either failed, success or deliveredpageSize
- size of results queried- Returns:
- Messages
-
create
public NewMessageResponse create(java.lang.String to, java.lang.String from, java.lang.String body)
Create a new phone number with the below parameters- Specified by:
create
in interfaceMessageInterface
- Parameters:
to
- Destination phone number (E164 format)from
- Phone number sending the message (E164 format)body
- body of the message- Returns:
- NewMessageResponse
-
create
public NewMessageResponse create(java.lang.String to, java.lang.String from, java.lang.String body, java.lang.String mediaUrl, java.lang.String statusCallback, java.lang.String validityPeriod)
Create a new message with the following params- Specified by:
create
in interfaceMessageInterface
- Parameters:
to
- Destination phone numberfrom
- Phone number sending the message (E164 format)body
- body of the messagemediaUrl
- media url if sending an MMSstatusCallback
- monitor status of the message sentvalidityPeriod
- period of message validity- Returns:
- NewMessageResponse
-
get
public Message get(java.lang.String sid)
Get the item of a particular message by SID- Specified by:
get
in interfaceMessageInterface
- Parameters:
sid
- unique SID for the phone call- Returns:
- Message
-
update
public NewMessageResponse update(java.lang.String sid, java.lang.String body)
Update a message by SID- Specified by:
update
in interfaceMessageInterface
- Parameters:
sid
- unique SID for the phone callbody
- body of the message been sent- Returns:
- NewMessageResponse
-
delete
public SuccessResponse delete(java.lang.String sid)
Delete a message from a space by SID- Specified by:
delete
in interfaceMessageInterface
- Parameters:
sid
- unique SID for the phone call- Returns:
- SuccessResponse
-
-