commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CartSetShippingMethodActionBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
29 private $shippingMethod;
30
35 private $externalTaxRate;
36
41 private $estimatedDelivery;
42
57 public function getShippingMethod()
58 {
59 return $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod;
60 }
61
68 public function getExternalTaxRate()
69 {
70 return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate;
71 }
72
80 public function getEstimatedDelivery()
81 {
82 return $this->estimatedDelivery instanceof EstimatedDeliveryBuilder ? $this->estimatedDelivery->build() : $this->estimatedDelivery;
83 }
84
89 public function withShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod)
90 {
91 $this->shippingMethod = $shippingMethod;
92
93 return $this;
94 }
95
100 public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate)
101 {
102 $this->externalTaxRate = $externalTaxRate;
103
104 return $this;
105 }
106
111 public function withEstimatedDelivery(?EstimatedDelivery $estimatedDelivery)
112 {
113 $this->estimatedDelivery = $estimatedDelivery;
114
115 return $this;
116 }
117
123 {
124 $this->shippingMethod = $shippingMethod;
125
126 return $this;
127 }
128
134 {
135 $this->externalTaxRate = $externalTaxRate;
136
137 return $this;
138 }
139
144 public function withEstimatedDeliveryBuilder(?EstimatedDeliveryBuilder $estimatedDelivery)
145 {
146 $this->estimatedDelivery = $estimatedDelivery;
147
148 return $this;
149 }
150
152 {
154 $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod,
155 $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate,
156 $this->estimatedDelivery instanceof EstimatedDeliveryBuilder ? $this->estimatedDelivery->build() : $this->estimatedDelivery
157 );
158 }
159
160 public static function of(): CartSetShippingMethodActionBuilder
161 {
162 return new self();
163 }
164}
withShippingMethodBuilder(?ShippingMethodResourceIdentifierBuilder $shippingMethod)