diff --git a/lib/commercetools-api-tests/gen.properties b/lib/commercetools-api-tests/gen.properties index 082436aefdb..3bcd76e07fa 100644 --- a/lib/commercetools-api-tests/gen.properties +++ b/lib/commercetools-api-tests/gen.properties @@ -1 +1 @@ -hash=f0c268413ad3a79b40cf1506214f032faa04c4bb +hash=54444c4eae550cc5db7327b4047c36aa5f064bf7 diff --git a/lib/commercetools-api/gen.properties b/lib/commercetools-api/gen.properties index 082436aefdb..3bcd76e07fa 100644 --- a/lib/commercetools-api/gen.properties +++ b/lib/commercetools-api/gen.properties @@ -1 +1 @@ -hash=f0c268413ad3a79b40cf1506214f032faa04c4bb +hash=54444c4eae550cc5db7327b4047c36aa5f064bf7 diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraft.php b/lib/commercetools-api/src/Models/Order/OrderImportDraft.php index 47d8ee581af..0c634231658 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraft.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\Order; -use Commercetools\Api\Models\Cart\CustomLineItemDraftCollection; +use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection; use Commercetools\Api\Models\Cart\TaxedPriceDraft; use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressCollection; @@ -78,7 +78,7 @@ public function getLineItems(); /** *

If not given lineItems must not be empty.

* - * @return null|CustomLineItemDraftCollection + * @return null|CustomLineItemImportDraftCollection */ public function getCustomLineItems(); @@ -211,9 +211,9 @@ public function setCustomerEmail(?string $customerEmail): void; public function setLineItems(?LineItemImportDraftCollection $lineItems): void; /** - * @param ?CustomLineItemDraftCollection $customLineItems + * @param ?CustomLineItemImportDraftCollection $customLineItems */ - public function setCustomLineItems(?CustomLineItemDraftCollection $customLineItems): void; + public function setCustomLineItems(?CustomLineItemImportDraftCollection $customLineItems): void; /** * @param ?Money $totalPrice diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php index 6a06d291d4e..bf6a4fb3a18 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\Order; -use Commercetools\Api\Models\Cart\CustomLineItemDraftCollection; +use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection; use Commercetools\Api\Models\Cart\TaxedPriceDraft; use Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder; use Commercetools\Api\Models\Common\BaseAddress; @@ -56,7 +56,7 @@ final class OrderImportDraftBuilder implements Builder private $lineItems; /** - * @var ?CustomLineItemDraftCollection + * @var ?CustomLineItemImportDraftCollection */ private $customLineItems; @@ -190,7 +190,7 @@ public function getLineItems() /** *

If not given lineItems must not be empty.

* - * @return null|CustomLineItemDraftCollection + * @return null|CustomLineItemImportDraftCollection */ public function getCustomLineItems() { @@ -401,10 +401,10 @@ public function withLineItems(?LineItemImportDraftCollection $lineItems) } /** - * @param ?CustomLineItemDraftCollection $customLineItems + * @param ?CustomLineItemImportDraftCollection $customLineItems * @return $this */ - public function withCustomLineItems(?CustomLineItemDraftCollection $customLineItems) + public function withCustomLineItems(?CustomLineItemImportDraftCollection $customLineItems) { $this->customLineItems = $customLineItems; diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php b/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php index 9da9fef489d..4a740421e7f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\Order; -use Commercetools\Api\Models\Cart\CustomLineItemDraftCollection; +use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection; use Commercetools\Api\Models\Cart\TaxedPriceDraft; use Commercetools\Api\Models\Cart\TaxedPriceDraftModel; use Commercetools\Api\Models\Common\BaseAddress; @@ -55,7 +55,7 @@ final class OrderImportDraftModel extends JsonObjectModel implements OrderImport protected $lineItems; /** - * @var ?CustomLineItemDraftCollection + * @var ?CustomLineItemImportDraftCollection */ protected $customLineItems; @@ -153,7 +153,7 @@ public function __construct( ?string $customerId = null, ?string $customerEmail = null, ?LineItemImportDraftCollection $lineItems = null, - ?CustomLineItemDraftCollection $customLineItems = null, + ?CustomLineItemImportDraftCollection $customLineItems = null, ?Money $totalPrice = null, ?TaxedPriceDraft $taxedPrice = null, ?BaseAddress $shippingAddress = null, @@ -277,7 +277,7 @@ public function getLineItems() /** *

If not given lineItems must not be empty.

* - * @return null|CustomLineItemDraftCollection + * @return null|CustomLineItemImportDraftCollection */ public function getCustomLineItems() { @@ -287,7 +287,7 @@ public function getCustomLineItems() if (is_null($data)) { return null; } - $this->customLineItems = CustomLineItemDraftCollection::fromArray($data); + $this->customLineItems = CustomLineItemImportDraftCollection::fromArray($data); } return $this->customLineItems; @@ -651,9 +651,9 @@ public function setLineItems(?LineItemImportDraftCollection $lineItems): void } /** - * @param ?CustomLineItemDraftCollection $customLineItems + * @param ?CustomLineItemImportDraftCollection $customLineItems */ - public function setCustomLineItems(?CustomLineItemDraftCollection $customLineItems): void + public function setCustomLineItems(?CustomLineItemImportDraftCollection $customLineItems): void { $this->customLineItems = $customLineItems; } diff --git a/lib/commercetools-api/src/Models/Project/Project.php b/lib/commercetools-api/src/Models/Project/Project.php index 8eeef91162a..7dc9f7309ab 100644 --- a/lib/commercetools-api/src/Models/Project/Project.php +++ b/lib/commercetools-api/src/Models/Project/Project.php @@ -28,6 +28,7 @@ interface Project extends JsonObject public const FIELD_EXTERNAL_O_AUTH = 'externalOAuth'; public const FIELD_CARTS = 'carts'; public const FIELD_SEARCH_INDEXING = 'searchIndexing'; + public const FIELD_SHOPPING_LISTS = 'shoppingLists'; /** *

The current version of the project.

@@ -106,6 +107,11 @@ public function getCarts(); */ public function getSearchIndexing(); + /** + * @return null|ShoppingListsConfiguration + */ + public function getShoppingLists(); + /** * @param ?int $version */ @@ -170,4 +176,9 @@ public function setCarts(?CartsConfiguration $carts): void; * @param ?SearchIndexingConfiguration $searchIndexing */ public function setSearchIndexing(?SearchIndexingConfiguration $searchIndexing): void; + + /** + * @param ?ShoppingListsConfiguration $shoppingLists + */ + public function setShoppingLists(?ShoppingListsConfiguration $shoppingLists): void; } diff --git a/lib/commercetools-api/src/Models/Project/ProjectBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectBuilder.php index 35ee4c29630..defc243f1ca 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectBuilder.php @@ -88,6 +88,11 @@ final class ProjectBuilder implements Builder */ private $searchIndexing; + /** + * @var null|ShoppingListsConfiguration|ShoppingListsConfigurationBuilder + */ + private $shoppingLists; + /** *

The current version of the project.

* @@ -204,6 +209,14 @@ public function getSearchIndexing() return $this->searchIndexing instanceof SearchIndexingConfigurationBuilder ? $this->searchIndexing->build() : $this->searchIndexing; } + /** + * @return null|ShoppingListsConfiguration + */ + public function getShoppingLists() + { + return $this->shoppingLists instanceof ShoppingListsConfigurationBuilder ? $this->shoppingLists->build() : $this->shoppingLists; + } + /** * @param ?int $version * @return $this @@ -347,6 +360,17 @@ public function withSearchIndexing(?SearchIndexingConfiguration $searchIndexing) return $this; } + /** + * @param ?ShoppingListsConfiguration $shoppingLists + * @return $this + */ + public function withShoppingLists(?ShoppingListsConfiguration $shoppingLists) + { + $this->shoppingLists = $shoppingLists; + + return $this; + } + /** * @deprecated use withMessages() instead * @return $this @@ -402,6 +426,17 @@ public function withSearchIndexingBuilder(?SearchIndexingConfigurationBuilder $s return $this; } + /** + * @deprecated use withShoppingLists() instead + * @return $this + */ + public function withShoppingListsBuilder(?ShoppingListsConfigurationBuilder $shoppingLists) + { + $this->shoppingLists = $shoppingLists; + + return $this; + } + public function build(): Project { return new ProjectModel( @@ -417,7 +452,8 @@ public function build(): Project $this->shippingRateInputType instanceof ShippingRateInputTypeBuilder ? $this->shippingRateInputType->build() : $this->shippingRateInputType, $this->externalOAuth instanceof ExternalOAuthBuilder ? $this->externalOAuth->build() : $this->externalOAuth, $this->carts instanceof CartsConfigurationBuilder ? $this->carts->build() : $this->carts, - $this->searchIndexing instanceof SearchIndexingConfigurationBuilder ? $this->searchIndexing->build() : $this->searchIndexing + $this->searchIndexing instanceof SearchIndexingConfigurationBuilder ? $this->searchIndexing->build() : $this->searchIndexing, + $this->shoppingLists instanceof ShoppingListsConfigurationBuilder ? $this->shoppingLists->build() : $this->shoppingLists ); } diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfiguration.php b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfiguration.php new file mode 100644 index 00000000000..fe1a729fa7d --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfiguration.php @@ -0,0 +1,27 @@ + + */ +final class ProjectChangeShoppingListsConfigurationBuilder implements Builder +{ + /** + * @var null|ShoppingListsConfiguration|ShoppingListsConfigurationBuilder + */ + private $shoppingListsConfiguration; + + /** + * @return null|ShoppingListsConfiguration + */ + public function getShoppingListsConfiguration() + { + return $this->shoppingListsConfiguration instanceof ShoppingListsConfigurationBuilder ? $this->shoppingListsConfiguration->build() : $this->shoppingListsConfiguration; + } + + /** + * @param ?ShoppingListsConfiguration $shoppingListsConfiguration + * @return $this + */ + public function withShoppingListsConfiguration(?ShoppingListsConfiguration $shoppingListsConfiguration) + { + $this->shoppingListsConfiguration = $shoppingListsConfiguration; + + return $this; + } + + /** + * @deprecated use withShoppingListsConfiguration() instead + * @return $this + */ + public function withShoppingListsConfigurationBuilder(?ShoppingListsConfigurationBuilder $shoppingListsConfiguration) + { + $this->shoppingListsConfiguration = $shoppingListsConfiguration; + + return $this; + } + + public function build(): ProjectChangeShoppingListsConfiguration + { + return new ProjectChangeShoppingListsConfigurationModel( + $this->shoppingListsConfiguration instanceof ShoppingListsConfigurationBuilder ? $this->shoppingListsConfiguration->build() : $this->shoppingListsConfiguration + ); + } + + public static function of(): ProjectChangeShoppingListsConfigurationBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationCollection.php b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationCollection.php new file mode 100644 index 00000000000..04f0d3774c5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationCollection.php @@ -0,0 +1,55 @@ + + * @method ProjectChangeShoppingListsConfiguration current() + * @method ProjectChangeShoppingListsConfiguration at($offset) + */ +class ProjectChangeShoppingListsConfigurationCollection extends ProjectUpdateActionCollection +{ + /** + * @psalm-assert ProjectChangeShoppingListsConfiguration $value + * @psalm-param ProjectChangeShoppingListsConfiguration|stdClass $value + * @throws InvalidArgumentException + * + * @return ProjectChangeShoppingListsConfigurationCollection + */ + public function add($value) + { + if (!$value instanceof ProjectChangeShoppingListsConfiguration) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ProjectChangeShoppingListsConfiguration + */ + protected function mapper() + { + return function (int $index): ?ProjectChangeShoppingListsConfiguration { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ProjectChangeShoppingListsConfiguration $data */ + $data = ProjectChangeShoppingListsConfigurationModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationModel.php new file mode 100644 index 00000000000..a7ad5c46f2a --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationModel.php @@ -0,0 +1,87 @@ +shoppingListsConfiguration = $shoppingListsConfiguration; + $this->action = static::DISCRIMINATOR_VALUE; + } + + /** + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + * @return null|ShoppingListsConfiguration + */ + public function getShoppingListsConfiguration() + { + if (is_null($this->shoppingListsConfiguration)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHOPPING_LISTS_CONFIGURATION); + if (is_null($data)) { + return null; + } + + $this->shoppingListsConfiguration = ShoppingListsConfigurationModel::of($data); + } + + return $this->shoppingListsConfiguration; + } + + + /** + * @param ?ShoppingListsConfiguration $shoppingListsConfiguration + */ + public function setShoppingListsConfiguration(?ShoppingListsConfiguration $shoppingListsConfiguration): void + { + $this->shoppingListsConfiguration = $shoppingListsConfiguration; + } +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectModel.php b/lib/commercetools-api/src/Models/Project/ProjectModel.php index cf2c18fbd9d..d0e384174f9 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectModel.php @@ -87,6 +87,11 @@ final class ProjectModel extends JsonObjectModel implements Project */ protected $searchIndexing; + /** + * @var ?ShoppingListsConfiguration + */ + protected $shoppingLists; + /** * @psalm-suppress MissingParamType @@ -104,7 +109,8 @@ public function __construct( ?ShippingRateInputType $shippingRateInputType = null, ?ExternalOAuth $externalOAuth = null, ?CartsConfiguration $carts = null, - ?SearchIndexingConfiguration $searchIndexing = null + ?SearchIndexingConfiguration $searchIndexing = null, + ?ShoppingListsConfiguration $shoppingLists = null ) { $this->version = $version; $this->key = $key; @@ -119,6 +125,7 @@ public function __construct( $this->externalOAuth = $externalOAuth; $this->carts = $carts; $this->searchIndexing = $searchIndexing; + $this->shoppingLists = $shoppingLists; } /** @@ -363,6 +370,24 @@ public function getSearchIndexing() return $this->searchIndexing; } + /** + * @return null|ShoppingListsConfiguration + */ + public function getShoppingLists() + { + if (is_null($this->shoppingLists)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHOPPING_LISTS); + if (is_null($data)) { + return null; + } + + $this->shoppingLists = ShoppingListsConfigurationModel::of($data); + } + + return $this->shoppingLists; + } + /** * @param ?int $version @@ -468,6 +493,14 @@ public function setSearchIndexing(?SearchIndexingConfiguration $searchIndexing): $this->searchIndexing = $searchIndexing; } + /** + * @param ?ShoppingListsConfiguration $shoppingLists + */ + public function setShoppingLists(?ShoppingListsConfiguration $shoppingLists): void + { + $this->shoppingLists = $shoppingLists; + } + public function jsonSerialize() { diff --git a/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php index 67d67c22076..adad4257856 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php @@ -39,6 +39,7 @@ final class ProjectUpdateActionModel extends JsonObjectModel implements ProjectU 'changeMessagesEnabled' => ProjectChangeMessagesEnabledActionModel::class, 'changeName' => ProjectChangeNameActionModel::class, 'changeProductSearchIndexingEnabled' => ProjectChangeProductSearchIndexingEnabledActionModel::class, + 'changeShoppingListsConfiguration' => ProjectChangeShoppingListsConfigurationModel::class, 'setExternalOAuth' => ProjectSetExternalOAuthActionModel::class, 'setShippingRateInputType' => ProjectSetShippingRateInputTypeActionModel::class, ]; diff --git a/lib/commercetools-api/src/Models/Project/ShoppingListsConfiguration.php b/lib/commercetools-api/src/Models/Project/ShoppingListsConfiguration.php new file mode 100644 index 00000000000..f76377edf48 --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ShoppingListsConfiguration.php @@ -0,0 +1,29 @@ +The default value for the deleteDaysAfterLastModification parameter of the ShoppingListDraft. Initially set to 360 for projects created after December 2019.

+ * + * @return null|int + */ + public function getDeleteDaysAfterLastModification(); + + /** + * @param ?int $deleteDaysAfterLastModification + */ + public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void; +} diff --git a/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationBuilder.php b/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationBuilder.php new file mode 100644 index 00000000000..d5be01fb1c8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationBuilder.php @@ -0,0 +1,61 @@ + + */ +final class ShoppingListsConfigurationBuilder implements Builder +{ + /** + * @var ?int + */ + private $deleteDaysAfterLastModification; + + /** + *

The default value for the deleteDaysAfterLastModification parameter of the ShoppingListDraft. Initially set to 360 for projects created after December 2019.

+ * + * @return null|int + */ + public function getDeleteDaysAfterLastModification() + { + return $this->deleteDaysAfterLastModification; + } + + /** + * @param ?int $deleteDaysAfterLastModification + * @return $this + */ + public function withDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification) + { + $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + + return $this; + } + + + public function build(): ShoppingListsConfiguration + { + return new ShoppingListsConfigurationModel( + $this->deleteDaysAfterLastModification + ); + } + + public static function of(): ShoppingListsConfigurationBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationCollection.php b/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationCollection.php new file mode 100644 index 00000000000..268bb62a2cb --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationCollection.php @@ -0,0 +1,55 @@ + + * @method ShoppingListsConfiguration current() + * @method ShoppingListsConfiguration at($offset) + */ +class ShoppingListsConfigurationCollection extends MapperSequence +{ + /** + * @psalm-assert ShoppingListsConfiguration $value + * @psalm-param ShoppingListsConfiguration|stdClass $value + * @throws InvalidArgumentException + * + * @return ShoppingListsConfigurationCollection + */ + public function add($value) + { + if (!$value instanceof ShoppingListsConfiguration) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ShoppingListsConfiguration + */ + protected function mapper() + { + return function (int $index): ?ShoppingListsConfiguration { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ShoppingListsConfiguration $data */ + $data = ShoppingListsConfigurationModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationModel.php b/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationModel.php new file mode 100644 index 00000000000..8fdf19e923b --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationModel.php @@ -0,0 +1,64 @@ +deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + } + + /** + *

The default value for the deleteDaysAfterLastModification parameter of the ShoppingListDraft. Initially set to 360 for projects created after December 2019.

+ * + * @return null|int + */ + public function getDeleteDaysAfterLastModification() + { + if (is_null($this->deleteDaysAfterLastModification)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION); + if (is_null($data)) { + return null; + } + $this->deleteDaysAfterLastModification = (int) $data; + } + + return $this->deleteDaysAfterLastModification; + } + + + /** + * @param ?int $deleteDaysAfterLastModification + */ + public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification): void + { + $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; + } +} diff --git a/lib/commercetools-base/gen.properties b/lib/commercetools-base/gen.properties index 082436aefdb..3bcd76e07fa 100644 --- a/lib/commercetools-base/gen.properties +++ b/lib/commercetools-base/gen.properties @@ -1 +1 @@ -hash=f0c268413ad3a79b40cf1506214f032faa04c4bb +hash=54444c4eae550cc5db7327b4047c36aa5f064bf7 diff --git a/lib/commercetools-history-tests/gen.properties b/lib/commercetools-history-tests/gen.properties index 082436aefdb..3bcd76e07fa 100644 --- a/lib/commercetools-history-tests/gen.properties +++ b/lib/commercetools-history-tests/gen.properties @@ -1 +1 @@ -hash=f0c268413ad3a79b40cf1506214f032faa04c4bb +hash=54444c4eae550cc5db7327b4047c36aa5f064bf7 diff --git a/lib/commercetools-history/gen.properties b/lib/commercetools-history/gen.properties index 082436aefdb..3bcd76e07fa 100644 --- a/lib/commercetools-history/gen.properties +++ b/lib/commercetools-history/gen.properties @@ -1 +1 @@ -hash=f0c268413ad3a79b40cf1506214f032faa04c4bb +hash=54444c4eae550cc5db7327b4047c36aa5f064bf7 diff --git a/lib/commercetools-import-tests/gen.properties b/lib/commercetools-import-tests/gen.properties index 082436aefdb..3bcd76e07fa 100644 --- a/lib/commercetools-import-tests/gen.properties +++ b/lib/commercetools-import-tests/gen.properties @@ -1 +1 @@ -hash=f0c268413ad3a79b40cf1506214f032faa04c4bb +hash=54444c4eae550cc5db7327b4047c36aa5f064bf7 diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyCategoriesImportSinkKeyByImportSinkKeyImportOperationsTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyCategoriesImportSinkKeyByImportSinkKeyImportOperationsTest.php index ff607e1e1d3..be7cb247fe6 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyCategoriesImportSinkKeyByImportSinkKeyImportOperationsTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyCategoriesImportSinkKeyByImportSinkKeyImportOperationsTest.php @@ -165,6 +165,19 @@ function (ImportRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/categories/importSinkKey=test_importSinkKey/import-operations?state=state', ], + 'ByProjectKeyCategoriesImportSinkKeyByImportSinkKeyImportOperationsGet_withDebug' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->categories() + ->importSinkKeyWithImportSinkKeyValue('test_importSinkKey') + ->importOperations() + ->get() + ->withDebug('debug'); + }, + 'get', + 'test_projectKey/categories/importSinkKey=test_importSinkKey/import-operations?debug=debug', + ], 'ByProjectKeyCategoriesImportSinkKeyByImportSinkKeyImportOperationsGet' => [ function (ImportRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersImportSinkKeyByImportSinkKeyImportOperationsTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersImportSinkKeyByImportSinkKeyImportOperationsTest.php index a3e07c8ecaf..9d563d4081b 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersImportSinkKeyByImportSinkKeyImportOperationsTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyCustomersImportSinkKeyByImportSinkKeyImportOperationsTest.php @@ -165,6 +165,19 @@ function (ImportRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/customers/importSinkKey=test_importSinkKey/import-operations?state=state', ], + 'ByProjectKeyCustomersImportSinkKeyByImportSinkKeyImportOperationsGet_withDebug' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->customers() + ->importSinkKeyWithImportSinkKeyValue('test_importSinkKey') + ->importOperations() + ->get() + ->withDebug('debug'); + }, + 'get', + 'test_projectKey/customers/importSinkKey=test_importSinkKey/import-operations?debug=debug', + ], 'ByProjectKeyCustomersImportSinkKeyByImportSinkKeyImportOperationsGet' => [ function (ImportRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyInventoriesImportSinkKeyByImportSinkKeyImportOperationsTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyInventoriesImportSinkKeyByImportSinkKeyImportOperationsTest.php index 5f09ede9b7f..7efaeea117b 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyInventoriesImportSinkKeyByImportSinkKeyImportOperationsTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyInventoriesImportSinkKeyByImportSinkKeyImportOperationsTest.php @@ -165,6 +165,19 @@ function (ImportRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/inventories/importSinkKey=test_importSinkKey/import-operations?state=state', ], + 'ByProjectKeyInventoriesImportSinkKeyByImportSinkKeyImportOperationsGet_withDebug' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->inventories() + ->importSinkKeyWithImportSinkKeyValue('test_importSinkKey') + ->importOperations() + ->get() + ->withDebug('debug'); + }, + 'get', + 'test_projectKey/inventories/importSinkKey=test_importSinkKey/import-operations?debug=debug', + ], 'ByProjectKeyInventoriesImportSinkKeyByImportSinkKeyImportOperationsGet' => [ function (ImportRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyOrderPatchesImportSinkKeyByImportSinkKeyImportOperationsTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyOrderPatchesImportSinkKeyByImportSinkKeyImportOperationsTest.php index a582a82c2ea..b58485a72b0 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyOrderPatchesImportSinkKeyByImportSinkKeyImportOperationsTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyOrderPatchesImportSinkKeyByImportSinkKeyImportOperationsTest.php @@ -165,6 +165,19 @@ function (ImportRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/order-patches/importSinkKey=test_importSinkKey/import-operations?state=state', ], + 'ByProjectKeyOrderPatchesImportSinkKeyByImportSinkKeyImportOperationsGet_withDebug' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->orderPatches() + ->importSinkKeyWithImportSinkKeyValue('test_importSinkKey') + ->importOperations() + ->get() + ->withDebug('debug'); + }, + 'get', + 'test_projectKey/order-patches/importSinkKey=test_importSinkKey/import-operations?debug=debug', + ], 'ByProjectKeyOrderPatchesImportSinkKeyByImportSinkKeyImportOperationsGet' => [ function (ImportRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyOrdersImportSinkKeyByImportSinkKeyImportOperationsTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyOrdersImportSinkKeyByImportSinkKeyImportOperationsTest.php index f22c42b84c9..9f8bd77a0d2 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyOrdersImportSinkKeyByImportSinkKeyImportOperationsTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyOrdersImportSinkKeyByImportSinkKeyImportOperationsTest.php @@ -165,6 +165,19 @@ function (ImportRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/orders/importSinkKey=test_importSinkKey/import-operations?state=state', ], + 'ByProjectKeyOrdersImportSinkKeyByImportSinkKeyImportOperationsGet_withDebug' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->orders() + ->importSinkKeyWithImportSinkKeyValue('test_importSinkKey') + ->importOperations() + ->get() + ->withDebug('debug'); + }, + 'get', + 'test_projectKey/orders/importSinkKey=test_importSinkKey/import-operations?debug=debug', + ], 'ByProjectKeyOrdersImportSinkKeyByImportSinkKeyImportOperationsGet' => [ function (ImportRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyPricesImportSinkKeyByImportSinkKeyImportOperationsTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyPricesImportSinkKeyByImportSinkKeyImportOperationsTest.php index eb65a174642..72449bd848e 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyPricesImportSinkKeyByImportSinkKeyImportOperationsTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyPricesImportSinkKeyByImportSinkKeyImportOperationsTest.php @@ -165,6 +165,19 @@ function (ImportRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/prices/importSinkKey=test_importSinkKey/import-operations?state=state', ], + 'ByProjectKeyPricesImportSinkKeyByImportSinkKeyImportOperationsGet_withDebug' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->prices() + ->importSinkKeyWithImportSinkKeyValue('test_importSinkKey') + ->importOperations() + ->get() + ->withDebug('debug'); + }, + 'get', + 'test_projectKey/prices/importSinkKey=test_importSinkKey/import-operations?debug=debug', + ], 'ByProjectKeyPricesImportSinkKeyByImportSinkKeyImportOperationsGet' => [ function (ImportRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductDraftsImportSinkKeyByImportSinkKeyImportOperationsTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductDraftsImportSinkKeyByImportSinkKeyImportOperationsTest.php index 9aff36f3e0f..c2f4dee7cf6 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductDraftsImportSinkKeyByImportSinkKeyImportOperationsTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductDraftsImportSinkKeyByImportSinkKeyImportOperationsTest.php @@ -165,6 +165,19 @@ function (ImportRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-drafts/importSinkKey=test_importSinkKey/import-operations?state=state', ], + 'ByProjectKeyProductDraftsImportSinkKeyByImportSinkKeyImportOperationsGet_withDebug' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->productDrafts() + ->importSinkKeyWithImportSinkKeyValue('test_importSinkKey') + ->importOperations() + ->get() + ->withDebug('debug'); + }, + 'get', + 'test_projectKey/product-drafts/importSinkKey=test_importSinkKey/import-operations?debug=debug', + ], 'ByProjectKeyProductDraftsImportSinkKeyByImportSinkKeyImportOperationsGet' => [ function (ImportRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesImportSinkKeyByImportSinkKeyImportOperationsTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesImportSinkKeyByImportSinkKeyImportOperationsTest.php index 75bc2e3fd9e..89ca90e90dc 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesImportSinkKeyByImportSinkKeyImportOperationsTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesImportSinkKeyByImportSinkKeyImportOperationsTest.php @@ -165,6 +165,19 @@ function (ImportRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-types/importSinkKey=test_importSinkKey/import-operations?state=state', ], + 'ByProjectKeyProductTypesImportSinkKeyByImportSinkKeyImportOperationsGet_withDebug' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->productTypes() + ->importSinkKeyWithImportSinkKeyValue('test_importSinkKey') + ->importOperations() + ->get() + ->withDebug('debug'); + }, + 'get', + 'test_projectKey/product-types/importSinkKey=test_importSinkKey/import-operations?debug=debug', + ], 'ByProjectKeyProductTypesImportSinkKeyByImportSinkKeyImportOperationsGet' => [ function (ImportRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductVariantPatchesImportSinkKeyByImportSinkKeyImportOperationsTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductVariantPatchesImportSinkKeyByImportSinkKeyImportOperationsTest.php index cf0b860fad7..7598ea41e03 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductVariantPatchesImportSinkKeyByImportSinkKeyImportOperationsTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductVariantPatchesImportSinkKeyByImportSinkKeyImportOperationsTest.php @@ -165,6 +165,19 @@ function (ImportRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-variant-patches/importSinkKey=test_importSinkKey/import-operations?state=state', ], + 'ByProjectKeyProductVariantPatchesImportSinkKeyByImportSinkKeyImportOperationsGet_withDebug' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->productVariantPatches() + ->importSinkKeyWithImportSinkKeyValue('test_importSinkKey') + ->importOperations() + ->get() + ->withDebug('debug'); + }, + 'get', + 'test_projectKey/product-variant-patches/importSinkKey=test_importSinkKey/import-operations?debug=debug', + ], 'ByProjectKeyProductVariantPatchesImportSinkKeyByImportSinkKeyImportOperationsGet' => [ function (ImportRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductVariantsImportSinkKeyByImportSinkKeyImportOperationsTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductVariantsImportSinkKeyByImportSinkKeyImportOperationsTest.php index 1d6c152e4db..163cfc53f16 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductVariantsImportSinkKeyByImportSinkKeyImportOperationsTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductVariantsImportSinkKeyByImportSinkKeyImportOperationsTest.php @@ -165,6 +165,19 @@ function (ImportRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-variants/importSinkKey=test_importSinkKey/import-operations?state=state', ], + 'ByProjectKeyProductVariantsImportSinkKeyByImportSinkKeyImportOperationsGet_withDebug' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->productVariants() + ->importSinkKeyWithImportSinkKeyValue('test_importSinkKey') + ->importOperations() + ->get() + ->withDebug('debug'); + }, + 'get', + 'test_projectKey/product-variants/importSinkKey=test_importSinkKey/import-operations?debug=debug', + ], 'ByProjectKeyProductVariantsImportSinkKeyByImportSinkKeyImportOperationsGet' => [ function (ImportRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsImportSinkKeyByImportSinkKeyImportOperationsTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsImportSinkKeyByImportSinkKeyImportOperationsTest.php index eedaa57113f..17b39d2ef63 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsImportSinkKeyByImportSinkKeyImportOperationsTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsImportSinkKeyByImportSinkKeyImportOperationsTest.php @@ -165,6 +165,19 @@ function (ImportRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/products/importSinkKey=test_importSinkKey/import-operations?state=state', ], + 'ByProjectKeyProductsImportSinkKeyByImportSinkKeyImportOperationsGet_withDebug' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->products() + ->importSinkKeyWithImportSinkKeyValue('test_importSinkKey') + ->importOperations() + ->get() + ->withDebug('debug'); + }, + 'get', + 'test_projectKey/products/importSinkKey=test_importSinkKey/import-operations?debug=debug', + ], 'ByProjectKeyProductsImportSinkKeyByImportSinkKeyImportOperationsGet' => [ function (ImportRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-import/gen.properties b/lib/commercetools-import/gen.properties index 082436aefdb..3bcd76e07fa 100644 --- a/lib/commercetools-import/gen.properties +++ b/lib/commercetools-import/gen.properties @@ -1 +1 @@ -hash=f0c268413ad3a79b40cf1506214f032faa04c4bb +hash=54444c4eae550cc5db7327b4047c36aa5f064bf7 diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyCategoriesImportSinkKeyByImportSinkKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyCategoriesImportSinkKeyByImportSinkKeyImportOperationsGet.php index 20e8d7a8697..d740700d585 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyCategoriesImportSinkKeyByImportSinkKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyCategoriesImportSinkKeyByImportSinkKeyImportOperationsGet.php @@ -156,4 +156,13 @@ public function withState($state): ByProjectKeyCategoriesImportSinkKeyByImportSi { return $this->withQueryParam('state', $state); } + + /** + * + * @psalm-param scalar|scalar[] $debug + */ + public function withDebug($debug): ByProjectKeyCategoriesImportSinkKeyByImportSinkKeyImportOperationsGet + { + return $this->withQueryParam('debug', $debug); + } } diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyCustomersImportSinkKeyByImportSinkKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyCustomersImportSinkKeyByImportSinkKeyImportOperationsGet.php index a96ccc1c716..3207b967a07 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyCustomersImportSinkKeyByImportSinkKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyCustomersImportSinkKeyByImportSinkKeyImportOperationsGet.php @@ -156,4 +156,13 @@ public function withState($state): ByProjectKeyCustomersImportSinkKeyByImportSin { return $this->withQueryParam('state', $state); } + + /** + * + * @psalm-param scalar|scalar[] $debug + */ + public function withDebug($debug): ByProjectKeyCustomersImportSinkKeyByImportSinkKeyImportOperationsGet + { + return $this->withQueryParam('debug', $debug); + } } diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyInventoriesImportSinkKeyByImportSinkKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyInventoriesImportSinkKeyByImportSinkKeyImportOperationsGet.php index b44dccefac1..bd3e0de9720 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyInventoriesImportSinkKeyByImportSinkKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyInventoriesImportSinkKeyByImportSinkKeyImportOperationsGet.php @@ -156,4 +156,13 @@ public function withState($state): ByProjectKeyInventoriesImportSinkKeyByImportS { return $this->withQueryParam('state', $state); } + + /** + * + * @psalm-param scalar|scalar[] $debug + */ + public function withDebug($debug): ByProjectKeyInventoriesImportSinkKeyByImportSinkKeyImportOperationsGet + { + return $this->withQueryParam('debug', $debug); + } } diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrderPatchesImportSinkKeyByImportSinkKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrderPatchesImportSinkKeyByImportSinkKeyImportOperationsGet.php index 5da7d7d7bbf..0b0faed92ae 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrderPatchesImportSinkKeyByImportSinkKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrderPatchesImportSinkKeyByImportSinkKeyImportOperationsGet.php @@ -156,4 +156,13 @@ public function withState($state): ByProjectKeyOrderPatchesImportSinkKeyByImport { return $this->withQueryParam('state', $state); } + + /** + * + * @psalm-param scalar|scalar[] $debug + */ + public function withDebug($debug): ByProjectKeyOrderPatchesImportSinkKeyByImportSinkKeyImportOperationsGet + { + return $this->withQueryParam('debug', $debug); + } } diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrdersImportSinkKeyByImportSinkKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrdersImportSinkKeyByImportSinkKeyImportOperationsGet.php index abc8ff79766..5999e7a916f 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrdersImportSinkKeyByImportSinkKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrdersImportSinkKeyByImportSinkKeyImportOperationsGet.php @@ -156,4 +156,13 @@ public function withState($state): ByProjectKeyOrdersImportSinkKeyByImportSinkKe { return $this->withQueryParam('state', $state); } + + /** + * + * @psalm-param scalar|scalar[] $debug + */ + public function withDebug($debug): ByProjectKeyOrdersImportSinkKeyByImportSinkKeyImportOperationsGet + { + return $this->withQueryParam('debug', $debug); + } } diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyPricesImportSinkKeyByImportSinkKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyPricesImportSinkKeyByImportSinkKeyImportOperationsGet.php index cae14d4a235..1a014cb4645 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyPricesImportSinkKeyByImportSinkKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyPricesImportSinkKeyByImportSinkKeyImportOperationsGet.php @@ -156,4 +156,13 @@ public function withState($state): ByProjectKeyPricesImportSinkKeyByImportSinkKe { return $this->withQueryParam('state', $state); } + + /** + * + * @psalm-param scalar|scalar[] $debug + */ + public function withDebug($debug): ByProjectKeyPricesImportSinkKeyByImportSinkKeyImportOperationsGet + { + return $this->withQueryParam('debug', $debug); + } } diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductDraftsImportSinkKeyByImportSinkKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductDraftsImportSinkKeyByImportSinkKeyImportOperationsGet.php index fd76c4ede7f..338e9b21fb9 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductDraftsImportSinkKeyByImportSinkKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductDraftsImportSinkKeyByImportSinkKeyImportOperationsGet.php @@ -156,4 +156,13 @@ public function withState($state): ByProjectKeyProductDraftsImportSinkKeyByImpor { return $this->withQueryParam('state', $state); } + + /** + * + * @psalm-param scalar|scalar[] $debug + */ + public function withDebug($debug): ByProjectKeyProductDraftsImportSinkKeyByImportSinkKeyImportOperationsGet + { + return $this->withQueryParam('debug', $debug); + } } diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductTypesImportSinkKeyByImportSinkKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductTypesImportSinkKeyByImportSinkKeyImportOperationsGet.php index 49c291c251f..9e1e2ff9c17 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductTypesImportSinkKeyByImportSinkKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductTypesImportSinkKeyByImportSinkKeyImportOperationsGet.php @@ -156,4 +156,13 @@ public function withState($state): ByProjectKeyProductTypesImportSinkKeyByImport { return $this->withQueryParam('state', $state); } + + /** + * + * @psalm-param scalar|scalar[] $debug + */ + public function withDebug($debug): ByProjectKeyProductTypesImportSinkKeyByImportSinkKeyImportOperationsGet + { + return $this->withQueryParam('debug', $debug); + } } diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantPatchesImportSinkKeyByImportSinkKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantPatchesImportSinkKeyByImportSinkKeyImportOperationsGet.php index 75dd085cc53..d8dfebecb3e 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantPatchesImportSinkKeyByImportSinkKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantPatchesImportSinkKeyByImportSinkKeyImportOperationsGet.php @@ -156,4 +156,13 @@ public function withState($state): ByProjectKeyProductVariantPatchesImportSinkKe { return $this->withQueryParam('state', $state); } + + /** + * + * @psalm-param scalar|scalar[] $debug + */ + public function withDebug($debug): ByProjectKeyProductVariantPatchesImportSinkKeyByImportSinkKeyImportOperationsGet + { + return $this->withQueryParam('debug', $debug); + } } diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantsImportSinkKeyByImportSinkKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantsImportSinkKeyByImportSinkKeyImportOperationsGet.php index c5f904b9547..7864f98cf5d 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantsImportSinkKeyByImportSinkKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantsImportSinkKeyByImportSinkKeyImportOperationsGet.php @@ -156,4 +156,13 @@ public function withState($state): ByProjectKeyProductVariantsImportSinkKeyByImp { return $this->withQueryParam('state', $state); } + + /** + * + * @psalm-param scalar|scalar[] $debug + */ + public function withDebug($debug): ByProjectKeyProductVariantsImportSinkKeyByImportSinkKeyImportOperationsGet + { + return $this->withQueryParam('debug', $debug); + } } diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductsImportSinkKeyByImportSinkKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductsImportSinkKeyByImportSinkKeyImportOperationsGet.php index 3afa1db3c4d..7d5e881e2e6 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductsImportSinkKeyByImportSinkKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductsImportSinkKeyByImportSinkKeyImportOperationsGet.php @@ -156,4 +156,13 @@ public function withState($state): ByProjectKeyProductsImportSinkKeyByImportSink { return $this->withQueryParam('state', $state); } + + /** + * + * @psalm-param scalar|scalar[] $debug + */ + public function withDebug($debug): ByProjectKeyProductsImportSinkKeyByImportSinkKeyImportOperationsGet + { + return $this->withQueryParam('debug', $debug); + } } diff --git a/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyImportSinksByImportSinkKey.php b/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyImportSinksByImportSinkKey.php index 000597d2298..395e49ff571 100644 --- a/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyImportSinksByImportSinkKey.php +++ b/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyImportSinksByImportSinkKey.php @@ -9,7 +9,7 @@ namespace Commercetools\Import\Client\Resource; use Commercetools\Client\ApiResource; -use Commercetools\Import\Models\Importsinks\ImportSinkDraft; +use Commercetools\Import\Models\Importsinks\ImportSinkUpdateDraft; use GuzzleHttp\ClientInterface; use Psr\Http\Message\UploadedFileInterface; @@ -27,10 +27,10 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** - * @psalm-param ?ImportSinkDraft $body + * @psalm-param ?ImportSinkUpdateDraft $body * @psalm-param array $headers */ - public function put(?ImportSinkDraft $body = null, array $headers = []): ByProjectKeyImportSinksByImportSinkKeyPut + public function put(?ImportSinkUpdateDraft $body = null, array $headers = []): ByProjectKeyImportSinksByImportSinkKeyPut { $args = $this->getArgs(); diff --git a/lib/commercetools-import/src/Models/Common/AssetDimensions.php b/lib/commercetools-import/src/Models/Common/AssetDimensions.php index 006624c0b08..e406b4b958e 100644 --- a/lib/commercetools-import/src/Models/Common/AssetDimensions.php +++ b/lib/commercetools-import/src/Models/Common/AssetDimensions.php @@ -19,24 +19,24 @@ interface AssetDimensions extends JsonObject /** *

The width of the asset source.

* - * @return null|float + * @return null|int */ public function getW(); /** *

The height of the asset source.

* - * @return null|float + * @return null|int */ public function getH(); /** - * @param ?float $w + * @param ?int $w */ - public function setW(?float $w): void; + public function setW(?int $w): void; /** - * @param ?float $h + * @param ?int $h */ - public function setH(?float $h): void; + public function setH(?int $h): void; } diff --git a/lib/commercetools-import/src/Models/Common/AssetDimensionsBuilder.php b/lib/commercetools-import/src/Models/Common/AssetDimensionsBuilder.php index 9355378ed6e..d5a248c54d8 100644 --- a/lib/commercetools-import/src/Models/Common/AssetDimensionsBuilder.php +++ b/lib/commercetools-import/src/Models/Common/AssetDimensionsBuilder.php @@ -21,19 +21,19 @@ final class AssetDimensionsBuilder implements Builder { /** - * @var ?float + * @var ?int */ private $w; /** - * @var ?float + * @var ?int */ private $h; /** *

The width of the asset source.

* - * @return null|float + * @return null|int */ public function getW() { @@ -43,7 +43,7 @@ public function getW() /** *

The height of the asset source.

* - * @return null|float + * @return null|int */ public function getH() { @@ -51,10 +51,10 @@ public function getH() } /** - * @param ?float $w + * @param ?int $w * @return $this */ - public function withW(?float $w) + public function withW(?int $w) { $this->w = $w; @@ -62,10 +62,10 @@ public function withW(?float $w) } /** - * @param ?float $h + * @param ?int $h * @return $this */ - public function withH(?float $h) + public function withH(?int $h) { $this->h = $h; diff --git a/lib/commercetools-import/src/Models/Common/AssetDimensionsModel.php b/lib/commercetools-import/src/Models/Common/AssetDimensionsModel.php index b044478a954..d5077a04425 100644 --- a/lib/commercetools-import/src/Models/Common/AssetDimensionsModel.php +++ b/lib/commercetools-import/src/Models/Common/AssetDimensionsModel.php @@ -20,12 +20,12 @@ final class AssetDimensionsModel extends JsonObjectModel implements AssetDimensions { /** - * @var ?float + * @var ?int */ protected $w; /** - * @var ?float + * @var ?int */ protected $h; @@ -34,8 +34,8 @@ final class AssetDimensionsModel extends JsonObjectModel implements AssetDimensi * @psalm-suppress MissingParamType */ public function __construct( - ?float $w = null, - ?float $h = null + ?int $w = null, + ?int $h = null ) { $this->w = $w; $this->h = $h; @@ -44,17 +44,17 @@ public function __construct( /** *

The width of the asset source.

* - * @return null|float + * @return null|int */ public function getW() { if (is_null($this->w)) { - /** @psalm-var ?float $data */ + /** @psalm-var ?int $data */ $data = $this->raw(self::FIELD_W); if (is_null($data)) { return null; } - $this->w = (float) $data; + $this->w = (int) $data; } return $this->w; @@ -63,17 +63,17 @@ public function getW() /** *

The height of the asset source.

* - * @return null|float + * @return null|int */ public function getH() { if (is_null($this->h)) { - /** @psalm-var ?float $data */ + /** @psalm-var ?int $data */ $data = $this->raw(self::FIELD_H); if (is_null($data)) { return null; } - $this->h = (float) $data; + $this->h = (int) $data; } return $this->h; @@ -81,17 +81,17 @@ public function getH() /** - * @param ?float $w + * @param ?int $w */ - public function setW(?float $w): void + public function setW(?int $w): void { $this->w = $w; } /** - * @param ?float $h + * @param ?int $h */ - public function setH(?float $h): void + public function setH(?int $h): void { $this->h = $h; } diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperation.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperation.php index ba5f76f2aad..61b272eb715 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperation.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperation.php @@ -10,6 +10,7 @@ use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; +use Commercetools\Import\Models\Common\KeyReferenceCollection; use Commercetools\Import\Models\Errors\ErrorObjectCollection; use DateTimeImmutable; @@ -22,6 +23,7 @@ interface ImportOperation extends JsonObject public const FIELD_STATE = 'state'; public const FIELD_RESOURCE_VERSION = 'resourceVersion'; public const FIELD_ERRORS = 'errors'; + public const FIELD_UNRESOLVED_REFERENCES = 'unresolvedReferences'; public const FIELD_CREATED_AT = 'createdAt'; public const FIELD_LAST_MODIFIED_AT = 'lastModifiedAt'; public const FIELD_EXPIRES_AT = 'expiresAt'; @@ -75,6 +77,13 @@ public function getResourceVersion(); */ public function getErrors(); + /** + *

In case of unresolved status this array will show the unresolved references

+ * + * @return null|KeyReferenceCollection + */ + public function getUnresolvedReferences(); + /** *

The time when the ImportOperation was created.

* @@ -131,6 +140,11 @@ public function setResourceVersion(?int $resourceVersion): void; */ public function setErrors(?ErrorObjectCollection $errors): void; + /** + * @param ?KeyReferenceCollection $unresolvedReferences + */ + public function setUnresolvedReferences(?KeyReferenceCollection $unresolvedReferences): void; + /** * @param ?DateTimeImmutable $createdAt */ diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperationBuilder.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperationBuilder.php index 22230fd052b..109b2f387e4 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperationBuilder.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperationBuilder.php @@ -13,6 +13,7 @@ use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; use Commercetools\Base\MapperFactory; +use Commercetools\Import\Models\Common\KeyReferenceCollection; use Commercetools\Import\Models\Errors\ErrorObjectCollection; use DateTimeImmutable; use stdClass; @@ -57,6 +58,11 @@ final class ImportOperationBuilder implements Builder */ private $errors; + /** + * @var ?KeyReferenceCollection + */ + private $unresolvedReferences; + /** * @var ?DateTimeImmutable */ @@ -142,6 +148,16 @@ public function getErrors() return $this->errors; } + /** + *

In case of unresolved status this array will show the unresolved references

+ * + * @return null|KeyReferenceCollection + */ + public function getUnresolvedReferences() + { + return $this->unresolvedReferences; + } + /** *

The time when the ImportOperation was created.

* @@ -249,6 +265,17 @@ public function withErrors(?ErrorObjectCollection $errors) return $this; } + /** + * @param ?KeyReferenceCollection $unresolvedReferences + * @return $this + */ + public function withUnresolvedReferences(?KeyReferenceCollection $unresolvedReferences) + { + $this->unresolvedReferences = $unresolvedReferences; + + return $this; + } + /** * @param ?DateTimeImmutable $createdAt * @return $this @@ -293,6 +320,7 @@ public function build(): ImportOperation $this->state, $this->resourceVersion, $this->errors, + $this->unresolvedReferences, $this->createdAt, $this->lastModifiedAt, $this->expiresAt diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperationModel.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperationModel.php index eca88dfc890..712c04c9d77 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperationModel.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperationModel.php @@ -12,6 +12,7 @@ use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; use Commercetools\Base\MapperFactory; +use Commercetools\Import\Models\Common\KeyReferenceCollection; use Commercetools\Import\Models\Errors\ErrorObjectCollection; use DateTimeImmutable; use stdClass; @@ -56,6 +57,11 @@ final class ImportOperationModel extends JsonObjectModel implements ImportOperat */ protected $errors; + /** + * @var ?KeyReferenceCollection + */ + protected $unresolvedReferences; + /** * @var ?DateTimeImmutable */ @@ -83,6 +89,7 @@ public function __construct( ?string $state = null, ?int $resourceVersion = null, ?ErrorObjectCollection $errors = null, + ?KeyReferenceCollection $unresolvedReferences = null, ?DateTimeImmutable $createdAt = null, ?DateTimeImmutable $lastModifiedAt = null, ?DateTimeImmutable $expiresAt = null @@ -94,6 +101,7 @@ public function __construct( $this->state = $state; $this->resourceVersion = $resourceVersion; $this->errors = $errors; + $this->unresolvedReferences = $unresolvedReferences; $this->createdAt = $createdAt; $this->lastModifiedAt = $lastModifiedAt; $this->expiresAt = $expiresAt; @@ -232,6 +240,25 @@ public function getErrors() return $this->errors; } + /** + *

In case of unresolved status this array will show the unresolved references

+ * + * @return null|KeyReferenceCollection + */ + public function getUnresolvedReferences() + { + if (is_null($this->unresolvedReferences)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_UNRESOLVED_REFERENCES); + if (is_null($data)) { + return null; + } + $this->unresolvedReferences = KeyReferenceCollection::fromArray($data); + } + + return $this->unresolvedReferences; + } + /** *

The time when the ImportOperation was created.

* @@ -358,6 +385,14 @@ public function setErrors(?ErrorObjectCollection $errors): void $this->errors = $errors; } + /** + * @param ?KeyReferenceCollection $unresolvedReferences + */ + public function setUnresolvedReferences(?KeyReferenceCollection $unresolvedReferences): void + { + $this->unresolvedReferences = $unresolvedReferences; + } + /** * @param ?DateTimeImmutable $createdAt */ diff --git a/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraft.php b/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraft.php index 7742b3a8136..d46592ff9f4 100644 --- a/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraft.php +++ b/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraft.php @@ -13,17 +13,9 @@ interface ImportSinkDraft extends JsonObject { - public const FIELD_VERSION = 'version'; public const FIELD_KEY = 'key'; public const FIELD_RESOURCE_TYPE = 'resourceType'; - /** - *

The version of the ImportSinkDraft.

- * - * @return null|int - */ - public function getVersion(); - /** *

User-defined unique identifier of the ImportSink. * Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).

@@ -40,11 +32,6 @@ public function getKey(); */ public function getResourceType(); - /** - * @param ?int $version - */ - public function setVersion(?int $version): void; - /** * @param ?string $key */ diff --git a/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraftBuilder.php b/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraftBuilder.php index 8fda3346007..bcdef8470c5 100644 --- a/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraftBuilder.php +++ b/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraftBuilder.php @@ -20,11 +20,6 @@ */ final class ImportSinkDraftBuilder implements Builder { - /** - * @var ?int - */ - private $version; - /** * @var ?string */ @@ -35,16 +30,6 @@ final class ImportSinkDraftBuilder implements Builder */ private $resourceType; - /** - *

The version of the ImportSinkDraft.

- * - * @return null|int - */ - public function getVersion() - { - return $this->version; - } - /** *

User-defined unique identifier of the ImportSink. * Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).

@@ -67,17 +52,6 @@ public function getResourceType() return $this->resourceType; } - /** - * @param ?int $version - * @return $this - */ - public function withVersion(?int $version) - { - $this->version = $version; - - return $this; - } - /** * @param ?string $key * @return $this @@ -104,7 +78,6 @@ public function withResourceType(?string $resourceType) public function build(): ImportSinkDraft { return new ImportSinkDraftModel( - $this->version, $this->key, $this->resourceType ); diff --git a/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraftModel.php b/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraftModel.php index 8b387bd0868..aa48948d769 100644 --- a/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraftModel.php +++ b/lib/commercetools-import/src/Models/Importsinks/ImportSinkDraftModel.php @@ -19,11 +19,6 @@ */ final class ImportSinkDraftModel extends JsonObjectModel implements ImportSinkDraft { - /** - * @var ?int - */ - protected $version; - /** * @var ?string */ @@ -39,34 +34,13 @@ final class ImportSinkDraftModel extends JsonObjectModel implements ImportSinkDr * @psalm-suppress MissingParamType */ public function __construct( - ?int $version = null, ?string $key = null, ?string $resourceType = null ) { - $this->version = $version; $this->key = $key; $this->resourceType = $resourceType; } - /** - *

The version of the ImportSinkDraft.

- * - * @return null|int - */ - public function getVersion() - { - if (is_null($this->version)) { - /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_VERSION); - if (is_null($data)) { - return null; - } - $this->version = (int) $data; - } - - return $this->version; - } - /** *

User-defined unique identifier of the ImportSink. * Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).

@@ -108,14 +82,6 @@ public function getResourceType() } - /** - * @param ?int $version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - /** * @param ?string $key */ diff --git a/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraft.php b/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraft.php new file mode 100644 index 00000000000..0f2fb1658b2 --- /dev/null +++ b/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraft.php @@ -0,0 +1,43 @@ +Current version of the ImportSink.

+ * + * @return null|int + */ + public function getVersion(); + + /** + *

The resource type to be imported. + * If not given, the ImportSink is able to import all of the supported ImportResourceTypes.

+ * + * @return null|string + */ + public function getResourceType(); + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void; + + /** + * @param ?string $resourceType + */ + public function setResourceType(?string $resourceType): void; +} diff --git a/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraftBuilder.php b/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraftBuilder.php new file mode 100644 index 00000000000..62590de26da --- /dev/null +++ b/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraftBuilder.php @@ -0,0 +1,89 @@ + + */ +final class ImportSinkUpdateDraftBuilder implements Builder +{ + /** + * @var ?int + */ + private $version; + + /** + * @var ?string + */ + private $resourceType; + + /** + *

Current version of the ImportSink.

+ * + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

The resource type to be imported. + * If not given, the ImportSink is able to import all of the supported ImportResourceTypes.

+ * + * @return null|string + */ + public function getResourceType() + { + return $this->resourceType; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?string $resourceType + * @return $this + */ + public function withResourceType(?string $resourceType) + { + $this->resourceType = $resourceType; + + return $this; + } + + + public function build(): ImportSinkUpdateDraft + { + return new ImportSinkUpdateDraftModel( + $this->version, + $this->resourceType + ); + } + + public static function of(): ImportSinkUpdateDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraftCollection.php b/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraftCollection.php new file mode 100644 index 00000000000..612a7800a8d --- /dev/null +++ b/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraftCollection.php @@ -0,0 +1,55 @@ + + * @method ImportSinkUpdateDraft current() + * @method ImportSinkUpdateDraft at($offset) + */ +class ImportSinkUpdateDraftCollection extends MapperSequence +{ + /** + * @psalm-assert ImportSinkUpdateDraft $value + * @psalm-param ImportSinkUpdateDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return ImportSinkUpdateDraftCollection + */ + public function add($value) + { + if (!$value instanceof ImportSinkUpdateDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ImportSinkUpdateDraft + */ + protected function mapper() + { + return function (int $index): ?ImportSinkUpdateDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ImportSinkUpdateDraft $data */ + $data = ImportSinkUpdateDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraftModel.php b/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraftModel.php new file mode 100644 index 00000000000..d043f1c2adf --- /dev/null +++ b/lib/commercetools-import/src/Models/Importsinks/ImportSinkUpdateDraftModel.php @@ -0,0 +1,99 @@ +version = $version; + $this->resourceType = $resourceType; + } + + /** + *

Current version of the ImportSink.

+ * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

The resource type to be imported. + * If not given, the ImportSink is able to import all of the supported ImportResourceTypes.

+ * + * @return null|string + */ + public function getResourceType() + { + if (is_null($this->resourceType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RESOURCE_TYPE); + if (is_null($data)) { + return null; + } + $this->resourceType = (string) $data; + } + + return $this->resourceType; + } + + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?string $resourceType + */ + public function setResourceType(?string $resourceType): void + { + $this->resourceType = $resourceType; + } +} diff --git a/lib/commercetools-ml-tests/gen.properties b/lib/commercetools-ml-tests/gen.properties index 082436aefdb..3bcd76e07fa 100644 --- a/lib/commercetools-ml-tests/gen.properties +++ b/lib/commercetools-ml-tests/gen.properties @@ -1 +1 @@ -hash=f0c268413ad3a79b40cf1506214f032faa04c4bb +hash=54444c4eae550cc5db7327b4047c36aa5f064bf7 diff --git a/lib/commercetools-ml/gen.properties b/lib/commercetools-ml/gen.properties index 082436aefdb..3bcd76e07fa 100644 --- a/lib/commercetools-ml/gen.properties +++ b/lib/commercetools-ml/gen.properties @@ -1 +1 @@ -hash=f0c268413ad3a79b40cf1506214f032faa04c4bb +hash=54444c4eae550cc5db7327b4047c36aa5f064bf7