Migrating to Versioned Java SDK

Sinch offers a Unified Java SDK (com.sinch.sdk.sinch-sdk-java). This guide provides information on how to migrate from the initial release of the Sinch Unified Java SDK to the versioned release.

Migration to versioned SDK

The initial Sinch Unified Java SDK was based on adapter layers; each programmatic API required its own business logic.

To reduce overhead and complexity, the SDK implemented "versioned" layers with v1.5.

To provide a smooth transition, the un-versioned APIs are still supported. However, they will be tagged as @Deprecated, and will be removed with the next major release. With fewer layers, the SDK decreases memory consumption and increases performance.

The versioned APIs are accessible from domains within the SinchClient (e.g. client.sms()) for SMS, but with an added vX suffix pointing to the version namespace.

For example, previous calls to client.sms().batches() (using the inital, un-versioned SDK) are now available by addressing client.sms().v1().batches() (using the first versioned SDK). This also impacts packages and classes names.

Tables providing mappings between un-versioned calls and versioned calls are below. The corresponding JavaDocs are linked for easy reference.

Client

Product Un-versioned Versioned
SMS client.sms() client.sms().v1()

SMS

In addition to the table below, you can review the corresponding synatx reference guide and API reference guide.

Batches

Un-versioned Versioned
cancel <T extends Batch<?>> T cancel(String) BatchResponse cancel(String)
dryRun DryRun dryRun(boolean, int, BaseBatch<?> batch) DryRunResponse dryRun(DryRunQueryParameters, BatchRequest)
get <T extends Batch<?>> T get(String) BatchResponse get(String)
list BatchesListResponse list(BatchesListRequestParameters) ListBatchesResponse list(ListBatchesQueryParameters)
replace <T extends Batch> T replace(String, BaseBatch) BatchResponse replace(String, BatchRequest
sendDeliveryFeedback void sendDeliveryFeedback(String, Collection) void sendDeliveryFeedback(String, SendDeliveryFeedbackRequest)
send <T extends Batch> T send(BaseBatch) BatchResponse send(BatchRequest)
update <T extends Batch> T update(String, UpdateBaseBatchRequest) BatchResponse update(String, UpdateBatchRequest)

Delivery Reports

Un-versioned Versioned
get DeliveryReportBatch get(String, DeliveryReportBatchGetRequestParameters) BatchDeliveryReport get(String, BatchDeliveryReportQueryParameters)
getForNumber DeliveryReportRecipient getForNumber(String, String) RecipientDeliveryReport getForNumber(String, String)
list DeliveryReportsListResponse list(DeliveryReportListRequestParameters) ListDeliveryReportsResponse list(ListDeliveryReportsQueryParameters)

Groups

Un-versioned Versioned
create Group create(GroupCreateRequestParameters) Group create(GroupRequest)
delete void delete(String) void delete(String)
get Group get(String) Group get(String)
listMembers Collection listMembers(String) List listMembers(String)
list GroupsListResponse list(GroupsListRequestParameters) ListGroupsResponse list(ListGroupsQueryParameters)
replace Group replace(String , GroupReplaceRequestParameters) Group replace(String, GroupRequest)
update Group update(String, GroupUpdateRequestParameters) Group update(String, GroupUpdateRequest)

Inbounds

Un-versioned Versioned
list InboundsListResponse list(InboundsListRequestParameters) ListInboundsResponse list(ListInboundMessagesQueryParameters)
get Inbound<?> get(String) InboundMessage get(String)

Webhooks

Un-versioned Versioned
parse WebhooksEvent parse(String) SmsEvent parseEvent(String)
validate N/A boolean validateAuthenticationHeader(String, Map<String, String>, String)
We'd love to hear from you!
Rate this content:
Still have a question?
 
Ask the community.