Skip to content

Commit

Permalink
Merge pull request #297 from plivo/messaging-list-ext
Browse files Browse the repository at this point in the history
extending message object filter option
  • Loading branch information
narayana-plivo authored Feb 23, 2023
2 parents 4091cd1 + 151ace7 commit c34a707
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Plivo/Resources/Message/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public function __construct(
'resourceUri' => $response['resource_uri'],
'totalAmount' => $response['total_amount'],
'totalRate' => $response['total_rate'],
'units' => $response['units']
'units' => $response['units'],
'destination_country_iso2' => $response['destination_country_iso2']
];

// handled empty string and null case
Expand All @@ -66,6 +67,13 @@ public function __construct(
$this->properties['requesterIP'] = $response['requester_ip'];
}

if (!empty($response['tendlc_campaign_id'])) {
$this->properties['tendlc_campaign_id'] = $response['tendlc_campaign_id'];
}
if (!empty($response['tendlc_registration_status'])) {
$this->properties['tendlc_registration_status'] = $response['tendlc_registration_status'];
}

$this->pathParams = [
'authId' => $authId,
'messageUuid' => $response['message_uuid']
Expand Down
3 changes: 3 additions & 0 deletions src/Plivo/Resources/Message/MessageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public function get($messageUuid)
* + [int] :offset Denotes the number of value items by which the results should be offset. Eg:- If the result contains a 1000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results.
* + [string] :error_code Delivery Response code returned by the carrier attempting the delivery. See Supported error codes {https://www.plivo.com/docs/api/message/#standard-plivo-error-codes}.
* + [string] : powerpack_id - Filter the results by Powerpack ID.
* + [string]: tendlc_campaign_id - exact tendlc campaign id search
* + [string]:destination_country_iso2 - valid 2 character country_iso2
* + [string] : tendlc_registration_status - registered or unregistered enum allowed
* @return MessageList
*/
protected function getList($optionalArgs = [])
Expand Down

0 comments on commit c34a707

Please sign in to comment.