From 0298a1ad5859b500b915c0ee79a1cc3567048b6f Mon Sep 17 00:00:00 2001 From: Opheugene Date: Thu, 20 Jun 2024 16:47:02 +0200 Subject: [PATCH] new fields --- src/Model/Entity/Customers/Subscription.php | 12 ++++++++++-- src/ResourceGroup/Customers.php | 17 +++++++++-------- tests/src/ResourceGroup/CustomersTest.php | 3 ++- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/Model/Entity/Customers/Subscription.php b/src/Model/Entity/Customers/Subscription.php index 0067bad..e6beb38 100644 --- a/src/Model/Entity/Customers/Subscription.php +++ b/src/Model/Entity/Customers/Subscription.php @@ -27,6 +27,14 @@ class Subscription */ public $channel; + /** + * @var string + * + * @JMS\Type("string") + * @JMS\SerializedName("subscription") + */ + public $subscription; + /** * @var bool * @@ -39,7 +47,7 @@ class Subscription * @var int * * @JMS\Type("int") - * @JMS\SerializedName("unsubscribeMessageId") + * @JMS\SerializedName("messageId") */ - public $unsubscribeMessageId; + public $messageId; } diff --git a/src/ResourceGroup/Customers.php b/src/ResourceGroup/Customers.php index e47c275..4b68f1f 100644 --- a/src/ResourceGroup/Customers.php +++ b/src/ResourceGroup/Customers.php @@ -797,14 +797,15 @@ class Customers extends AbstractApiResourceGroup * * $client = SimpleClientFactory::createClient('https://test.retailcrm.pro', 'apiKey'); * - * $subscription = new Subscription(); - * $subscription->channel = 'waba'; - * $subscription->active = false; - * $subscription->unsubscribeMessageId = 123; - * $request = new CustomersSubscriptionsRequest(); - * $request->by = ByIdentifier::ID; - * $request->site = 'aliexpress'; - * $request->subscriptions = [$subscription]; + * $subscription = new Subscription(); + * $subscription->channel = 'waba'; + * $subscription->subscription = 'category'; + * $subscription->active = false; + * $subscription->messageId = 123; + * $request = new CustomersSubscriptionsRequest(); + * $request->by = ByIdentifier::ID; + * $request->site = 'aliexpress'; + * $request->subscriptions = [$subscription]; * * try { * $response = $client->customers->subscriptions(4770, $request); diff --git a/tests/src/ResourceGroup/CustomersTest.php b/tests/src/ResourceGroup/CustomersTest.php index 79ee92c..2c26914 100644 --- a/tests/src/ResourceGroup/CustomersTest.php +++ b/tests/src/ResourceGroup/CustomersTest.php @@ -2786,8 +2786,9 @@ EOF; $subscription = new Subscription(); $subscription->channel = 'waba'; + $subscription->subscription = 'category'; $subscription->active = false; - $subscription->unsubscribeMessageId = 123; + $subscription->messageId = 123; $request = new CustomersSubscriptionsRequest(); $request->by = ByIdentifier::ID;