commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ShippingMethodDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
23use stdClass;
24
28final class ShippingMethodDraftBuilder implements Builder
29{
34 private $key;
35
40 private $name;
41
46 private $localizedName;
47
52 private $description;
53
58 private $localizedDescription;
59
64 private $taxCategory;
65
70 private $zoneRates;
71
76 private $active;
77
82 private $isDefault;
83
88 private $predicate;
89
94 private $custom;
95
100 private $stores;
101
106 private $carrier;
107
114 public function getKey()
115 {
116 return $this->key;
117 }
118
125 public function getName()
126 {
127 return $this->name;
128 }
129
136 public function getLocalizedName()
137 {
138 return $this->localizedName instanceof LocalizedStringBuilder ? $this->localizedName->build() : $this->localizedName;
139 }
140
147 public function getDescription()
148 {
149 return $this->description;
150 }
151
158 public function getLocalizedDescription()
159 {
160 return $this->localizedDescription instanceof LocalizedStringBuilder ? $this->localizedDescription->build() : $this->localizedDescription;
161 }
162
169 public function getTaxCategory()
170 {
171 return $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory;
172 }
173
180 public function getZoneRates()
181 {
182 return $this->zoneRates;
183 }
184
191 public function getActive()
192 {
193 return $this->active;
194 }
195
202 public function getIsDefault()
203 {
204 return $this->isDefault;
205 }
206
213 public function getPredicate()
214 {
215 return $this->predicate;
216 }
217
224 public function getCustom()
225 {
226 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
227 }
228
239 public function getStores()
240 {
241 return $this->stores;
242 }
243
250 public function getCarrier()
251 {
252 return $this->carrier;
253 }
254
259 public function withKey(?string $key)
260 {
261 $this->key = $key;
262
263 return $this;
264 }
265
270 public function withName(?string $name)
271 {
272 $this->name = $name;
273
274 return $this;
275 }
276
281 public function withLocalizedName(?LocalizedString $localizedName)
282 {
283 $this->localizedName = $localizedName;
284
285 return $this;
286 }
287
292 public function withDescription(?string $description)
293 {
294 $this->description = $description;
295
296 return $this;
297 }
298
303 public function withLocalizedDescription(?LocalizedString $localizedDescription)
304 {
305 $this->localizedDescription = $localizedDescription;
306
307 return $this;
308 }
309
314 public function withTaxCategory(?TaxCategoryResourceIdentifier $taxCategory)
315 {
316 $this->taxCategory = $taxCategory;
317
318 return $this;
319 }
320
325 public function withZoneRates(?ZoneRateDraftCollection $zoneRates)
326 {
327 $this->zoneRates = $zoneRates;
328
329 return $this;
330 }
331
336 public function withActive(?bool $active)
337 {
338 $this->active = $active;
339
340 return $this;
341 }
342
347 public function withIsDefault(?bool $isDefault)
348 {
349 $this->isDefault = $isDefault;
350
351 return $this;
352 }
353
358 public function withPredicate(?string $predicate)
359 {
360 $this->predicate = $predicate;
361
362 return $this;
363 }
364
369 public function withCustom(?CustomFieldsDraft $custom)
370 {
371 $this->custom = $custom;
372
373 return $this;
374 }
375
381 {
382 $this->stores = $stores;
383
384 return $this;
385 }
386
391 public function withCarrier(?string $carrier)
392 {
393 $this->carrier = $carrier;
394
395 return $this;
396 }
397
402 public function withLocalizedNameBuilder(?LocalizedStringBuilder $localizedName)
403 {
404 $this->localizedName = $localizedName;
405
406 return $this;
407 }
408
413 public function withLocalizedDescriptionBuilder(?LocalizedStringBuilder $localizedDescription)
414 {
415 $this->localizedDescription = $localizedDescription;
416
417 return $this;
418 }
419
425 {
426 $this->taxCategory = $taxCategory;
427
428 return $this;
429 }
430
436 {
437 $this->custom = $custom;
438
439 return $this;
440 }
441
442 public function build(): ShippingMethodDraft
443 {
444 return new ShippingMethodDraftModel(
445 $this->key,
446 $this->name,
447 $this->localizedName instanceof LocalizedStringBuilder ? $this->localizedName->build() : $this->localizedName,
448 $this->description,
449 $this->localizedDescription instanceof LocalizedStringBuilder ? $this->localizedDescription->build() : $this->localizedDescription,
450 $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory,
451 $this->zoneRates,
452 $this->active,
453 $this->isDefault,
454 $this->predicate,
455 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
456 $this->stores,
457 $this->carrier
458 );
459 }
460
461 public static function of(): ShippingMethodDraftBuilder
462 {
463 return new self();
464 }
465}
withLocalizedDescriptionBuilder(?LocalizedStringBuilder $localizedDescription)
withTaxCategoryBuilder(?TaxCategoryResourceIdentifierBuilder $taxCategory)