Class AsyncOutgoing
- java.lang.Object
-
- pl.gsmservice.gateway.AsyncOutgoing
-
public class AsyncOutgoing extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CancelMessagesRequestBuildercancelScheduled()Cancel a scheduled messagesjava.util.concurrent.CompletableFuture<CancelMessagesResponse>cancelScheduled(java.util.List<java.lang.Long> ids)Cancel a scheduled messagesjava.util.concurrent.CompletableFuture<CancelMessagesResponse>cancelScheduled(java.util.List<java.lang.Long> ids, java.util.Optional<Options> options)Cancel a scheduled messagesGetMessagesRequestBuildergetByIds()Get the messages details and status by IDsjava.util.concurrent.CompletableFuture<GetMessagesResponse>getByIds(java.util.List<java.lang.Long> ids)Get the messages details and status by IDsjava.util.concurrent.CompletableFuture<GetMessagesResponse>getByIds(java.util.List<java.lang.Long> ids, java.util.Optional<Options> options)Get the messages details and status by IDsListMessagesRequestBuilderlist()Lists the history of sent messagesjava.util.concurrent.CompletableFuture<ListMessagesResponse>list(java.util.Optional<java.lang.Long> page, java.util.Optional<java.lang.Long> limit, java.util.Optional<Options> options)Lists the history of sent messagesjava.util.concurrent.CompletableFuture<ListMessagesResponse>listDirect()Lists the history of sent messagesAsyncMmsmms()AsyncSmssms()Outgoingsync()Switches to the sync SDK.
-
-
-
Method Detail
-
mms
public final AsyncMms mms()
-
sms
public final AsyncSms sms()
-
sync
public Outgoing sync()
Switches to the sync SDK.- Returns:
- The sync SDK
-
getByIds
public GetMessagesRequestBuilder getByIds()
Get the messages details and status by IDs
Check the current status and details of one or more messages using theirids. You should pass theListOf()containing unique message IDs (Longtype) which details you want to fetch. Please use builder style:
GetMessagesResponse res = sdk.outgoing().getByIds() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call.
As a successful result aGetMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>withMessageobjects, each object per single found message.GetMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were found and returned correctly) andX-Error-Count(count of messages which were not found) elements.- Returns:
- The async call builder
-
getByIds
public java.util.concurrent.CompletableFuture<GetMessagesResponse> getByIds(java.util.List<java.lang.Long> ids)
Get the messages details and status by IDs
Check the current status and details of one or more messages using theirids. You should pass theListOf()containing unique message IDs (Longtype) which details you want to fetch. Please use builder style:
GetMessagesResponse res = sdk.outgoing().getByIds() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call.
As a successful result aGetMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>withMessageobjects, each object per single found message.GetMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were found and returned correctly) andX-Error-Count(count of messages which were not found) elements.- Parameters:
ids- Listof Message IDs assigned by the system. The system will accept a maximum of 50 identifiers in one call. - Returns:
- CompletableFuture<GetMessagesResponse> - The async response
-
getByIds
public java.util.concurrent.CompletableFuture<GetMessagesResponse> getByIds(java.util.List<java.lang.Long> ids, java.util.Optional<Options> options)
Get the messages details and status by IDs
Check the current status and details of one or more messages using theirids. You should pass theListOf()containing unique message IDs (Longtype) which details you want to fetch. Please use builder style:
GetMessagesResponse res = sdk.outgoing().getByIds() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call.
As a successful result aGetMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>withMessageobjects, each object per single found message.GetMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were found and returned correctly) andX-Error-Count(count of messages which were not found) elements.- Parameters:
ids- Listof Message IDs assigned by the system. The system will accept a maximum of 50 identifiers in one call. options- additional options- Returns:
- CompletableFuture<GetMessagesResponse> - The async response
-
cancelScheduled
public CancelMessagesRequestBuilder cancelScheduled()
Cancel a scheduled messages
Cancel messages using theiridswhich were scheduled to be sent at a specific time. You have to pass aListOf()containing the unique message IDs (Longtype), which were returned after sending a message. Please use builder style:
CancelMessagesResponse res2 = sdk.outgoing().cancelScheduled() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call. You can cancel only messages with SCHEDULED status.As a successful result a
CancelMessagesResponseobject will be returned, withcancelledMessagesproperty of typeList<CancelledMessage>containingCancelledMessageobjects. Thestatusproperty of eachCancelledMessageobject will contain a status code of operation -204if a particular message was cancelled successfully and other code if an error occured.CancelMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were cancelled successfully),X-Error-Count(count of messages which were not cancelled) andX-Sandbox(if a request was made in Sandbox or Production system) elements.- Returns:
- The async call builder
-
cancelScheduled
public java.util.concurrent.CompletableFuture<CancelMessagesResponse> cancelScheduled(java.util.List<java.lang.Long> ids)
Cancel a scheduled messages
Cancel messages using theiridswhich were scheduled to be sent at a specific time. You have to pass aListOf()containing the unique message IDs (Longtype), which were returned after sending a message. Please use builder style:
CancelMessagesResponse res2 = sdk.outgoing().cancelScheduled() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call. You can cancel only messages with SCHEDULED status.As a successful result a
CancelMessagesResponseobject will be returned, withcancelledMessagesproperty of typeList<CancelledMessage>containingCancelledMessageobjects. Thestatusproperty of eachCancelledMessageobject will contain a status code of operation -204if a particular message was cancelled successfully and other code if an error occured.CancelMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were cancelled successfully),X-Error-Count(count of messages which were not cancelled) andX-Sandbox(if a request was made in Sandbox or Production system) elements.- Parameters:
ids- Listof Message IDs assigned by the system. The system will accept a maximum of 50 identifiers in one call. - Returns:
- CompletableFuture<CancelMessagesResponse> - The async response
-
cancelScheduled
public java.util.concurrent.CompletableFuture<CancelMessagesResponse> cancelScheduled(java.util.List<java.lang.Long> ids, java.util.Optional<Options> options)
Cancel a scheduled messages
Cancel messages using theiridswhich were scheduled to be sent at a specific time. You have to pass aListOf()containing the unique message IDs (Longtype), which were returned after sending a message. Please use builder style:
CancelMessagesResponse res2 = sdk.outgoing().cancelScheduled() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call. You can cancel only messages with SCHEDULED status.As a successful result a
CancelMessagesResponseobject will be returned, withcancelledMessagesproperty of typeList<CancelledMessage>containingCancelledMessageobjects. Thestatusproperty of eachCancelledMessageobject will contain a status code of operation -204if a particular message was cancelled successfully and other code if an error occured.CancelMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were cancelled successfully),X-Error-Count(count of messages which were not cancelled) andX-Sandbox(if a request was made in Sandbox or Production system) elements.- Parameters:
ids- Listof Message IDs assigned by the system. The system will accept a maximum of 50 identifiers in one call. options- additional options- Returns:
- CompletableFuture<CancelMessagesResponse> - The async response
-
list
public ListMessagesRequestBuilder list()
Lists the history of sent messages
Get the details and current status of all of sent messages from your account message history. This method supports pagination so you have to pass apage(number of page with messages which you want to access,Longtype) and alimit(max of messages per page,Longtype) parameters. Please use builder style:
ListMessagesResponse res = sdk.outgoing().list() .page(1L) .limit(10L) .call();
Messages are fetched from the latest one. This method will accept maximum value of 50 aslimitparameter value.
As a successful result aListMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>with aMessageobjects, each object per single message.ListMessagesResponsewill also containheadersproperty where you can findX-Total-Results(a total count of all messages which are available in history on your account),X-Total-Pages(a total number of all pages with results),X-Current-Page(A current page number) andX-Limit(messages count per single page) elements.- Returns:
- The async call builder
-
listDirect
public java.util.concurrent.CompletableFuture<ListMessagesResponse> listDirect()
Lists the history of sent messages
Get the details and current status of all of sent messages from your account message history. This method supports pagination so you have to pass apage(number of page with messages which you want to access,Longtype) and alimit(max of messages per page,Longtype) parameters. Please use builder style:
ListMessagesResponse res = sdk.outgoing().list() .page(1L) .limit(10L) .call();
Messages are fetched from the latest one. This method will accept maximum value of 50 aslimitparameter value.
As a successful result aListMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>with aMessageobjects, each object per single message.ListMessagesResponsewill also containheadersproperty where you can findX-Total-Results(a total count of all messages which are available in history on your account),X-Total-Pages(a total number of all pages with results),X-Current-Page(A current page number) andX-Limit(messages count per single page) elements.- Returns:
- CompletableFuture<ListMessagesResponse> - The async response
-
list
public java.util.concurrent.CompletableFuture<ListMessagesResponse> list(java.util.Optional<java.lang.Long> page, java.util.Optional<java.lang.Long> limit, java.util.Optional<Options> options)
Lists the history of sent messages
Get the details and current status of all of sent messages from your account message history. This method supports pagination so you have to pass apage(number of page with messages which you want to access,Longtype) and alimit(max of messages per page,Longtype) parameters. Please use builder style:
ListMessagesResponse res = sdk.outgoing().list() .page(1L) .limit(10L) .call();
Messages are fetched from the latest one. This method will accept maximum value of 50 aslimitparameter value.
As a successful result aListMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>with aMessageobjects, each object per single message.ListMessagesResponsewill also containheadersproperty where you can findX-Total-Results(a total count of all messages which are available in history on your account),X-Total-Pages(a total number of all pages with results),X-Current-Page(A current page number) andX-Limit(messages count per single page) elements.- Parameters:
page- Page number of resultslimit- Number of results on one pageoptions- additional options- Returns:
- CompletableFuture<ListMessagesResponse> - The async response
-
-