commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CloudEventsFormatModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'CloudEvents';
27 protected $type;
28
34
35
39 public function __construct(
40 ?string $cloudEventsVersion = null,
41 ?string $type = null
42 ) {
43 $this->cloudEventsVersion = $cloudEventsVersion;
44 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
45 }
46
51 public function getType()
52 {
53 if (is_null($this->type)) {
55 $data = $this->raw(self::FIELD_TYPE);
56 if (is_null($data)) {
57 return null;
58 }
59 $this->type = (string) $data;
60 }
61
62 return $this->type;
63 }
64
69 public function getCloudEventsVersion()
70 {
71 if (is_null($this->cloudEventsVersion)) {
73 $data = $this->raw(self::FIELD_CLOUD_EVENTS_VERSION);
74 if (is_null($data)) {
75 return null;
76 }
77 $this->cloudEventsVersion = (string) $data;
78 }
79
81 }
82
83
87 public function setCloudEventsVersion(?string $cloudEventsVersion): void
88 {
89 $this->cloudEventsVersion = $cloudEventsVersion;
90 }
91}
__construct(?string $cloudEventsVersion=null, ?string $type=null)