commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
DeliveryAddedMessagePayloadBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
24 {
29  private $delivery;
30 
35  private $shippingKey;
36 
43  public function getDelivery()
44  {
45  return $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery;
46  }
47 
54  public function getShippingKey()
55  {
56  return $this->shippingKey;
57  }
58 
63  public function withDelivery(?Delivery $delivery)
64  {
65  $this->delivery = $delivery;
66 
67  return $this;
68  }
69 
74  public function withShippingKey(?string $shippingKey)
75  {
76  $this->shippingKey = $shippingKey;
77 
78  return $this;
79  }
80 
85  public function withDeliveryBuilder(?DeliveryBuilder $delivery)
86  {
87  $this->delivery = $delivery;
88 
89  return $this;
90  }
91 
93  {
95  $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery,
96  $this->shippingKey
97  );
98  }
99 
100  public static function of(): DeliveryAddedMessagePayloadBuilder
101  {
102  return new self();
103  }
104 }