commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
QuoteRequestBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
52 use DateTimeImmutable;
53 use stdClass;
54 
58 final class QuoteRequestBuilder implements Builder
59 {
64  private $id;
65 
70  private $version;
71 
76  private $createdAt;
77 
82  private $lastModifiedAt;
83 
88  private $key;
89 
94  private $lastModifiedBy;
95 
100  private $createdBy;
101 
106  private $quoteRequestState;
107 
112  private $comment;
113 
118  private $customer;
119 
124  private $customerGroup;
125 
130  private $store;
131 
136  private $lineItems;
137 
142  private $customLineItems;
143 
148  private $totalPrice;
149 
154  private $taxedPrice;
155 
160  private $shippingAddress;
161 
166  private $billingAddress;
167 
172  private $inventoryMode;
173 
178  private $taxMode;
179 
184  private $taxRoundingMode;
185 
190  private $taxCalculationMode;
191 
196  private $country;
197 
202  private $shippingInfo;
203 
208  private $paymentInfo;
209 
214  private $shippingRateInput;
215 
220  private $itemShippingAddresses;
221 
226  private $directDiscounts;
227 
232  private $custom;
233 
238  private $state;
239 
244  private $purchaseOrderNumber;
245 
250  private $cart;
251 
256  private $businessUnit;
257 
264  public function getId()
265  {
266  return $this->id;
267  }
268 
275  public function getVersion()
276  {
277  return $this->version;
278  }
279 
286  public function getCreatedAt()
287  {
288  return $this->createdAt;
289  }
290 
297  public function getLastModifiedAt()
298  {
299  return $this->lastModifiedAt;
300  }
301 
308  public function getKey()
309  {
310  return $this->key;
311  }
312 
319  public function getLastModifiedBy()
320  {
321  return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
322  }
323 
330  public function getCreatedBy()
331  {
332  return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
333  }
334 
341  public function getQuoteRequestState()
342  {
343  return $this->quoteRequestState;
344  }
345 
352  public function getComment()
353  {
354  return $this->comment;
355  }
356 
363  public function getCustomer()
364  {
365  return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;
366  }
367 
376  public function getCustomerGroup()
377  {
378  return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
379  }
380 
387  public function getStore()
388  {
389  return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store;
390  }
391 
398  public function getLineItems()
399  {
400  return $this->lineItems;
401  }
402 
409  public function getCustomLineItems()
410  {
411  return $this->customLineItems;
412  }
413 
421  public function getTotalPrice()
422  {
423  return $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice;
424  }
425 
434  public function getTaxedPrice()
435  {
436  return $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice;
437  }
438 
446  public function getShippingAddress()
447  {
448  return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress;
449  }
450 
457  public function getBillingAddress()
458  {
459  return $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress;
460  }
461 
468  public function getInventoryMode()
469  {
470  return $this->inventoryMode;
471  }
472 
479  public function getTaxMode()
480  {
481  return $this->taxMode;
482  }
483 
490  public function getTaxRoundingMode()
491  {
492  return $this->taxRoundingMode;
493  }
494 
501  public function getTaxCalculationMode()
502  {
503  return $this->taxCalculationMode;
504  }
505 
512  public function getCountry()
513  {
514  return $this->country;
515  }
516 
523  public function getShippingInfo()
524  {
525  return $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo;
526  }
527 
534  public function getPaymentInfo()
535  {
536  return $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo;
537  }
538 
545  public function getShippingRateInput()
546  {
547  return $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput;
548  }
549 
559  public function getItemShippingAddresses()
560  {
561  return $this->itemShippingAddresses;
562  }
563 
570  public function getDirectDiscounts()
571  {
572  return $this->directDiscounts;
573  }
574 
581  public function getCustom()
582  {
583  return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
584  }
585 
593  public function getState()
594  {
595  return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
596  }
597 
605  public function getPurchaseOrderNumber()
606  {
607  return $this->purchaseOrderNumber;
608  }
609 
616  public function getCart()
617  {
618  return $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart;
619  }
620 
627  public function getBusinessUnit()
628  {
629  return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit;
630  }
631 
636  public function withId(?string $id)
637  {
638  $this->id = $id;
639 
640  return $this;
641  }
642 
647  public function withVersion(?int $version)
648  {
649  $this->version = $version;
650 
651  return $this;
652  }
653 
658  public function withCreatedAt(?DateTimeImmutable $createdAt)
659  {
660  $this->createdAt = $createdAt;
661 
662  return $this;
663  }
664 
669  public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
670  {
671  $this->lastModifiedAt = $lastModifiedAt;
672 
673  return $this;
674  }
675 
680  public function withKey(?string $key)
681  {
682  $this->key = $key;
683 
684  return $this;
685  }
686 
691  public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
692  {
693  $this->lastModifiedBy = $lastModifiedBy;
694 
695  return $this;
696  }
697 
702  public function withCreatedBy(?CreatedBy $createdBy)
703  {
704  $this->createdBy = $createdBy;
705 
706  return $this;
707  }
708 
713  public function withQuoteRequestState(?string $quoteRequestState)
714  {
715  $this->quoteRequestState = $quoteRequestState;
716 
717  return $this;
718  }
719 
724  public function withComment(?string $comment)
725  {
726  $this->comment = $comment;
727 
728  return $this;
729  }
730 
735  public function withCustomer(?CustomerReference $customer)
736  {
737  $this->customer = $customer;
738 
739  return $this;
740  }
741 
746  public function withCustomerGroup(?CustomerGroupReference $customerGroup)
747  {
748  $this->customerGroup = $customerGroup;
749 
750  return $this;
751  }
752 
757  public function withStore(?StoreKeyReference $store)
758  {
759  $this->store = $store;
760 
761  return $this;
762  }
763 
768  public function withLineItems(?LineItemCollection $lineItems)
769  {
770  $this->lineItems = $lineItems;
771 
772  return $this;
773  }
774 
779  public function withCustomLineItems(?CustomLineItemCollection $customLineItems)
780  {
781  $this->customLineItems = $customLineItems;
782 
783  return $this;
784  }
785 
790  public function withTotalPrice(?TypedMoney $totalPrice)
791  {
792  $this->totalPrice = $totalPrice;
793 
794  return $this;
795  }
796 
801  public function withTaxedPrice(?TaxedPrice $taxedPrice)
802  {
803  $this->taxedPrice = $taxedPrice;
804 
805  return $this;
806  }
807 
812  public function withShippingAddress(?Address $shippingAddress)
813  {
814  $this->shippingAddress = $shippingAddress;
815 
816  return $this;
817  }
818 
823  public function withBillingAddress(?Address $billingAddress)
824  {
825  $this->billingAddress = $billingAddress;
826 
827  return $this;
828  }
829 
834  public function withInventoryMode(?string $inventoryMode)
835  {
836  $this->inventoryMode = $inventoryMode;
837 
838  return $this;
839  }
840 
845  public function withTaxMode(?string $taxMode)
846  {
847  $this->taxMode = $taxMode;
848 
849  return $this;
850  }
851 
856  public function withTaxRoundingMode(?string $taxRoundingMode)
857  {
858  $this->taxRoundingMode = $taxRoundingMode;
859 
860  return $this;
861  }
862 
867  public function withTaxCalculationMode(?string $taxCalculationMode)
868  {
869  $this->taxCalculationMode = $taxCalculationMode;
870 
871  return $this;
872  }
873 
878  public function withCountry(?string $country)
879  {
880  $this->country = $country;
881 
882  return $this;
883  }
884 
889  public function withShippingInfo(?ShippingInfo $shippingInfo)
890  {
891  $this->shippingInfo = $shippingInfo;
892 
893  return $this;
894  }
895 
900  public function withPaymentInfo(?PaymentInfo $paymentInfo)
901  {
902  $this->paymentInfo = $paymentInfo;
903 
904  return $this;
905  }
906 
911  public function withShippingRateInput(?ShippingRateInput $shippingRateInput)
912  {
913  $this->shippingRateInput = $shippingRateInput;
914 
915  return $this;
916  }
917 
922  public function withItemShippingAddresses(?AddressCollection $itemShippingAddresses)
923  {
924  $this->itemShippingAddresses = $itemShippingAddresses;
925 
926  return $this;
927  }
928 
933  public function withDirectDiscounts(?DirectDiscountCollection $directDiscounts)
934  {
935  $this->directDiscounts = $directDiscounts;
936 
937  return $this;
938  }
939 
944  public function withCustom(?CustomFields $custom)
945  {
946  $this->custom = $custom;
947 
948  return $this;
949  }
950 
955  public function withState(?StateReference $state)
956  {
957  $this->state = $state;
958 
959  return $this;
960  }
961 
966  public function withPurchaseOrderNumber(?string $purchaseOrderNumber)
967  {
968  $this->purchaseOrderNumber = $purchaseOrderNumber;
969 
970  return $this;
971  }
972 
977  public function withCart(?CartReference $cart)
978  {
979  $this->cart = $cart;
980 
981  return $this;
982  }
983 
988  public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit)
989  {
990  $this->businessUnit = $businessUnit;
991 
992  return $this;
993  }
994 
999  public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
1000  {
1001  $this->lastModifiedBy = $lastModifiedBy;
1002 
1003  return $this;
1004  }
1005 
1010  public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
1011  {
1012  $this->createdBy = $createdBy;
1013 
1014  return $this;
1015  }
1016 
1021  public function withCustomerBuilder(?CustomerReferenceBuilder $customer)
1022  {
1023  $this->customer = $customer;
1024 
1025  return $this;
1026  }
1027 
1033  {
1034  $this->customerGroup = $customerGroup;
1035 
1036  return $this;
1037  }
1038 
1044  {
1045  $this->store = $store;
1046 
1047  return $this;
1048  }
1049 
1054  public function withTotalPriceBuilder(?TypedMoneyBuilder $totalPrice)
1055  {
1056  $this->totalPrice = $totalPrice;
1057 
1058  return $this;
1059  }
1060 
1065  public function withTaxedPriceBuilder(?TaxedPriceBuilder $taxedPrice)
1066  {
1067  $this->taxedPrice = $taxedPrice;
1068 
1069  return $this;
1070  }
1071 
1076  public function withShippingAddressBuilder(?AddressBuilder $shippingAddress)
1077  {
1078  $this->shippingAddress = $shippingAddress;
1079 
1080  return $this;
1081  }
1082 
1087  public function withBillingAddressBuilder(?AddressBuilder $billingAddress)
1088  {
1089  $this->billingAddress = $billingAddress;
1090 
1091  return $this;
1092  }
1093 
1098  public function withShippingInfoBuilder(?ShippingInfoBuilder $shippingInfo)
1099  {
1100  $this->shippingInfo = $shippingInfo;
1101 
1102  return $this;
1103  }
1104 
1109  public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo)
1110  {
1111  $this->paymentInfo = $paymentInfo;
1112 
1113  return $this;
1114  }
1115 
1120  public function withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput)
1121  {
1122  $this->shippingRateInput = $shippingRateInput;
1123 
1124  return $this;
1125  }
1126 
1131  public function withCustomBuilder(?CustomFieldsBuilder $custom)
1132  {
1133  $this->custom = $custom;
1134 
1135  return $this;
1136  }
1137 
1142  public function withStateBuilder(?StateReferenceBuilder $state)
1143  {
1144  $this->state = $state;
1145 
1146  return $this;
1147  }
1148 
1153  public function withCartBuilder(?CartReferenceBuilder $cart)
1154  {
1155  $this->cart = $cart;
1156 
1157  return $this;
1158  }
1159 
1165  {
1166  $this->businessUnit = $businessUnit;
1167 
1168  return $this;
1169  }
1170 
1171  public function build(): QuoteRequest
1172  {
1173  return new QuoteRequestModel(
1174  $this->id,
1175  $this->version,
1176  $this->createdAt,
1177  $this->lastModifiedAt,
1178  $this->key,
1179  $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
1180  $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
1181  $this->quoteRequestState,
1182  $this->comment,
1183  $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer,
1184  $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
1185  $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store,
1186  $this->lineItems,
1187  $this->customLineItems,
1188  $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice,
1189  $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice,
1190  $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress,
1191  $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress,
1192  $this->inventoryMode,
1193  $this->taxMode,
1194  $this->taxRoundingMode,
1195  $this->taxCalculationMode,
1196  $this->country,
1197  $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo,
1198  $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo,
1199  $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput,
1200  $this->itemShippingAddresses,
1201  $this->directDiscounts,
1202  $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
1203  $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
1204  $this->purchaseOrderNumber,
1205  $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart,
1206  $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit
1207  );
1208  }
1209 
1210  public static function of(): QuoteRequestBuilder
1211  {
1212  return new self();
1213  }
1214 }
withBusinessUnit(?BusinessUnitKeyReference $businessUnit)
withShippingRateInput(?ShippingRateInput $shippingRateInput)
withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withCustomerGroup(?CustomerGroupReference $customerGroup)
withDirectDiscounts(?DirectDiscountCollection $directDiscounts)
withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit)
withItemShippingAddresses(?AddressCollection $itemShippingAddresses)
withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput)
withCustomLineItems(?CustomLineItemCollection $customLineItems)