commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
McpServer
McpServerSetStateActionModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\McpServer
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
20
final
class
McpServerSetStateActionModel
extends
JsonObjectModel
implements
McpServerSetStateAction
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'setState'
;
27
protected
$action
;
28
33
protected
$state
;
34
35
39
public
function
__construct
(
40
?
string
$state
=
null
,
41
?
string
$action
=
null
42
) {
43
$this->state =
$state
;
44
$this->action =
$action
??
self::DISCRIMINATOR_VALUE
;
45
}
46
53
public
function
getAction
()
54
{
55
if
(is_null($this->action)) {
57
$data = $this->
raw
(self::FIELD_ACTION);
58
if
(is_null($data)) {
59
return
null
;
60
}
61
$this->action = (string) $data;
62
}
63
64
return
$this->action
;
65
}
66
73
public
function
getState
()
74
{
75
if
(is_null($this->state)) {
77
$data = $this->
raw
(self::FIELD_STATE);
78
if
(is_null($data)) {
79
return
null
;
80
}
81
$this->state = (string) $data;
82
}
83
84
return
$this->state
;
85
}
86
87
91
public
function
setState
(?
string
$state
): void
92
{
93
$this->state =
$state
;
94
}
95
}
Commercetools\Api\Models\McpServer\McpServerSetStateActionModel
Definition
McpServerSetStateActionModel.php:21
Commercetools\Api\Models\McpServer\McpServerSetStateActionModel\__construct
__construct(?string $state=null, ?string $action=null)
Definition
McpServerSetStateActionModel.php:39
Commercetools\Api\Models\McpServer\McpServerSetStateActionModel\$action
$action
Definition
McpServerSetStateActionModel.php:27
Commercetools\Api\Models\McpServer\McpServerSetStateActionModel\$state
$state
Definition
McpServerSetStateActionModel.php:33
Commercetools\Api\Models\McpServer\McpServerSetStateActionModel\setState
setState(?string $state)
Definition
McpServerSetStateActionModel.php:91
Commercetools\Api\Models\McpServer\McpServerSetStateActionModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
McpServerSetStateActionModel.php:22
Commercetools\Api\Models\McpServer\McpServerSetStateActionModel\getState
getState()
Definition
McpServerSetStateActionModel.php:73
Commercetools\Api\Models\McpServer\McpServerSetStateActionModel\getAction
getAction()
Definition
McpServerSetStateActionModel.php:53
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition
BaseJsonObject.php:57
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\McpServer\McpServerSetStateAction
Definition
McpServerSetStateAction.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\McpServer
Definition
CommerceMcpServerConfig.php:9
Generated by
1.9.8