commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
TaxRateDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final class TaxRateDraftBuilder implements Builder
22 {
27  private $name;
28 
33  private $amount;
34 
39  private $includedInPrice;
40 
45  private $country;
46 
51  private $state;
52 
57  private $subRates;
58 
63  private $key;
64 
71  public function getName()
72  {
73  return $this->name;
74  }
75 
84  public function getAmount()
85  {
86  return $this->amount;
87  }
88 
95  public function getIncludedInPrice()
96  {
97  return $this->includedInPrice;
98  }
99 
106  public function getCountry()
107  {
108  return $this->country;
109  }
110 
117  public function getState()
118  {
119  return $this->state;
120  }
121 
129  public function getSubRates()
130  {
131  return $this->subRates;
132  }
133 
140  public function getKey()
141  {
142  return $this->key;
143  }
144 
149  public function withName(?string $name)
150  {
151  $this->name = $name;
152 
153  return $this;
154  }
155 
160  public function withAmount(?float $amount)
161  {
162  $this->amount = $amount;
163 
164  return $this;
165  }
166 
171  public function withIncludedInPrice(?bool $includedInPrice)
172  {
173  $this->includedInPrice = $includedInPrice;
174 
175  return $this;
176  }
177 
182  public function withCountry(?string $country)
183  {
184  $this->country = $country;
185 
186  return $this;
187  }
188 
193  public function withState(?string $state)
194  {
195  $this->state = $state;
196 
197  return $this;
198  }
199 
204  public function withSubRates(?SubRateCollection $subRates)
205  {
206  $this->subRates = $subRates;
207 
208  return $this;
209  }
210 
215  public function withKey(?string $key)
216  {
217  $this->key = $key;
218 
219  return $this;
220  }
221 
222 
223  public function build(): TaxRateDraft
224  {
225  return new TaxRateDraftModel(
226  $this->name,
227  $this->amount,
228  $this->includedInPrice,
229  $this->country,
230  $this->state,
231  $this->subRates,
232  $this->key
233  );
234  }
235 
236  public static function of(): TaxRateDraftBuilder
237  {
238  return new self();
239  }
240 }