commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ExtensionBadResponseErrorBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
24 {
29  private $message;
30 
35  private $localizedMessage;
36 
41  private $extensionExtraInfo;
42 
47  private $extensionErrors;
48 
53  private $extensionBody;
54 
59  private $extensionStatusCode;
60 
65  private $extensionId;
66 
71  private $extensionKey;
72 
79  public function getMessage()
80  {
81  return $this->message;
82  }
83 
90  public function getLocalizedMessage()
91  {
92  return $this->localizedMessage instanceof LocalizedStringBuilder ? $this->localizedMessage->build() : $this->localizedMessage;
93  }
94 
101  public function getExtensionExtraInfo()
102  {
103  return $this->extensionExtraInfo;
104  }
105 
112  public function getExtensionErrors()
113  {
114  return $this->extensionErrors;
115  }
116 
123  public function getExtensionBody()
124  {
125  return $this->extensionBody;
126  }
127 
134  public function getExtensionStatusCode()
135  {
136  return $this->extensionStatusCode;
137  }
138 
145  public function getExtensionId()
146  {
147  return $this->extensionId;
148  }
149 
156  public function getExtensionKey()
157  {
158  return $this->extensionKey;
159  }
160 
165  public function withMessage(?string $message)
166  {
167  $this->message = $message;
168 
169  return $this;
170  }
171 
176  public function withLocalizedMessage(?LocalizedString $localizedMessage)
177  {
178  $this->localizedMessage = $localizedMessage;
179 
180  return $this;
181  }
182 
187  public function withExtensionExtraInfo(?JsonObject $extensionExtraInfo)
188  {
189  $this->extensionExtraInfo = $extensionExtraInfo;
190 
191  return $this;
192  }
193 
198  public function withExtensionErrors(?ExtensionErrorCollection $extensionErrors)
199  {
200  $this->extensionErrors = $extensionErrors;
201 
202  return $this;
203  }
204 
209  public function withExtensionBody(?string $extensionBody)
210  {
211  $this->extensionBody = $extensionBody;
212 
213  return $this;
214  }
215 
220  public function withExtensionStatusCode(?int $extensionStatusCode)
221  {
222  $this->extensionStatusCode = $extensionStatusCode;
223 
224  return $this;
225  }
226 
231  public function withExtensionId(?string $extensionId)
232  {
233  $this->extensionId = $extensionId;
234 
235  return $this;
236  }
237 
242  public function withExtensionKey(?string $extensionKey)
243  {
244  $this->extensionKey = $extensionKey;
245 
246  return $this;
247  }
248 
253  public function withLocalizedMessageBuilder(?LocalizedStringBuilder $localizedMessage)
254  {
255  $this->localizedMessage = $localizedMessage;
256 
257  return $this;
258  }
259 
260  public function build(): ExtensionBadResponseError
261  {
263  $this->message,
264  $this->localizedMessage instanceof LocalizedStringBuilder ? $this->localizedMessage->build() : $this->localizedMessage,
265  $this->extensionExtraInfo,
266  $this->extensionErrors,
267  $this->extensionBody,
268  $this->extensionStatusCode,
269  $this->extensionId,
270  $this->extensionKey
271  );
272  }
273 
274  public static function of(): ExtensionBadResponseErrorBuilder
275  {
276  return new self();
277  }
278 }