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 $custom;
239
244 private $state;
245
250 private $purchaseOrderNumber;
251
256 private $cart;
257
262 private $businessUnit;
263
270 public function getId()
271 {
272 return $this->id;
273 }
274
281 public function getVersion()
282 {
283 return $this->version;
284 }
285
292 public function getCreatedAt()
293 {
294 return $this->createdAt;
295 }
296
303 public function getLastModifiedAt()
304 {
305 return $this->lastModifiedAt;
306 }
307
314 public function getKey()
315 {
316 return $this->key;
317 }
318
325 public function getLastModifiedBy()
326 {
327 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
328 }
329
336 public function getCreatedBy()
337 {
338 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
339 }
340
347 public function getQuoteRequestState()
348 {
349 return $this->quoteRequestState;
350 }
351
358 public function getComment()
359 {
360 return $this->comment;
361 }
362
369 public function getCustomer()
370 {
371 return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;
372 }
373
382 public function getCustomerGroup()
383 {
384 return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
385 }
386
393 public function getStore()
394 {
395 return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store;
396 }
397
404 public function getLineItems()
405 {
406 return $this->lineItems;
407 }
408
415 public function getCustomLineItems()
416 {
417 return $this->customLineItems;
418 }
419
427 public function getTotalPrice()
428 {
429 return $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice;
430 }
431
440 public function getTaxedPrice()
441 {
442 return $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice;
443 }
444
452 public function getShippingAddress()
453 {
454 return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress;
455 }
456
463 public function getBillingAddress()
464 {
465 return $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress;
466 }
467
474 public function getInventoryMode()
475 {
476 return $this->inventoryMode;
477 }
478
485 public function getTaxMode()
486 {
487 return $this->taxMode;
488 }
489
496 public function getPriceRoundingMode()
497 {
498 return $this->priceRoundingMode;
499 }
500
507 public function getTaxRoundingMode()
508 {
509 return $this->taxRoundingMode;
510 }
511
518 public function getTaxCalculationMode()
519 {
520 return $this->taxCalculationMode;
521 }
522
529 public function getCountry()
530 {
531 return $this->country;
532 }
533
540 public function getShippingInfo()
541 {
542 return $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo;
543 }
544
551 public function getPaymentInfo()
552 {
553 return $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo;
554 }
555
562 public function getShippingRateInput()
563 {
564 return $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput;
565 }
566
576 public function getItemShippingAddresses()
577 {
578 return $this->itemShippingAddresses;
579 }
580
587 public function getDirectDiscounts()
588 {
589 return $this->directDiscounts;
590 }
591
598 public function getCustom()
599 {
600 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
601 }
602
610 public function getState()
611 {
612 return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
613 }
614
622 public function getPurchaseOrderNumber()
623 {
624 return $this->purchaseOrderNumber;
625 }
626
633 public function getCart()
634 {
635 return $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart;
636 }
637
644 public function getBusinessUnit()
645 {
646 return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit;
647 }
648
653 public function withId(?string $id)
654 {
655 $this->id = $id;
656
657 return $this;
658 }
659
664 public function withVersion(?int $version)
665 {
666 $this->version = $version;
667
668 return $this;
669 }
670
675 public function withCreatedAt(?DateTimeImmutable $createdAt)
676 {
677 $this->createdAt = $createdAt;
678
679 return $this;
680 }
681
686 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
687 {
688 $this->lastModifiedAt = $lastModifiedAt;
689
690 return $this;
691 }
692
697 public function withKey(?string $key)
698 {
699 $this->key = $key;
700
701 return $this;
702 }
703
708 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
709 {
710 $this->lastModifiedBy = $lastModifiedBy;
711
712 return $this;
713 }
714
719 public function withCreatedBy(?CreatedBy $createdBy)
720 {
721 $this->createdBy = $createdBy;
722
723 return $this;
724 }
725
730 public function withQuoteRequestState(?string $quoteRequestState)
731 {
732 $this->quoteRequestState = $quoteRequestState;
733
734 return $this;
735 }
736
741 public function withComment(?string $comment)
742 {
743 $this->comment = $comment;
744
745 return $this;
746 }
747
752 public function withCustomer(?CustomerReference $customer)
753 {
754 $this->customer = $customer;
755
756 return $this;
757 }
758
763 public function withCustomerGroup(?CustomerGroupReference $customerGroup)
764 {
765 $this->customerGroup = $customerGroup;
766
767 return $this;
768 }
769
774 public function withStore(?StoreKeyReference $store)
775 {
776 $this->store = $store;
777
778 return $this;
779 }
780
785 public function withLineItems(?LineItemCollection $lineItems)
786 {
787 $this->lineItems = $lineItems;
788
789 return $this;
790 }
791
796 public function withCustomLineItems(?CustomLineItemCollection $customLineItems)
797 {
798 $this->customLineItems = $customLineItems;
799
800 return $this;
801 }
802
807 public function withTotalPrice(?TypedMoney $totalPrice)
808 {
809 $this->totalPrice = $totalPrice;
810
811 return $this;
812 }
813
818 public function withTaxedPrice(?TaxedPrice $taxedPrice)
819 {
820 $this->taxedPrice = $taxedPrice;
821
822 return $this;
823 }
824
829 public function withShippingAddress(?Address $shippingAddress)
830 {
831 $this->shippingAddress = $shippingAddress;
832
833 return $this;
834 }
835
840 public function withBillingAddress(?Address $billingAddress)
841 {
842 $this->billingAddress = $billingAddress;
843
844 return $this;
845 }
846
851 public function withInventoryMode(?string $inventoryMode)
852 {
853 $this->inventoryMode = $inventoryMode;
854
855 return $this;
856 }
857
862 public function withTaxMode(?string $taxMode)
863 {
864 $this->taxMode = $taxMode;
865
866 return $this;
867 }
868
873 public function withPriceRoundingMode(?string $priceRoundingMode)
874 {
875 $this->priceRoundingMode = $priceRoundingMode;
876
877 return $this;
878 }
879
884 public function withTaxRoundingMode(?string $taxRoundingMode)
885 {
886 $this->taxRoundingMode = $taxRoundingMode;
887
888 return $this;
889 }
890
895 public function withTaxCalculationMode(?string $taxCalculationMode)
896 {
897 $this->taxCalculationMode = $taxCalculationMode;
898
899 return $this;
900 }
901
906 public function withCountry(?string $country)
907 {
908 $this->country = $country;
909
910 return $this;
911 }
912
917 public function withShippingInfo(?ShippingInfo $shippingInfo)
918 {
919 $this->shippingInfo = $shippingInfo;
920
921 return $this;
922 }
923
928 public function withPaymentInfo(?PaymentInfo $paymentInfo)
929 {
930 $this->paymentInfo = $paymentInfo;
931
932 return $this;
933 }
934
939 public function withShippingRateInput(?ShippingRateInput $shippingRateInput)
940 {
941 $this->shippingRateInput = $shippingRateInput;
942
943 return $this;
944 }
945
950 public function withItemShippingAddresses(?AddressCollection $itemShippingAddresses)
951 {
952 $this->itemShippingAddresses = $itemShippingAddresses;
953
954 return $this;
955 }
956
961 public function withDirectDiscounts(?DirectDiscountCollection $directDiscounts)
962 {
963 $this->directDiscounts = $directDiscounts;
964
965 return $this;
966 }
967
972 public function withCustom(?CustomFields $custom)
973 {
974 $this->custom = $custom;
975
976 return $this;
977 }
978
983 public function withState(?StateReference $state)
984 {
985 $this->state = $state;
986
987 return $this;
988 }
989
994 public function withPurchaseOrderNumber(?string $purchaseOrderNumber)
995 {
996 $this->purchaseOrderNumber = $purchaseOrderNumber;
997
998 return $this;
999 }
1000
1005 public function withCart(?CartReference $cart)
1006 {
1007 $this->cart = $cart;
1008
1009 return $this;
1010 }
1011
1016 public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit)
1017 {
1018 $this->businessUnit = $businessUnit;
1019
1020 return $this;
1021 }
1022
1027 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
1028 {
1029 $this->lastModifiedBy = $lastModifiedBy;
1030
1031 return $this;
1032 }
1033
1038 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
1039 {
1040 $this->createdBy = $createdBy;
1041
1042 return $this;
1043 }
1044
1050 {
1051 $this->customer = $customer;
1052
1053 return $this;
1054 }
1055
1061 {
1062 $this->customerGroup = $customerGroup;
1063
1064 return $this;
1065 }
1066
1072 {
1073 $this->store = $store;
1074
1075 return $this;
1076 }
1077
1082 public function withTotalPriceBuilder(?TypedMoneyBuilder $totalPrice)
1083 {
1084 $this->totalPrice = $totalPrice;
1085
1086 return $this;
1087 }
1088
1093 public function withTaxedPriceBuilder(?TaxedPriceBuilder $taxedPrice)
1094 {
1095 $this->taxedPrice = $taxedPrice;
1096
1097 return $this;
1098 }
1099
1104 public function withShippingAddressBuilder(?AddressBuilder $shippingAddress)
1105 {
1106 $this->shippingAddress = $shippingAddress;
1107
1108 return $this;
1109 }
1110
1115 public function withBillingAddressBuilder(?AddressBuilder $billingAddress)
1116 {
1117 $this->billingAddress = $billingAddress;
1118
1119 return $this;
1120 }
1121
1126 public function withShippingInfoBuilder(?ShippingInfoBuilder $shippingInfo)
1127 {
1128 $this->shippingInfo = $shippingInfo;
1129
1130 return $this;
1131 }
1132
1137 public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo)
1138 {
1139 $this->paymentInfo = $paymentInfo;
1140
1141 return $this;
1142 }
1143
1148 public function withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput)
1149 {
1150 $this->shippingRateInput = $shippingRateInput;
1151
1152 return $this;
1153 }
1154
1159 public function withCustomBuilder(?CustomFieldsBuilder $custom)
1160 {
1161 $this->custom = $custom;
1162
1163 return $this;
1164 }
1165
1171 {
1172 $this->state = $state;
1173
1174 return $this;
1175 }
1176
1182 {
1183 $this->cart = $cart;
1184
1185 return $this;
1186 }
1187
1193 {
1194 $this->businessUnit = $businessUnit;
1195
1196 return $this;
1197 }
1198
1199 public function build(): QuoteRequest
1200 {
1201 return new QuoteRequestModel(
1202 $this->id,
1203 $this->version,
1204 $this->createdAt,
1205 $this->lastModifiedAt,
1206 $this->key,
1207 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
1208 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
1209 $this->quoteRequestState,
1210 $this->comment,
1211 $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer,
1212 $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
1213 $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store,
1214 $this->lineItems,
1215 $this->customLineItems,
1216 $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice,
1217 $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice,
1218 $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress,
1219 $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress,
1220 $this->inventoryMode,
1221 $this->taxMode,
1222 $this->priceRoundingMode,
1223 $this->taxRoundingMode,
1224 $this->taxCalculationMode,
1225 $this->country,
1226 $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo,
1227 $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo,
1228 $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput,
1229 $this->itemShippingAddresses,
1230 $this->directDiscounts,
1231 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
1232 $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
1233 $this->purchaseOrderNumber,
1234 $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart,
1235 $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit
1236 );
1237 }
1238
1239 public static function of(): QuoteRequestBuilder
1240 {
1241 return new self();
1242 }
1243}
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)