commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AgentResponsesErrorResponseModel.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
29 protected $statusCode;
30
35 protected $message;
36
41 protected $errors;
42
47 protected $threadId;
48
49
53 public function __construct(
54 ?int $statusCode = null,
55 ?string $message = null,
57 ?string $threadId = null
58 ) {
59 $this->statusCode = $statusCode;
60 $this->message = $message;
61 $this->errors = $errors;
62 $this->threadId = $threadId;
63 }
64
71 public function getStatusCode()
72 {
73 if (is_null($this->statusCode)) {
75 $data = $this->raw(self::FIELD_STATUS_CODE);
76 if (is_null($data)) {
77 return null;
78 }
79 $this->statusCode = (int) $data;
80 }
81
82 return $this->statusCode;
83 }
84
91 public function getMessage()
92 {
93 if (is_null($this->message)) {
95 $data = $this->raw(self::FIELD_MESSAGE);
96 if (is_null($data)) {
97 return null;
98 }
99 $this->message = (string) $data;
100 }
101
102 return $this->message;
103 }
104
112 public function getErrors()
113 {
114 if (is_null($this->errors)) {
116 $data = $this->raw(self::FIELD_ERRORS);
117 if (is_null($data)) {
118 return null;
119 }
120 $this->errors = ErrorObjectCollection::fromArray($data);
121 }
122
123 return $this->errors;
124 }
125
132 public function getThreadId()
133 {
134 if (is_null($this->threadId)) {
136 $data = $this->raw(self::FIELD_THREAD_ID);
137 if (is_null($data)) {
138 return null;
139 }
140 $this->threadId = (string) $data;
141 }
142
143 return $this->threadId;
144 }
145
146
150 public function setStatusCode(?int $statusCode): void
151 {
152 $this->statusCode = $statusCode;
153 }
154
158 public function setMessage(?string $message): void
159 {
160 $this->message = $message;
161 }
162
167 {
168 $this->errors = $errors;
169 }
170
174 public function setThreadId(?string $threadId): void
175 {
176 $this->threadId = $threadId;
177 }
178}
__construct(?int $statusCode=null, ?string $message=null, ?ErrorObjectCollection $errors=null, ?string $threadId=null)