commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantCreatedMessageBuilder.php
1<?php
2
3declare(strict_types=1);
10
27use DateTimeImmutable;
28use stdClass;
29
34{
39 private $id;
40
45 private $version;
46
51 private $createdAt;
52
57 private $lastModifiedAt;
58
63 private $lastModifiedBy;
64
69 private $createdBy;
70
75 private $sequenceNumber;
76
81 private $resource;
82
87 private $resourceVersion;
88
93 private $resourceUserProvidedIdentifiers;
94
99 private $product;
100
105 private $variantId;
106
111 private $key;
112
117 private $sku;
118
123 private $attributes;
124
129 private $assets;
130
135 private $images;
136
141 private $publish;
142
149 public function getId()
150 {
151 return $this->id;
152 }
153
160 public function getVersion()
161 {
162 return $this->version;
163 }
164
171 public function getCreatedAt()
172 {
173 return $this->createdAt;
174 }
175
182 public function getLastModifiedAt()
183 {
184 return $this->lastModifiedAt;
185 }
186
193 public function getLastModifiedBy()
194 {
195 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
196 }
197
204 public function getCreatedBy()
205 {
206 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
207 }
208
216 public function getSequenceNumber()
217 {
218 return $this->sequenceNumber;
219 }
220
227 public function getResource()
228 {
229 return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource;
230 }
231
238 public function getResourceVersion()
239 {
240 return $this->resourceVersion;
241 }
242
250 {
251 return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers;
252 }
253
260 public function getProduct()
261 {
262 return $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product;
263 }
264
271 public function getVariantId()
272 {
273 return $this->variantId;
274 }
275
282 public function getKey()
283 {
284 return $this->key;
285 }
286
293 public function getSku()
294 {
295 return $this->sku;
296 }
297
304 public function getAttributes()
305 {
306 return $this->attributes;
307 }
308
315 public function getAssets()
316 {
317 return $this->assets;
318 }
319
326 public function getImages()
327 {
328 return $this->images;
329 }
330
337 public function getPublish()
338 {
339 return $this->publish;
340 }
341
346 public function withId(?string $id)
347 {
348 $this->id = $id;
349
350 return $this;
351 }
352
357 public function withVersion(?int $version)
358 {
359 $this->version = $version;
360
361 return $this;
362 }
363
368 public function withCreatedAt(?DateTimeImmutable $createdAt)
369 {
370 $this->createdAt = $createdAt;
371
372 return $this;
373 }
374
379 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
380 {
381 $this->lastModifiedAt = $lastModifiedAt;
382
383 return $this;
384 }
385
390 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
391 {
392 $this->lastModifiedBy = $lastModifiedBy;
393
394 return $this;
395 }
396
401 public function withCreatedBy(?CreatedBy $createdBy)
402 {
403 $this->createdBy = $createdBy;
404
405 return $this;
406 }
407
412 public function withSequenceNumber(?int $sequenceNumber)
413 {
414 $this->sequenceNumber = $sequenceNumber;
415
416 return $this;
417 }
418
423 public function withResource(?Reference $resource)
424 {
425 $this->resource = $resource;
426
427 return $this;
428 }
429
434 public function withResourceVersion(?int $resourceVersion)
435 {
436 $this->resourceVersion = $resourceVersion;
437
438 return $this;
439 }
440
445 public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)
446 {
447 $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
448
449 return $this;
450 }
451
456 public function withProduct(?ProductReference $product)
457 {
458 $this->product = $product;
459
460 return $this;
461 }
462
467 public function withVariantId(?int $variantId)
468 {
469 $this->variantId = $variantId;
470
471 return $this;
472 }
473
478 public function withKey(?string $key)
479 {
480 $this->key = $key;
481
482 return $this;
483 }
484
489 public function withSku(?string $sku)
490 {
491 $this->sku = $sku;
492
493 return $this;
494 }
495
500 public function withAttributes(?AttributeCollection $attributes)
501 {
502 $this->attributes = $attributes;
503
504 return $this;
505 }
506
511 public function withAssets(?AssetCollection $assets)
512 {
513 $this->assets = $assets;
514
515 return $this;
516 }
517
522 public function withImages(?ImageCollection $images)
523 {
524 $this->images = $images;
525
526 return $this;
527 }
528
533 public function withPublish(?bool $publish)
534 {
535 $this->publish = $publish;
536
537 return $this;
538 }
539
544 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
545 {
546 $this->lastModifiedBy = $lastModifiedBy;
547
548 return $this;
549 }
550
555 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
556 {
557 $this->createdBy = $createdBy;
558
559 return $this;
560 }
561
566 public function withResourceBuilder(?ReferenceBuilder $resource)
567 {
568 $this->resource = $resource;
569
570 return $this;
571 }
572
577 public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)
578 {
579 $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
580
581 return $this;
582 }
583
589 {
590 $this->product = $product;
591
592 return $this;
593 }
594
595 public function build(): VariantCreatedMessage
596 {
598 $this->id,
599 $this->version,
600 $this->createdAt,
601 $this->lastModifiedAt,
602 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
603 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
604 $this->sequenceNumber,
605 $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource,
606 $this->resourceVersion,
607 $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers,
608 $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product,
609 $this->variantId,
610 $this->key,
611 $this->sku,
612 $this->attributes,
613 $this->assets,
614 $this->images,
615 $this->publish
616 );
617 }
618
619 public static function of(): VariantCreatedMessageBuilder
620 {
621 return new self();
622 }
623}
withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)
withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)