From 615d1b8afd883cbfb3ad4214848f520009ea3281 Mon Sep 17 00:00:00 2001 From: phodoval <9001218+phodoval@users.noreply.github.com> Date: Mon, 3 Aug 2026 10:43:31 +0200 Subject: [PATCH] [create-pull-request] automated change --- init.php | 4 +++ src/Endpoint/EndpointMap.php | 1 + .../Products/ProductImageBatchDelete.php | 35 +++++++++++++++++++ .../ProductImageBatchDeleteRequest.php | 33 +++++++++++++++++ .../ProductImageBatchDeleteResponse.php | 35 +++++++++++++++++++ .../ProductImageBatchDeleteResponse/Data.php | 21 +++++++++++ src/Sdk.php | 27 ++++++++++++++ 7 files changed, 156 insertions(+) create mode 100644 src/Endpoint/Products/ProductImageBatchDelete.php create mode 100644 src/Endpoint/Products/ProductImageBatchDeleteRequest/ProductImageBatchDeleteRequest.php create mode 100644 src/Endpoint/Products/ProductImageBatchDeleteResponse/ProductImageBatchDeleteResponse.php create mode 100644 src/Endpoint/Products/ProductImageBatchDeleteResponse/ProductImageBatchDeleteResponse/Data.php diff --git a/init.php b/init.php index 2ffc55f..3d5a90b 100644 --- a/init.php +++ b/init.php @@ -1573,6 +1573,10 @@ require_once __DIR__ . '/src/Endpoint/Products/ProductCopyRequest/ProductCopyRequest/Data.php'; require_once __DIR__ . '/src/Endpoint/Products/ProductCopyRequest/ProductCopyRequest/Data/CopyProperties.php'; require_once __DIR__ . '/src/Endpoint/Products/ProductCopyResponse/ProductCopyResponse.php'; +require_once __DIR__ . '/src/Endpoint/Products/ProductImageBatchDelete.php'; +require_once __DIR__ . '/src/Endpoint/Products/ProductImageBatchDeleteRequest/ProductImageBatchDeleteRequest.php'; +require_once __DIR__ . '/src/Endpoint/Products/ProductImageBatchDeleteResponse/ProductImageBatchDeleteResponse.php'; +require_once __DIR__ . '/src/Endpoint/Products/ProductImageBatchDeleteResponse/ProductImageBatchDeleteResponse/Data.php'; require_once __DIR__ . '/src/Endpoint/Products/UnlinkAllProductRelatedFiles.php'; require_once __DIR__ . '/src/Endpoint/Products/UnlinkAllProductRelatedFilesResponse/UnlinkAllProductRelatedFilesResponse.php'; require_once __DIR__ . '/src/Endpoint/Products/UnlinkAllProductRelatedFilesResponse/UnlinkAllProductRelatedFilesResponse/Data.php'; diff --git a/src/Endpoint/EndpointMap.php b/src/Endpoint/EndpointMap.php index 638e360..58897f2 100644 --- a/src/Endpoint/EndpointMap.php +++ b/src/Endpoint/EndpointMap.php @@ -9,6 +9,7 @@ class EndpointMap 'delete' => [ '/api/products/{guid}' => 'Shoptet\Api\Sdk\Php\Endpoint\Products\DeleteProduct', '/api/products/batch' => 'Shoptet\Api\Sdk\Php\Endpoint\Products\ProductBatchDelete', + '/api/products/images/batch' => 'Shoptet\Api\Sdk\Php\Endpoint\Products\ProductImageBatchDelete', '/api/products/code/{code}' => 'Shoptet\Api\Sdk\Php\Endpoint\Products\DeleteProductVariant', '/api/products/{guid}/images/{gallery}' => 'Shoptet\Api\Sdk\Php\Endpoint\ProductImages\DeleteAllProductImagesInGallery', '/api/products/{guid}/images/{gallery}/{imageName}' => 'Shoptet\Api\Sdk\Php\Endpoint\ProductImages\DeleteOneProductImage', diff --git a/src/Endpoint/Products/ProductImageBatchDelete.php b/src/Endpoint/Products/ProductImageBatchDelete.php new file mode 100644 index 0000000..7f440a9 --- /dev/null +++ b/src/Endpoint/Products/ProductImageBatchDelete.php @@ -0,0 +1,35 @@ +|ProductImageBatchDeleteRequest $entity) + * @method null|ProductImageBatchDeleteRequest getBody() + */ +class ProductImageBatchDelete extends Delete implements AsyncEndpoint +{ + protected array $supportedPathParams = []; + protected array $supportedQueryParams = ['language' => false]; + + public function getRequestEntityClass(): string + { + return ProductImageBatchDeleteRequest::class; + } + + public function getResponseEntityClass(): string + { + return ProductImageBatchDeleteResponse::class; + } + + public function getEndpoint(): string + { + return '/api/products/images/batch'; + } +} diff --git a/src/Endpoint/Products/ProductImageBatchDeleteRequest/ProductImageBatchDeleteRequest.php b/src/Endpoint/Products/ProductImageBatchDeleteRequest/ProductImageBatchDeleteRequest.php new file mode 100644 index 0000000..b3ef318 --- /dev/null +++ b/src/Endpoint/Products/ProductImageBatchDeleteRequest/ProductImageBatchDeleteRequest.php @@ -0,0 +1,33 @@ +batchFileUrlPath; + } + + public function setBatchFileUrlPath(string $batchFileUrlPath): static + { + $this->batchFileUrlPath = $batchFileUrlPath; + return $this; + } + + public function getRemoveReference(): ?bool + { + return $this->removeReference; + } + + public function setRemoveReference(?bool $removeReference): static + { + $this->removeReference = $removeReference; + return $this; + } +} diff --git a/src/Endpoint/Products/ProductImageBatchDeleteResponse/ProductImageBatchDeleteResponse.php b/src/Endpoint/Products/ProductImageBatchDeleteResponse/ProductImageBatchDeleteResponse.php new file mode 100644 index 0000000..9607542 --- /dev/null +++ b/src/Endpoint/Products/ProductImageBatchDeleteResponse/ProductImageBatchDeleteResponse.php @@ -0,0 +1,35 @@ +data; + } + + public function setData(?Data $data): static + { + $this->data = $data; + return $this; + } + + public function getErrors(): ?Errors + { + return $this->errors; + } + + public function setErrors(?Errors $errors): static + { + $this->errors = $errors; + return $this; + } +} diff --git a/src/Endpoint/Products/ProductImageBatchDeleteResponse/ProductImageBatchDeleteResponse/Data.php b/src/Endpoint/Products/ProductImageBatchDeleteResponse/ProductImageBatchDeleteResponse/Data.php new file mode 100644 index 0000000..ed7c4bf --- /dev/null +++ b/src/Endpoint/Products/ProductImageBatchDeleteResponse/ProductImageBatchDeleteResponse/Data.php @@ -0,0 +1,21 @@ +jobId; + } + + public function setJobId(string $jobId): static + { + $this->jobId = $jobId; + return $this; + } +} diff --git a/src/Sdk.php b/src/Sdk.php index d5187e0..c03fc4c 100644 --- a/src/Sdk.php +++ b/src/Sdk.php @@ -340,6 +340,8 @@ use Shoptet\Api\Sdk\Php\Endpoint\Products\ProductBatchUpdateRequest\ProductBatchUpdateRequest; use Shoptet\Api\Sdk\Php\Endpoint\Products\ProductCopy; use Shoptet\Api\Sdk\Php\Endpoint\Products\ProductCopyRequest\ProductCopyRequest; +use Shoptet\Api\Sdk\Php\Endpoint\Products\ProductImageBatchDelete; +use Shoptet\Api\Sdk\Php\Endpoint\Products\ProductImageBatchDeleteRequest\ProductImageBatchDeleteRequest; use Shoptet\Api\Sdk\Php\Endpoint\Products\UnlinkAllProductRelatedFiles; use Shoptet\Api\Sdk\Php\Endpoint\Products\UpdateProduct; use Shoptet\Api\Sdk\Php\Endpoint\Products\UpdateProductByCode; @@ -944,6 +946,31 @@ public static function productBatchUpdate( ->execute(); } + /** + * @param array|ProductImageBatchDeleteRequest $requestBody + * @param array{ + * language?: string, + * } $queryParams + * + * @return ResponseInterface + * + * @throws LogicException + * @throws RuntimeException + * @throws ReflectionException + * + * @see https://api.docs.shoptet.com/shoptet-api/openapi/Products/productimagebatchdelete + */ + public static function productImageBatchDelete( + array|ProductImageBatchDeleteRequest $requestBody, + array $queryParams = [], + ): ResponseInterface { + return self::getEndpointFactory() + ->createEndpoint(ProductImageBatchDelete::class) + ->setBody($requestBody) + ->setQueryParams($queryParams) + ->execute(); + } + /** * @param string $code [133] product or variant code. * @param array{