commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
OrderEditAppliedMessageBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
26 use DateTimeImmutable;
27 use stdClass;
28 
33 {
38  private $id;
39 
44  private $version;
45 
50  private $createdAt;
51 
56  private $lastModifiedAt;
57 
62  private $lastModifiedBy;
63 
68  private $createdBy;
69 
74  private $sequenceNumber;
75 
80  private $resource;
81 
86  private $resourceVersion;
87 
92  private $resourceUserProvidedIdentifiers;
93 
98  private $edit;
99 
104  private $result;
105 
112  public function getId()
113  {
114  return $this->id;
115  }
116 
123  public function getVersion()
124  {
125  return $this->version;
126  }
127 
134  public function getCreatedAt()
135  {
136  return $this->createdAt;
137  }
138 
145  public function getLastModifiedAt()
146  {
147  return $this->lastModifiedAt;
148  }
149 
156  public function getLastModifiedBy()
157  {
158  return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
159  }
160 
167  public function getCreatedBy()
168  {
169  return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
170  }
171 
179  public function getSequenceNumber()
180  {
181  return $this->sequenceNumber;
182  }
183 
190  public function getResource()
191  {
192  return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource;
193  }
194 
201  public function getResourceVersion()
202  {
203  return $this->resourceVersion;
204  }
205 
213  {
214  return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers;
215  }
216 
223  public function getEdit()
224  {
225  return $this->edit instanceof OrderEditBuilder ? $this->edit->build() : $this->edit;
226  }
227 
234  public function getResult()
235  {
236  return $this->result instanceof OrderEditAppliedBuilder ? $this->result->build() : $this->result;
237  }
238 
243  public function withId(?string $id)
244  {
245  $this->id = $id;
246 
247  return $this;
248  }
249 
254  public function withVersion(?int $version)
255  {
256  $this->version = $version;
257 
258  return $this;
259  }
260 
265  public function withCreatedAt(?DateTimeImmutable $createdAt)
266  {
267  $this->createdAt = $createdAt;
268 
269  return $this;
270  }
271 
276  public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
277  {
278  $this->lastModifiedAt = $lastModifiedAt;
279 
280  return $this;
281  }
282 
287  public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
288  {
289  $this->lastModifiedBy = $lastModifiedBy;
290 
291  return $this;
292  }
293 
298  public function withCreatedBy(?CreatedBy $createdBy)
299  {
300  $this->createdBy = $createdBy;
301 
302  return $this;
303  }
304 
309  public function withSequenceNumber(?int $sequenceNumber)
310  {
311  $this->sequenceNumber = $sequenceNumber;
312 
313  return $this;
314  }
315 
320  public function withResource(?Reference $resource)
321  {
322  $this->resource = $resource;
323 
324  return $this;
325  }
326 
331  public function withResourceVersion(?int $resourceVersion)
332  {
333  $this->resourceVersion = $resourceVersion;
334 
335  return $this;
336  }
337 
342  public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)
343  {
344  $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
345 
346  return $this;
347  }
348 
353  public function withEdit(?OrderEdit $edit)
354  {
355  $this->edit = $edit;
356 
357  return $this;
358  }
359 
364  public function withResult(?OrderEditApplied $result)
365  {
366  $this->result = $result;
367 
368  return $this;
369  }
370 
375  public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
376  {
377  $this->lastModifiedBy = $lastModifiedBy;
378 
379  return $this;
380  }
381 
386  public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
387  {
388  $this->createdBy = $createdBy;
389 
390  return $this;
391  }
392 
397  public function withResourceBuilder(?ReferenceBuilder $resource)
398  {
399  $this->resource = $resource;
400 
401  return $this;
402  }
403 
408  public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)
409  {
410  $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
411 
412  return $this;
413  }
414 
419  public function withEditBuilder(?OrderEditBuilder $edit)
420  {
421  $this->edit = $edit;
422 
423  return $this;
424  }
425 
430  public function withResultBuilder(?OrderEditAppliedBuilder $result)
431  {
432  $this->result = $result;
433 
434  return $this;
435  }
436 
437  public function build(): OrderEditAppliedMessage
438  {
439  return new OrderEditAppliedMessageModel(
440  $this->id,
441  $this->version,
442  $this->createdAt,
443  $this->lastModifiedAt,
444  $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
445  $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
446  $this->sequenceNumber,
447  $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource,
448  $this->resourceVersion,
449  $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers,
450  $this->edit instanceof OrderEditBuilder ? $this->edit->build() : $this->edit,
451  $this->result instanceof OrderEditAppliedBuilder ? $this->result->build() : $this->result
452  );
453  }
454 
455  public static function of(): OrderEditAppliedMessageBuilder
456  {
457  return new self();
458  }
459 }
withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)
withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)