commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CartAddShippingMethodActionBuilder.php
1<?php
2
3declare(strict_types=1);
10
23use stdClass;
24
29{
34 private $shippingKey;
35
40 private $shippingMethod;
41
46 private $shippingAddress;
47
52 private $shippingRateInput;
53
58 private $externalTaxRate;
59
64 private $deliveries;
65
70 private $custom;
71
76 private $estimatedDelivery;
77
84 public function getShippingKey()
85 {
86 return $this->shippingKey;
87 }
88
102 public function getShippingMethod()
103 {
104 return $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod;
105 }
106
113 public function getShippingAddress()
114 {
115 return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress;
116 }
117
130 public function getShippingRateInput()
131 {
132 return $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput;
133 }
134
141 public function getExternalTaxRate()
142 {
143 return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate;
144 }
145
152 public function getDeliveries()
153 {
154 return $this->deliveries;
155 }
156
163 public function getCustom()
164 {
165 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
166 }
167
174 public function getEstimatedDelivery()
175 {
176 return $this->estimatedDelivery instanceof EstimatedDeliveryBuilder ? $this->estimatedDelivery->build() : $this->estimatedDelivery;
177 }
178
183 public function withShippingKey(?string $shippingKey)
184 {
185 $this->shippingKey = $shippingKey;
186
187 return $this;
188 }
189
194 public function withShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod)
195 {
196 $this->shippingMethod = $shippingMethod;
197
198 return $this;
199 }
200
205 public function withShippingAddress(?BaseAddress $shippingAddress)
206 {
207 $this->shippingAddress = $shippingAddress;
208
209 return $this;
210 }
211
216 public function withShippingRateInput(?ShippingRateInputDraft $shippingRateInput)
217 {
218 $this->shippingRateInput = $shippingRateInput;
219
220 return $this;
221 }
222
227 public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate)
228 {
229 $this->externalTaxRate = $externalTaxRate;
230
231 return $this;
232 }
233
238 public function withDeliveries(?DeliveryDraftCollection $deliveries)
239 {
240 $this->deliveries = $deliveries;
241
242 return $this;
243 }
244
249 public function withCustom(?CustomFieldsDraft $custom)
250 {
251 $this->custom = $custom;
252
253 return $this;
254 }
255
260 public function withEstimatedDelivery(?EstimatedDelivery $estimatedDelivery)
261 {
262 $this->estimatedDelivery = $estimatedDelivery;
263
264 return $this;
265 }
266
272 {
273 $this->shippingMethod = $shippingMethod;
274
275 return $this;
276 }
277
282 public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress)
283 {
284 $this->shippingAddress = $shippingAddress;
285
286 return $this;
287 }
288
294 {
295 $this->shippingRateInput = $shippingRateInput;
296
297 return $this;
298 }
299
305 {
306 $this->externalTaxRate = $externalTaxRate;
307
308 return $this;
309 }
310
316 {
317 $this->custom = $custom;
318
319 return $this;
320 }
321
326 public function withEstimatedDeliveryBuilder(?EstimatedDeliveryBuilder $estimatedDelivery)
327 {
328 $this->estimatedDelivery = $estimatedDelivery;
329
330 return $this;
331 }
332
334 {
336 $this->shippingKey,
337 $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod,
338 $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress,
339 $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput,
340 $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate,
341 $this->deliveries,
342 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
343 $this->estimatedDelivery instanceof EstimatedDeliveryBuilder ? $this->estimatedDelivery->build() : $this->estimatedDelivery
344 );
345 }
346
347 public static function of(): CartAddShippingMethodActionBuilder
348 {
349 return new self();
350 }
351}
withShippingMethodBuilder(?ShippingMethodResourceIdentifierBuilder $shippingMethod)
withShippingRateInputBuilder(?ShippingRateInputDraftBuilder $shippingRateInput)