commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
MessageDeliveryPayloadBuilder.php
1<?php
2
3declare(strict_types=1);
10
20use DateTimeImmutable;
21use stdClass;
22
27{
32 private $projectKey;
33
38 private $resource;
39
44 private $resourceUserProvidedIdentifiers;
45
50 private $id;
51
56 private $version;
57
62 private $createdAt;
63
68 private $lastModifiedAt;
69
74 private $sequenceNumber;
75
80 private $resourceVersion;
81
86 private $payloadNotIncluded;
87
95 public function getProjectKey()
96 {
97 return $this->projectKey;
98 }
99
106 public function getResource()
107 {
108 return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource;
109 }
110
118 {
119 return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers;
120 }
121
128 public function getId()
129 {
130 return $this->id;
131 }
132
139 public function getVersion()
140 {
141 return $this->version;
142 }
143
150 public function getCreatedAt()
151 {
152 return $this->createdAt;
153 }
154
161 public function getLastModifiedAt()
162 {
163 return $this->lastModifiedAt;
164 }
165
173 public function getSequenceNumber()
174 {
175 return $this->sequenceNumber;
176 }
177
184 public function getResourceVersion()
185 {
186 return $this->resourceVersion;
187 }
188
195 public function getPayloadNotIncluded()
196 {
197 return $this->payloadNotIncluded instanceof PayloadNotIncludedBuilder ? $this->payloadNotIncluded->build() : $this->payloadNotIncluded;
198 }
199
204 public function withProjectKey(?string $projectKey)
205 {
206 $this->projectKey = $projectKey;
207
208 return $this;
209 }
210
215 public function withResource(?Reference $resource)
216 {
217 $this->resource = $resource;
218
219 return $this;
220 }
221
226 public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)
227 {
228 $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
229
230 return $this;
231 }
232
237 public function withId(?string $id)
238 {
239 $this->id = $id;
240
241 return $this;
242 }
243
248 public function withVersion(?int $version)
249 {
250 $this->version = $version;
251
252 return $this;
253 }
254
259 public function withCreatedAt(?DateTimeImmutable $createdAt)
260 {
261 $this->createdAt = $createdAt;
262
263 return $this;
264 }
265
270 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
271 {
272 $this->lastModifiedAt = $lastModifiedAt;
273
274 return $this;
275 }
276
281 public function withSequenceNumber(?int $sequenceNumber)
282 {
283 $this->sequenceNumber = $sequenceNumber;
284
285 return $this;
286 }
287
292 public function withResourceVersion(?int $resourceVersion)
293 {
294 $this->resourceVersion = $resourceVersion;
295
296 return $this;
297 }
298
303 public function withPayloadNotIncluded(?PayloadNotIncluded $payloadNotIncluded)
304 {
305 $this->payloadNotIncluded = $payloadNotIncluded;
306
307 return $this;
308 }
309
314 public function withResourceBuilder(?ReferenceBuilder $resource)
315 {
316 $this->resource = $resource;
317
318 return $this;
319 }
320
325 public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)
326 {
327 $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
328
329 return $this;
330 }
331
336 public function withPayloadNotIncludedBuilder(?PayloadNotIncludedBuilder $payloadNotIncluded)
337 {
338 $this->payloadNotIncluded = $payloadNotIncluded;
339
340 return $this;
341 }
342
343 public function build(): MessageDeliveryPayload
344 {
346 $this->projectKey,
347 $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource,
348 $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers,
349 $this->id,
350 $this->version,
351 $this->createdAt,
352 $this->lastModifiedAt,
353 $this->sequenceNumber,
354 $this->resourceVersion,
355 $this->payloadNotIncluded instanceof PayloadNotIncludedBuilder ? $this->payloadNotIncluded->build() : $this->payloadNotIncluded
356 );
357 }
358
359 public static function of(): MessageDeliveryPayloadBuilder
360 {
361 return new self();
362 }
363}
withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)
withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)