\Clx\XmsDeserialize

A collection of static deserialization functions.

These function are capable of deserializing XMS API data objects in a manner suitable for XMS.

Summary

Methods
Properties
Constants
batchResponse()
batchesPage()
batchDryRun()
batchDeliveryReport()
batchRecipientDeliveryReport()
groupResponse()
groupsPage()
groupMembers()
tags()
error()
moSms()
inboundsPage()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

batchResponse()

batchResponse(string  $json) : \Clx\Xms\Api\MtBatchSmsResult

Reads a JSON blob describing a batch result.

If the type field has the value mt_text then an MtBatchSmsTextCreate object is returned, if the value is mt_binary then an MtBatchTextSmsCreate object is returned, otherwise an exception is thrown.

Parameters

string $json

the JSON text to interpret

Throws

\Clx\Xms\UnexpectedResponseException

if the JSON contained an unexpected message type

Returns

\Clx\Xms\Api\MtBatchSmsResult

the parsed result

batchesPage()

batchesPage(string  $json) : \Clx\Xms\Api\Page

Reads a JSON blob describing a page of batches.

Parameters

string $json

the JSON text

Throws

\Clx\Xms\UnexpectedResponseException

if the JSON contained an unexpected message type

Returns

\Clx\Xms\Api\Page

the parsed page

batchDryRun()

batchDryRun(string  $json) : \Clx\Xms\Api\MtBatchDryRunResult

Reads a JSON formatted string describing a dry-run result.

Parameters

string $json

the JSON text

Returns

\Clx\Xms\Api\MtBatchDryRunResult

the parsed result

batchDeliveryReport()

batchDeliveryReport(string  $json) : \Clx\Xms\Api\BatchDeliveryReport

Reads a JSON blob describing a batch delivery report.

Parameters

string $json

the JSON text

Throws

\Clx\Xms\UnexpectedResponseException

if the JSON contained an unexpected message type

Returns

\Clx\Xms\Api\BatchDeliveryReport

the parsed batch delivery report

batchRecipientDeliveryReport()

batchRecipientDeliveryReport(string  $json) : \Clx\Xms\Api\batchRecipientDeliveryReport

Reads a batch recipient delivery report from the given JSON text.

Parameters

string $json

JSON formatted text

Throws

\Clx\Xms\UnexpectedResponseException

if the JSON contained an unexpected message type

Returns

\Clx\Xms\Api\batchRecipientDeliveryReport —

a delivery report

groupResponse()

groupResponse(string  $json) : \Clx\Xms\Api\GroupResult

Parses a group response from the given JSON text.

Parameters

string $json

JSON formatted text

Returns

\Clx\Xms\Api\GroupResult

the created group response

groupsPage()

groupsPage(string  $json) : \Clx\Xms\Api\Page

Parses a page of groups from the given JSON text.

Parameters

string $json

JSON formatted text

Returns

\Clx\Xms\Api\Page

the created page of groups

groupMembers()

groupMembers(string  $json) : array<mixed,string>

Reads a JSON blob containing a set of group members.

Parameters

string $json

JSON formatted text

Returns

array<mixed,string> —

a list of MSISDNs

tags()

tags(string  $json) : array<mixed,string>

Reads a JSON blob containing a list of tags.

Parameters

string $json

a JSON formatted text

Returns

array<mixed,string> —

a list of tags

error()

error(string  $json) : \Clx\Xms\Api\Error

Reads a JSON blob containing an error response.

Parameters

string $json

a JSON formatted text

Returns

\Clx\Xms\Api\Error

the decoded error

moSms()

moSms(string  $json) : \Clx\Xms\Api\MoSms

Reads a JSON blob containing an MO message.

Parameters

string $json

a JSON formatted text

Throws

\Clx\Xms\UnexpectedResponseException

if the JSON contained an unexpected message type

Returns

\Clx\Xms\Api\MoSms

the decoded error

inboundsPage()

inboundsPage(string  $json) : \Clx\Xms\Api\Page

Reads a JSON blob describing a page of MO messages.

Parameters

string $json

the JSON text

Throws

\Clx\Xms\UnexpectedResponseException

if the JSON contained an unexpected message type

Returns

\Clx\Xms\Api\Page

the parsed page