commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ResourceCreationErrorModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'ResourceCreation';
27 protected $code;
28
33 protected $message;
34
39 protected $resource;
40
41
45 public function __construct(
46 ?string $message = null,
47 $resource = null,
48 ?string $code = null
49 ) {
50 $this->message = $message;
51 $this->resource = $resource;
52 $this->code = $code ?? self::DISCRIMINATOR_VALUE;
53 }
54
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
99 public function getResource()
100 {
101 if (is_null($this->resource)) {
103 $data = $this->raw(self::FIELD_RESOURCE);
104 if (is_null($data)) {
105 return null;
106 }
107 $this->resource = $data;
108 }
109
110 return $this->resource;
111 }
112
113
117 public function setMessage(?string $message): void
118 {
119 $this->message = $message;
120 }
121
125 public function setResource($resource): void
126 {
127 $this->resource = $resource;
128 }
129}
__construct(?string $message=null, $resource=null, ?string $code=null)