commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ExternalTaxRateDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
22 final class ExternalTaxRateDraftBuilder implements Builder
23 {
28  private $name;
29 
34  private $amount;
35 
40  private $country;
41 
46  private $state;
47 
52  private $subRates;
53 
58  private $includedInPrice;
59 
64  public function getName()
65  {
66  return $this->name;
67  }
68 
73  public function getAmount()
74  {
75  return $this->amount;
76  }
77 
82  public function getCountry()
83  {
84  return $this->country;
85  }
86 
91  public function getState()
92  {
93  return $this->state;
94  }
95 
100  public function getSubRates()
101  {
102  return $this->subRates;
103  }
104 
109  public function getIncludedInPrice()
110  {
111  return $this->includedInPrice;
112  }
113 
118  public function withName(?string $name)
119  {
120  $this->name = $name;
121 
122  return $this;
123  }
124 
129  public function withAmount(?float $amount)
130  {
131  $this->amount = $amount;
132 
133  return $this;
134  }
135 
140  public function withCountry(?string $country)
141  {
142  $this->country = $country;
143 
144  return $this;
145  }
146 
151  public function withState(?string $state)
152  {
153  $this->state = $state;
154 
155  return $this;
156  }
157 
162  public function withSubRates(?SubRateCollection $subRates)
163  {
164  $this->subRates = $subRates;
165 
166  return $this;
167  }
168 
173  public function withIncludedInPrice(?bool $includedInPrice)
174  {
175  $this->includedInPrice = $includedInPrice;
176 
177  return $this;
178  }
179 
180 
181  public function build(): ExternalTaxRateDraft
182  {
183  return new ExternalTaxRateDraftModel(
184  $this->name,
185  $this->amount,
186  $this->country,
187  $this->state,
188  $this->subRates,
189  $this->includedInPrice
190  );
191  }
192 
193  public static function of(): ExternalTaxRateDraftBuilder
194  {
195  return new self();
196  }
197 }