1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
*/ |
4
|
|
|
|
5
|
|
|
namespace Commercetools\Core\Request\Project\Command; |
6
|
|
|
|
7
|
|
|
use Commercetools\Core\Model\Common\Context; |
8
|
|
|
use Commercetools\Core\Model\Message\MessagesConfigurationDraft; |
9
|
|
|
use Commercetools\Core\Request\AbstractAction; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* @package Commercetools\Core\Request\Project\Command |
13
|
|
|
* @link https://docs.commercetools.com/http-api-projects-project.html#change-messages-enabled |
14
|
|
|
* @method string getAction() |
15
|
|
|
* @method ProjectChangeMessagesConfigurationAction setAction(string $action = null) |
16
|
|
|
* @method bool getMessagesEnabled() |
17
|
|
|
* @method ProjectChangeMessagesConfigurationAction setMessagesEnabled(bool $messagesEnabled = null) |
18
|
|
|
* @method MessagesConfigurationDraft getMessagesConfiguration() |
19
|
|
|
* phpcs:disable |
20
|
|
|
* @method ProjectChangeMessagesConfigurationAction setMessagesConfiguration(MessagesConfigurationDraft $messagesConfiguration = null) |
21
|
|
|
* phpcs:enable |
22
|
|
|
*/ |
23
|
|
|
class ProjectChangeMessagesConfigurationAction extends AbstractAction |
24
|
|
|
{ |
25
|
3 |
|
public function fieldDefinitions() |
26
|
|
|
{ |
27
|
|
|
return [ |
28
|
3 |
|
'action' => [static::TYPE => 'string'], |
29
|
3 |
|
'messagesConfiguration' => [static::TYPE => MessagesConfigurationDraft::class], |
30
|
|
|
]; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @param array $data |
35
|
|
|
* @param Context|callable $context |
36
|
|
|
*/ |
37
|
3 |
|
public function __construct(array $data = [], $context = null) |
38
|
|
|
{ |
39
|
3 |
|
parent::__construct($data, $context); |
40
|
3 |
|
$this->setAction('changeMessagesConfiguration'); |
41
|
3 |
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @param MessagesConfigurationDraft $draft |
45
|
|
|
* @param Context|callable $context |
46
|
|
|
* @return ProjectChangeMessagesConfigurationAction |
47
|
|
|
*/ |
48
|
1 |
|
public static function ofDraft(MessagesConfigurationDraft $draft, $context = null) |
49
|
|
|
{ |
50
|
1 |
|
return static::of($context)->setMessagesConfiguration($draft); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|