Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
1 change: 1 addition & 0 deletions src/Endpoint/EndpointMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
35 changes: 35 additions & 0 deletions src/Endpoint/Products/ProductImageBatchDelete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Shoptet\Api\Sdk\Php\Endpoint\Products;

use Shoptet\Api\Sdk\Php\Async\AsyncEndpoint;
use Shoptet\Api\Sdk\Php\Endpoint\Delete;
use Shoptet\Api\Sdk\Php\Endpoint\Products\ProductImageBatchDeleteRequest\ProductImageBatchDeleteRequest;
use Shoptet\Api\Sdk\Php\Endpoint\Products\ProductImageBatchDeleteResponse\ProductImageBatchDeleteResponse;

/**
* @see https://api.docs.shoptet.com/shoptet-api/openapi/Products/productimagebatchdelete
*
* @method ProductImageBatchDelete setBody(null|array<string, mixed>|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';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Shoptet\Api\Sdk\Php\Endpoint\Products\ProductImageBatchDeleteRequest;

use Shoptet\Api\Sdk\Php\Component\Entity\Entity;

class ProductImageBatchDeleteRequest extends Entity
{
protected string $batchFileUrlPath;
protected ?bool $removeReference;

public function getBatchFileUrlPath(): string
{
return $this->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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Shoptet\Api\Sdk\Php\Endpoint\Products\ProductImageBatchDeleteResponse;

use Shoptet\Api\Sdk\Php\Component\Entity\Entity;
use Shoptet\Api\Sdk\Php\Component\Entity\Errors;
use Shoptet\Api\Sdk\Php\Endpoint\Products\ProductImageBatchDeleteResponse\ProductImageBatchDeleteResponse\Data;

class ProductImageBatchDeleteResponse extends Entity
{
protected ?Data $data;
protected ?Errors $errors;

public function getData(): ?Data
{
return $this->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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Shoptet\Api\Sdk\Php\Endpoint\Products\ProductImageBatchDeleteResponse\ProductImageBatchDeleteResponse;

use Shoptet\Api\Sdk\Php\Component\Entity\Entity;

class Data extends Entity
{
protected string $jobId;

public function getJobId(): string
{
return $this->jobId;
}

public function setJobId(string $jobId): static
{
$this->jobId = $jobId;
return $this;
}
}
27 changes: 27 additions & 0 deletions src/Sdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -944,6 +946,31 @@ public static function productBatchUpdate(
->execute();
}

/**
* @param array<string, mixed>|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{
Expand Down
Loading