commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CartSetShippingMethodActionBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
24 {
29  private $shippingMethod;
30 
35  private $externalTaxRate;
36 
45  public function getShippingMethod()
46  {
47  return $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod;
48  }
49 
56  public function getExternalTaxRate()
57  {
58  return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate;
59  }
60 
65  public function withShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod)
66  {
67  $this->shippingMethod = $shippingMethod;
68 
69  return $this;
70  }
71 
76  public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate)
77  {
78  $this->externalTaxRate = $externalTaxRate;
79 
80  return $this;
81  }
82 
88  {
89  $this->shippingMethod = $shippingMethod;
90 
91  return $this;
92  }
93 
98  public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate)
99  {
100  $this->externalTaxRate = $externalTaxRate;
101 
102  return $this;
103  }
104 
106  {
108  $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod,
109  $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate
110  );
111  }
112 
113  public static function of(): CartSetShippingMethodActionBuilder
114  {
115  return new self();
116  }
117 }
withShippingMethodBuilder(?ShippingMethodResourceIdentifierBuilder $shippingMethod)