diff --git a/changes.md b/changes.md
index e167bf004a2..d7c8bf8d89f 100644
--- a/changes.md
+++ b/changes.md
@@ -567,18 +567,32 @@
Added Type(s)
+- added type `AssociateRoleKeyReference`
+- added type `BusinessUnitKeyReference`
- added type `StrategyEnum`
- added type `RetentionPolicy`
- added type `TimeToLiveConfig`
- added type `TimeToLiveRetentionPolicy`
- added type `ProductSelectionImportRequest`
-- added type `AttributeLevel`
+- added type `BusinessUnitImportRequest`
+- added type `AssociateRoleInheritanceMode`
+- added type `BusinessUnitStatus`
+- added type `BusinessUnitAssociateMode`
+- added type `BusinessUnitApprovalRuleMode`
+- added type `BusinessUnitStoreMode`
+- added type `BusinessUnitType`
+- added type `AssociateRoleAssignmentDraft`
+- added type `AssociateDraft`
+- added type `BusinessUnitImport`
+- added type `CompanyBusinessUnitImport`
+- added type `DivisionBusinessUnitImport`
- added type `VariantSelectionType`
- added type `VariantSelection`
- added type `VariantExclusion`
- added type `ProductSelectionAssignment`
- added type `ProductSelectionMode`
- added type `ProductSelectionImport`
+- added type `AttributeLevel`
Changed Property(s)
-- :warning: changed property `country` of type `ExternalTaxRateDraft` from type `string` to `CountryCode`
- :warning: changed property `value` of type `MoneySetField` from type `Money[]` to `TypedMoney[]`
+- :warning: changed property `country` of type `ExternalTaxRateDraft` from type `string` to `CountryCode`
Added Property(s)
+- added property `/^[a-zA-Z]{2,3}(?:-[a-zA-Z]{4})?(?:-(?:[a-zA-Z]{2}|\d{3}))?$/` to type `LocalizedString`
- added property `retentionPolicy` to type `ImportContainer`
- added property `expiresAt` to type `ImportContainer`
- added property `retentionPolicy` to type `ImportContainerDraft`
+- added property `attributes` to type `ProductDraftImport`
- added property `/^[a-zA-Z]{2,3}(?:-[a-zA-Z]{4})?(?:-(?:[a-zA-Z]{2}|\d{3}))?$/` to type `SearchKeywords`
- added property `attributes` to type `ProductImport`
-- added property `attributes` to type `ProductDraftImport`
- added property `level` to type `AttributeDefinition`
-- added property `/^[a-zA-Z]{2,3}(?:-[a-zA-Z]{4})?(?:-(?:[a-zA-Z]{2}|\d{3}))?$/` to type `LocalizedString`
Added Enum(s)
+- added enum `business-unit` to type `ImportResourceType`
- added enum `product-selection` to type `ImportResourceType`
+- added enum `associate-role` to type `ReferenceType`
+- added enum `business-unit` to type `ReferenceType`
The roles to assign to the Associate.
+ * + + * @return null|AssociateRoleAssignmentDraftCollection + */ + public function getAssociateRoleAssignments(); + + /** + * @param ?CustomerKeyReference $customer + */ + public function setCustomer(?CustomerKeyReference $customer): void; + + /** + * @param ?AssociateRoleAssignmentDraftCollection $associateRoleAssignments + */ + public function setAssociateRoleAssignments(?AssociateRoleAssignmentDraftCollection $associateRoleAssignments): void; +} diff --git a/lib/commercetools-import/src/Models/BusinessUnits/AssociateDraftBuilder.php b/lib/commercetools-import/src/Models/BusinessUnits/AssociateDraftBuilder.php new file mode 100644 index 00000000000..d1046093ec9 --- /dev/null +++ b/lib/commercetools-import/src/Models/BusinessUnits/AssociateDraftBuilder.php @@ -0,0 +1,104 @@ + + */ +final class AssociateDraftBuilder implements Builder +{ + /** + + * @var null|CustomerKeyReference|CustomerKeyReferenceBuilder + */ + private $customer; + + /** + + * @var ?AssociateRoleAssignmentDraftCollection + */ + private $associateRoleAssignments; + + /** + *The Customer to be part of the Business Unit.
+ * + + * @return null|CustomerKeyReference + */ + public function getCustomer() + { + return $this->customer instanceof CustomerKeyReferenceBuilder ? $this->customer->build() : $this->customer; + } + + /** + *The roles to assign to the Associate.
+ * + + * @return null|AssociateRoleAssignmentDraftCollection + */ + public function getAssociateRoleAssignments() + { + return $this->associateRoleAssignments; + } + + /** + * @param ?CustomerKeyReference $customer + * @return $this + */ + public function withCustomer(?CustomerKeyReference $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @param ?AssociateRoleAssignmentDraftCollection $associateRoleAssignments + * @return $this + */ + public function withAssociateRoleAssignments(?AssociateRoleAssignmentDraftCollection $associateRoleAssignments) + { + $this->associateRoleAssignments = $associateRoleAssignments; + + return $this; + } + + /** + * @deprecated use withCustomer() instead + * @return $this + */ + public function withCustomerBuilder(?CustomerKeyReferenceBuilder $customer) + { + $this->customer = $customer; + + return $this; + } + + public function build(): AssociateDraft + { + return new AssociateDraftModel( + $this->customer instanceof CustomerKeyReferenceBuilder ? $this->customer->build() : $this->customer, + $this->associateRoleAssignments + ); + } + + public static function of(): AssociateDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-import/src/Models/BusinessUnits/AssociateDraftCollection.php b/lib/commercetools-import/src/Models/BusinessUnits/AssociateDraftCollection.php new file mode 100644 index 00000000000..bfe210b850f --- /dev/null +++ b/lib/commercetools-import/src/Models/BusinessUnits/AssociateDraftCollection.php @@ -0,0 +1,56 @@ + + * @method AssociateDraft current() + * @method AssociateDraft end() + * @method AssociateDraft at($offset) + */ +class AssociateDraftCollection extends MapperSequence +{ + /** + * @psalm-assert AssociateDraft $value + * @psalm-param AssociateDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return AssociateDraftCollection + */ + public function add($value) + { + if (!$value instanceof AssociateDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?AssociateDraft + */ + protected function mapper() + { + return function (?int $index): ?AssociateDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var AssociateDraft $data */ + $data = AssociateDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-import/src/Models/BusinessUnits/AssociateDraftModel.php b/lib/commercetools-import/src/Models/BusinessUnits/AssociateDraftModel.php new file mode 100644 index 00000000000..f540879f9b1 --- /dev/null +++ b/lib/commercetools-import/src/Models/BusinessUnits/AssociateDraftModel.php @@ -0,0 +1,105 @@ +customer = $customer; + $this->associateRoleAssignments = $associateRoleAssignments; + } + + /** + *The Customer to be part of the Business Unit.
+ * + * + * @return null|CustomerKeyReference + */ + public function getCustomer() + { + if (is_null($this->customer)) { + /** @psalm-var stdClass|arrayThe roles to assign to the Associate.
+ * + * + * @return null|AssociateRoleAssignmentDraftCollection + */ + public function getAssociateRoleAssignments() + { + if (is_null($this->associateRoleAssignments)) { + /** @psalm-var ?listDetermines whether the AssociateRole is inherited. If Disabled, the AssociateRole is not inherited from a parent Business Unit.
The role to assign to the Associate.
+ * + + * @return null|AssociateRoleKeyReference + */ + public function getAssociateRole() + { + return $this->associateRole instanceof AssociateRoleKeyReferenceBuilder ? $this->associateRole->build() : $this->associateRole; + } + + /** + *Determines whether the AssociateRole is inherited. If Disabled, the AssociateRole is not inherited from a parent Business Unit.
The role to assign to the Associate.
+ * + * + * @return null|AssociateRoleKeyReference + */ + public function getAssociateRole() + { + if (is_null($this->associateRole)) { + /** @psalm-var stdClass|arrayDetermines whether the AssociateRole is inherited. If Disabled, the AssociateRole is not inherited from a parent Business Unit.
User-defined unique identifier. If a BusinessUnit with this key exists, it is updated with the imported data.
The name of the Business Unit.
+ * + + * @return null|string + */ + public function getName(); + + /** + *The status of the Business Unit.
+ * + + * @return null|string + */ + public function getStatus(); + + /** + *The contact email address for the Business Unit.
+ * + + * @return null|string + */ + public function getContactEmail(); + + /** + *List of Associates to be assigned to the Business Unit.
+ * + + * @return null|AssociateDraftCollection + */ + public function getAssociates(); + + /** + *The addresses for the Business Unit.
+ * + + * @return null|AddressCollection + */ + public function getAddresses(); + + /** + *The indices of the shipping addresses in the addresses array.
The index of the default shipping address in the addresses array.
The indices of the billing addresses in the addresses array.
The index of the default billing address in the addresses array.
The Stores of the Business Unit.
+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores(); + + /** + *Custom fields for the Business Unit.
+ * + + * @return null|Custom + */ + public function getCustom(); + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void; + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void; + + /** + * @param ?AssociateDraftCollection $associates + */ + public function setAssociates(?AssociateDraftCollection $associates): void; + + /** + * @param ?AddressCollection $addresses + */ + public function setAddresses(?AddressCollection $addresses): void; + + /** + * @param ?array $shippingAddresses + */ + public function setShippingAddresses(?array $shippingAddresses): void; + + /** + * @param ?int $defaultShippingAddress + */ + public function setDefaultShippingAddress(?int $defaultShippingAddress): void; + + /** + * @param ?array $billingAddresses + */ + public function setBillingAddresses(?array $billingAddresses): void; + + /** + * @param ?int $defaultBillingAddress + */ + public function setDefaultBillingAddress(?int $defaultBillingAddress): void; + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void; + + /** + * @param ?Custom $custom + */ + public function setCustom(?Custom $custom): void; +} diff --git a/lib/commercetools-import/src/Models/BusinessUnits/BusinessUnitImportBuilder.php b/lib/commercetools-import/src/Models/BusinessUnits/BusinessUnitImportBuilder.php new file mode 100644 index 00000000000..34277fc25cd --- /dev/null +++ b/lib/commercetools-import/src/Models/BusinessUnits/BusinessUnitImportBuilder.php @@ -0,0 +1,396 @@ + + */ +final class BusinessUnitImportBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var ?string + */ + private $status; + + /** + + * @var ?string + */ + private $contactEmail; + + /** + + * @var ?AssociateDraftCollection + */ + private $associates; + + /** + + * @var ?AddressCollection + */ + private $addresses; + + /** + + * @var ?array + */ + private $shippingAddresses; + + /** + + * @var ?int + */ + private $defaultShippingAddress; + + /** + + * @var ?array + */ + private $billingAddresses; + + /** + + * @var ?int + */ + private $defaultBillingAddress; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + + * @var null|Custom|CustomBuilder + */ + private $custom; + + /** + *User-defined unique identifier. If a BusinessUnit with this key exists, it is updated with the imported data.
The name of the Business Unit.
+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *The status of the Business Unit.
+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + *The contact email address for the Business Unit.
+ * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *List of Associates to be assigned to the Business Unit.
+ * + + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + *The addresses for the Business Unit.
+ * + + * @return null|AddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *The indices of the shipping addresses in the addresses array.
The index of the default shipping address in the addresses array.
The indices of the billing addresses in the addresses array.
The index of the default billing address in the addresses array.
The Stores of the Business Unit.
+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *Custom fields for the Business Unit.
+ * + + * @return null|Custom + */ + public function getCustom() + { + return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @param ?AssociateDraftCollection $associates + * @return $this + */ + public function withAssociates(?AssociateDraftCollection $associates) + { + $this->associates = $associates; + + return $this; + } + + /** + * @param ?AddressCollection $addresses + * @return $this + */ + public function withAddresses(?AddressCollection $addresses) + { + $this->addresses = $addresses; + + return $this; + } + + /** + * @param ?array $shippingAddresses + * @return $this + */ + public function withShippingAddresses(?array $shippingAddresses) + { + $this->shippingAddresses = $shippingAddresses; + + return $this; + } + + /** + * @param ?int $defaultShippingAddress + * @return $this + */ + public function withDefaultShippingAddress(?int $defaultShippingAddress) + { + $this->defaultShippingAddress = $defaultShippingAddress; + + return $this; + } + + /** + * @param ?array $billingAddresses + * @return $this + */ + public function withBillingAddresses(?array $billingAddresses) + { + $this->billingAddresses = $billingAddresses; + + return $this; + } + + /** + * @param ?int $defaultBillingAddress + * @return $this + */ + public function withDefaultBillingAddress(?int $defaultBillingAddress) + { + $this->defaultBillingAddress = $defaultBillingAddress; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + /** + * @param ?Custom $custom + * @return $this + */ + public function withCustom(?Custom $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + public function build(): BusinessUnitImport + { + return new BusinessUnitImportModel( + $this->key, + $this->name, + $this->status, + $this->contactEmail, + $this->associates, + $this->addresses, + $this->shippingAddresses, + $this->defaultShippingAddress, + $this->billingAddresses, + $this->defaultBillingAddress, + $this->stores, + $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom + ); + } + + public static function of(): BusinessUnitImportBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-import/src/Models/BusinessUnits/BusinessUnitImportCollection.php b/lib/commercetools-import/src/Models/BusinessUnits/BusinessUnitImportCollection.php new file mode 100644 index 00000000000..f8e6f9db275 --- /dev/null +++ b/lib/commercetools-import/src/Models/BusinessUnits/BusinessUnitImportCollection.php @@ -0,0 +1,60 @@ + + * @psalm-method T current() + * @psalm-method T end() + * @psalm-method T at($offset) + * @method BusinessUnitImport current() + * @method BusinessUnitImport end() + * @method BusinessUnitImport at($offset) + */ +class BusinessUnitImportCollection extends MapperSequence +{ + /** + * @psalm-assert T $value + * @psalm-param T|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitImportCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitImport) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?T + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitImport { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var T $data */ + $data = BusinessUnitImportModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-import/src/Models/BusinessUnits/BusinessUnitImportModel.php b/lib/commercetools-import/src/Models/BusinessUnits/BusinessUnitImportModel.php new file mode 100644 index 00000000000..cd4a28cc90e --- /dev/null +++ b/lib/commercetools-import/src/Models/BusinessUnits/BusinessUnitImportModel.php @@ -0,0 +1,533 @@ + > + * + */ + private static $discriminatorClasses = [ + 'Company' => CompanyBusinessUnitImportModel::class, + 'Division' => DivisionBusinessUnitImportModel::class, + ]; + + /** + * @psalm-suppress MissingParamType + */ + public function __construct( + ?string $key = null, + ?string $name = null, + ?string $status = null, + ?string $contactEmail = null, + ?AssociateDraftCollection $associates = null, + ?AddressCollection $addresses = null, + ?array $shippingAddresses = null, + ?int $defaultShippingAddress = null, + ?array $billingAddresses = null, + ?int $defaultBillingAddress = null, + ?StoreKeyReferenceCollection $stores = null, + ?Custom $custom = null, + ?string $unitType = null + ) { + $this->key = $key; + $this->name = $name; + $this->status = $status; + $this->contactEmail = $contactEmail; + $this->associates = $associates; + $this->addresses = $addresses; + $this->shippingAddresses = $shippingAddresses; + $this->defaultShippingAddress = $defaultShippingAddress; + $this->billingAddresses = $billingAddresses; + $this->defaultBillingAddress = $defaultBillingAddress; + $this->stores = $stores; + $this->custom = $custom; + $this->unitType = $unitType; + } + + /** + *The type of Business Unit.
+ * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *User-defined unique identifier. If a BusinessUnit with this key exists, it is updated with the imported data.
The name of the Business Unit.
+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *The status of the Business Unit.
+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + /** + *The contact email address for the Business Unit.
+ * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *List of Associates to be assigned to the Business Unit.
+ * + * + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?listThe addresses for the Business Unit.
+ * + * + * @return null|AddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?listThe indices of the shipping addresses in the addresses array.
The index of the default shipping address in the addresses array.
The indices of the billing addresses in the addresses array.
The index of the default billing address in the addresses array.
The Stores of the Business Unit.
+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?listCustom fields for the Business Unit.
+ * + * + * @return null|Custom + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|arrayUser-defined unique identifier. If a BusinessUnit with this key exists, it is updated with the imported data.
The name of the Business Unit.
+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *The status of the Business Unit.
+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + *The contact email address for the Business Unit.
+ * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *List of Associates to be assigned to the Business Unit.
+ * + + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + *The addresses for the Business Unit.
+ * + + * @return null|AddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *The indices of the shipping addresses in the addresses array.
The index of the default shipping address in the addresses array.
The indices of the billing addresses in the addresses array.
The index of the default billing address in the addresses array.
The Stores of the Business Unit.
+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *Custom fields for the Business Unit.
+ * + + * @return null|Custom + */ + public function getCustom() + { + return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom; + } + + /** + + * @return null|string + */ + public function getStoreMode() + { + return $this->storeMode; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @param ?AssociateDraftCollection $associates + * @return $this + */ + public function withAssociates(?AssociateDraftCollection $associates) + { + $this->associates = $associates; + + return $this; + } + + /** + * @param ?AddressCollection $addresses + * @return $this + */ + public function withAddresses(?AddressCollection $addresses) + { + $this->addresses = $addresses; + + return $this; + } + + /** + * @param ?array $shippingAddresses + * @return $this + */ + public function withShippingAddresses(?array $shippingAddresses) + { + $this->shippingAddresses = $shippingAddresses; + + return $this; + } + + /** + * @param ?int $defaultShippingAddress + * @return $this + */ + public function withDefaultShippingAddress(?int $defaultShippingAddress) + { + $this->defaultShippingAddress = $defaultShippingAddress; + + return $this; + } + + /** + * @param ?array $billingAddresses + * @return $this + */ + public function withBillingAddresses(?array $billingAddresses) + { + $this->billingAddresses = $billingAddresses; + + return $this; + } + + /** + * @param ?int $defaultBillingAddress + * @return $this + */ + public function withDefaultBillingAddress(?int $defaultBillingAddress) + { + $this->defaultBillingAddress = $defaultBillingAddress; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + /** + * @param ?Custom $custom + * @return $this + */ + public function withCustom(?Custom $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @param ?string $storeMode + * @return $this + */ + public function withStoreMode(?string $storeMode) + { + $this->storeMode = $storeMode; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + public function build(): CompanyBusinessUnitImport + { + return new CompanyBusinessUnitImportModel( + $this->key, + $this->name, + $this->status, + $this->contactEmail, + $this->associates, + $this->addresses, + $this->shippingAddresses, + $this->defaultShippingAddress, + $this->billingAddresses, + $this->defaultBillingAddress, + $this->stores, + $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom, + $this->storeMode + ); + } + + public static function of(): CompanyBusinessUnitImportBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-import/src/Models/BusinessUnits/CompanyBusinessUnitImportCollection.php b/lib/commercetools-import/src/Models/BusinessUnits/CompanyBusinessUnitImportCollection.php new file mode 100644 index 00000000000..bb89ffc273b --- /dev/null +++ b/lib/commercetools-import/src/Models/BusinessUnits/CompanyBusinessUnitImportCollection.php @@ -0,0 +1,56 @@ + + * @method CompanyBusinessUnitImport current() + * @method CompanyBusinessUnitImport end() + * @method CompanyBusinessUnitImport at($offset) + */ +class CompanyBusinessUnitImportCollection extends BusinessUnitImportCollection +{ + /** + * @psalm-assert CompanyBusinessUnitImport $value + * @psalm-param CompanyBusinessUnitImport|stdClass $value + * @throws InvalidArgumentException + * + * @return CompanyBusinessUnitImportCollection + */ + public function add($value) + { + if (!$value instanceof CompanyBusinessUnitImport) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CompanyBusinessUnitImport + */ + protected function mapper() + { + return function (?int $index): ?CompanyBusinessUnitImport { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CompanyBusinessUnitImport $data */ + $data = CompanyBusinessUnitImportModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-import/src/Models/BusinessUnits/CompanyBusinessUnitImportModel.php b/lib/commercetools-import/src/Models/BusinessUnits/CompanyBusinessUnitImportModel.php new file mode 100644 index 00000000000..2b495bfd641 --- /dev/null +++ b/lib/commercetools-import/src/Models/BusinessUnits/CompanyBusinessUnitImportModel.php @@ -0,0 +1,530 @@ +key = $key; + $this->name = $name; + $this->status = $status; + $this->contactEmail = $contactEmail; + $this->associates = $associates; + $this->addresses = $addresses; + $this->shippingAddresses = $shippingAddresses; + $this->defaultShippingAddress = $defaultShippingAddress; + $this->billingAddresses = $billingAddresses; + $this->defaultBillingAddress = $defaultBillingAddress; + $this->stores = $stores; + $this->custom = $custom; + $this->storeMode = $storeMode; + $this->unitType = $unitType ?? self::DISCRIMINATOR_VALUE; + } + + /** + *The type of Business Unit.
+ * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *User-defined unique identifier. If a BusinessUnit with this key exists, it is updated with the imported data.
The name of the Business Unit.
+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *The status of the Business Unit.
+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + /** + *The contact email address for the Business Unit.
+ * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *List of Associates to be assigned to the Business Unit.
+ * + * + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?listThe addresses for the Business Unit.
+ * + * + * @return null|AddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?listThe indices of the shipping addresses in the addresses array.
The index of the default shipping address in the addresses array.
The indices of the billing addresses in the addresses array.
The index of the default billing address in the addresses array.
The Stores of the Business Unit.
+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?listCustom fields for the Business Unit.
+ * + * + * @return null|Custom + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|arrayExplicit, the stores field cannot be empty and the Business Unit is explicitly associated with the given Stores. If FromParent, the Business Unit inherits the Stores from its parent.
+ *
+
+ * @return null|string
+ */
+ public function getStoreMode();
+
+ /**
+ * The parent Business Unit of this Division.
+ * + + * @return null|BusinessUnitKeyReference + */ + public function getParentUnit(); + + /** + *If Explicit, Associates are not inherited from the parent. If ExplicitAndFromParent, Associates are inherited from the parent.
If Explicit, approval rules are not inherited from the parent. If ExplicitAndFromParent, approval rules are inherited from the parent.
User-defined unique identifier. If a BusinessUnit with this key exists, it is updated with the imported data.
The name of the Business Unit.
+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *The status of the Business Unit.
+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + *The contact email address for the Business Unit.
+ * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *List of Associates to be assigned to the Business Unit.
+ * + + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + *The addresses for the Business Unit.
+ * + + * @return null|AddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *The indices of the shipping addresses in the addresses array.
The index of the default shipping address in the addresses array.
The indices of the billing addresses in the addresses array.
The index of the default billing address in the addresses array.
The Stores of the Business Unit.
+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *Custom fields for the Business Unit.
+ * + + * @return null|Custom + */ + public function getCustom() + { + return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom; + } + + /** + *If Explicit, the stores field cannot be empty and the Business Unit is explicitly associated with the given Stores. If FromParent, the Business Unit inherits the Stores from its parent.
The parent Business Unit of this Division.
+ * + + * @return null|BusinessUnitKeyReference + */ + public function getParentUnit() + { + return $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit; + } + + /** + *If Explicit, Associates are not inherited from the parent. If ExplicitAndFromParent, Associates are inherited from the parent.
If Explicit, approval rules are not inherited from the parent. If ExplicitAndFromParent, approval rules are inherited from the parent.
The type of Business Unit.
+ * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *User-defined unique identifier. If a BusinessUnit with this key exists, it is updated with the imported data.
The name of the Business Unit.
+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *The status of the Business Unit.
+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + /** + *The contact email address for the Business Unit.
+ * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *List of Associates to be assigned to the Business Unit.
+ * + * + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?listThe addresses for the Business Unit.
+ * + * + * @return null|AddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?listThe indices of the shipping addresses in the addresses array.
The index of the default shipping address in the addresses array.
The indices of the billing addresses in the addresses array.
The index of the default billing address in the addresses array.
The Stores of the Business Unit.
+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?listCustom fields for the Business Unit.
+ * + * + * @return null|Custom + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|arrayIf Explicit, the stores field cannot be empty and the Business Unit is explicitly associated with the given Stores. If FromParent, the Business Unit inherits the Stores from its parent.
The parent Business Unit of this Division.
+ * + * + * @return null|BusinessUnitKeyReference + */ + public function getParentUnit() + { + if (is_null($this->parentUnit)) { + /** @psalm-var stdClass|arrayIf Explicit, Associates are not inherited from the parent. If ExplicitAndFromParent, Associates are inherited from the parent.
If Explicit, approval rules are not inherited from the parent. If ExplicitAndFromParent, approval rules are inherited from the parent.
User-defined unique identifier of the referenced Type.
+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + + public function build(): AssociateRoleKeyReference + { + return new AssociateRoleKeyReferenceModel( + $this->key + ); + } + + public static function of(): AssociateRoleKeyReferenceBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-import/src/Models/Common/AssociateRoleKeyReferenceCollection.php b/lib/commercetools-import/src/Models/Common/AssociateRoleKeyReferenceCollection.php new file mode 100644 index 00000000000..920c4afd852 --- /dev/null +++ b/lib/commercetools-import/src/Models/Common/AssociateRoleKeyReferenceCollection.php @@ -0,0 +1,56 @@ + + * @method AssociateRoleKeyReference current() + * @method AssociateRoleKeyReference end() + * @method AssociateRoleKeyReference at($offset) + */ +class AssociateRoleKeyReferenceCollection extends KeyReferenceCollection +{ + /** + * @psalm-assert AssociateRoleKeyReference $value + * @psalm-param AssociateRoleKeyReference|stdClass $value + * @throws InvalidArgumentException + * + * @return AssociateRoleKeyReferenceCollection + */ + public function add($value) + { + if (!$value instanceof AssociateRoleKeyReference) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?AssociateRoleKeyReference + */ + protected function mapper() + { + return function (?int $index): ?AssociateRoleKeyReference { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var AssociateRoleKeyReference $data */ + $data = AssociateRoleKeyReferenceModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-import/src/Models/Common/AssociateRoleKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/AssociateRoleKeyReferenceModel.php new file mode 100644 index 00000000000..a085be06d1f --- /dev/null +++ b/lib/commercetools-import/src/Models/Common/AssociateRoleKeyReferenceModel.php @@ -0,0 +1,95 @@ +key = $key; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; + } + + /** + *User-defined unique identifier of the referenced Type.
+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *Type of referenced resource.
+ * + * + * @return null|string + */ + public function getTypeId() + { + if (is_null($this->typeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->typeId = (string) $data; + } + + return $this->typeId; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } +} diff --git a/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReference.php b/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReference.php new file mode 100644 index 00000000000..56803db806d --- /dev/null +++ b/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReference.php @@ -0,0 +1,28 @@ +User-defined unique identifier of the referenced Type. + * + + * @return null|string + */ + public function getKey(); + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; +} diff --git a/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReferenceBuilder.php new file mode 100644 index 00000000000..e7238108be9 --- /dev/null +++ b/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReferenceBuilder.php @@ -0,0 +1,63 @@ + + */ +final class BusinessUnitKeyReferenceBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + *User-defined unique identifier of the referenced Type.
+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + + public function build(): BusinessUnitKeyReference + { + return new BusinessUnitKeyReferenceModel( + $this->key + ); + } + + public static function of(): BusinessUnitKeyReferenceBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReferenceCollection.php b/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReferenceCollection.php new file mode 100644 index 00000000000..e944c8b68e7 --- /dev/null +++ b/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReferenceCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitKeyReference current() + * @method BusinessUnitKeyReference end() + * @method BusinessUnitKeyReference at($offset) + */ +class BusinessUnitKeyReferenceCollection extends KeyReferenceCollection +{ + /** + * @psalm-assert BusinessUnitKeyReference $value + * @psalm-param BusinessUnitKeyReference|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitKeyReferenceCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitKeyReference) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitKeyReference + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitKeyReference { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitKeyReference $data */ + $data = BusinessUnitKeyReferenceModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReferenceModel.php new file mode 100644 index 00000000000..7f25751c1bc --- /dev/null +++ b/lib/commercetools-import/src/Models/Common/BusinessUnitKeyReferenceModel.php @@ -0,0 +1,95 @@ +key = $key; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; + } + + /** + *User-defined unique identifier of the referenced Type.
+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *Type of referenced resource.
+ * + * + * @return null|string + */ + public function getTypeId() + { + if (is_null($this->typeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->typeId = (string) $data; + } + + return $this->typeId; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } +} diff --git a/lib/commercetools-import/src/Models/Common/KeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/KeyReferenceModel.php index faa4ad2cc87..8e352223b91 100644 --- a/lib/commercetools-import/src/Models/Common/KeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/KeyReferenceModel.php @@ -37,6 +37,8 @@ final class KeyReferenceModel extends JsonObjectModel implements KeyReference * */ private static $discriminatorClasses = [ + 'associate-role' => AssociateRoleKeyReferenceModel::class, + 'business-unit' => BusinessUnitKeyReferenceModel::class, 'cart' => CartKeyReferenceModel::class, 'cart-discount' => CartDiscountKeyReferenceModel::class, 'category' => CategoryKeyReferenceModel::class, diff --git a/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequest.php new file mode 100644 index 00000000000..2362c9fbe10 --- /dev/null +++ b/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequest.php @@ -0,0 +1,31 @@ +The Business Unit import resources of this request. Can contain CompanyBusinessUnitImport or DivisionBusinessUnitImport. + * + + * @return null|BusinessUnitImportCollection + */ + public function getResources(); + + /** + * @param ?BusinessUnitImportCollection $resources + */ + public function setResources(?BusinessUnitImportCollection $resources): void; +} diff --git a/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequestBuilder.php new file mode 100644 index 00000000000..a83a0f078f6 --- /dev/null +++ b/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequestBuilder.php @@ -0,0 +1,64 @@ + + */ +final class BusinessUnitImportRequestBuilder implements Builder +{ + /** + + * @var ?BusinessUnitImportCollection + */ + private $resources; + + /** + *The Business Unit import resources of this request. Can contain CompanyBusinessUnitImport or DivisionBusinessUnitImport.
+ * + + * @return null|BusinessUnitImportCollection + */ + public function getResources() + { + return $this->resources; + } + + /** + * @param ?BusinessUnitImportCollection $resources + * @return $this + */ + public function withResources(?BusinessUnitImportCollection $resources) + { + $this->resources = $resources; + + return $this; + } + + + public function build(): BusinessUnitImportRequest + { + return new BusinessUnitImportRequestModel( + $this->resources + ); + } + + public static function of(): BusinessUnitImportRequestBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequestCollection.php b/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequestCollection.php new file mode 100644 index 00000000000..60e6023fdd3 --- /dev/null +++ b/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequestCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitImportRequest current() + * @method BusinessUnitImportRequest end() + * @method BusinessUnitImportRequest at($offset) + */ +class BusinessUnitImportRequestCollection extends ImportRequestCollection +{ + /** + * @psalm-assert BusinessUnitImportRequest $value + * @psalm-param BusinessUnitImportRequest|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitImportRequestCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitImportRequest) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitImportRequest + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitImportRequest { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitImportRequest $data */ + $data = BusinessUnitImportRequestModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequestModel.php new file mode 100644 index 00000000000..c648b8d56c9 --- /dev/null +++ b/lib/commercetools-import/src/Models/Importrequests/BusinessUnitImportRequestModel.php @@ -0,0 +1,96 @@ +resources = $resources; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *The resource type that can be imported.
+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *The Business Unit import resources of this request. Can contain CompanyBusinessUnitImport or DivisionBusinessUnitImport.
+ * + * + * @return null|BusinessUnitImportCollection + */ + public function getResources() + { + if (is_null($this->resources)) { + /** @psalm-var ?listThe resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestModel.php index 6af2fed969b..4340c11cad3 100644 --- a/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/DiscountCodeImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/DiscountCodeImportRequestModel.php index 1c7b4589e58..033c0bfa767 100644 --- a/lib/commercetools-import/src/Models/Importrequests/DiscountCodeImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/DiscountCodeImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/ImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/ImportRequest.php index 55b68da6334..a608500be13 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/ImportRequest.php @@ -17,7 +17,7 @@ interface ImportRequest extends JsonObject public const FIELD_TYPE = 'type'; /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/ImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ImportRequestModel.php index 91601cd3e30..0c5edf62a5b 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ImportRequestModel.php @@ -31,6 +31,7 @@ final class ImportRequestModel extends JsonObjectModel implements ImportRequest * */ private static $discriminatorClasses = [ + 'business-unit' => BusinessUnitImportRequestModel::class, 'category' => CategoryImportRequestModel::class, 'customer' => CustomerImportRequestModel::class, 'discount-code' => DiscountCodeImportRequestModel::class, @@ -58,7 +59,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestModel.php index 7470eb4b793..6542d203253 100644 --- a/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestModel.php index 098092f9773..32387d93d7a 100644 --- a/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestModel.php index 86f2e065c56..53f9ffa0885 100644 --- a/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestModel.php index 22fc9359c97..e325ec6c816 100644 --- a/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestModel.php index 1907cecefb7..0a6e5c73659 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestModel.php index f68d03e58bf..fbcf0c5248b 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductSelectionImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ProductSelectionImportRequestModel.php index 4a56f9dd5c9..d3377110ec0 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductSelectionImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductSelectionImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestModel.php index 26e1ee42678..e0fce4590d7 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestModel.php index 25e8b121f53..bf4d1d4b974 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestModel.php index a0f997b03b5..7e7ef8825d9 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestModel.php index 433710d51f6..9c8699ce9bf 100644 --- a/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importrequests/TypeImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/TypeImportRequestModel.php index 4c8fde2882c..e4ccebf2407 100644 --- a/lib/commercetools-import/src/Models/Importrequests/TypeImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/TypeImportRequestModel.php @@ -46,7 +46,7 @@ public function __construct( } /** - *The resource types that can be imported.
+ *The resource type that can be imported.
* * * @return null|string diff --git a/references.txt b/references.txt index 893d29a1c4c..23627f49e52 100644 --- a/references.txt +++ b/references.txt @@ -490,3 +490,4 @@ d084ab15a8dfa7bd18efa10417a0bb263c08f269 4b73acb69ed586da4ca2893e3b698335c356d720 cb9cca64ecfb31885e7b9fb0ad52a9954b990ed9 48dc5d57bbfede103bdf01023deea4f649dc5cae +291e2569b7c0e4f1db3bb99761c7b23e0cc1659f