commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Cart
CartAddShippingMethodActionBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Api\Models\Common\BaseAddress
;
12
use
Commercetools\Api\Models\Common\BaseAddressBuilder
;
13
use
Commercetools\Api\Models\Order\DeliveryDraftCollection
;
14
use
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier
;
15
use
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifierBuilder
;
16
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
17
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
18
use
Commercetools\Base\Builder
;
19
use
Commercetools\Base\DateTimeImmutableCollection
;
20
use
Commercetools\Base\JsonObject
;
21
use
Commercetools\Base\JsonObjectModel
;
22
use
Commercetools\Base\MapperFactory
;
23
use stdClass;
24
28
final
class
CartAddShippingMethodActionBuilder
implements
Builder
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
78
public
function
getShippingKey
()
79
{
80
return
$this->shippingKey;
81
}
82
90
public
function
getShippingMethod
()
91
{
92
return
$this->shippingMethod instanceof
ShippingMethodResourceIdentifierBuilder
? $this->shippingMethod->
build
() : $this->shippingMethod;
93
}
94
101
public
function
getShippingAddress
()
102
{
103
return
$this->shippingAddress instanceof
BaseAddressBuilder
? $this->shippingAddress->
build
() : $this->shippingAddress;
104
}
105
118
public
function
getShippingRateInput
()
119
{
120
return
$this->shippingRateInput instanceof
ShippingRateInputDraftBuilder
? $this->shippingRateInput->
build
() : $this->shippingRateInput;
121
}
122
129
public
function
getExternalTaxRate
()
130
{
131
return
$this->externalTaxRate instanceof
ExternalTaxRateDraftBuilder
? $this->externalTaxRate->
build
() : $this->externalTaxRate;
132
}
133
140
public
function
getDeliveries
()
141
{
142
return
$this->deliveries;
143
}
144
151
public
function
getCustom
()
152
{
153
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
154
}
155
160
public
function
withShippingKey
(?
string
$shippingKey)
161
{
162
$this->shippingKey = $shippingKey;
163
164
return
$this;
165
}
166
171
public
function
withShippingMethod
(?
ShippingMethodResourceIdentifier
$shippingMethod)
172
{
173
$this->shippingMethod = $shippingMethod;
174
175
return
$this;
176
}
177
182
public
function
withShippingAddress
(?
BaseAddress
$shippingAddress)
183
{
184
$this->shippingAddress = $shippingAddress;
185
186
return
$this;
187
}
188
193
public
function
withShippingRateInput
(?
ShippingRateInputDraft
$shippingRateInput)
194
{
195
$this->shippingRateInput = $shippingRateInput;
196
197
return
$this;
198
}
199
204
public
function
withExternalTaxRate
(?
ExternalTaxRateDraft
$externalTaxRate)
205
{
206
$this->externalTaxRate = $externalTaxRate;
207
208
return
$this;
209
}
210
215
public
function
withDeliveries
(?
DeliveryDraftCollection
$deliveries)
216
{
217
$this->deliveries = $deliveries;
218
219
return
$this;
220
}
221
226
public
function
withCustom
(?
CustomFieldsDraft
$custom)
227
{
228
$this->custom = $custom;
229
230
return
$this;
231
}
232
237
public
function
withShippingMethodBuilder
(?
ShippingMethodResourceIdentifierBuilder
$shippingMethod)
238
{
239
$this->shippingMethod = $shippingMethod;
240
241
return
$this;
242
}
243
248
public
function
withShippingAddressBuilder
(?
BaseAddressBuilder
$shippingAddress)
249
{
250
$this->shippingAddress = $shippingAddress;
251
252
return
$this;
253
}
254
259
public
function
withShippingRateInputBuilder
(?
ShippingRateInputDraftBuilder
$shippingRateInput)
260
{
261
$this->shippingRateInput = $shippingRateInput;
262
263
return
$this;
264
}
265
270
public
function
withExternalTaxRateBuilder
(?
ExternalTaxRateDraftBuilder
$externalTaxRate)
271
{
272
$this->externalTaxRate = $externalTaxRate;
273
274
return
$this;
275
}
276
281
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
282
{
283
$this->custom = $custom;
284
285
return
$this;
286
}
287
288
public
function
build
():
CartAddShippingMethodAction
289
{
290
return
new
CartAddShippingMethodActionModel
(
291
$this->shippingKey,
292
$this->shippingMethod instanceof
ShippingMethodResourceIdentifierBuilder
? $this->shippingMethod->
build
() : $this->shippingMethod,
293
$this->shippingAddress instanceof
BaseAddressBuilder
? $this->shippingAddress->
build
() : $this->shippingAddress,
294
$this->shippingRateInput instanceof
ShippingRateInputDraftBuilder
? $this->shippingRateInput->
build
() : $this->shippingRateInput,
295
$this->externalTaxRate instanceof
ExternalTaxRateDraftBuilder
? $this->externalTaxRate->
build
() : $this->externalTaxRate,
296
$this->deliveries,
297
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom
298
);
299
}
300
301
public
static
function
of
():
CartAddShippingMethodActionBuilder
302
{
303
return
new
self
();
304
}
305
}
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder
Definition
CartAddShippingMethodActionBuilder.php:29
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition
CartAddShippingMethodActionBuilder.php:281
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withShippingMethodBuilder
withShippingMethodBuilder(?ShippingMethodResourceIdentifierBuilder $shippingMethod)
Definition
CartAddShippingMethodActionBuilder.php:237
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withDeliveries
withDeliveries(?DeliveryDraftCollection $deliveries)
Definition
CartAddShippingMethodActionBuilder.php:215
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withShippingAddressBuilder
withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress)
Definition
CartAddShippingMethodActionBuilder.php:248
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition
CartAddShippingMethodActionBuilder.php:226
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\getCustom
getCustom()
Definition
CartAddShippingMethodActionBuilder.php:151
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\of
static of()
Definition
CartAddShippingMethodActionBuilder.php:301
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withExternalTaxRate
withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate)
Definition
CartAddShippingMethodActionBuilder.php:204
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withShippingMethod
withShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod)
Definition
CartAddShippingMethodActionBuilder.php:171
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\getShippingRateInput
getShippingRateInput()
Definition
CartAddShippingMethodActionBuilder.php:118
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withShippingKey
withShippingKey(?string $shippingKey)
Definition
CartAddShippingMethodActionBuilder.php:160
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\getExternalTaxRate
getExternalTaxRate()
Definition
CartAddShippingMethodActionBuilder.php:129
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withShippingRateInputBuilder
withShippingRateInputBuilder(?ShippingRateInputDraftBuilder $shippingRateInput)
Definition
CartAddShippingMethodActionBuilder.php:259
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\getShippingKey
getShippingKey()
Definition
CartAddShippingMethodActionBuilder.php:78
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withShippingRateInput
withShippingRateInput(?ShippingRateInputDraft $shippingRateInput)
Definition
CartAddShippingMethodActionBuilder.php:193
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withShippingAddress
withShippingAddress(?BaseAddress $shippingAddress)
Definition
CartAddShippingMethodActionBuilder.php:182
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\getShippingMethod
getShippingMethod()
Definition
CartAddShippingMethodActionBuilder.php:90
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\getShippingAddress
getShippingAddress()
Definition
CartAddShippingMethodActionBuilder.php:101
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\build
build()
Definition
CartAddShippingMethodActionBuilder.php:288
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\getDeliveries
getDeliveries()
Definition
CartAddShippingMethodActionBuilder.php:140
Commercetools\Api\Models\Cart\CartAddShippingMethodActionBuilder\withExternalTaxRateBuilder
withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate)
Definition
CartAddShippingMethodActionBuilder.php:270
Commercetools\Api\Models\Cart\CartAddShippingMethodActionModel
Definition
CartAddShippingMethodActionModel.php:28
Commercetools\Api\Models\Cart\ExternalTaxRateDraftBuilder
Definition
ExternalTaxRateDraftBuilder.php:23
Commercetools\Api\Models\Cart\ExternalTaxRateDraftBuilder\build
build()
Definition
ExternalTaxRateDraftBuilder.php:201
Commercetools\Api\Models\Cart\ShippingRateInputDraftBuilder
Definition
ShippingRateInputDraftBuilder.php:22
Commercetools\Api\Models\Cart\ShippingRateInputDraftBuilder\build
build()
Definition
ShippingRateInputDraftBuilder.php:23
Commercetools\Api\Models\Common\BaseAddressBuilder
Definition
BaseAddressBuilder.php:22
Commercetools\Api\Models\Common\BaseAddressBuilder\build
build()
Definition
BaseAddressBuilder.php:726
Commercetools\Api\Models\Order\DeliveryDraftCollection
Definition
DeliveryDraftCollection.php:22
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifierBuilder
Definition
ShippingMethodResourceIdentifierBuilder.php:24
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifierBuilder\build
build()
Definition
ShippingMethodResourceIdentifierBuilder.php:82
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
Definition
CustomFieldsDraftBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\build
build()
Definition
CustomFieldsDraftBuilder.php:101
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Cart\CartAddShippingMethodAction
Definition
CartAddShippingMethodAction.php:19
Commercetools\Api\Models\Cart\ExternalTaxRateDraft
Definition
ExternalTaxRateDraft.php:16
Commercetools\Api\Models\Cart\ShippingRateInputDraft
Definition
ShippingRateInputDraft.php:15
Commercetools\Api\Models\Common\BaseAddress
Definition
BaseAddress.php:15
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier
Definition
ShippingMethodResourceIdentifier.php:16
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition
CustomFieldsDraft.php:15
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition
Cart.php:9
Generated by
1.9.8