commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ProjectBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use DateTimeImmutable;
19 use stdClass;
20 
24 final class ProjectBuilder implements Builder
25 {
30  private $version;
31 
36  private $key;
37 
42  private $name;
43 
48  private $countries;
49 
54  private $currencies;
55 
60  private $languages;
61 
66  private $createdAt;
67 
72  private $trialUntil;
73 
78  private $messages;
79 
84  private $carts;
85 
90  private $shoppingLists;
91 
96  private $shippingRateInputType;
97 
102  private $externalOAuth;
103 
108  private $searchIndexing;
109 
114  private $businessUnits;
115 
122  public function getVersion()
123  {
124  return $this->version;
125  }
126 
133  public function getKey()
134  {
135  return $this->key;
136  }
137 
144  public function getName()
145  {
146  return $this->name;
147  }
148 
155  public function getCountries()
156  {
157  return $this->countries;
158  }
159 
166  public function getCurrencies()
167  {
168  return $this->currencies;
169  }
170 
177  public function getLanguages()
178  {
179  return $this->languages;
180  }
181 
188  public function getCreatedAt()
189  {
190  return $this->createdAt;
191  }
192 
199  public function getTrialUntil()
200  {
201  return $this->trialUntil;
202  }
203 
210  public function getMessages()
211  {
212  return $this->messages instanceof MessagesConfigurationBuilder ? $this->messages->build() : $this->messages;
213  }
214 
221  public function getCarts()
222  {
223  return $this->carts instanceof CartsConfigurationBuilder ? $this->carts->build() : $this->carts;
224  }
225 
232  public function getShoppingLists()
233  {
234  return $this->shoppingLists instanceof ShoppingListsConfigurationBuilder ? $this->shoppingLists->build() : $this->shoppingLists;
235  }
236 
243  public function getShippingRateInputType()
244  {
245  return $this->shippingRateInputType instanceof ShippingRateInputTypeBuilder ? $this->shippingRateInputType->build() : $this->shippingRateInputType;
246  }
247 
254  public function getExternalOAuth()
255  {
256  return $this->externalOAuth instanceof ExternalOAuthBuilder ? $this->externalOAuth->build() : $this->externalOAuth;
257  }
258 
265  public function getSearchIndexing()
266  {
267  return $this->searchIndexing instanceof SearchIndexingConfigurationBuilder ? $this->searchIndexing->build() : $this->searchIndexing;
268  }
269 
276  public function getBusinessUnits()
277  {
278  return $this->businessUnits instanceof BusinessUnitConfigurationBuilder ? $this->businessUnits->build() : $this->businessUnits;
279  }
280 
285  public function withVersion(?int $version)
286  {
287  $this->version = $version;
288 
289  return $this;
290  }
291 
296  public function withKey(?string $key)
297  {
298  $this->key = $key;
299 
300  return $this;
301  }
302 
307  public function withName(?string $name)
308  {
309  $this->name = $name;
310 
311  return $this;
312  }
313 
318  public function withCountries(?array $countries)
319  {
320  $this->countries = $countries;
321 
322  return $this;
323  }
324 
329  public function withCurrencies(?array $currencies)
330  {
331  $this->currencies = $currencies;
332 
333  return $this;
334  }
335 
340  public function withLanguages(?array $languages)
341  {
342  $this->languages = $languages;
343 
344  return $this;
345  }
346 
351  public function withCreatedAt(?DateTimeImmutable $createdAt)
352  {
353  $this->createdAt = $createdAt;
354 
355  return $this;
356  }
357 
362  public function withTrialUntil(?string $trialUntil)
363  {
364  $this->trialUntil = $trialUntil;
365 
366  return $this;
367  }
368 
373  public function withMessages(?MessagesConfiguration $messages)
374  {
375  $this->messages = $messages;
376 
377  return $this;
378  }
379 
384  public function withCarts(?CartsConfiguration $carts)
385  {
386  $this->carts = $carts;
387 
388  return $this;
389  }
390 
395  public function withShoppingLists(?ShoppingListsConfiguration $shoppingLists)
396  {
397  $this->shoppingLists = $shoppingLists;
398 
399  return $this;
400  }
401 
406  public function withShippingRateInputType(?ShippingRateInputType $shippingRateInputType)
407  {
408  $this->shippingRateInputType = $shippingRateInputType;
409 
410  return $this;
411  }
412 
417  public function withExternalOAuth(?ExternalOAuth $externalOAuth)
418  {
419  $this->externalOAuth = $externalOAuth;
420 
421  return $this;
422  }
423 
428  public function withSearchIndexing(?SearchIndexingConfiguration $searchIndexing)
429  {
430  $this->searchIndexing = $searchIndexing;
431 
432  return $this;
433  }
434 
439  public function withBusinessUnits(?BusinessUnitConfiguration $businessUnits)
440  {
441  $this->businessUnits = $businessUnits;
442 
443  return $this;
444  }
445 
451  {
452  $this->messages = $messages;
453 
454  return $this;
455  }
456 
462  {
463  $this->carts = $carts;
464 
465  return $this;
466  }
467 
473  {
474  $this->shoppingLists = $shoppingLists;
475 
476  return $this;
477  }
478 
483  public function withShippingRateInputTypeBuilder(?ShippingRateInputTypeBuilder $shippingRateInputType)
484  {
485  $this->shippingRateInputType = $shippingRateInputType;
486 
487  return $this;
488  }
489 
494  public function withExternalOAuthBuilder(?ExternalOAuthBuilder $externalOAuth)
495  {
496  $this->externalOAuth = $externalOAuth;
497 
498  return $this;
499  }
500 
506  {
507  $this->searchIndexing = $searchIndexing;
508 
509  return $this;
510  }
511 
517  {
518  $this->businessUnits = $businessUnits;
519 
520  return $this;
521  }
522 
523  public function build(): Project
524  {
525  return new ProjectModel(
526  $this->version,
527  $this->key,
528  $this->name,
529  $this->countries,
530  $this->currencies,
531  $this->languages,
532  $this->createdAt,
533  $this->trialUntil,
534  $this->messages instanceof MessagesConfigurationBuilder ? $this->messages->build() : $this->messages,
535  $this->carts instanceof CartsConfigurationBuilder ? $this->carts->build() : $this->carts,
536  $this->shoppingLists instanceof ShoppingListsConfigurationBuilder ? $this->shoppingLists->build() : $this->shoppingLists,
537  $this->shippingRateInputType instanceof ShippingRateInputTypeBuilder ? $this->shippingRateInputType->build() : $this->shippingRateInputType,
538  $this->externalOAuth instanceof ExternalOAuthBuilder ? $this->externalOAuth->build() : $this->externalOAuth,
539  $this->searchIndexing instanceof SearchIndexingConfigurationBuilder ? $this->searchIndexing->build() : $this->searchIndexing,
540  $this->businessUnits instanceof BusinessUnitConfigurationBuilder ? $this->businessUnits->build() : $this->businessUnits
541  );
542  }
543 
544  public static function of(): ProjectBuilder
545  {
546  return new self();
547  }
548 }
withSearchIndexing(?SearchIndexingConfiguration $searchIndexing)
withBusinessUnits(?BusinessUnitConfiguration $businessUnits)
withShoppingLists(?ShoppingListsConfiguration $shoppingLists)
withExternalOAuthBuilder(?ExternalOAuthBuilder $externalOAuth)
withCartsBuilder(?CartsConfigurationBuilder $carts)
withSearchIndexingBuilder(?SearchIndexingConfigurationBuilder $searchIndexing)
withShippingRateInputType(?ShippingRateInputType $shippingRateInputType)
withCreatedAt(?DateTimeImmutable $createdAt)
withShippingRateInputTypeBuilder(?ShippingRateInputTypeBuilder $shippingRateInputType)
withShoppingListsBuilder(?ShoppingListsConfigurationBuilder $shoppingLists)
withMessagesBuilder(?MessagesConfigurationBuilder $messages)
withBusinessUnitsBuilder(?BusinessUnitConfigurationBuilder $businessUnits)
withMessages(?MessagesConfiguration $messages)
withExternalOAuth(?ExternalOAuth $externalOAuth)