commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
DeliveryAddressSetMessagePayloadBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
29 private $deliveryId;
30
35 private $address;
36
41 private $oldAddress;
42
47 private $shippingKey;
48
55 public function getDeliveryId()
56 {
57 return $this->deliveryId;
58 }
59
66 public function getAddress()
67 {
68 return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address;
69 }
70
77 public function getOldAddress()
78 {
79 return $this->oldAddress instanceof AddressBuilder ? $this->oldAddress->build() : $this->oldAddress;
80 }
81
88 public function getShippingKey()
89 {
90 return $this->shippingKey;
91 }
92
97 public function withDeliveryId(?string $deliveryId)
98 {
99 $this->deliveryId = $deliveryId;
100
101 return $this;
102 }
103
108 public function withAddress(?Address $address)
109 {
110 $this->address = $address;
111
112 return $this;
113 }
114
119 public function withOldAddress(?Address $oldAddress)
120 {
121 $this->oldAddress = $oldAddress;
122
123 return $this;
124 }
125
130 public function withShippingKey(?string $shippingKey)
131 {
132 $this->shippingKey = $shippingKey;
133
134 return $this;
135 }
136
141 public function withAddressBuilder(?AddressBuilder $address)
142 {
143 $this->address = $address;
144
145 return $this;
146 }
147
152 public function withOldAddressBuilder(?AddressBuilder $oldAddress)
153 {
154 $this->oldAddress = $oldAddress;
155
156 return $this;
157 }
158
160 {
162 $this->deliveryId,
163 $this->address instanceof AddressBuilder ? $this->address->build() : $this->address,
164 $this->oldAddress instanceof AddressBuilder ? $this->oldAddress->build() : $this->oldAddress,
165 $this->shippingKey
166 );
167 }
168
170 {
171 return new self();
172 }
173}