This repository was archived by the owner on Oct 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
Request/Subscriptions/Command Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 44
55use Commercetools \Core \Error \InvalidArgumentException ;
66use Commercetools \Core \Request \AbstractAction ;
7+ use Commercetools \Core \Request \Subscriptions \Command \SubscriptionChangeDestinationAction ;
78use Commercetools \Core \Request \Subscriptions \Command \SubscriptionSetChangesAction ;
89use Commercetools \Core \Request \Subscriptions \Command \SubscriptionSetKeyAction ;
910use Commercetools \Core \Request \Subscriptions \Command \SubscriptionSetMessagesAction ;
@@ -12,6 +13,17 @@ class SubscriptionsActionBuilder
1213{
1314 private $ actions = [];
1415
16+ /**
17+ * @link https://docs.commercetools.com/http-api-projects-subscriptions.html#change-destination
18+ * @param SubscriptionChangeDestinationAction|callable $action
19+ * @return $this
20+ */
21+ public function changeDestination ($ action = null )
22+ {
23+ $ this ->addAction ($ this ->resolveAction (SubscriptionChangeDestinationAction::class, $ action ));
24+ return $ this ;
25+ }
26+
1527 /**
1628 * @link https://docs.commercetools.com/http-api-projects-subscriptions.html#set-changes
1729 * @param SubscriptionSetChangesAction|callable $action
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ */
4+
5+ namespace Commercetools \Core \Request \Subscriptions \Command ;
6+
7+ use Commercetools \Core \Model \Common \Context ;
8+ use Commercetools \Core \Model \Extension \Destination ;
9+ use Commercetools \Core \Request \AbstractAction ;
10+
11+ /**
12+ * @package Commercetools\Core\Request\Subscriptions\Command
13+ * @link https://docs.commercetools.com/http-api-projects-subscriptions.html#change-destination
14+ * @method string getAction()
15+ * @method SubscriptionChangeDestinationAction setAction(string $action = null)
16+ * @method Destination getDestination()
17+ * @method SubscriptionChangeDestinationAction setDestination(Destination $destination = null)
18+ */
19+ class SubscriptionChangeDestinationAction extends AbstractAction
20+ {
21+ public function fieldDefinitions ()
22+ {
23+ return [
24+ 'action ' => [static ::TYPE => 'string ' ],
25+ 'destination ' => [static ::TYPE => Destination::class],
26+ ];
27+ }
28+
29+ /**
30+ * @param array $data
31+ * @param Context|callable $context
32+ */
33+ public function __construct (array $ data = [], $ context = null )
34+ {
35+ parent ::__construct ($ data , $ context );
36+ $ this ->setAction ('changeDestination ' );
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments