commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
QuoteRequestBuilder.php
1<?php
2
3declare(strict_types=1);
10
52use DateTimeImmutable;
53use stdClass;
54
58final 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 $priceRoundingMode;
185
190 private $taxRoundingMode;
191
196 private $taxCalculationMode;
197
202 private $country;
203
208 private $shippingInfo;
209
214 private $paymentInfo;
215
220 private $shippingRateInput;
221
226 private $itemShippingAddresses;
227
232 private $directDiscounts;
233
238 private $directDiscountsIgnoreCartDiscounts;
239
244 private $custom;
245
250 private $state;
251
256 private $purchaseOrderNumber;
257
262 private $cart;
263
268 private $businessUnit;
269
276 public function getId()
277 {
278 return $this->id;
279 }
280
287 public function getVersion()
288 {
289 return $this->version;
290 }
291
298 public function getCreatedAt()
299 {
300 return $this->createdAt;
301 }
302
309 public function getLastModifiedAt()
310 {
311 return $this->lastModifiedAt;
312 }
313
320 public function getKey()
321 {
322 return $this->key;
323 }
324
331 public function getLastModifiedBy()
332 {
333 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
334 }
335
342 public function getCreatedBy()
343 {
344 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
345 }
346
353 public function getQuoteRequestState()
354 {
355 return $this->quoteRequestState;
356 }
357
364 public function getComment()
365 {
366 return $this->comment;
367 }
368
375 public function getCustomer()
376 {
377 return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;
378 }
379
388 public function getCustomerGroup()
389 {
390 return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
391 }
392
399 public function getStore()
400 {
401 return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store;
402 }
403
410 public function getLineItems()
411 {
412 return $this->lineItems;
413 }
414
421 public function getCustomLineItems()
422 {
423 return $this->customLineItems;
424 }
425
433 public function getTotalPrice()
434 {
435 return $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice;
436 }
437
446 public function getTaxedPrice()
447 {
448 return $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice;
449 }
450
458 public function getShippingAddress()
459 {
460 return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress;
461 }
462
469 public function getBillingAddress()
470 {
471 return $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress;
472 }
473
480 public function getInventoryMode()
481 {
482 return $this->inventoryMode;
483 }
484
491 public function getTaxMode()
492 {
493 return $this->taxMode;
494 }
495
502 public function getPriceRoundingMode()
503 {
504 return $this->priceRoundingMode;
505 }
506
513 public function getTaxRoundingMode()
514 {
515 return $this->taxRoundingMode;
516 }
517
524 public function getTaxCalculationMode()
525 {
526 return $this->taxCalculationMode;
527 }
528
535 public function getCountry()
536 {
537 return $this->country;
538 }
539
546 public function getShippingInfo()
547 {
548 return $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo;
549 }
550
557 public function getPaymentInfo()
558 {
559 return $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo;
560 }
561
568 public function getShippingRateInput()
569 {
570 return $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput;
571 }
572
582 public function getItemShippingAddresses()
583 {
584 return $this->itemShippingAddresses;
585 }
586
593 public function getDirectDiscounts()
594 {
595 return $this->directDiscounts;
596 }
597
608 {
609 return $this->directDiscountsIgnoreCartDiscounts;
610 }
611
618 public function getCustom()
619 {
620 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
621 }
622
630 public function getState()
631 {
632 return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
633 }
634
642 public function getPurchaseOrderNumber()
643 {
644 return $this->purchaseOrderNumber;
645 }
646
653 public function getCart()
654 {
655 return $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart;
656 }
657
664 public function getBusinessUnit()
665 {
666 return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit;
667 }
668
673 public function withId(?string $id)
674 {
675 $this->id = $id;
676
677 return $this;
678 }
679
684 public function withVersion(?int $version)
685 {
686 $this->version = $version;
687
688 return $this;
689 }
690
695 public function withCreatedAt(?DateTimeImmutable $createdAt)
696 {
697 $this->createdAt = $createdAt;
698
699 return $this;
700 }
701
706 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
707 {
708 $this->lastModifiedAt = $lastModifiedAt;
709
710 return $this;
711 }
712
717 public function withKey(?string $key)
718 {
719 $this->key = $key;
720
721 return $this;
722 }
723
728 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
729 {
730 $this->lastModifiedBy = $lastModifiedBy;
731
732 return $this;
733 }
734
739 public function withCreatedBy(?CreatedBy $createdBy)
740 {
741 $this->createdBy = $createdBy;
742
743 return $this;
744 }
745
750 public function withQuoteRequestState(?string $quoteRequestState)
751 {
752 $this->quoteRequestState = $quoteRequestState;
753
754 return $this;
755 }
756
761 public function withComment(?string $comment)
762 {
763 $this->comment = $comment;
764
765 return $this;
766 }
767
772 public function withCustomer(?CustomerReference $customer)
773 {
774 $this->customer = $customer;
775
776 return $this;
777 }
778
783 public function withCustomerGroup(?CustomerGroupReference $customerGroup)
784 {
785 $this->customerGroup = $customerGroup;
786
787 return $this;
788 }
789
794 public function withStore(?StoreKeyReference $store)
795 {
796 $this->store = $store;
797
798 return $this;
799 }
800
805 public function withLineItems(?LineItemCollection $lineItems)
806 {
807 $this->lineItems = $lineItems;
808
809 return $this;
810 }
811
816 public function withCustomLineItems(?CustomLineItemCollection $customLineItems)
817 {
818 $this->customLineItems = $customLineItems;
819
820 return $this;
821 }
822
827 public function withTotalPrice(?TypedMoney $totalPrice)
828 {
829 $this->totalPrice = $totalPrice;
830
831 return $this;
832 }
833
838 public function withTaxedPrice(?TaxedPrice $taxedPrice)
839 {
840 $this->taxedPrice = $taxedPrice;
841
842 return $this;
843 }
844
849 public function withShippingAddress(?Address $shippingAddress)
850 {
851 $this->shippingAddress = $shippingAddress;
852
853 return $this;
854 }
855
860 public function withBillingAddress(?Address $billingAddress)
861 {
862 $this->billingAddress = $billingAddress;
863
864 return $this;
865 }
866
871 public function withInventoryMode(?string $inventoryMode)
872 {
873 $this->inventoryMode = $inventoryMode;
874
875 return $this;
876 }
877
882 public function withTaxMode(?string $taxMode)
883 {
884 $this->taxMode = $taxMode;
885
886 return $this;
887 }
888
893 public function withPriceRoundingMode(?string $priceRoundingMode)
894 {
895 $this->priceRoundingMode = $priceRoundingMode;
896
897 return $this;
898 }
899
904 public function withTaxRoundingMode(?string $taxRoundingMode)
905 {
906 $this->taxRoundingMode = $taxRoundingMode;
907
908 return $this;
909 }
910
915 public function withTaxCalculationMode(?string $taxCalculationMode)
916 {
917 $this->taxCalculationMode = $taxCalculationMode;
918
919 return $this;
920 }
921
926 public function withCountry(?string $country)
927 {
928 $this->country = $country;
929
930 return $this;
931 }
932
937 public function withShippingInfo(?ShippingInfo $shippingInfo)
938 {
939 $this->shippingInfo = $shippingInfo;
940
941 return $this;
942 }
943
948 public function withPaymentInfo(?PaymentInfo $paymentInfo)
949 {
950 $this->paymentInfo = $paymentInfo;
951
952 return $this;
953 }
954
959 public function withShippingRateInput(?ShippingRateInput $shippingRateInput)
960 {
961 $this->shippingRateInput = $shippingRateInput;
962
963 return $this;
964 }
965
970 public function withItemShippingAddresses(?AddressCollection $itemShippingAddresses)
971 {
972 $this->itemShippingAddresses = $itemShippingAddresses;
973
974 return $this;
975 }
976
981 public function withDirectDiscounts(?DirectDiscountCollection $directDiscounts)
982 {
983 $this->directDiscounts = $directDiscounts;
984
985 return $this;
986 }
987
992 public function withDirectDiscountsIgnoreCartDiscounts(?bool $directDiscountsIgnoreCartDiscounts)
993 {
994 $this->directDiscountsIgnoreCartDiscounts = $directDiscountsIgnoreCartDiscounts;
995
996 return $this;
997 }
998
1003 public function withCustom(?CustomFields $custom)
1004 {
1005 $this->custom = $custom;
1006
1007 return $this;
1008 }
1009
1014 public function withState(?StateReference $state)
1015 {
1016 $this->state = $state;
1017
1018 return $this;
1019 }
1020
1025 public function withPurchaseOrderNumber(?string $purchaseOrderNumber)
1026 {
1027 $this->purchaseOrderNumber = $purchaseOrderNumber;
1028
1029 return $this;
1030 }
1031
1036 public function withCart(?CartReference $cart)
1037 {
1038 $this->cart = $cart;
1039
1040 return $this;
1041 }
1042
1047 public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit)
1048 {
1049 $this->businessUnit = $businessUnit;
1050
1051 return $this;
1052 }
1053
1058 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
1059 {
1060 $this->lastModifiedBy = $lastModifiedBy;
1061
1062 return $this;
1063 }
1064
1069 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
1070 {
1071 $this->createdBy = $createdBy;
1072
1073 return $this;
1074 }
1075
1081 {
1082 $this->customer = $customer;
1083
1084 return $this;
1085 }
1086
1092 {
1093 $this->customerGroup = $customerGroup;
1094
1095 return $this;
1096 }
1097
1103 {
1104 $this->store = $store;
1105
1106 return $this;
1107 }
1108
1113 public function withTotalPriceBuilder(?TypedMoneyBuilder $totalPrice)
1114 {
1115 $this->totalPrice = $totalPrice;
1116
1117 return $this;
1118 }
1119
1124 public function withTaxedPriceBuilder(?TaxedPriceBuilder $taxedPrice)
1125 {
1126 $this->taxedPrice = $taxedPrice;
1127
1128 return $this;
1129 }
1130
1135 public function withShippingAddressBuilder(?AddressBuilder $shippingAddress)
1136 {
1137 $this->shippingAddress = $shippingAddress;
1138
1139 return $this;
1140 }
1141
1146 public function withBillingAddressBuilder(?AddressBuilder $billingAddress)
1147 {
1148 $this->billingAddress = $billingAddress;
1149
1150 return $this;
1151 }
1152
1157 public function withShippingInfoBuilder(?ShippingInfoBuilder $shippingInfo)
1158 {
1159 $this->shippingInfo = $shippingInfo;
1160
1161 return $this;
1162 }
1163
1168 public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo)
1169 {
1170 $this->paymentInfo = $paymentInfo;
1171
1172 return $this;
1173 }
1174
1179 public function withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput)
1180 {
1181 $this->shippingRateInput = $shippingRateInput;
1182
1183 return $this;
1184 }
1185
1190 public function withCustomBuilder(?CustomFieldsBuilder $custom)
1191 {
1192 $this->custom = $custom;
1193
1194 return $this;
1195 }
1196
1202 {
1203 $this->state = $state;
1204
1205 return $this;
1206 }
1207
1213 {
1214 $this->cart = $cart;
1215
1216 return $this;
1217 }
1218
1224 {
1225 $this->businessUnit = $businessUnit;
1226
1227 return $this;
1228 }
1229
1230 public function build(): QuoteRequest
1231 {
1232 return new QuoteRequestModel(
1233 $this->id,
1234 $this->version,
1235 $this->createdAt,
1236 $this->lastModifiedAt,
1237 $this->key,
1238 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
1239 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
1240 $this->quoteRequestState,
1241 $this->comment,
1242 $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer,
1243 $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
1244 $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store,
1245 $this->lineItems,
1246 $this->customLineItems,
1247 $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice,
1248 $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice,
1249 $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress,
1250 $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress,
1251 $this->inventoryMode,
1252 $this->taxMode,
1253 $this->priceRoundingMode,
1254 $this->taxRoundingMode,
1255 $this->taxCalculationMode,
1256 $this->country,
1257 $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo,
1258 $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo,
1259 $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput,
1260 $this->itemShippingAddresses,
1261 $this->directDiscounts,
1262 $this->directDiscountsIgnoreCartDiscounts,
1263 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
1264 $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
1265 $this->purchaseOrderNumber,
1266 $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart,
1267 $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit
1268 );
1269 }
1270
1271 public static function of(): QuoteRequestBuilder
1272 {
1273 return new self();
1274 }
1275}
withBusinessUnit(?BusinessUnitKeyReference $businessUnit)
withShippingRateInput(?ShippingRateInput $shippingRateInput)
withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup)
withDirectDiscountsIgnoreCartDiscounts(?bool $directDiscountsIgnoreCartDiscounts)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withCustomerGroup(?CustomerGroupReference $customerGroup)
withDirectDiscounts(?DirectDiscountCollection $directDiscounts)
withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit)
withItemShippingAddresses(?AddressCollection $itemShippingAddresses)
withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput)
withCustomLineItems(?CustomLineItemCollection $customLineItems)