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(MessageRequest data)
Create a new message with the following paramsNewMessageResponse
create(java.lang.String to, java.lang.String from, java.lang.String body)
Create a new phone number with the below parametersSuccessResponse
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(MessageFilter filter)
Filter messages based on parameters chosenNewMessageResponse
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
-
create
public NewMessageResponse create(java.lang.String to, java.lang.String from, java.lang.String body) throws SignalWireException
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
- Throws:
SignalWireException
-
create
public NewMessageResponse create(MessageRequest data) throws SignalWireException
Create a new message with the following params- Specified by:
create
in interfaceMessageInterface
- Parameters:
data
- This is an object that holds necessary parameters to create a message- Returns:
- NewMessageResponse
- Throws:
SignalWireException
-
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) throws SignalWireException
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
- Throws:
SignalWireException
-
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
-
getMessages
public Messages getMessages(MessageFilter filter)
Filter messages based on parameters chosen- Specified by:
getMessages
in interfaceMessageInterface
- Parameters:
filter
- filter object from MessageFilter object- Returns:
- Messages
-
-