commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CartSetShippingMethodActionModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
24 public const DISCRIMINATOR_VALUE = 'setShippingMethod';
29 protected $action;
30
35 protected $shippingMethod;
36
42
48
49
53 public function __construct(
57 ?string $action = null
58 ) {
59 $this->shippingMethod = $shippingMethod;
60 $this->externalTaxRate = $externalTaxRate;
61 $this->estimatedDelivery = $estimatedDelivery;
62 $this->action = $action ?? self::DISCRIMINATOR_VALUE;
63 }
64
69 public function getAction()
70 {
71 if (is_null($this->action)) {
73 $data = $this->raw(self::FIELD_ACTION);
74 if (is_null($data)) {
75 return null;
76 }
77 $this->action = (string) $data;
78 }
79
80 return $this->action;
81 }
82
97 public function getShippingMethod()
98 {
99 if (is_null($this->shippingMethod)) {
101 $data = $this->raw(self::FIELD_SHIPPING_METHOD);
102 if (is_null($data)) {
103 return null;
104 }
105
106 $this->shippingMethod = ShippingMethodResourceIdentifierModel::of($data);
107 }
108
110 }
111
118 public function getExternalTaxRate()
119 {
120 if (is_null($this->externalTaxRate)) {
122 $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE);
123 if (is_null($data)) {
124 return null;
125 }
126
127 $this->externalTaxRate = ExternalTaxRateDraftModel::of($data);
128 }
129
131 }
132
140 public function getEstimatedDelivery()
141 {
142 if (is_null($this->estimatedDelivery)) {
144 $data = $this->raw(self::FIELD_ESTIMATED_DELIVERY);
145 if (is_null($data)) {
146 return null;
147 }
148
149 $this->estimatedDelivery = EstimatedDeliveryModel::of($data);
150 }
151
153 }
154
155
160 {
161 $this->shippingMethod = $shippingMethod;
162 }
163
168 {
169 $this->externalTaxRate = $externalTaxRate;
170 }
171
176 {
177 $this->estimatedDelivery = $estimatedDelivery;
178 }
179}
__construct(?ShippingMethodResourceIdentifier $shippingMethod=null, ?ExternalTaxRateDraft $externalTaxRate=null, ?EstimatedDelivery $estimatedDelivery=null, ?string $action=null)