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
Error
UnauthorizedErrorModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Error
;
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
UnauthorizedErrorModel
extends
JsonObjectModel
implements
UnauthorizedError
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'Unauthorized'
;
27
protected
$code
;
28
33
protected
$message
;
34
39
protected
$storesWithoutPermission
;
40
41
45
public
function
__construct
(
46
?
string
$message
=
null
,
47
?array
$storesWithoutPermission
=
null
,
48
?
string
$code
=
null
49
) {
50
$this->message =
$message
;
51
$this->storesWithoutPermission =
$storesWithoutPermission
;
52
$this->code =
$code
??
self::DISCRIMINATOR_VALUE
;
53
}
54
59
public
function
getCode
()
60
{
61
if
(is_null($this->code)) {
63
$data = $this->
raw
(self::FIELD_CODE);
64
if
(is_null($data)) {
65
return
null
;
66
}
67
$this->code = (string) $data;
68
}
69
70
return
$this->code
;
71
}
72
79
public
function
getMessage
()
80
{
81
if
(is_null($this->message)) {
83
$data = $this->
raw
(self::FIELD_MESSAGE);
84
if
(is_null($data)) {
85
return
null
;
86
}
87
$this->message = (string) $data;
88
}
89
90
return
$this->message
;
91
}
92
100
public
function
getStoresWithoutPermission
()
101
{
102
if
(is_null($this->storesWithoutPermission)) {
104
$data = $this->
raw
(self::FIELD_STORES_WITHOUT_PERMISSION);
105
if
(is_null($data)) {
106
return
null
;
107
}
108
$this->storesWithoutPermission = $data;
109
}
110
111
return
$this->storesWithoutPermission
;
112
}
113
114
118
public
function
setMessage
(?
string
$message
): void
119
{
120
$this->message =
$message
;
121
}
122
126
public
function
setStoresWithoutPermission
(?array
$storesWithoutPermission
): void
127
{
128
$this->storesWithoutPermission =
$storesWithoutPermission
;
129
}
130
134
public
function
by
(
string
$key)
135
{
136
$data = $this->
raw
($key);
137
if
(is_null($data)) {
138
return
null
;
139
}
140
141
return
$data;
142
}
143
}
Commercetools\Api\Models\Error\UnauthorizedErrorModel
Definition
UnauthorizedErrorModel.php:21
Commercetools\Api\Models\Error\UnauthorizedErrorModel\$storesWithoutPermission
$storesWithoutPermission
Definition
UnauthorizedErrorModel.php:39
Commercetools\Api\Models\Error\UnauthorizedErrorModel\$message
$message
Definition
UnauthorizedErrorModel.php:33
Commercetools\Api\Models\Error\UnauthorizedErrorModel\getMessage
getMessage()
Definition
UnauthorizedErrorModel.php:79
Commercetools\Api\Models\Error\UnauthorizedErrorModel\setMessage
setMessage(?string $message)
Definition
UnauthorizedErrorModel.php:118
Commercetools\Api\Models\Error\UnauthorizedErrorModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
UnauthorizedErrorModel.php:22
Commercetools\Api\Models\Error\UnauthorizedErrorModel\getCode
getCode()
Definition
UnauthorizedErrorModel.php:59
Commercetools\Api\Models\Error\UnauthorizedErrorModel\__construct
__construct(?string $message=null, ?array $storesWithoutPermission=null, ?string $code=null)
Definition
UnauthorizedErrorModel.php:45
Commercetools\Api\Models\Error\UnauthorizedErrorModel\getStoresWithoutPermission
getStoresWithoutPermission()
Definition
UnauthorizedErrorModel.php:100
Commercetools\Api\Models\Error\UnauthorizedErrorModel\setStoresWithoutPermission
setStoresWithoutPermission(?array $storesWithoutPermission)
Definition
UnauthorizedErrorModel.php:126
Commercetools\Api\Models\Error\UnauthorizedErrorModel\by
by(string $key)
Definition
UnauthorizedErrorModel.php:134
Commercetools\Api\Models\Error\UnauthorizedErrorModel\$code
$code
Definition
UnauthorizedErrorModel.php:27
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\Error\UnauthorizedError
Definition
UnauthorizedError.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Error
Definition
AnonymousIdAlreadyInUseError.php:9
Generated by
1.9.8