commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
EditPreviewFailedErrorModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
24 public const DISCRIMINATOR_VALUE = 'EditPreviewFailed';
29 protected $code;
30
35 protected $message;
36
41 protected $result;
42
43
47 public function __construct(
48 ?string $message = null,
50 ?string $code = null
51 ) {
52 $this->message = $message;
53 $this->result = $result;
54 $this->code = $code ?? self::DISCRIMINATOR_VALUE;
55 }
56
61 public function getCode()
62 {
63 if (is_null($this->code)) {
65 $data = $this->raw(self::FIELD_CODE);
66 if (is_null($data)) {
67 return null;
68 }
69 $this->code = (string) $data;
70 }
71
72 return $this->code;
73 }
74
81 public function getMessage()
82 {
83 if (is_null($this->message)) {
85 $data = $this->raw(self::FIELD_MESSAGE);
86 if (is_null($data)) {
87 return null;
88 }
89 $this->message = (string) $data;
90 }
91
92 return $this->message;
93 }
94
101 public function getResult()
102 {
103 if (is_null($this->result)) {
105 $data = $this->raw(self::FIELD_RESULT);
106 if (is_null($data)) {
107 return null;
108 }
109
110 $this->result = OrderEditPreviewFailureModel::of($data);
111 }
112
113 return $this->result;
114 }
115
116
120 public function setMessage(?string $message): void
121 {
122 $this->message = $message;
123 }
124
129 {
130 $this->result = $result;
131 }
132
136 public function by(string $key)
137 {
138 $data = $this->raw($key);
139 if (is_null($data)) {
140 return null;
141 }
142
143 return $data;
144 }
145}
__construct(?string $message=null, ?OrderEditPreviewFailure $result=null, ?string $code=null)