commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ContentionErrorModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
22  public const DISCRIMINATOR_VALUE = 'Contention';
27  protected $code;
28 
33  protected $message;
34 
35 
39  public function __construct(
40  ?string $message = null,
41  ?string $code = null
42  ) {
43  $this->message = $message;
44  $this->code = $code ?? self::DISCRIMINATOR_VALUE;
45  }
46 
51  public function getCode()
52  {
53  if (is_null($this->code)) {
55  $data = $this->raw(self::FIELD_CODE);
56  if (is_null($data)) {
57  return null;
58  }
59  $this->code = (string) $data;
60  }
61 
62  return $this->code;
63  }
64 
69  public function getMessage()
70  {
71  if (is_null($this->message)) {
73  $data = $this->raw(self::FIELD_MESSAGE);
74  if (is_null($data)) {
75  return null;
76  }
77  $this->message = (string) $data;
78  }
79 
80  return $this->message;
81  }
82 
83 
87  public function setMessage(?string $message): void
88  {
89  $this->message = $message;
90  }
91 }
__construct(?string $message=null, ?string $code=null)