commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AuthErrorResponseModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 protected $statusCode;
29
34 protected $message;
35
40 protected $errors;
41
46 protected $error;
47
53
54
58 public function __construct(
59 ?int $statusCode = null,
60 ?string $message = null,
62 ?string $error = null,
63 ?string $error_description = null
64 ) {
65 $this->statusCode = $statusCode;
66 $this->message = $message;
67 $this->errors = $errors;
68 $this->error = $error;
69 $this->error_description = $error_description;
70 }
71
78 public function getStatusCode()
79 {
80 if (is_null($this->statusCode)) {
82 $data = $this->raw(self::FIELD_STATUS_CODE);
83 if (is_null($data)) {
84 return null;
85 }
86 $this->statusCode = (int) $data;
87 }
88
89 return $this->statusCode;
90 }
91
98 public function getMessage()
99 {
100 if (is_null($this->message)) {
102 $data = $this->raw(self::FIELD_MESSAGE);
103 if (is_null($data)) {
104 return null;
105 }
106 $this->message = (string) $data;
107 }
108
109 return $this->message;
110 }
111
118 public function getErrors()
119 {
120 if (is_null($this->errors)) {
122 $data = $this->raw(self::FIELD_ERRORS);
123 if (is_null($data)) {
124 return null;
125 }
126 $this->errors = ErrorObjectCollection::fromArray($data);
127 }
128
129 return $this->errors;
130 }
131
138 public function getError()
139 {
140 if (is_null($this->error)) {
142 $data = $this->raw(self::FIELD_ERROR);
143 if (is_null($data)) {
144 return null;
145 }
146 $this->error = (string) $data;
147 }
148
149 return $this->error;
150 }
151
158 public function getError_description()
159 {
160 if (is_null($this->error_description)) {
162 $data = $this->raw(self::FIELD_ERROR_DESCRIPTION);
163 if (is_null($data)) {
164 return null;
165 }
166 $this->error_description = (string) $data;
167 }
168
170 }
171
172
176 public function setStatusCode(?int $statusCode): void
177 {
178 $this->statusCode = $statusCode;
179 }
180
184 public function setMessage(?string $message): void
185 {
186 $this->message = $message;
187 }
188
193 {
194 $this->errors = $errors;
195 }
196
200 public function setError(?string $error): void
201 {
202 $this->error = $error;
203 }
204
208 public function setError_description(?string $error_description): void
209 {
210 $this->error_description = $error_description;
211 }
212}
__construct(?int $statusCode=null, ?string $message=null, ?ErrorObjectCollection $errors=null, ?string $error=null, ?string $error_description=null)
static fromArray(array $data)