commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
EventDeliveryPayloadBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use DateTimeImmutable;
17use stdClass;
18
23{
28 private $id;
29
34 private $type;
35
40 private $resourceType;
41
46 private $data;
47
52 private $createdAt;
53
60 public function getId()
61 {
62 return $this->id;
63 }
64
71 public function getType()
72 {
73 return $this->type;
74 }
75
82 public function getResourceType()
83 {
84 return $this->resourceType;
85 }
86
93 public function getData()
94 {
95 return $this->data;
96 }
97
104 public function getCreatedAt()
105 {
106 return $this->createdAt;
107 }
108
113 public function withId(?string $id)
114 {
115 $this->id = $id;
116
117 return $this;
118 }
119
124 public function withType(?string $type)
125 {
126 $this->type = $type;
127
128 return $this;
129 }
130
135 public function withResourceType(?string $resourceType)
136 {
137 $this->resourceType = $resourceType;
138
139 return $this;
140 }
141
146 public function withData(?JsonObject $data)
147 {
148 $this->data = $data;
149
150 return $this;
151 }
152
157 public function withCreatedAt(?DateTimeImmutable $createdAt)
158 {
159 $this->createdAt = $createdAt;
160
161 return $this;
162 }
163
164
165 public function build(): EventDeliveryPayload
166 {
167 return new EventDeliveryPayloadModel(
168 $this->id,
169 $this->type,
170 $this->resourceType,
171 $this->data,
172 $this->createdAt
173 );
174 }
175
176 public static function of(): EventDeliveryPayloadBuilder
177 {
178 return new self();
179 }
180}