Packages summary
diff --git a/build/theme/resources/style.css b/build/theme/resources/style.css
index 9554b16a7f..8594c1176b 100755
--- a/build/theme/resources/style.css
+++ b/build/theme/resources/style.css
@@ -220,7 +220,6 @@ pre code {
}
#rightInner {
- max-width: 1500px; /* orinally 1000px */
min-width: 350px;
}
@@ -256,29 +255,15 @@ pre code {
#content > .description {
margin: 1.2em 0;
- max-width: 1000px;
}
#content .alert-info {
margin-top: 18px;
- max-width: 1000px;
}
-.class-annotations th{
- font-weight: bold;
- white-space: nowrap;
- width: 1%;
- padding-right: 15px;
-}
-.class-annotations td{
- width: 99%;
-}
-
-
dl.tree {
margin: 1.2em 0;
padding: 10px;
- max-width: 1000px;
}
dl.tree dd {
@@ -297,7 +282,7 @@ h2.switchable {
}
.summary td:first-child {
- /* text-align: right; */ /* left because we increased the possible width so much */
+ text-align: right;
}
.summary td hr {
@@ -310,7 +295,6 @@ h2.switchable {
.summary tr:hover td {
background: #f6f6f4;
- /* cursor: help; */ /* TODO add semantically correct tag that something is expandable by clicking it */
}
.summary .description p {
@@ -359,7 +343,8 @@ td.name, td.attributes {
}
.class .methods .name > div > code span, .function .value > code {
- /* white-space: nowrap; */
+ white-space: nowrap;
+ display: inline-block;
}
.class .methods td.name > div, .class td.value > div {
diff --git a/composer.json b/composer.json
index 88fc13bf5b..19a0bf501a 100644
--- a/composer.json
+++ b/composer.json
@@ -12,8 +12,8 @@
},
"autoload": {
"psr-4": {
- "Commercetools\\Core\\": "src/",
- "Commercetools\\Commons\\": "commons/"
+ "Commercetools\\Core\\": "src/Core/",
+ "Commercetools\\Commons\\": "src/Commons/"
}
},
"autoload-dev": {
@@ -30,7 +30,7 @@
"require": {
"php": ">=5.6",
"psr/log": "^1.0",
- "guzzlehttp/guzzle": "^6.0 || ^5.0",
+ "guzzlehttp/guzzle": "^6.0 || ^5.3.1",
"guzzlehttp/psr7": "^1.1",
"psr/cache": "^1.0",
"psr/simple-cache": "^1.0",
diff --git a/install-apigen.sh b/install-apigen.sh
index 9526feff23..18ca2d23d8 100755
--- a/install-apigen.sh
+++ b/install-apigen.sh
@@ -2,5 +2,5 @@
if [ ! -e apigen.phar ]
then
- wget http://apigen.org/apigen.phar
+ wget https://github.com/jayS-de/ApiGen/releases/download/v4.2.0-dev-withMD/apigen.phar
fi
diff --git a/set_guzzle5.sh b/set_guzzle5.sh
index a1aca6b8e3..c04d979a1d 100755
--- a/set_guzzle5.sh
+++ b/set_guzzle5.sh
@@ -1,4 +1,4 @@
#!/bin/bash
SRC='"guzzlehttp/guzzle": "^6.0"'
-DST='"guzzlehttp/guzzle": "^5.3.1", "guzzlehttp/log-subscriber": "^1.0", "guzzlehttp/ringphp": "^1.0.7", "react/promise": "^2.2.0"'
+DST='"guzzlehttp/guzzle": "^5.3.1", "react/promise": "^2.2.0"'
sed -ibak -e "s|$SRC|$DST|g" composer.json
diff --git a/commons/Helper/PriceFinder.php b/src/Commons/Helper/PriceFinder.php
similarity index 91%
rename from commons/Helper/PriceFinder.php
rename to src/Commons/Helper/PriceFinder.php
index 8c7a2148ec..305a125a08 100644
--- a/commons/Helper/PriceFinder.php
+++ b/src/Commons/Helper/PriceFinder.php
@@ -5,12 +5,15 @@
namespace Commercetools\Commons\Helper;
-
use Commercetools\Core\Model\Channel\ChannelReference;
use Commercetools\Core\Model\Common\Price;
use Commercetools\Core\Model\Common\PriceCollection;
use Commercetools\Core\Model\CustomerGroup\CustomerGroupReference;
+/**
+ * @deprecated Please use the price selection functionality of the platform
+ * @link http://dev.commercetools.com/http-api-projects-products.html#price-selection
+ */
class PriceFinder
{
private $currency;
@@ -18,8 +21,12 @@ class PriceFinder
private $customerGroup;
private $channel;
- public function __construct($currency, $country = null, CustomerGroupReference $customerGroup = null, ChannelReference $channel = null)
- {
+ public function __construct(
+ $currency,
+ $country = null,
+ CustomerGroupReference $customerGroup = null,
+ ChannelReference $channel = null
+ ) {
$this->currency = $currency;
$this->country = $country;
$this->customerGroup = $customerGroup;
@@ -100,7 +107,6 @@ public static function findPriceFor(
private function priceHasCurrency(Price $price, $currency)
{
return !is_null($price->getValue()) && $price->getValue()->getCurrencyCode() == $currency;
-
}
private function priceHasCountry(Price $price, $country)
@@ -130,7 +136,8 @@ private function priceHasNoDate(Price $price)
return is_null($price->getValidFrom()) && is_null($price->getValidUntil());
}
- private function priceHas(Price $price, $field) {
+ private function priceHas(Price $price, $field)
+ {
return !is_null($price->get($field));
}
}
diff --git a/commons/Helper/QueryHelper.php b/src/Commons/Helper/QueryHelper.php
similarity index 99%
rename from commons/Helper/QueryHelper.php
rename to src/Commons/Helper/QueryHelper.php
index 6bd4f5511f..9239c728eb 100644
--- a/commons/Helper/QueryHelper.php
+++ b/src/Commons/Helper/QueryHelper.php
@@ -5,7 +5,6 @@
namespace Commercetools\Commons\Helper;
-
use Commercetools\Core\Client;
use Commercetools\Core\Request\QueryAllRequestInterface;
diff --git a/src/AbstractHttpClient.php b/src/Core/AbstractHttpClient.php
similarity index 98%
rename from src/AbstractHttpClient.php
rename to src/Core/AbstractHttpClient.php
index 6c880fee76..92559b2b0e 100644
--- a/src/AbstractHttpClient.php
+++ b/src/Core/AbstractHttpClient.php
@@ -14,7 +14,7 @@
*/
abstract class AbstractHttpClient
{
- const VERSION = '2.0.0-RC1';
+ const VERSION = '2.0.0';
/**
* @var AdapterInterface
diff --git a/src/Cache/CacheAdapterFactory.php b/src/Core/Cache/CacheAdapterFactory.php
similarity index 100%
rename from src/Cache/CacheAdapterFactory.php
rename to src/Core/Cache/CacheAdapterFactory.php
diff --git a/src/Client.php b/src/Core/Client.php
similarity index 91%
rename from src/Client.php
rename to src/Core/Client.php
index 4b3160514c..b8ea15e29f 100644
--- a/src/Client.php
+++ b/src/Core/Client.php
@@ -200,7 +200,11 @@ public function getHttpClient($options = [])
if (is_null($this->httpClient)) {
$client = parent::getHttpClient($options);
if ($this->logger instanceof LoggerInterface) {
- $client->setLogger($this->logger);
+ $client->setLogger(
+ $this->logger,
+ $this->getConfig()->getLogLevel(),
+ $this->getConfig()->getMessageFormatter()
+ );
}
}
@@ -220,17 +224,17 @@ protected function getBaseUrl()
* Executes an API request synchronously
*
* @param ClientRequestInterface $request
+ * @param array $headers
* @return ApiResponseInterface
- * @throws InvalidTokenException
* @throws ApiException
- * @throws \Exception
+ * @throws InvalidTokenException
*/
- public function execute(ClientRequestInterface $request)
+ public function execute(ClientRequestInterface $request, array $headers = null)
{
if ($request instanceof ContextAwareInterface) {
$request->setContextIfNull($this->getConfig()->getContext());
}
- $httpRequest = $this->createHttpRequest($request);
+ $httpRequest = $this->createHttpRequest($request, $headers);
try {
$httpResponse = $this->getHttpClient()->execute($httpRequest);
@@ -259,12 +263,12 @@ public function execute(ClientRequestInterface $request)
* @param ClientRequestInterface $request
* @return ApiResponseInterface
*/
- public function executeAsync(ClientRequestInterface $request)
+ public function executeAsync(ClientRequestInterface $request, array $headers = null)
{
if ($request instanceof ContextAwareInterface) {
$request->setContextIfNull($this->getConfig()->getContext());
}
- $httpRequest = $this->createHttpRequest($request);
+ $httpRequest = $this->createHttpRequest($request, $headers);
$response = $request->buildResponse($this->getHttpClient()->executeAsync($httpRequest));
$response = $response->then(
@@ -279,27 +283,36 @@ function ($httpResponse) use ($httpRequest) {
/**
* @param ClientRequestInterface $request
+ * @param array $headers
* @return RequestInterface
*/
- protected function createHttpRequest(ClientRequestInterface $request)
+ protected function createHttpRequest(ClientRequestInterface $request, array $headers = null)
{
$token = $this->getOauthManager()->getToken();
-
$httpRequest = $request->httpRequest();
$httpRequest = $httpRequest
->withHeader('Authorization', 'Bearer ' . $token->getToken())
;
+ if (is_array($headers)) {
+ foreach ($headers as $headerName => $headerValues) {
+ $httpRequest = $httpRequest
+ ->withAddedHeader($headerName, $headerValues)
+ ;
+ }
+ }
+
return $httpRequest;
}
/**
* Executes API requests in batch
- * @return Response\ApiResponseInterface[]
+ * @param array $headers
+ * @return ApiResponseInterface[]
* @throws ApiException
*/
- public function executeBatch()
+ public function executeBatch(array $headers = null)
{
- $requests = $this->getBatchHttpRequests();
+ $requests = $this->getBatchHttpRequests($headers);
$httpResponses = $this->getHttpClient()->executeBatch($requests);
$responses = [];
@@ -394,13 +407,14 @@ protected function format(RequestInterface $request, ResponseInterface $response
}
/**
+ * @param array $headers
* @return array
*/
- protected function getBatchHttpRequests()
+ protected function getBatchHttpRequests(array $headers = null)
{
$requests = array_map(
- function ($request) {
- return $this->createHttpRequest($request);
+ function ($request) use ($headers) {
+ return $this->createHttpRequest($request, $headers);
},
$this->batchRequests
);
diff --git a/src/Client/Adapter/AdapterFactory.php b/src/Core/Client/Adapter/AdapterFactory.php
similarity index 100%
rename from src/Client/Adapter/AdapterFactory.php
rename to src/Core/Client/Adapter/AdapterFactory.php
diff --git a/src/Client/Adapter/AdapterInterface.php b/src/Core/Client/Adapter/AdapterInterface.php
similarity index 90%
rename from src/Client/Adapter/AdapterInterface.php
rename to src/Core/Client/Adapter/AdapterInterface.php
index 3de2095fe0..dfcfd9ab1f 100644
--- a/src/Client/Adapter/AdapterInterface.php
+++ b/src/Core/Client/Adapter/AdapterInterface.php
@@ -9,10 +9,11 @@
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
+use Psr\Log\LogLevel;
interface AdapterInterface extends LoggerAwareInterface
{
- public function setLogger(LoggerInterface $logger);
+ public function setLogger(LoggerInterface $logger, $logLevel = LogLevel::INFO, $formatter = null);
public function addHandler($handler);
diff --git a/src/Client/Adapter/AdapterPromiseInterface.php b/src/Core/Client/Adapter/AdapterPromiseInterface.php
similarity index 100%
rename from src/Client/Adapter/AdapterPromiseInterface.php
rename to src/Core/Client/Adapter/AdapterPromiseInterface.php
diff --git a/src/Client/Adapter/Guzzle5Adapter.php b/src/Core/Client/Adapter/Guzzle5Adapter.php
similarity index 97%
rename from src/Client/Adapter/Guzzle5Adapter.php
rename to src/Core/Client/Adapter/Guzzle5Adapter.php
index 0c5d374865..12ca405fab 100644
--- a/src/Client/Adapter/Guzzle5Adapter.php
+++ b/src/Core/Client/Adapter/Guzzle5Adapter.php
@@ -10,11 +10,12 @@
use GuzzleHttp\Pool;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
-use GuzzleHttp\Subscriber\Log\LogSubscriber;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
+use Commercetools\Core\Helper\Subscriber\Log\LogSubscriber;
use Commercetools\Core\Error\ApiException;
+use Psr\Log\LogLevel;
class Guzzle5Adapter implements AdapterInterface
{
@@ -54,11 +55,11 @@ public function __construct(array $options = [])
$this->client = new Client($options);
}
- public function setLogger(LoggerInterface $logger)
+ public function setLogger(LoggerInterface $logger, $logLevel = LogLevel::INFO, $formatter = null)
{
$this->logger = $logger;
if ($logger instanceof LoggerInterface) {
- $this->getEmitter()->attach(new LogSubscriber($logger));
+ $this->getEmitter()->attach(new LogSubscriber($logger, $formatter, $logLevel));
}
}
diff --git a/src/Client/Adapter/Guzzle5Promise.php b/src/Core/Client/Adapter/Guzzle5Promise.php
similarity index 100%
rename from src/Client/Adapter/Guzzle5Promise.php
rename to src/Core/Client/Adapter/Guzzle5Promise.php
diff --git a/src/Client/Adapter/Guzzle6Adapter.php b/src/Core/Client/Adapter/Guzzle6Adapter.php
similarity index 95%
rename from src/Client/Adapter/Guzzle6Adapter.php
rename to src/Core/Client/Adapter/Guzzle6Adapter.php
index b589ffe85b..8f304cdc4f 100644
--- a/src/Client/Adapter/Guzzle6Adapter.php
+++ b/src/Core/Client/Adapter/Guzzle6Adapter.php
@@ -43,10 +43,13 @@ public function __construct(array $options = [])
$this->client = new Client($options);
}
- public function setLogger(LoggerInterface $logger)
+ public function setLogger(LoggerInterface $logger, $logLevel = LogLevel::INFO, $formatter = null)
{
+ if (is_null($formatter)) {
+ $formatter = new MessageFormatter();
+ }
$this->logger = $logger;
- $this->addHandler(self::log($logger, new MessageFormatter()));
+ $this->addHandler(self::log($logger, $formatter, $logLevel));
}
/**
diff --git a/src/Client/Adapter/Guzzle6Promise.php b/src/Core/Client/Adapter/Guzzle6Promise.php
similarity index 100%
rename from src/Client/Adapter/Guzzle6Promise.php
rename to src/Core/Client/Adapter/Guzzle6Promise.php
diff --git a/src/Client/FileUploadRequest.php b/src/Core/Client/FileUploadRequest.php
similarity index 100%
rename from src/Client/FileUploadRequest.php
rename to src/Core/Client/FileUploadRequest.php
diff --git a/src/Client/HttpMethod.php b/src/Core/Client/HttpMethod.php
similarity index 100%
rename from src/Client/HttpMethod.php
rename to src/Core/Client/HttpMethod.php
diff --git a/src/Client/HttpRequest.php b/src/Core/Client/HttpRequest.php
similarity index 100%
rename from src/Client/HttpRequest.php
rename to src/Core/Client/HttpRequest.php
diff --git a/src/Client/HttpRequestInterface.php b/src/Core/Client/HttpRequestInterface.php
similarity index 100%
rename from src/Client/HttpRequestInterface.php
rename to src/Core/Client/HttpRequestInterface.php
diff --git a/src/Client/JsonEndpoint.php b/src/Core/Client/JsonEndpoint.php
similarity index 100%
rename from src/Client/JsonEndpoint.php
rename to src/Core/Client/JsonEndpoint.php
diff --git a/src/Client/JsonRequest.php b/src/Core/Client/JsonRequest.php
similarity index 100%
rename from src/Client/JsonRequest.php
rename to src/Core/Client/JsonRequest.php
diff --git a/src/Client/OAuth/Manager.php b/src/Core/Client/OAuth/Manager.php
similarity index 100%
rename from src/Client/OAuth/Manager.php
rename to src/Core/Client/OAuth/Manager.php
diff --git a/src/Client/OAuth/Token.php b/src/Core/Client/OAuth/Token.php
similarity index 100%
rename from src/Client/OAuth/Token.php
rename to src/Core/Client/OAuth/Token.php
diff --git a/src/Config.php b/src/Core/Config.php
similarity index 93%
rename from src/Config.php
rename to src/Core/Config.php
index 5f9c1053d9..9267379949 100644
--- a/src/Config.php
+++ b/src/Core/Config.php
@@ -10,6 +10,7 @@
use Commercetools\Core\Error\InvalidArgumentException;
use Commercetools\Core\Model\Common\ContextAwareInterface;
use Commercetools\Core\Model\Common\ContextTrait;
+use Psr\Log\LogLevel;
/**
* Client configuration object
@@ -144,6 +145,13 @@ class Config implements ContextAwareInterface
*/
protected $cacheDir;
+ /**
+ * @var string
+ */
+ protected $logLevel = LogLevel::INFO;
+
+ protected $messageFormatter;
+
/**
* @param array $configValues
* @return static
@@ -542,4 +550,41 @@ public function setCacheDir($cacheDir)
return $this;
}
+
+ /**
+ * @return string
+ */
+ public function getLogLevel()
+ {
+ return $this->logLevel;
+ }
+
+ /**
+ * @param string $logLevel
+ * @return $this
+ */
+ public function setLogLevel($logLevel)
+ {
+ $this->logLevel = $logLevel;
+
+ return $this;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getMessageFormatter()
+ {
+ return $this->messageFormatter;
+ }
+
+ /**
+ * @param mixed $messageFormatter
+ * @return $this
+ */
+ public function setMessageFormatter($messageFormatter)
+ {
+ $this->messageFormatter = $messageFormatter;
+ return $this;
+ }
}
diff --git a/src/Error/AccessDeniedError.php b/src/Core/Error/AccessDeniedError.php
similarity index 100%
rename from src/Error/AccessDeniedError.php
rename to src/Core/Error/AccessDeniedError.php
diff --git a/src/Error/ApiError.php b/src/Core/Error/ApiError.php
similarity index 100%
rename from src/Error/ApiError.php
rename to src/Core/Error/ApiError.php
diff --git a/src/Error/ApiException.php b/src/Core/Error/ApiException.php
similarity index 100%
rename from src/Error/ApiException.php
rename to src/Core/Error/ApiException.php
diff --git a/src/Error/ApiServiceException.php b/src/Core/Error/ApiServiceException.php
similarity index 100%
rename from src/Error/ApiServiceException.php
rename to src/Core/Error/ApiServiceException.php
diff --git a/src/Error/BadGatewayException.php b/src/Core/Error/BadGatewayException.php
similarity index 100%
rename from src/Error/BadGatewayException.php
rename to src/Core/Error/BadGatewayException.php
diff --git a/src/Error/BadRequestException.php b/src/Core/Error/BadRequestException.php
similarity index 100%
rename from src/Error/BadRequestException.php
rename to src/Core/Error/BadRequestException.php
diff --git a/src/Error/ClientErrorException.php b/src/Core/Error/ClientErrorException.php
similarity index 100%
rename from src/Error/ClientErrorException.php
rename to src/Core/Error/ClientErrorException.php
diff --git a/src/Error/ConcurrentModificationError.php b/src/Core/Error/ConcurrentModificationError.php
similarity index 100%
rename from src/Error/ConcurrentModificationError.php
rename to src/Core/Error/ConcurrentModificationError.php
diff --git a/src/Error/ConcurrentModificationException.php b/src/Core/Error/ConcurrentModificationException.php
similarity index 100%
rename from src/Error/ConcurrentModificationException.php
rename to src/Core/Error/ConcurrentModificationException.php
diff --git a/src/Error/DeprecatedException.php b/src/Core/Error/DeprecatedException.php
similarity index 100%
rename from src/Error/DeprecatedException.php
rename to src/Core/Error/DeprecatedException.php
diff --git a/src/Error/DiscountCodeNonApplicableError.php b/src/Core/Error/DiscountCodeNonApplicableError.php
similarity index 100%
rename from src/Error/DiscountCodeNonApplicableError.php
rename to src/Core/Error/DiscountCodeNonApplicableError.php
diff --git a/src/Error/DuplicateAttributeValueError.php b/src/Core/Error/DuplicateAttributeValueError.php
similarity index 100%
rename from src/Error/DuplicateAttributeValueError.php
rename to src/Core/Error/DuplicateAttributeValueError.php
diff --git a/src/Error/DuplicateAttributeValuesError.php b/src/Core/Error/DuplicateAttributeValuesError.php
similarity index 100%
rename from src/Error/DuplicateAttributeValuesError.php
rename to src/Core/Error/DuplicateAttributeValuesError.php
diff --git a/src/Error/DuplicateFieldError.php b/src/Core/Error/DuplicateFieldError.php
similarity index 100%
rename from src/Error/DuplicateFieldError.php
rename to src/Core/Error/DuplicateFieldError.php
diff --git a/src/Error/DuplicatePriceScopeError.php b/src/Core/Error/DuplicatePriceScopeError.php
similarity index 100%
rename from src/Error/DuplicatePriceScopeError.php
rename to src/Core/Error/DuplicatePriceScopeError.php
diff --git a/src/Error/DuplicateVariantValuesError.php b/src/Core/Error/DuplicateVariantValuesError.php
similarity index 100%
rename from src/Error/DuplicateVariantValuesError.php
rename to src/Core/Error/DuplicateVariantValuesError.php
diff --git a/src/Error/ErrorContainer.php b/src/Core/Error/ErrorContainer.php
similarity index 100%
rename from src/Error/ErrorContainer.php
rename to src/Core/Error/ErrorContainer.php
diff --git a/src/Error/ErrorResponseException.php b/src/Core/Error/ErrorResponseException.php
similarity index 100%
rename from src/Error/ErrorResponseException.php
rename to src/Core/Error/ErrorResponseException.php
diff --git a/src/Error/GatewayTimeoutException.php b/src/Core/Error/GatewayTimeoutException.php
similarity index 100%
rename from src/Error/GatewayTimeoutException.php
rename to src/Core/Error/GatewayTimeoutException.php
diff --git a/src/Error/InsufficientScopeError.php b/src/Core/Error/InsufficientScopeError.php
similarity index 100%
rename from src/Error/InsufficientScopeError.php
rename to src/Core/Error/InsufficientScopeError.php
diff --git a/src/Error/InternalServerErrorException.php b/src/Core/Error/InternalServerErrorException.php
similarity index 100%
rename from src/Error/InternalServerErrorException.php
rename to src/Core/Error/InternalServerErrorException.php
diff --git a/src/Error/InvalidArgumentException.php b/src/Core/Error/InvalidArgumentException.php
similarity index 100%
rename from src/Error/InvalidArgumentException.php
rename to src/Core/Error/InvalidArgumentException.php
diff --git a/src/Error/InvalidClientCredentialsException.php b/src/Core/Error/InvalidClientCredentialsException.php
similarity index 100%
rename from src/Error/InvalidClientCredentialsException.php
rename to src/Core/Error/InvalidClientCredentialsException.php
diff --git a/src/Error/InvalidCredentialsError.php b/src/Core/Error/InvalidCredentialsError.php
similarity index 100%
rename from src/Error/InvalidCredentialsError.php
rename to src/Core/Error/InvalidCredentialsError.php
diff --git a/src/Error/InvalidCurrentPasswordError.php b/src/Core/Error/InvalidCurrentPasswordError.php
similarity index 100%
rename from src/Error/InvalidCurrentPasswordError.php
rename to src/Core/Error/InvalidCurrentPasswordError.php
diff --git a/src/Error/InvalidFieldError.php b/src/Core/Error/InvalidFieldError.php
similarity index 100%
rename from src/Error/InvalidFieldError.php
rename to src/Core/Error/InvalidFieldError.php
diff --git a/src/Error/InvalidOperationError.php b/src/Core/Error/InvalidOperationError.php
similarity index 100%
rename from src/Error/InvalidOperationError.php
rename to src/Core/Error/InvalidOperationError.php
diff --git a/src/Error/InvalidSubjectError.php b/src/Core/Error/InvalidSubjectError.php
similarity index 100%
rename from src/Error/InvalidSubjectError.php
rename to src/Core/Error/InvalidSubjectError.php
diff --git a/src/Error/InvalidTokenError.php b/src/Core/Error/InvalidTokenError.php
similarity index 100%
rename from src/Error/InvalidTokenError.php
rename to src/Core/Error/InvalidTokenError.php
diff --git a/src/Error/InvalidTokenException.php b/src/Core/Error/InvalidTokenException.php
similarity index 100%
rename from src/Error/InvalidTokenException.php
rename to src/Core/Error/InvalidTokenException.php
diff --git a/src/Error/Message.php b/src/Core/Error/Message.php
similarity index 100%
rename from src/Error/Message.php
rename to src/Core/Error/Message.php
diff --git a/src/Error/NotFoundException.php b/src/Core/Error/NotFoundException.php
similarity index 100%
rename from src/Error/NotFoundException.php
rename to src/Core/Error/NotFoundException.php
diff --git a/src/Error/OutOfStockError.php b/src/Core/Error/OutOfStockError.php
similarity index 100%
rename from src/Error/OutOfStockError.php
rename to src/Core/Error/OutOfStockError.php
diff --git a/src/Error/PriceChangedError.php b/src/Core/Error/PriceChangedError.php
similarity index 100%
rename from src/Error/PriceChangedError.php
rename to src/Core/Error/PriceChangedError.php
diff --git a/src/Error/RequiredFieldError.php b/src/Core/Error/RequiredFieldError.php
similarity index 100%
rename from src/Error/RequiredFieldError.php
rename to src/Core/Error/RequiredFieldError.php
diff --git a/src/Error/ResourceNotFoundError.php b/src/Core/Error/ResourceNotFoundError.php
similarity index 100%
rename from src/Error/ResourceNotFoundError.php
rename to src/Core/Error/ResourceNotFoundError.php
diff --git a/src/Error/ServerErrorException.php b/src/Core/Error/ServerErrorException.php
similarity index 100%
rename from src/Error/ServerErrorException.php
rename to src/Core/Error/ServerErrorException.php
diff --git a/src/Error/ServiceUnavailableException.php b/src/Core/Error/ServiceUnavailableException.php
similarity index 100%
rename from src/Error/ServiceUnavailableException.php
rename to src/Core/Error/ServiceUnavailableException.php
diff --git a/src/Error/UnauthorizedException.php b/src/Core/Error/UnauthorizedException.php
similarity index 100%
rename from src/Error/UnauthorizedException.php
rename to src/Core/Error/UnauthorizedException.php
diff --git a/src/Error/UpdateActionLimitException.php b/src/Core/Error/UpdateActionLimitException.php
similarity index 100%
rename from src/Error/UpdateActionLimitException.php
rename to src/Core/Error/UpdateActionLimitException.php
diff --git a/src/Helper/Annotate/AnnotationGenerator.php b/src/Core/Helper/Annotate/AnnotationGenerator.php
similarity index 100%
rename from src/Helper/Annotate/AnnotationGenerator.php
rename to src/Core/Helper/Annotate/AnnotationGenerator.php
diff --git a/src/Helper/Annotate/ClassAnnotator.php b/src/Core/Helper/Annotate/ClassAnnotator.php
similarity index 100%
rename from src/Helper/Annotate/ClassAnnotator.php
rename to src/Core/Helper/Annotate/ClassAnnotator.php
diff --git a/src/Helper/Annotate/ReflectedClass.php b/src/Core/Helper/Annotate/ReflectedClass.php
similarity index 100%
rename from src/Helper/Annotate/ReflectedClass.php
rename to src/Core/Helper/Annotate/ReflectedClass.php
diff --git a/src/Helper/CurrencyFormatter.php b/src/Core/Helper/CurrencyFormatter.php
similarity index 100%
rename from src/Helper/CurrencyFormatter.php
rename to src/Core/Helper/CurrencyFormatter.php
diff --git a/src/Helper/State/Renderer.php b/src/Core/Helper/State/Renderer.php
similarity index 100%
rename from src/Helper/State/Renderer.php
rename to src/Core/Helper/State/Renderer.php
diff --git a/src/Helper/State/Renderer/NodeRenderer.php b/src/Core/Helper/State/Renderer/NodeRenderer.php
similarity index 100%
rename from src/Helper/State/Renderer/NodeRenderer.php
rename to src/Core/Helper/State/Renderer/NodeRenderer.php
diff --git a/src/Helper/State/Renderer/TransitionRenderer.php b/src/Core/Helper/State/Renderer/TransitionRenderer.php
similarity index 100%
rename from src/Helper/State/Renderer/TransitionRenderer.php
rename to src/Core/Helper/State/Renderer/TransitionRenderer.php
diff --git a/src/Core/Helper/Subscriber/Log/Formatter.php b/src/Core/Helper/Subscriber/Log/Formatter.php
new file mode 100644
index 0000000000..e8dc924a1a
--- /dev/null
+++ b/src/Core/Helper/Subscriber/Log/Formatter.php
@@ -0,0 +1,206 @@
+
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace Commercetools\Core\Helper\Subscriber\Log;
+
+use GuzzleHttp\Message\MessageInterface;
+use GuzzleHttp\Message\RequestInterface;
+use GuzzleHttp\Message\ResponseInterface;
+
+/**
+ * Formats log messages using variable substitutions for requests, responses,
+ * and other transactional data.
+ *
+ * The following variable substitutions are supported:
+ *
+ * - {request}: Full HTTP request message
+ * - {response}: Full HTTP response message
+ * - {ts}: Timestamp
+ * - {host}: Host of the request
+ * - {method}: Method of the request
+ * - {url}: URL of the request
+ * - {host}: Host of the request
+ * - {protocol}: Request protocol
+ * - {version}: Protocol version
+ * - {resource}: Resource of the request (path + query + fragment)
+ * - {hostname}: Hostname of the machine that sent the request
+ * - {code}: Status code of the response (if available)
+ * - {phrase}: Reason phrase of the response (if available)
+ * - {error}: Any error messages (if available)
+ * - {req_header_*}: Replace `*` with the lowercased name of a request header to add to the message
+ * - {res_header_*}: Replace `*` with the lowercased name of a response header to add to the message
+ * - {req_headers}: Request headers
+ * - {res_headers}: Response headers
+ * - {req_body}: Request body
+ * - {res_body}: Response body
+ */
+class Formatter
+{
+ /**
+ * Apache Common Log Format.
+ * @link http://httpd.apache.org/docs/1.3/logs.html#common
+ * @var string
+ * @codingStandardsIgnoreStart
+ */
+ const CLF = "{hostname} {req_header_User-Agent} - [{ts}] \"{method} {resource} {protocol}/{version}\" {code} {res_header_Content-Length}";
+ /**
+ * codingStandardsIgnoreEnd
+ */
+ const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
+ const SHORT = '[{ts}] "{method} {resource} {protocol}/{version}" {code}';
+
+ /** @var string Template used to format log messages */
+ private $template;
+
+ /**
+ * @param string $template Log message template
+ */
+ public function __construct($template = self::CLF)
+ {
+ $this->template = $template ?: self::CLF;
+ }
+
+ /**
+ * Returns a formatted message
+ *
+ * @param RequestInterface $request Request that was sent
+ * @param ResponseInterface $response Response that was received
+ * @param \Exception $error Exception that was received
+ * @param array $customData Associative array of custom template data
+ *
+ * @return string
+ */
+ public function format(
+ RequestInterface $request,
+ ResponseInterface $response = null,
+ \Exception $error = null,
+ array $customData = []
+ ) {
+ $cache = $customData;
+
+ return preg_replace_callback(
+ '/{\s*([A-Za-z_\-\.0-9]+)\s*}/',
+ function (array $matches) use ($request, $response, $error, &$cache) {
+
+ if (isset($cache[$matches[1]])) {
+ return $cache[$matches[1]];
+ }
+
+ $result = '';
+ switch ($matches[1]) {
+ case 'request':
+ $result = $request;
+ break;
+ case 'response':
+ $result = $response;
+ break;
+ case 'req_headers':
+ $result = trim($request->getMethod() . ' '
+ . $request->getResource()) . ' HTTP/'
+ . $request->getProtocolVersion() . "\r\n"
+ . $this->headers($request);
+ break;
+ case 'res_headers':
+ $result = $response ?
+ sprintf(
+ 'HTTP/%s %d %s',
+ $response->getProtocolVersion(),
+ $response->getStatusCode(),
+ $response->getReasonPhrase()
+ ) . "\r\n" . $this->headers($response)
+ : 'NULL';
+ break;
+ case 'req_body':
+ $result = $request->getBody();
+ break;
+ case 'res_body':
+ $result = $response ? $response->getBody() : 'NULL';
+ break;
+ case 'ts':
+ $result = gmdate('c');
+ break;
+ case 'method':
+ $result = $request->getMethod();
+ break;
+ case 'url':
+ $result = $request->getUrl();
+ break;
+ case 'resource':
+ $result = $request->getResource();
+ break;
+ case 'req_version':
+ $result = $request->getProtocolVersion();
+ break;
+ case 'res_version':
+ $result = $response
+ ? $response->getProtocolVersion()
+ : 'NULL';
+ break;
+ case 'host':
+ $result = $request->getHost();
+ break;
+ case 'hostname':
+ $result = gethostname();
+ break;
+ case 'code':
+ $result = $response
+ ? $response->getStatusCode()
+ : 'NULL';
+ break;
+ case 'phrase':
+ $result = $response
+ ? $response->getReasonPhrase()
+ : 'NULL';
+ break;
+ case 'error':
+ $result = $error ? $error->getMessage() : 'NULL';
+ break;
+ default:
+ // handle prefixed dynamic headers
+ if (strpos($matches[1], 'req_header_') === 0) {
+ $result = $request->getHeader(substr($matches[1], 11));
+ } elseif (strpos($matches[1], 'res_header_') === 0) {
+ $result = $response
+ ? $response->getHeader(substr($matches[1], 11))
+ : 'NULL';
+ }
+ }
+
+ $cache[$matches[1]] = $result;
+ return $result;
+ },
+ $this->template
+ );
+ }
+
+ private function headers(MessageInterface $message)
+ {
+ $result = '';
+ foreach ($message->getHeaders() as $name => $values) {
+ $result .= $name . ': ' . implode(', ', $values) . "\r\n";
+ }
+
+ return trim($result);
+ }
+}
diff --git a/src/Core/Helper/Subscriber/Log/LogSubscriber.php b/src/Core/Helper/Subscriber/Log/LogSubscriber.php
new file mode 100644
index 0000000000..7b9b5f6b83
--- /dev/null
+++ b/src/Core/Helper/Subscriber/Log/LogSubscriber.php
@@ -0,0 +1,119 @@
+
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+namespace Commercetools\Core\Helper\Subscriber\Log;
+
+use GuzzleHttp\Event\RequestEvents;
+use GuzzleHttp\Event\SubscriberInterface;
+use GuzzleHttp\Event\CompleteEvent;
+use GuzzleHttp\Event\ErrorEvent;
+use Psr\Log\LoggerInterface;
+use Psr\Log\LogLevel;
+
+/**
+ * Plugin class that will add request and response logging to an HTTP request.
+ *
+ * The log plugin uses a message formatter that allows custom messages via
+ * template variable substitution.
+ *
+ * @see MessageLogger for a list of available template variable substitutions
+ */
+class LogSubscriber implements SubscriberInterface
+{
+ /** @var LoggerInterface */
+ private $logger;
+
+ /** @var Formatter Formatter used to format log messages */
+ private $formatter;
+
+ /**
+ * @var string
+ */
+ private $logLevel;
+
+ /**
+ * @param LoggerInterface|callable|resource|null $logger Logger used to log
+ * messages. Pass a LoggerInterface to use a PSR-3 logger. Pass a
+ * callable to log messages to a function that accepts a string of
+ * data. Pass a resource returned from ``fopen()`` to log to an open
+ * resource. Pass null or leave empty to write log messages using
+ * ``echo()``.
+ * @param string|Formatter $formatter Formatter used to format log
+ * messages or a string representing a message formatter template.
+ */
+ public function __construct($logger = null, $formatter = null, $logLevel = LogLevel::INFO)
+ {
+ $this->logLevel = $logLevel;
+ $this->logger = $logger instanceof LoggerInterface
+ ? $logger
+ : new SimpleLogger($logger);
+
+ $this->formatter = $formatter instanceof Formatter
+ ? $formatter
+ : new Formatter($formatter);
+ }
+
+ public function getEvents()
+ {
+ return [
+ // Fire after responses are verified (which trigger error events).
+ 'complete' => ['onComplete', RequestEvents::VERIFY_RESPONSE - 10],
+ 'error' => ['onError', RequestEvents::EARLY]
+ ];
+ }
+
+ public function onComplete(CompleteEvent $event)
+ {
+ $this->logger->log(
+ substr($event->getResponse()->getStatusCode(), 0, 1) == '2'
+ ? $this->logLevel
+ : LogLevel::WARNING,
+ $this->formatter->format(
+ $event->getRequest(),
+ $event->getResponse()
+ ),
+ [
+ 'request' => $event->getRequest(),
+ 'response' => $event->getResponse()
+ ]
+ );
+ }
+
+ public function onError(ErrorEvent $event)
+ {
+ $ex = $event->getException();
+ $this->logger->log(
+ LogLevel::CRITICAL,
+ $this->formatter->format(
+ $event->getRequest(),
+ $event->getResponse(),
+ $ex
+ ),
+ [
+ 'request' => $event->getRequest(),
+ 'response' => $event->getResponse(),
+ 'exception' => $ex
+ ]
+ );
+ }
+}
diff --git a/src/Core/Helper/Subscriber/Log/SimpleLogger.php b/src/Core/Helper/Subscriber/Log/SimpleLogger.php
new file mode 100644
index 0000000000..6b7a4f13a8
--- /dev/null
+++ b/src/Core/Helper/Subscriber/Log/SimpleLogger.php
@@ -0,0 +1,54 @@
+
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+namespace Commercetools\Core\Helper\Subscriber\Log;
+
+use Psr\Log\LoggerTrait;
+use Psr\Log\LoggerInterface;
+
+/**
+ * Simple logger implementation that can write to a function, resource, or
+ * uses echo() if nothing is provided.
+ */
+class SimpleLogger implements LoggerInterface
+{
+ use LoggerTrait;
+
+ private $writeTo;
+
+ public function __construct($writeTo = null)
+ {
+ $this->writeTo = $writeTo;
+ }
+
+ public function log($level, $message, array $context = array())
+ {
+ if (is_resource($this->writeTo)) {
+ fwrite($this->writeTo, "[{$level}] {$message}\n");
+ } elseif (is_callable($this->writeTo)) {
+ call_user_func($this->writeTo, "[{$level}] {$message}\n");
+ } else {
+ echo "[{$level}] {$message}\n";
+ }
+ }
+}
diff --git a/src/Model/Cart/Cart.php b/src/Core/Model/Cart/Cart.php
similarity index 100%
rename from src/Model/Cart/Cart.php
rename to src/Core/Model/Cart/Cart.php
diff --git a/src/Model/Cart/CartCollection.php b/src/Core/Model/Cart/CartCollection.php
similarity index 100%
rename from src/Model/Cart/CartCollection.php
rename to src/Core/Model/Cart/CartCollection.php
diff --git a/src/Model/Cart/CartDiscountCodeState.php b/src/Core/Model/Cart/CartDiscountCodeState.php
similarity index 100%
rename from src/Model/Cart/CartDiscountCodeState.php
rename to src/Core/Model/Cart/CartDiscountCodeState.php
diff --git a/src/Model/Cart/CartDraft.php b/src/Core/Model/Cart/CartDraft.php
similarity index 100%
rename from src/Model/Cart/CartDraft.php
rename to src/Core/Model/Cart/CartDraft.php
diff --git a/src/Model/Cart/CartReference.php b/src/Core/Model/Cart/CartReference.php
similarity index 100%
rename from src/Model/Cart/CartReference.php
rename to src/Core/Model/Cart/CartReference.php
diff --git a/src/Model/Cart/CartState.php b/src/Core/Model/Cart/CartState.php
similarity index 100%
rename from src/Model/Cart/CartState.php
rename to src/Core/Model/Cart/CartState.php
diff --git a/src/Model/Cart/CustomLineItem.php b/src/Core/Model/Cart/CustomLineItem.php
similarity index 100%
rename from src/Model/Cart/CustomLineItem.php
rename to src/Core/Model/Cart/CustomLineItem.php
diff --git a/src/Model/Cart/CustomLineItemCollection.php b/src/Core/Model/Cart/CustomLineItemCollection.php
similarity index 100%
rename from src/Model/Cart/CustomLineItemCollection.php
rename to src/Core/Model/Cart/CustomLineItemCollection.php
diff --git a/src/Model/Cart/CustomLineItemDraft.php b/src/Core/Model/Cart/CustomLineItemDraft.php
similarity index 100%
rename from src/Model/Cart/CustomLineItemDraft.php
rename to src/Core/Model/Cart/CustomLineItemDraft.php
diff --git a/src/Model/Cart/CustomLineItemDraftCollection.php b/src/Core/Model/Cart/CustomLineItemDraftCollection.php
similarity index 100%
rename from src/Model/Cart/CustomLineItemDraftCollection.php
rename to src/Core/Model/Cart/CustomLineItemDraftCollection.php
diff --git a/src/Model/Cart/DiscountCodeInfo.php b/src/Core/Model/Cart/DiscountCodeInfo.php
similarity index 100%
rename from src/Model/Cart/DiscountCodeInfo.php
rename to src/Core/Model/Cart/DiscountCodeInfo.php
diff --git a/src/Model/Cart/DiscountCodeInfoCollection.php b/src/Core/Model/Cart/DiscountCodeInfoCollection.php
similarity index 100%
rename from src/Model/Cart/DiscountCodeInfoCollection.php
rename to src/Core/Model/Cart/DiscountCodeInfoCollection.php
diff --git a/src/Model/Cart/DiscountedLineItemPortion.php b/src/Core/Model/Cart/DiscountedLineItemPortion.php
similarity index 100%
rename from src/Model/Cart/DiscountedLineItemPortion.php
rename to src/Core/Model/Cart/DiscountedLineItemPortion.php
diff --git a/src/Model/Cart/DiscountedLineItemPortionCollection.php b/src/Core/Model/Cart/DiscountedLineItemPortionCollection.php
similarity index 100%
rename from src/Model/Cart/DiscountedLineItemPortionCollection.php
rename to src/Core/Model/Cart/DiscountedLineItemPortionCollection.php
diff --git a/src/Model/Cart/DiscountedLineItemPrice.php b/src/Core/Model/Cart/DiscountedLineItemPrice.php
similarity index 100%
rename from src/Model/Cart/DiscountedLineItemPrice.php
rename to src/Core/Model/Cart/DiscountedLineItemPrice.php
diff --git a/src/Model/Cart/DiscountedPricePerQuantity.php b/src/Core/Model/Cart/DiscountedPricePerQuantity.php
similarity index 100%
rename from src/Model/Cart/DiscountedPricePerQuantity.php
rename to src/Core/Model/Cart/DiscountedPricePerQuantity.php
diff --git a/src/Model/Cart/DiscountedPricePerQuantityCollection.php b/src/Core/Model/Cart/DiscountedPricePerQuantityCollection.php
similarity index 100%
rename from src/Model/Cart/DiscountedPricePerQuantityCollection.php
rename to src/Core/Model/Cart/DiscountedPricePerQuantityCollection.php
diff --git a/src/Model/Cart/ExternalLineItemTotalPrice.php b/src/Core/Model/Cart/ExternalLineItemTotalPrice.php
similarity index 100%
rename from src/Model/Cart/ExternalLineItemTotalPrice.php
rename to src/Core/Model/Cart/ExternalLineItemTotalPrice.php
diff --git a/src/Model/Cart/InventoryMode.php b/src/Core/Model/Cart/InventoryMode.php
similarity index 100%
rename from src/Model/Cart/InventoryMode.php
rename to src/Core/Model/Cart/InventoryMode.php
diff --git a/src/Model/Cart/LineItem.php b/src/Core/Model/Cart/LineItem.php
similarity index 100%
rename from src/Model/Cart/LineItem.php
rename to src/Core/Model/Cart/LineItem.php
diff --git a/src/Model/Cart/LineItemCollection.php b/src/Core/Model/Cart/LineItemCollection.php
similarity index 100%
rename from src/Model/Cart/LineItemCollection.php
rename to src/Core/Model/Cart/LineItemCollection.php
diff --git a/src/Model/Cart/LineItemDraft.php b/src/Core/Model/Cart/LineItemDraft.php
similarity index 100%
rename from src/Model/Cart/LineItemDraft.php
rename to src/Core/Model/Cart/LineItemDraft.php
diff --git a/src/Model/Cart/LineItemDraftCollection.php b/src/Core/Model/Cart/LineItemDraftCollection.php
similarity index 100%
rename from src/Model/Cart/LineItemDraftCollection.php
rename to src/Core/Model/Cart/LineItemDraftCollection.php
diff --git a/src/Model/Cart/MyCartDraft.php b/src/Core/Model/Cart/MyCartDraft.php
similarity index 100%
rename from src/Model/Cart/MyCartDraft.php
rename to src/Core/Model/Cart/MyCartDraft.php
diff --git a/src/Model/Cart/MyLineItemDraft.php b/src/Core/Model/Cart/MyLineItemDraft.php
similarity index 100%
rename from src/Model/Cart/MyLineItemDraft.php
rename to src/Core/Model/Cart/MyLineItemDraft.php
diff --git a/src/Model/Cart/MyLineItemDraftCollection.php b/src/Core/Model/Cart/MyLineItemDraftCollection.php
similarity index 100%
rename from src/Model/Cart/MyLineItemDraftCollection.php
rename to src/Core/Model/Cart/MyLineItemDraftCollection.php
diff --git a/src/Model/Cart/ShippingInfo.php b/src/Core/Model/Cart/ShippingInfo.php
similarity index 100%
rename from src/Model/Cart/ShippingInfo.php
rename to src/Core/Model/Cart/ShippingInfo.php
diff --git a/src/Model/CartDiscount/CartDiscount.php b/src/Core/Model/CartDiscount/CartDiscount.php
similarity index 100%
rename from src/Model/CartDiscount/CartDiscount.php
rename to src/Core/Model/CartDiscount/CartDiscount.php
diff --git a/src/Model/CartDiscount/CartDiscountCollection.php b/src/Core/Model/CartDiscount/CartDiscountCollection.php
similarity index 100%
rename from src/Model/CartDiscount/CartDiscountCollection.php
rename to src/Core/Model/CartDiscount/CartDiscountCollection.php
diff --git a/src/Model/CartDiscount/CartDiscountDraft.php b/src/Core/Model/CartDiscount/CartDiscountDraft.php
similarity index 100%
rename from src/Model/CartDiscount/CartDiscountDraft.php
rename to src/Core/Model/CartDiscount/CartDiscountDraft.php
diff --git a/src/Model/CartDiscount/CartDiscountReference.php b/src/Core/Model/CartDiscount/CartDiscountReference.php
similarity index 100%
rename from src/Model/CartDiscount/CartDiscountReference.php
rename to src/Core/Model/CartDiscount/CartDiscountReference.php
diff --git a/src/Model/CartDiscount/CartDiscountReferenceCollection.php b/src/Core/Model/CartDiscount/CartDiscountReferenceCollection.php
similarity index 100%
rename from src/Model/CartDiscount/CartDiscountReferenceCollection.php
rename to src/Core/Model/CartDiscount/CartDiscountReferenceCollection.php
diff --git a/src/Model/CartDiscount/CartDiscountTarget.php b/src/Core/Model/CartDiscount/CartDiscountTarget.php
similarity index 100%
rename from src/Model/CartDiscount/CartDiscountTarget.php
rename to src/Core/Model/CartDiscount/CartDiscountTarget.php
diff --git a/src/Model/CartDiscount/CartDiscountValue.php b/src/Core/Model/CartDiscount/CartDiscountValue.php
similarity index 100%
rename from src/Model/CartDiscount/CartDiscountValue.php
rename to src/Core/Model/CartDiscount/CartDiscountValue.php
diff --git a/src/Model/Category/Category.php b/src/Core/Model/Category/Category.php
similarity index 100%
rename from src/Model/Category/Category.php
rename to src/Core/Model/Category/Category.php
diff --git a/src/Model/Category/CategoryCollection.php b/src/Core/Model/Category/CategoryCollection.php
similarity index 100%
rename from src/Model/Category/CategoryCollection.php
rename to src/Core/Model/Category/CategoryCollection.php
diff --git a/src/Model/Category/CategoryDraft.php b/src/Core/Model/Category/CategoryDraft.php
similarity index 100%
rename from src/Model/Category/CategoryDraft.php
rename to src/Core/Model/Category/CategoryDraft.php
diff --git a/src/Model/Category/CategoryReference.php b/src/Core/Model/Category/CategoryReference.php
similarity index 100%
rename from src/Model/Category/CategoryReference.php
rename to src/Core/Model/Category/CategoryReference.php
diff --git a/src/Model/Category/CategoryReferenceCollection.php b/src/Core/Model/Category/CategoryReferenceCollection.php
similarity index 100%
rename from src/Model/Category/CategoryReferenceCollection.php
rename to src/Core/Model/Category/CategoryReferenceCollection.php
diff --git a/src/Model/Channel/Channel.php b/src/Core/Model/Channel/Channel.php
similarity index 100%
rename from src/Model/Channel/Channel.php
rename to src/Core/Model/Channel/Channel.php
diff --git a/src/Model/Channel/ChannelCollection.php b/src/Core/Model/Channel/ChannelCollection.php
similarity index 100%
rename from src/Model/Channel/ChannelCollection.php
rename to src/Core/Model/Channel/ChannelCollection.php
diff --git a/src/Model/Channel/ChannelDraft.php b/src/Core/Model/Channel/ChannelDraft.php
similarity index 100%
rename from src/Model/Channel/ChannelDraft.php
rename to src/Core/Model/Channel/ChannelDraft.php
diff --git a/src/Model/Channel/ChannelReference.php b/src/Core/Model/Channel/ChannelReference.php
similarity index 100%
rename from src/Model/Channel/ChannelReference.php
rename to src/Core/Model/Channel/ChannelReference.php
diff --git a/src/Model/Channel/ChannelRole.php b/src/Core/Model/Channel/ChannelRole.php
similarity index 100%
rename from src/Model/Channel/ChannelRole.php
rename to src/Core/Model/Channel/ChannelRole.php
diff --git a/src/Model/Common/AbstractJsonDeserializeObject.php b/src/Core/Model/Common/AbstractJsonDeserializeObject.php
similarity index 100%
rename from src/Model/Common/AbstractJsonDeserializeObject.php
rename to src/Core/Model/Common/AbstractJsonDeserializeObject.php
diff --git a/src/Model/Common/Address.php b/src/Core/Model/Common/Address.php
similarity index 100%
rename from src/Model/Common/Address.php
rename to src/Core/Model/Common/Address.php
diff --git a/src/Model/Common/AddressCollection.php b/src/Core/Model/Common/AddressCollection.php
similarity index 100%
rename from src/Model/Common/AddressCollection.php
rename to src/Core/Model/Common/AddressCollection.php
diff --git a/src/Model/Common/Asset.php b/src/Core/Model/Common/Asset.php
similarity index 100%
rename from src/Model/Common/Asset.php
rename to src/Core/Model/Common/Asset.php
diff --git a/src/Model/Common/AssetCollection.php b/src/Core/Model/Common/AssetCollection.php
similarity index 100%
rename from src/Model/Common/AssetCollection.php
rename to src/Core/Model/Common/AssetCollection.php
diff --git a/src/Model/Common/AssetDimension.php b/src/Core/Model/Common/AssetDimension.php
similarity index 100%
rename from src/Model/Common/AssetDimension.php
rename to src/Core/Model/Common/AssetDimension.php
diff --git a/src/Model/Common/AssetDraft.php b/src/Core/Model/Common/AssetDraft.php
similarity index 100%
rename from src/Model/Common/AssetDraft.php
rename to src/Core/Model/Common/AssetDraft.php
diff --git a/src/Model/Common/AssetDraftCollection.php b/src/Core/Model/Common/AssetDraftCollection.php
similarity index 100%
rename from src/Model/Common/AssetDraftCollection.php
rename to src/Core/Model/Common/AssetDraftCollection.php
diff --git a/src/Model/Common/AssetSource.php b/src/Core/Model/Common/AssetSource.php
similarity index 100%
rename from src/Model/Common/AssetSource.php
rename to src/Core/Model/Common/AssetSource.php
diff --git a/src/Model/Common/AssetSourceCollection.php b/src/Core/Model/Common/AssetSourceCollection.php
similarity index 100%
rename from src/Model/Common/AssetSourceCollection.php
rename to src/Core/Model/Common/AssetSourceCollection.php
diff --git a/src/Model/Common/Attribute.php b/src/Core/Model/Common/Attribute.php
similarity index 100%
rename from src/Model/Common/Attribute.php
rename to src/Core/Model/Common/Attribute.php
diff --git a/src/Model/Common/AttributeCollection.php b/src/Core/Model/Common/AttributeCollection.php
similarity index 100%
rename from src/Model/Common/AttributeCollection.php
rename to src/Core/Model/Common/AttributeCollection.php
diff --git a/src/Model/Common/Collection.php b/src/Core/Model/Common/Collection.php
similarity index 94%
rename from src/Model/Common/Collection.php
rename to src/Core/Model/Common/Collection.php
index 858f9562ae..56ae0b2b03 100644
--- a/src/Model/Common/Collection.php
+++ b/src/Core/Model/Common/Collection.php
@@ -14,6 +14,9 @@ class Collection extends AbstractJsonDeserializeObject implements \Iterator, \Js
{
const ID = 'id';
use ContextTrait;
+ const COLLECTION_TYPE = Collection::TYPE_LIST;
+ const TYPE_LIST = 'List';
+ const TYPE_MAP = 'Map';
/**
* @var string
@@ -367,5 +370,20 @@ public function offsetUnset($offset)
{
unset($this->rawData[$offset]);
unset($this->typeData[$offset]);
+ $rawKeys = array_keys($this->rawData);
+ $typeKeys = array_keys($this->typeData);
+ $keys = array_merge($rawKeys, $typeKeys);
+ $this->keys = array_unique($keys);
+ }
+
+ protected function toJson()
+ {
+ $data = parent::toJson();
+
+ if (static::COLLECTION_TYPE == self::TYPE_LIST) {
+ return array_values($data);
+ }
+
+ return $data;
}
}
diff --git a/src/Model/Common/Context.php b/src/Core/Model/Common/Context.php
similarity index 100%
rename from src/Model/Common/Context.php
rename to src/Core/Model/Common/Context.php
diff --git a/src/Model/Common/ContextAwareInterface.php b/src/Core/Model/Common/ContextAwareInterface.php
similarity index 100%
rename from src/Model/Common/ContextAwareInterface.php
rename to src/Core/Model/Common/ContextAwareInterface.php
diff --git a/src/Model/Common/ContextTrait.php b/src/Core/Model/Common/ContextTrait.php
similarity index 100%
rename from src/Model/Common/ContextTrait.php
rename to src/Core/Model/Common/ContextTrait.php
diff --git a/src/Model/Common/DateDecorator.php b/src/Core/Model/Common/DateDecorator.php
similarity index 100%
rename from src/Model/Common/DateDecorator.php
rename to src/Core/Model/Common/DateDecorator.php
diff --git a/src/Model/Common/DateTimeDecorator.php b/src/Core/Model/Common/DateTimeDecorator.php
similarity index 100%
rename from src/Model/Common/DateTimeDecorator.php
rename to src/Core/Model/Common/DateTimeDecorator.php
diff --git a/src/Model/Common/DiscountValue.php b/src/Core/Model/Common/DiscountValue.php
similarity index 100%
rename from src/Model/Common/DiscountValue.php
rename to src/Core/Model/Common/DiscountValue.php
diff --git a/src/Model/Common/DiscountedPrice.php b/src/Core/Model/Common/DiscountedPrice.php
similarity index 100%
rename from src/Model/Common/DiscountedPrice.php
rename to src/Core/Model/Common/DiscountedPrice.php
diff --git a/src/Model/Common/Enum.php b/src/Core/Model/Common/Enum.php
similarity index 100%
rename from src/Model/Common/Enum.php
rename to src/Core/Model/Common/Enum.php
diff --git a/src/Model/Common/EnumCollection.php b/src/Core/Model/Common/EnumCollection.php
similarity index 100%
rename from src/Model/Common/EnumCollection.php
rename to src/Core/Model/Common/EnumCollection.php
diff --git a/src/Model/Common/GeoLocation.php b/src/Core/Model/Common/GeoLocation.php
similarity index 100%
rename from src/Model/Common/GeoLocation.php
rename to src/Core/Model/Common/GeoLocation.php
diff --git a/src/Model/Common/GeoPoint.php b/src/Core/Model/Common/GeoPoint.php
similarity index 100%
rename from src/Model/Common/GeoPoint.php
rename to src/Core/Model/Common/GeoPoint.php
diff --git a/src/Model/Common/Image.php b/src/Core/Model/Common/Image.php
similarity index 100%
rename from src/Model/Common/Image.php
rename to src/Core/Model/Common/Image.php
diff --git a/src/Model/Common/ImageCollection.php b/src/Core/Model/Common/ImageCollection.php
similarity index 100%
rename from src/Model/Common/ImageCollection.php
rename to src/Core/Model/Common/ImageCollection.php
diff --git a/src/Model/Common/ImageDimension.php b/src/Core/Model/Common/ImageDimension.php
similarity index 100%
rename from src/Model/Common/ImageDimension.php
rename to src/Core/Model/Common/ImageDimension.php
diff --git a/src/Model/Common/JsonDeserializeInterface.php b/src/Core/Model/Common/JsonDeserializeInterface.php
similarity index 100%
rename from src/Model/Common/JsonDeserializeInterface.php
rename to src/Core/Model/Common/JsonDeserializeInterface.php
diff --git a/src/Model/Common/JsonObject.php b/src/Core/Model/Common/JsonObject.php
similarity index 100%
rename from src/Model/Common/JsonObject.php
rename to src/Core/Model/Common/JsonObject.php
diff --git a/src/Model/Common/KeyResourceIdentifier.php b/src/Core/Model/Common/KeyResourceIdentifier.php
similarity index 100%
rename from src/Model/Common/KeyResourceIdentifier.php
rename to src/Core/Model/Common/KeyResourceIdentifier.php
diff --git a/src/Model/Common/LocaleTrait.php b/src/Core/Model/Common/LocaleTrait.php
similarity index 100%
rename from src/Model/Common/LocaleTrait.php
rename to src/Core/Model/Common/LocaleTrait.php
diff --git a/src/Model/Common/LocalizedEnum.php b/src/Core/Model/Common/LocalizedEnum.php
similarity index 100%
rename from src/Model/Common/LocalizedEnum.php
rename to src/Core/Model/Common/LocalizedEnum.php
diff --git a/src/Model/Common/LocalizedEnumCollection.php b/src/Core/Model/Common/LocalizedEnumCollection.php
similarity index 100%
rename from src/Model/Common/LocalizedEnumCollection.php
rename to src/Core/Model/Common/LocalizedEnumCollection.php
diff --git a/src/Model/Common/LocalizedString.php b/src/Core/Model/Common/LocalizedString.php
similarity index 100%
rename from src/Model/Common/LocalizedString.php
rename to src/Core/Model/Common/LocalizedString.php
diff --git a/src/Model/Common/Money.php b/src/Core/Model/Common/Money.php
similarity index 100%
rename from src/Model/Common/Money.php
rename to src/Core/Model/Common/Money.php
diff --git a/src/Model/Common/MoneyCollection.php b/src/Core/Model/Common/MoneyCollection.php
similarity index 100%
rename from src/Model/Common/MoneyCollection.php
rename to src/Core/Model/Common/MoneyCollection.php
diff --git a/src/Model/Common/ObjectTreeInterface.php b/src/Core/Model/Common/ObjectTreeInterface.php
similarity index 100%
rename from src/Model/Common/ObjectTreeInterface.php
rename to src/Core/Model/Common/ObjectTreeInterface.php
diff --git a/src/Model/Common/ObjectTreeTrait.php b/src/Core/Model/Common/ObjectTreeTrait.php
similarity index 100%
rename from src/Model/Common/ObjectTreeTrait.php
rename to src/Core/Model/Common/ObjectTreeTrait.php
diff --git a/src/Model/Common/Price.php b/src/Core/Model/Common/Price.php
similarity index 93%
rename from src/Model/Common/Price.php
rename to src/Core/Model/Common/Price.php
index 0a38c54a2e..762261ca02 100644
--- a/src/Model/Common/Price.php
+++ b/src/Core/Model/Common/Price.php
@@ -32,6 +32,8 @@
* @method Price setValidUntil(DateTime $validUntil = null)
* @method CustomFieldObject getCustom()
* @method Price setCustom(CustomFieldObject $custom = null)
+ * @method PriceTierCollection getTiers()
+ * @method Price setTiers(PriceTierCollection $tiers = null)
*/
class Price extends JsonObject
{
@@ -44,6 +46,7 @@ class Price extends JsonObject
const VALID_UNTIL = 'validUntil';
const DISCOUNTED = 'discounted';
const CUSTOM = 'custom';
+ const TIERS = 'tiers';
public function fieldDefinitions()
{
@@ -63,6 +66,7 @@ public function fieldDefinitions()
],
static::DISCOUNTED => [self::TYPE => DiscountedPrice::class],
static::CUSTOM => [static::TYPE => CustomFieldObject::class],
+ static::TIERS => [static::TYPE => PriceTierCollection::class]
];
}
diff --git a/src/Model/Common/PriceCollection.php b/src/Core/Model/Common/PriceCollection.php
similarity index 100%
rename from src/Model/Common/PriceCollection.php
rename to src/Core/Model/Common/PriceCollection.php
diff --git a/src/Model/Common/PriceDraft.php b/src/Core/Model/Common/PriceDraft.php
similarity index 92%
rename from src/Model/Common/PriceDraft.php
rename to src/Core/Model/Common/PriceDraft.php
index fe92e3da02..5a6214413b 100644
--- a/src/Model/Common/PriceDraft.php
+++ b/src/Core/Model/Common/PriceDraft.php
@@ -27,6 +27,8 @@
* @method PriceDraft setValidUntil(DateTime $validUntil = null)
* @method CustomFieldObject getCustom()
* @method PriceDraft setCustom(CustomFieldObject $custom = null)
+ * @method PriceTierCollection getTiers()
+ * @method PriceDraft setTiers(PriceTierCollection $tiers = null)
*/
class PriceDraft extends JsonObject
{
@@ -38,6 +40,7 @@ class PriceDraft extends JsonObject
const VALID_UNTIL = 'validUntil';
const DISCOUNTED = 'discounted';
const CUSTOM = 'custom';
+ const TIERS = 'tiers';
public function fieldDefinitions()
{
@@ -55,6 +58,7 @@ public function fieldDefinitions()
self::DECORATOR => DateTimeDecorator::class
],
static::CUSTOM => [static::TYPE => CustomFieldObject::class],
+ static::TIERS => [static::TYPE => PriceTierCollection::class]
];
}
diff --git a/src/Model/Common/PriceDraftCollection.php b/src/Core/Model/Common/PriceDraftCollection.php
similarity index 100%
rename from src/Model/Common/PriceDraftCollection.php
rename to src/Core/Model/Common/PriceDraftCollection.php
diff --git a/src/Core/Model/Common/PriceTier.php b/src/Core/Model/Common/PriceTier.php
new file mode 100644
index 0000000000..d277e64920
--- /dev/null
+++ b/src/Core/Model/Common/PriceTier.php
@@ -0,0 +1,35 @@
+ [static::TYPE => 'int'],
+ static::VALUE => [self::TYPE => Money::class]
+ ];
+ }
+ /**
+ * @param int $quantity
+ * @param Money $money
+ * @param Context|callable $context
+ * @return PriceTier
+ */
+ public static function ofQuantityAndMoney($quantity, Money $money, $context = null)
+ {
+ return static::of($context)->setValue($money)->setMinimumQuantity($quantity);
+ }
+}
diff --git a/src/Core/Model/Common/PriceTierCollection.php b/src/Core/Model/Common/PriceTierCollection.php
new file mode 100644
index 0000000000..3909025309
--- /dev/null
+++ b/src/Core/Model/Common/PriceTierCollection.php
@@ -0,0 +1,15 @@
+ [static::TYPE => LineItemCollection::class],
'textLineItems' => [static::TYPE => TextLineItemCollection::class],
'custom' => [static::TYPE => CustomFieldObject::class],
+ 'deleteDaysAfterLastModification' => [static::TYPE => 'int']
];
}
}
diff --git a/src/Model/ShoppingList/ShoppingListCollection.php b/src/Core/Model/ShoppingList/ShoppingListCollection.php
similarity index 100%
rename from src/Model/ShoppingList/ShoppingListCollection.php
rename to src/Core/Model/ShoppingList/ShoppingListCollection.php
diff --git a/src/Model/ShoppingList/ShoppingListDraft.php b/src/Core/Model/ShoppingList/ShoppingListDraft.php
similarity index 91%
rename from src/Model/ShoppingList/ShoppingListDraft.php
rename to src/Core/Model/ShoppingList/ShoppingListDraft.php
index bc43673b1a..0256b20588 100644
--- a/src/Model/ShoppingList/ShoppingListDraft.php
+++ b/src/Core/Model/ShoppingList/ShoppingListDraft.php
@@ -30,6 +30,8 @@
* @method ShoppingListDraft setTextLineItems(TextLineItemDraftCollection $textLineItems = null)
* @method CustomFieldObjectDraft getCustom()
* @method ShoppingListDraft setCustom(CustomFieldObjectDraft $custom = null)
+ * @method int getDeleteDaysAfterLastModification()
+ * @method ShoppingListDraft setDeleteDaysAfterLastModification(int $deleteDaysAfterLastModification = null)
*/
class ShoppingListDraft extends Resource
{
@@ -44,6 +46,7 @@ public function fieldDefinitions()
'lineItems' => [static::TYPE => LineItemDraftCollection::class],
'textLineItems' => [static::TYPE => TextLineItemDraftCollection::class],
'custom' => [static::TYPE => CustomFieldObjectDraft::class],
+ 'deleteDaysAfterLastModification' => [static::TYPE => 'int']
];
}
diff --git a/src/Model/ShoppingList/ShoppingListReference.php b/src/Core/Model/ShoppingList/ShoppingListReference.php
similarity index 100%
rename from src/Model/ShoppingList/ShoppingListReference.php
rename to src/Core/Model/ShoppingList/ShoppingListReference.php
diff --git a/src/Model/ShoppingList/TextLineItem.php b/src/Core/Model/ShoppingList/TextLineItem.php
similarity index 100%
rename from src/Model/ShoppingList/TextLineItem.php
rename to src/Core/Model/ShoppingList/TextLineItem.php
diff --git a/src/Model/ShoppingList/TextLineItemCollection.php b/src/Core/Model/ShoppingList/TextLineItemCollection.php
similarity index 100%
rename from src/Model/ShoppingList/TextLineItemCollection.php
rename to src/Core/Model/ShoppingList/TextLineItemCollection.php
diff --git a/src/Model/ShoppingList/TextLineItemDraft.php b/src/Core/Model/ShoppingList/TextLineItemDraft.php
similarity index 100%
rename from src/Model/ShoppingList/TextLineItemDraft.php
rename to src/Core/Model/ShoppingList/TextLineItemDraft.php
diff --git a/src/Model/ShoppingList/TextLineItemDraftCollection.php b/src/Core/Model/ShoppingList/TextLineItemDraftCollection.php
similarity index 100%
rename from src/Model/ShoppingList/TextLineItemDraftCollection.php
rename to src/Core/Model/ShoppingList/TextLineItemDraftCollection.php
diff --git a/src/Model/State/State.php b/src/Core/Model/State/State.php
similarity index 100%
rename from src/Model/State/State.php
rename to src/Core/Model/State/State.php
diff --git a/src/Model/State/StateCollection.php b/src/Core/Model/State/StateCollection.php
similarity index 100%
rename from src/Model/State/StateCollection.php
rename to src/Core/Model/State/StateCollection.php
diff --git a/src/Model/State/StateDraft.php b/src/Core/Model/State/StateDraft.php
similarity index 100%
rename from src/Model/State/StateDraft.php
rename to src/Core/Model/State/StateDraft.php
diff --git a/src/Model/State/StateReference.php b/src/Core/Model/State/StateReference.php
similarity index 100%
rename from src/Model/State/StateReference.php
rename to src/Core/Model/State/StateReference.php
diff --git a/src/Model/State/StateReferenceCollection.php b/src/Core/Model/State/StateReferenceCollection.php
similarity index 100%
rename from src/Model/State/StateReferenceCollection.php
rename to src/Core/Model/State/StateReferenceCollection.php
diff --git a/src/Model/State/StateRole.php b/src/Core/Model/State/StateRole.php
similarity index 100%
rename from src/Model/State/StateRole.php
rename to src/Core/Model/State/StateRole.php
diff --git a/src/Model/Subscription/ChangeSubscription.php b/src/Core/Model/Subscription/ChangeSubscription.php
similarity index 100%
rename from src/Model/Subscription/ChangeSubscription.php
rename to src/Core/Model/Subscription/ChangeSubscription.php
diff --git a/src/Model/Subscription/ChangeSubscriptionCollection.php b/src/Core/Model/Subscription/ChangeSubscriptionCollection.php
similarity index 100%
rename from src/Model/Subscription/ChangeSubscriptionCollection.php
rename to src/Core/Model/Subscription/ChangeSubscriptionCollection.php
diff --git a/src/Model/Subscription/Delivery.php b/src/Core/Model/Subscription/Delivery.php
similarity index 100%
rename from src/Model/Subscription/Delivery.php
rename to src/Core/Model/Subscription/Delivery.php
diff --git a/src/Model/Subscription/Destination.php b/src/Core/Model/Subscription/Destination.php
similarity index 100%
rename from src/Model/Subscription/Destination.php
rename to src/Core/Model/Subscription/Destination.php
diff --git a/src/Model/Subscription/IronMQDestination.php b/src/Core/Model/Subscription/IronMQDestination.php
similarity index 100%
rename from src/Model/Subscription/IronMQDestination.php
rename to src/Core/Model/Subscription/IronMQDestination.php
diff --git a/src/Model/Subscription/MessageDelivery.php b/src/Core/Model/Subscription/MessageDelivery.php
similarity index 93%
rename from src/Model/Subscription/MessageDelivery.php
rename to src/Core/Model/Subscription/MessageDelivery.php
index 931b6e1285..c45db43948 100644
--- a/src/Model/Subscription/MessageDelivery.php
+++ b/src/Core/Model/Subscription/MessageDelivery.php
@@ -7,6 +7,7 @@
use Commercetools\Core\Model\Common\Reference;
use Commercetools\Core\Model\Common\DateTimeDecorator;
+use Commercetools\Core\Model\Message\Message;
use DateTime;
/**
@@ -54,4 +55,9 @@ public function fieldDefinitions()
);
return $definition;
}
+
+ public function getMessage()
+ {
+ return Message::fromArray($this->rawData);
+ }
}
diff --git a/src/Model/Subscription/MessageSubscription.php b/src/Core/Model/Subscription/MessageSubscription.php
similarity index 100%
rename from src/Model/Subscription/MessageSubscription.php
rename to src/Core/Model/Subscription/MessageSubscription.php
diff --git a/src/Model/Subscription/MessageSubscriptionCollection.php b/src/Core/Model/Subscription/MessageSubscriptionCollection.php
similarity index 100%
rename from src/Model/Subscription/MessageSubscriptionCollection.php
rename to src/Core/Model/Subscription/MessageSubscriptionCollection.php
diff --git a/src/Model/Subscription/ResourceCreatedDelivery.php b/src/Core/Model/Subscription/ResourceCreatedDelivery.php
similarity index 100%
rename from src/Model/Subscription/ResourceCreatedDelivery.php
rename to src/Core/Model/Subscription/ResourceCreatedDelivery.php
diff --git a/src/Model/Subscription/ResourceDeletedDelivery.php b/src/Core/Model/Subscription/ResourceDeletedDelivery.php
similarity index 100%
rename from src/Model/Subscription/ResourceDeletedDelivery.php
rename to src/Core/Model/Subscription/ResourceDeletedDelivery.php
diff --git a/src/Model/Subscription/ResourceUpdatedDelivery.php b/src/Core/Model/Subscription/ResourceUpdatedDelivery.php
similarity index 100%
rename from src/Model/Subscription/ResourceUpdatedDelivery.php
rename to src/Core/Model/Subscription/ResourceUpdatedDelivery.php
diff --git a/src/Model/Subscription/SNSDestination.php b/src/Core/Model/Subscription/SNSDestination.php
similarity index 100%
rename from src/Model/Subscription/SNSDestination.php
rename to src/Core/Model/Subscription/SNSDestination.php
diff --git a/src/Model/Subscription/SQSDestination.php b/src/Core/Model/Subscription/SQSDestination.php
similarity index 100%
rename from src/Model/Subscription/SQSDestination.php
rename to src/Core/Model/Subscription/SQSDestination.php
diff --git a/src/Model/Subscription/Subscription.php b/src/Core/Model/Subscription/Subscription.php
similarity index 100%
rename from src/Model/Subscription/Subscription.php
rename to src/Core/Model/Subscription/Subscription.php
diff --git a/src/Model/Subscription/SubscriptionCollection.php b/src/Core/Model/Subscription/SubscriptionCollection.php
similarity index 100%
rename from src/Model/Subscription/SubscriptionCollection.php
rename to src/Core/Model/Subscription/SubscriptionCollection.php
diff --git a/src/Model/Subscription/SubscriptionDraft.php b/src/Core/Model/Subscription/SubscriptionDraft.php
similarity index 100%
rename from src/Model/Subscription/SubscriptionDraft.php
rename to src/Core/Model/Subscription/SubscriptionDraft.php
diff --git a/src/Model/Subscription/SubscriptionReference.php b/src/Core/Model/Subscription/SubscriptionReference.php
similarity index 100%
rename from src/Model/Subscription/SubscriptionReference.php
rename to src/Core/Model/Subscription/SubscriptionReference.php
diff --git a/src/Model/TaxCategory/ExternalTaxRateDraft.php b/src/Core/Model/TaxCategory/ExternalTaxRateDraft.php
similarity index 100%
rename from src/Model/TaxCategory/ExternalTaxRateDraft.php
rename to src/Core/Model/TaxCategory/ExternalTaxRateDraft.php
diff --git a/src/Model/TaxCategory/SubRate.php b/src/Core/Model/TaxCategory/SubRate.php
similarity index 100%
rename from src/Model/TaxCategory/SubRate.php
rename to src/Core/Model/TaxCategory/SubRate.php
diff --git a/src/Model/TaxCategory/SubRateCollection.php b/src/Core/Model/TaxCategory/SubRateCollection.php
similarity index 100%
rename from src/Model/TaxCategory/SubRateCollection.php
rename to src/Core/Model/TaxCategory/SubRateCollection.php
diff --git a/src/Model/TaxCategory/TaxCategory.php b/src/Core/Model/TaxCategory/TaxCategory.php
similarity index 100%
rename from src/Model/TaxCategory/TaxCategory.php
rename to src/Core/Model/TaxCategory/TaxCategory.php
diff --git a/src/Model/TaxCategory/TaxCategoryCollection.php b/src/Core/Model/TaxCategory/TaxCategoryCollection.php
similarity index 100%
rename from src/Model/TaxCategory/TaxCategoryCollection.php
rename to src/Core/Model/TaxCategory/TaxCategoryCollection.php
diff --git a/src/Model/TaxCategory/TaxCategoryDraft.php b/src/Core/Model/TaxCategory/TaxCategoryDraft.php
similarity index 100%
rename from src/Model/TaxCategory/TaxCategoryDraft.php
rename to src/Core/Model/TaxCategory/TaxCategoryDraft.php
diff --git a/src/Model/TaxCategory/TaxCategoryReference.php b/src/Core/Model/TaxCategory/TaxCategoryReference.php
similarity index 100%
rename from src/Model/TaxCategory/TaxCategoryReference.php
rename to src/Core/Model/TaxCategory/TaxCategoryReference.php
diff --git a/src/Model/TaxCategory/TaxRate.php b/src/Core/Model/TaxCategory/TaxRate.php
similarity index 100%
rename from src/Model/TaxCategory/TaxRate.php
rename to src/Core/Model/TaxCategory/TaxRate.php
diff --git a/src/Model/TaxCategory/TaxRateCollection.php b/src/Core/Model/TaxCategory/TaxRateCollection.php
similarity index 100%
rename from src/Model/TaxCategory/TaxRateCollection.php
rename to src/Core/Model/TaxCategory/TaxRateCollection.php
diff --git a/src/Model/Type/BooleanType.php b/src/Core/Model/Type/BooleanType.php
similarity index 100%
rename from src/Model/Type/BooleanType.php
rename to src/Core/Model/Type/BooleanType.php
diff --git a/src/Model/Type/DateTimeType.php b/src/Core/Model/Type/DateTimeType.php
similarity index 100%
rename from src/Model/Type/DateTimeType.php
rename to src/Core/Model/Type/DateTimeType.php
diff --git a/src/Model/Type/DateType.php b/src/Core/Model/Type/DateType.php
similarity index 100%
rename from src/Model/Type/DateType.php
rename to src/Core/Model/Type/DateType.php
diff --git a/src/Model/Type/EnumType.php b/src/Core/Model/Type/EnumType.php
similarity index 100%
rename from src/Model/Type/EnumType.php
rename to src/Core/Model/Type/EnumType.php
diff --git a/src/Model/Type/FieldDefinition.php b/src/Core/Model/Type/FieldDefinition.php
similarity index 100%
rename from src/Model/Type/FieldDefinition.php
rename to src/Core/Model/Type/FieldDefinition.php
diff --git a/src/Model/Type/FieldDefinitionCollection.php b/src/Core/Model/Type/FieldDefinitionCollection.php
similarity index 100%
rename from src/Model/Type/FieldDefinitionCollection.php
rename to src/Core/Model/Type/FieldDefinitionCollection.php
diff --git a/src/Model/Type/FieldType.php b/src/Core/Model/Type/FieldType.php
similarity index 100%
rename from src/Model/Type/FieldType.php
rename to src/Core/Model/Type/FieldType.php
diff --git a/src/Model/Type/LocalizedEnumType.php b/src/Core/Model/Type/LocalizedEnumType.php
similarity index 100%
rename from src/Model/Type/LocalizedEnumType.php
rename to src/Core/Model/Type/LocalizedEnumType.php
diff --git a/src/Model/Type/LocalizedStringType.php b/src/Core/Model/Type/LocalizedStringType.php
similarity index 100%
rename from src/Model/Type/LocalizedStringType.php
rename to src/Core/Model/Type/LocalizedStringType.php
diff --git a/src/Model/Type/MoneyType.php b/src/Core/Model/Type/MoneyType.php
similarity index 100%
rename from src/Model/Type/MoneyType.php
rename to src/Core/Model/Type/MoneyType.php
diff --git a/src/Model/Type/NumberType.php b/src/Core/Model/Type/NumberType.php
similarity index 100%
rename from src/Model/Type/NumberType.php
rename to src/Core/Model/Type/NumberType.php
diff --git a/src/Model/Type/ReferenceType.php b/src/Core/Model/Type/ReferenceType.php
similarity index 100%
rename from src/Model/Type/ReferenceType.php
rename to src/Core/Model/Type/ReferenceType.php
diff --git a/src/Model/Type/SetType.php b/src/Core/Model/Type/SetType.php
similarity index 100%
rename from src/Model/Type/SetType.php
rename to src/Core/Model/Type/SetType.php
diff --git a/src/Model/Type/StringType.php b/src/Core/Model/Type/StringType.php
similarity index 100%
rename from src/Model/Type/StringType.php
rename to src/Core/Model/Type/StringType.php
diff --git a/src/Model/Type/TimeType.php b/src/Core/Model/Type/TimeType.php
similarity index 100%
rename from src/Model/Type/TimeType.php
rename to src/Core/Model/Type/TimeType.php
diff --git a/src/Model/Type/Type.php b/src/Core/Model/Type/Type.php
similarity index 100%
rename from src/Model/Type/Type.php
rename to src/Core/Model/Type/Type.php
diff --git a/src/Model/Type/TypeCollection.php b/src/Core/Model/Type/TypeCollection.php
similarity index 100%
rename from src/Model/Type/TypeCollection.php
rename to src/Core/Model/Type/TypeCollection.php
diff --git a/src/Model/Type/TypeDraft.php b/src/Core/Model/Type/TypeDraft.php
similarity index 100%
rename from src/Model/Type/TypeDraft.php
rename to src/Core/Model/Type/TypeDraft.php
diff --git a/src/Model/Type/TypeReference.php b/src/Core/Model/Type/TypeReference.php
similarity index 100%
rename from src/Model/Type/TypeReference.php
rename to src/Core/Model/Type/TypeReference.php
diff --git a/src/Model/Zone/Location.php b/src/Core/Model/Zone/Location.php
similarity index 100%
rename from src/Model/Zone/Location.php
rename to src/Core/Model/Zone/Location.php
diff --git a/src/Model/Zone/LocationCollection.php b/src/Core/Model/Zone/LocationCollection.php
similarity index 100%
rename from src/Model/Zone/LocationCollection.php
rename to src/Core/Model/Zone/LocationCollection.php
diff --git a/src/Model/Zone/Zone.php b/src/Core/Model/Zone/Zone.php
similarity index 100%
rename from src/Model/Zone/Zone.php
rename to src/Core/Model/Zone/Zone.php
diff --git a/src/Model/Zone/ZoneCollection.php b/src/Core/Model/Zone/ZoneCollection.php
similarity index 100%
rename from src/Model/Zone/ZoneCollection.php
rename to src/Core/Model/Zone/ZoneCollection.php
diff --git a/src/Model/Zone/ZoneDraft.php b/src/Core/Model/Zone/ZoneDraft.php
similarity index 100%
rename from src/Model/Zone/ZoneDraft.php
rename to src/Core/Model/Zone/ZoneDraft.php
diff --git a/src/Model/Zone/ZoneReference.php b/src/Core/Model/Zone/ZoneReference.php
similarity index 100%
rename from src/Model/Zone/ZoneReference.php
rename to src/Core/Model/Zone/ZoneReference.php
diff --git a/src/Request/AbstractAction.php b/src/Core/Request/AbstractAction.php
similarity index 100%
rename from src/Request/AbstractAction.php
rename to src/Core/Request/AbstractAction.php
diff --git a/src/Request/AbstractApiRequest.php b/src/Core/Request/AbstractApiRequest.php
similarity index 97%
rename from src/Request/AbstractApiRequest.php
rename to src/Core/Request/AbstractApiRequest.php
index 77ae84efa6..d526e630e6 100644
--- a/src/Request/AbstractApiRequest.php
+++ b/src/Core/Request/AbstractApiRequest.php
@@ -228,10 +228,11 @@ public function map(array $data, Context $context = null, MapperInterface $mappe
/**
* @param Client $client
+ * @param array $headers
* @return ApiResponseInterface
*/
- public function executeWithClient(Client $client)
+ public function executeWithClient(Client $client, array $headers = null)
{
- return $client->execute($this);
+ return $client->execute($this, $headers);
}
}
diff --git a/src/Request/AbstractByIdGetRequest.php b/src/Core/Request/AbstractByIdGetRequest.php
similarity index 100%
rename from src/Request/AbstractByIdGetRequest.php
rename to src/Core/Request/AbstractByIdGetRequest.php
diff --git a/src/Request/AbstractByKeyGetRequest.php b/src/Core/Request/AbstractByKeyGetRequest.php
similarity index 100%
rename from src/Request/AbstractByKeyGetRequest.php
rename to src/Core/Request/AbstractByKeyGetRequest.php
diff --git a/src/Request/AbstractCreateRequest.php b/src/Core/Request/AbstractCreateRequest.php
similarity index 100%
rename from src/Request/AbstractCreateRequest.php
rename to src/Core/Request/AbstractCreateRequest.php
diff --git a/src/Request/AbstractDeleteByKeyRequest.php b/src/Core/Request/AbstractDeleteByKeyRequest.php
similarity index 100%
rename from src/Request/AbstractDeleteByKeyRequest.php
rename to src/Core/Request/AbstractDeleteByKeyRequest.php
diff --git a/src/Request/AbstractDeleteRequest.php b/src/Core/Request/AbstractDeleteRequest.php
similarity index 100%
rename from src/Request/AbstractDeleteRequest.php
rename to src/Core/Request/AbstractDeleteRequest.php
diff --git a/src/Request/AbstractProjectionRequest.php b/src/Core/Request/AbstractProjectionRequest.php
similarity index 100%
rename from src/Request/AbstractProjectionRequest.php
rename to src/Core/Request/AbstractProjectionRequest.php
diff --git a/src/Request/AbstractQueryRequest.php b/src/Core/Request/AbstractQueryRequest.php
similarity index 100%
rename from src/Request/AbstractQueryRequest.php
rename to src/Core/Request/AbstractQueryRequest.php
diff --git a/src/Request/AbstractUpdateByKeyRequest.php b/src/Core/Request/AbstractUpdateByKeyRequest.php
similarity index 100%
rename from src/Request/AbstractUpdateByKeyRequest.php
rename to src/Core/Request/AbstractUpdateByKeyRequest.php
diff --git a/src/Request/AbstractUpdateRequest.php b/src/Core/Request/AbstractUpdateRequest.php
similarity index 100%
rename from src/Request/AbstractUpdateRequest.php
rename to src/Core/Request/AbstractUpdateRequest.php
diff --git a/src/Request/CartDiscounts/CartDiscountByIdGetRequest.php b/src/Core/Request/CartDiscounts/CartDiscountByIdGetRequest.php
similarity index 100%
rename from src/Request/CartDiscounts/CartDiscountByIdGetRequest.php
rename to src/Core/Request/CartDiscounts/CartDiscountByIdGetRequest.php
diff --git a/src/Request/CartDiscounts/CartDiscountCreateRequest.php b/src/Core/Request/CartDiscounts/CartDiscountCreateRequest.php
similarity index 100%
rename from src/Request/CartDiscounts/CartDiscountCreateRequest.php
rename to src/Core/Request/CartDiscounts/CartDiscountCreateRequest.php
diff --git a/src/Request/CartDiscounts/CartDiscountDeleteRequest.php b/src/Core/Request/CartDiscounts/CartDiscountDeleteRequest.php
similarity index 100%
rename from src/Request/CartDiscounts/CartDiscountDeleteRequest.php
rename to src/Core/Request/CartDiscounts/CartDiscountDeleteRequest.php
diff --git a/src/Request/CartDiscounts/CartDiscountQueryRequest.php b/src/Core/Request/CartDiscounts/CartDiscountQueryRequest.php
similarity index 100%
rename from src/Request/CartDiscounts/CartDiscountQueryRequest.php
rename to src/Core/Request/CartDiscounts/CartDiscountQueryRequest.php
diff --git a/src/Request/CartDiscounts/CartDiscountUpdateRequest.php b/src/Core/Request/CartDiscounts/CartDiscountUpdateRequest.php
similarity index 100%
rename from src/Request/CartDiscounts/CartDiscountUpdateRequest.php
rename to src/Core/Request/CartDiscounts/CartDiscountUpdateRequest.php
diff --git a/src/Request/CartDiscounts/CartDiscountsEndpoint.php b/src/Core/Request/CartDiscounts/CartDiscountsEndpoint.php
similarity index 100%
rename from src/Request/CartDiscounts/CartDiscountsEndpoint.php
rename to src/Core/Request/CartDiscounts/CartDiscountsEndpoint.php
diff --git a/src/Request/CartDiscounts/Command/CartDiscountChangeCartPredicateAction.php b/src/Core/Request/CartDiscounts/Command/CartDiscountChangeCartPredicateAction.php
similarity index 100%
rename from src/Request/CartDiscounts/Command/CartDiscountChangeCartPredicateAction.php
rename to src/Core/Request/CartDiscounts/Command/CartDiscountChangeCartPredicateAction.php
diff --git a/src/Request/CartDiscounts/Command/CartDiscountChangeIsActiveAction.php b/src/Core/Request/CartDiscounts/Command/CartDiscountChangeIsActiveAction.php
similarity index 100%
rename from src/Request/CartDiscounts/Command/CartDiscountChangeIsActiveAction.php
rename to src/Core/Request/CartDiscounts/Command/CartDiscountChangeIsActiveAction.php
diff --git a/src/Request/CartDiscounts/Command/CartDiscountChangeNameAction.php b/src/Core/Request/CartDiscounts/Command/CartDiscountChangeNameAction.php
similarity index 100%
rename from src/Request/CartDiscounts/Command/CartDiscountChangeNameAction.php
rename to src/Core/Request/CartDiscounts/Command/CartDiscountChangeNameAction.php
diff --git a/src/Request/CartDiscounts/Command/CartDiscountChangeRequiresDiscountCodeAction.php b/src/Core/Request/CartDiscounts/Command/CartDiscountChangeRequiresDiscountCodeAction.php
similarity index 100%
rename from src/Request/CartDiscounts/Command/CartDiscountChangeRequiresDiscountCodeAction.php
rename to src/Core/Request/CartDiscounts/Command/CartDiscountChangeRequiresDiscountCodeAction.php
diff --git a/src/Request/CartDiscounts/Command/CartDiscountChangeSortOrderAction.php b/src/Core/Request/CartDiscounts/Command/CartDiscountChangeSortOrderAction.php
similarity index 100%
rename from src/Request/CartDiscounts/Command/CartDiscountChangeSortOrderAction.php
rename to src/Core/Request/CartDiscounts/Command/CartDiscountChangeSortOrderAction.php
diff --git a/src/Request/CartDiscounts/Command/CartDiscountChangeTargetAction.php b/src/Core/Request/CartDiscounts/Command/CartDiscountChangeTargetAction.php
similarity index 100%
rename from src/Request/CartDiscounts/Command/CartDiscountChangeTargetAction.php
rename to src/Core/Request/CartDiscounts/Command/CartDiscountChangeTargetAction.php
diff --git a/src/Request/CartDiscounts/Command/CartDiscountChangeValueAction.php b/src/Core/Request/CartDiscounts/Command/CartDiscountChangeValueAction.php
similarity index 100%
rename from src/Request/CartDiscounts/Command/CartDiscountChangeValueAction.php
rename to src/Core/Request/CartDiscounts/Command/CartDiscountChangeValueAction.php
diff --git a/src/Request/CartDiscounts/Command/CartDiscountSetDescriptionAction.php b/src/Core/Request/CartDiscounts/Command/CartDiscountSetDescriptionAction.php
similarity index 100%
rename from src/Request/CartDiscounts/Command/CartDiscountSetDescriptionAction.php
rename to src/Core/Request/CartDiscounts/Command/CartDiscountSetDescriptionAction.php
diff --git a/src/Request/CartDiscounts/Command/CartDiscountSetValidFromAction.php b/src/Core/Request/CartDiscounts/Command/CartDiscountSetValidFromAction.php
similarity index 100%
rename from src/Request/CartDiscounts/Command/CartDiscountSetValidFromAction.php
rename to src/Core/Request/CartDiscounts/Command/CartDiscountSetValidFromAction.php
diff --git a/src/Request/CartDiscounts/Command/CartDiscountSetValidUntilAction.php b/src/Core/Request/CartDiscounts/Command/CartDiscountSetValidUntilAction.php
similarity index 100%
rename from src/Request/CartDiscounts/Command/CartDiscountSetValidUntilAction.php
rename to src/Core/Request/CartDiscounts/Command/CartDiscountSetValidUntilAction.php
diff --git a/src/Request/Carts/CartByCustomerIdGetRequest.php b/src/Core/Request/Carts/CartByCustomerIdGetRequest.php
similarity index 100%
rename from src/Request/Carts/CartByCustomerIdGetRequest.php
rename to src/Core/Request/Carts/CartByCustomerIdGetRequest.php
diff --git a/src/Request/Carts/CartByIdGetRequest.php b/src/Core/Request/Carts/CartByIdGetRequest.php
similarity index 100%
rename from src/Request/Carts/CartByIdGetRequest.php
rename to src/Core/Request/Carts/CartByIdGetRequest.php
diff --git a/src/Request/Carts/CartCreateRequest.php b/src/Core/Request/Carts/CartCreateRequest.php
similarity index 100%
rename from src/Request/Carts/CartCreateRequest.php
rename to src/Core/Request/Carts/CartCreateRequest.php
diff --git a/src/Request/Carts/CartDeleteRequest.php b/src/Core/Request/Carts/CartDeleteRequest.php
similarity index 100%
rename from src/Request/Carts/CartDeleteRequest.php
rename to src/Core/Request/Carts/CartDeleteRequest.php
diff --git a/src/Request/Carts/CartQueryRequest.php b/src/Core/Request/Carts/CartQueryRequest.php
similarity index 100%
rename from src/Request/Carts/CartQueryRequest.php
rename to src/Core/Request/Carts/CartQueryRequest.php
diff --git a/src/Request/Carts/CartUpdateRequest.php b/src/Core/Request/Carts/CartUpdateRequest.php
similarity index 100%
rename from src/Request/Carts/CartUpdateRequest.php
rename to src/Core/Request/Carts/CartUpdateRequest.php
diff --git a/src/Request/Carts/CartsEndpoint.php b/src/Core/Request/Carts/CartsEndpoint.php
similarity index 100%
rename from src/Request/Carts/CartsEndpoint.php
rename to src/Core/Request/Carts/CartsEndpoint.php
diff --git a/src/Request/Carts/Command/CartAddCustomLineItemAction.php b/src/Core/Request/Carts/Command/CartAddCustomLineItemAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartAddCustomLineItemAction.php
rename to src/Core/Request/Carts/Command/CartAddCustomLineItemAction.php
diff --git a/src/Request/Carts/Command/CartAddDiscountCodeAction.php b/src/Core/Request/Carts/Command/CartAddDiscountCodeAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartAddDiscountCodeAction.php
rename to src/Core/Request/Carts/Command/CartAddDiscountCodeAction.php
diff --git a/src/Request/Carts/Command/CartAddLineItemAction.php b/src/Core/Request/Carts/Command/CartAddLineItemAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartAddLineItemAction.php
rename to src/Core/Request/Carts/Command/CartAddLineItemAction.php
diff --git a/src/Request/Carts/Command/CartAddPaymentAction.php b/src/Core/Request/Carts/Command/CartAddPaymentAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartAddPaymentAction.php
rename to src/Core/Request/Carts/Command/CartAddPaymentAction.php
diff --git a/src/Request/Carts/Command/CartAddShoppingListAction.php b/src/Core/Request/Carts/Command/CartAddShoppingListAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartAddShoppingListAction.php
rename to src/Core/Request/Carts/Command/CartAddShoppingListAction.php
diff --git a/src/Request/Carts/Command/CartChangeCustomLineItemMoneyAction.php b/src/Core/Request/Carts/Command/CartChangeCustomLineItemMoneyAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartChangeCustomLineItemMoneyAction.php
rename to src/Core/Request/Carts/Command/CartChangeCustomLineItemMoneyAction.php
diff --git a/src/Request/Carts/Command/CartChangeCustomLineItemQuantityAction.php b/src/Core/Request/Carts/Command/CartChangeCustomLineItemQuantityAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartChangeCustomLineItemQuantityAction.php
rename to src/Core/Request/Carts/Command/CartChangeCustomLineItemQuantityAction.php
diff --git a/src/Request/Carts/Command/CartChangeLineItemQuantityAction.php b/src/Core/Request/Carts/Command/CartChangeLineItemQuantityAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartChangeLineItemQuantityAction.php
rename to src/Core/Request/Carts/Command/CartChangeLineItemQuantityAction.php
diff --git a/src/Request/Carts/Command/CartChangeTaxModeAction.php b/src/Core/Request/Carts/Command/CartChangeTaxModeAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartChangeTaxModeAction.php
rename to src/Core/Request/Carts/Command/CartChangeTaxModeAction.php
diff --git a/src/Request/Carts/Command/CartChangeTaxRoundingModeAction.php b/src/Core/Request/Carts/Command/CartChangeTaxRoundingModeAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartChangeTaxRoundingModeAction.php
rename to src/Core/Request/Carts/Command/CartChangeTaxRoundingModeAction.php
diff --git a/src/Request/Carts/Command/CartRecalculateAction.php b/src/Core/Request/Carts/Command/CartRecalculateAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartRecalculateAction.php
rename to src/Core/Request/Carts/Command/CartRecalculateAction.php
diff --git a/src/Request/Carts/Command/CartRemoveCustomLineItemAction.php b/src/Core/Request/Carts/Command/CartRemoveCustomLineItemAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartRemoveCustomLineItemAction.php
rename to src/Core/Request/Carts/Command/CartRemoveCustomLineItemAction.php
diff --git a/src/Request/Carts/Command/CartRemoveDiscountCodeAction.php b/src/Core/Request/Carts/Command/CartRemoveDiscountCodeAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartRemoveDiscountCodeAction.php
rename to src/Core/Request/Carts/Command/CartRemoveDiscountCodeAction.php
diff --git a/src/Request/Carts/Command/CartRemoveLineItemAction.php b/src/Core/Request/Carts/Command/CartRemoveLineItemAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartRemoveLineItemAction.php
rename to src/Core/Request/Carts/Command/CartRemoveLineItemAction.php
diff --git a/src/Request/Carts/Command/CartRemovePaymentAction.php b/src/Core/Request/Carts/Command/CartRemovePaymentAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartRemovePaymentAction.php
rename to src/Core/Request/Carts/Command/CartRemovePaymentAction.php
diff --git a/src/Request/Carts/Command/CartSetBillingAddressAction.php b/src/Core/Request/Carts/Command/CartSetBillingAddressAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetBillingAddressAction.php
rename to src/Core/Request/Carts/Command/CartSetBillingAddressAction.php
diff --git a/src/Request/Carts/Command/CartSetCountryAction.php b/src/Core/Request/Carts/Command/CartSetCountryAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetCountryAction.php
rename to src/Core/Request/Carts/Command/CartSetCountryAction.php
diff --git a/src/Request/Carts/Command/CartSetCustomLineItemCustomFieldAction.php b/src/Core/Request/Carts/Command/CartSetCustomLineItemCustomFieldAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetCustomLineItemCustomFieldAction.php
rename to src/Core/Request/Carts/Command/CartSetCustomLineItemCustomFieldAction.php
diff --git a/src/Request/Carts/Command/CartSetCustomLineItemCustomTypeAction.php b/src/Core/Request/Carts/Command/CartSetCustomLineItemCustomTypeAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetCustomLineItemCustomTypeAction.php
rename to src/Core/Request/Carts/Command/CartSetCustomLineItemCustomTypeAction.php
diff --git a/src/Request/Carts/Command/CartSetCustomLineItemTaxRateAction.php b/src/Core/Request/Carts/Command/CartSetCustomLineItemTaxRateAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetCustomLineItemTaxRateAction.php
rename to src/Core/Request/Carts/Command/CartSetCustomLineItemTaxRateAction.php
diff --git a/src/Request/Carts/Command/CartSetCustomShippingMethodAction.php b/src/Core/Request/Carts/Command/CartSetCustomShippingMethodAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetCustomShippingMethodAction.php
rename to src/Core/Request/Carts/Command/CartSetCustomShippingMethodAction.php
diff --git a/src/Request/Carts/Command/CartSetCustomerEmailAction.php b/src/Core/Request/Carts/Command/CartSetCustomerEmailAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetCustomerEmailAction.php
rename to src/Core/Request/Carts/Command/CartSetCustomerEmailAction.php
diff --git a/src/Request/Carts/Command/CartSetCustomerIdAction.php b/src/Core/Request/Carts/Command/CartSetCustomerIdAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetCustomerIdAction.php
rename to src/Core/Request/Carts/Command/CartSetCustomerIdAction.php
diff --git a/src/Request/Carts/Command/CartSetDeleteDaysAfterLastModificationAction.php b/src/Core/Request/Carts/Command/CartSetDeleteDaysAfterLastModificationAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetDeleteDaysAfterLastModificationAction.php
rename to src/Core/Request/Carts/Command/CartSetDeleteDaysAfterLastModificationAction.php
diff --git a/src/Request/Carts/Command/CartSetLineItemCustomFieldAction.php b/src/Core/Request/Carts/Command/CartSetLineItemCustomFieldAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetLineItemCustomFieldAction.php
rename to src/Core/Request/Carts/Command/CartSetLineItemCustomFieldAction.php
diff --git a/src/Request/Carts/Command/CartSetLineItemCustomTypeAction.php b/src/Core/Request/Carts/Command/CartSetLineItemCustomTypeAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetLineItemCustomTypeAction.php
rename to src/Core/Request/Carts/Command/CartSetLineItemCustomTypeAction.php
diff --git a/src/Request/Carts/Command/CartSetLineItemTaxRateAction.php b/src/Core/Request/Carts/Command/CartSetLineItemTaxRateAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetLineItemTaxRateAction.php
rename to src/Core/Request/Carts/Command/CartSetLineItemTaxRateAction.php
diff --git a/src/Request/Carts/Command/CartSetLineItemTotalPriceAction.php b/src/Core/Request/Carts/Command/CartSetLineItemTotalPriceAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetLineItemTotalPriceAction.php
rename to src/Core/Request/Carts/Command/CartSetLineItemTotalPriceAction.php
diff --git a/src/Request/Carts/Command/CartSetLocaleAction.php b/src/Core/Request/Carts/Command/CartSetLocaleAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetLocaleAction.php
rename to src/Core/Request/Carts/Command/CartSetLocaleAction.php
diff --git a/src/Request/Carts/Command/CartSetShippingAddressAction.php b/src/Core/Request/Carts/Command/CartSetShippingAddressAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetShippingAddressAction.php
rename to src/Core/Request/Carts/Command/CartSetShippingAddressAction.php
diff --git a/src/Request/Carts/Command/CartSetShippingMethodAction.php b/src/Core/Request/Carts/Command/CartSetShippingMethodAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetShippingMethodAction.php
rename to src/Core/Request/Carts/Command/CartSetShippingMethodAction.php
diff --git a/src/Request/Carts/Command/CartSetShippingMethodTaxRateAction.php b/src/Core/Request/Carts/Command/CartSetShippingMethodTaxRateAction.php
similarity index 100%
rename from src/Request/Carts/Command/CartSetShippingMethodTaxRateAction.php
rename to src/Core/Request/Carts/Command/CartSetShippingMethodTaxRateAction.php
diff --git a/src/Request/Categories/CategoriesEndpoint.php b/src/Core/Request/Categories/CategoriesEndpoint.php
similarity index 100%
rename from src/Request/Categories/CategoriesEndpoint.php
rename to src/Core/Request/Categories/CategoriesEndpoint.php
diff --git a/src/Request/Categories/CategoryByIdGetRequest.php b/src/Core/Request/Categories/CategoryByIdGetRequest.php
similarity index 100%
rename from src/Request/Categories/CategoryByIdGetRequest.php
rename to src/Core/Request/Categories/CategoryByIdGetRequest.php
diff --git a/src/Request/Categories/CategoryCreateRequest.php b/src/Core/Request/Categories/CategoryCreateRequest.php
similarity index 100%
rename from src/Request/Categories/CategoryCreateRequest.php
rename to src/Core/Request/Categories/CategoryCreateRequest.php
diff --git a/src/Request/Categories/CategoryDeleteRequest.php b/src/Core/Request/Categories/CategoryDeleteRequest.php
similarity index 100%
rename from src/Request/Categories/CategoryDeleteRequest.php
rename to src/Core/Request/Categories/CategoryDeleteRequest.php
diff --git a/src/Request/Categories/CategoryQueryRequest.php b/src/Core/Request/Categories/CategoryQueryRequest.php
similarity index 100%
rename from src/Request/Categories/CategoryQueryRequest.php
rename to src/Core/Request/Categories/CategoryQueryRequest.php
diff --git a/src/Request/Categories/CategoryUpdateRequest.php b/src/Core/Request/Categories/CategoryUpdateRequest.php
similarity index 100%
rename from src/Request/Categories/CategoryUpdateRequest.php
rename to src/Core/Request/Categories/CategoryUpdateRequest.php
diff --git a/src/Request/Categories/Command/CategoryAddAssetAction.php b/src/Core/Request/Categories/Command/CategoryAddAssetAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategoryAddAssetAction.php
rename to src/Core/Request/Categories/Command/CategoryAddAssetAction.php
diff --git a/src/Request/Categories/Command/CategoryChangeAssetNameAction.php b/src/Core/Request/Categories/Command/CategoryChangeAssetNameAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategoryChangeAssetNameAction.php
rename to src/Core/Request/Categories/Command/CategoryChangeAssetNameAction.php
diff --git a/src/Request/Categories/Command/CategoryChangeAssetOrderAction.php b/src/Core/Request/Categories/Command/CategoryChangeAssetOrderAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategoryChangeAssetOrderAction.php
rename to src/Core/Request/Categories/Command/CategoryChangeAssetOrderAction.php
diff --git a/src/Request/Categories/Command/CategoryChangeNameAction.php b/src/Core/Request/Categories/Command/CategoryChangeNameAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategoryChangeNameAction.php
rename to src/Core/Request/Categories/Command/CategoryChangeNameAction.php
diff --git a/src/Request/Categories/Command/CategoryChangeOrderHintAction.php b/src/Core/Request/Categories/Command/CategoryChangeOrderHintAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategoryChangeOrderHintAction.php
rename to src/Core/Request/Categories/Command/CategoryChangeOrderHintAction.php
diff --git a/src/Request/Categories/Command/CategoryChangeParentAction.php b/src/Core/Request/Categories/Command/CategoryChangeParentAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategoryChangeParentAction.php
rename to src/Core/Request/Categories/Command/CategoryChangeParentAction.php
diff --git a/src/Request/Categories/Command/CategoryChangeSlugAction.php b/src/Core/Request/Categories/Command/CategoryChangeSlugAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategoryChangeSlugAction.php
rename to src/Core/Request/Categories/Command/CategoryChangeSlugAction.php
diff --git a/src/Request/Categories/Command/CategoryRemoveAssetAction.php b/src/Core/Request/Categories/Command/CategoryRemoveAssetAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategoryRemoveAssetAction.php
rename to src/Core/Request/Categories/Command/CategoryRemoveAssetAction.php
diff --git a/src/Request/Categories/Command/CategorySetAssetCustomFieldAction.php b/src/Core/Request/Categories/Command/CategorySetAssetCustomFieldAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategorySetAssetCustomFieldAction.php
rename to src/Core/Request/Categories/Command/CategorySetAssetCustomFieldAction.php
diff --git a/src/Request/Categories/Command/CategorySetAssetCustomTypeAction.php b/src/Core/Request/Categories/Command/CategorySetAssetCustomTypeAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategorySetAssetCustomTypeAction.php
rename to src/Core/Request/Categories/Command/CategorySetAssetCustomTypeAction.php
diff --git a/src/Request/Categories/Command/CategorySetAssetDescriptionAction.php b/src/Core/Request/Categories/Command/CategorySetAssetDescriptionAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategorySetAssetDescriptionAction.php
rename to src/Core/Request/Categories/Command/CategorySetAssetDescriptionAction.php
diff --git a/src/Request/Categories/Command/CategorySetAssetSourcesAction.php b/src/Core/Request/Categories/Command/CategorySetAssetSourcesAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategorySetAssetSourcesAction.php
rename to src/Core/Request/Categories/Command/CategorySetAssetSourcesAction.php
diff --git a/src/Request/Categories/Command/CategorySetAssetTagsAction.php b/src/Core/Request/Categories/Command/CategorySetAssetTagsAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategorySetAssetTagsAction.php
rename to src/Core/Request/Categories/Command/CategorySetAssetTagsAction.php
diff --git a/src/Request/Categories/Command/CategorySetDescriptionAction.php b/src/Core/Request/Categories/Command/CategorySetDescriptionAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategorySetDescriptionAction.php
rename to src/Core/Request/Categories/Command/CategorySetDescriptionAction.php
diff --git a/src/Request/Categories/Command/CategorySetExternalIdAction.php b/src/Core/Request/Categories/Command/CategorySetExternalIdAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategorySetExternalIdAction.php
rename to src/Core/Request/Categories/Command/CategorySetExternalIdAction.php
diff --git a/src/Request/Categories/Command/CategorySetMetaDescriptionAction.php b/src/Core/Request/Categories/Command/CategorySetMetaDescriptionAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategorySetMetaDescriptionAction.php
rename to src/Core/Request/Categories/Command/CategorySetMetaDescriptionAction.php
diff --git a/src/Request/Categories/Command/CategorySetMetaKeywordsAction.php b/src/Core/Request/Categories/Command/CategorySetMetaKeywordsAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategorySetMetaKeywordsAction.php
rename to src/Core/Request/Categories/Command/CategorySetMetaKeywordsAction.php
diff --git a/src/Request/Categories/Command/CategorySetMetaTitleAction.php b/src/Core/Request/Categories/Command/CategorySetMetaTitleAction.php
similarity index 100%
rename from src/Request/Categories/Command/CategorySetMetaTitleAction.php
rename to src/Core/Request/Categories/Command/CategorySetMetaTitleAction.php
diff --git a/src/Request/Channels/ChannelByIdGetRequest.php b/src/Core/Request/Channels/ChannelByIdGetRequest.php
similarity index 100%
rename from src/Request/Channels/ChannelByIdGetRequest.php
rename to src/Core/Request/Channels/ChannelByIdGetRequest.php
diff --git a/src/Request/Channels/ChannelCreateRequest.php b/src/Core/Request/Channels/ChannelCreateRequest.php
similarity index 100%
rename from src/Request/Channels/ChannelCreateRequest.php
rename to src/Core/Request/Channels/ChannelCreateRequest.php
diff --git a/src/Request/Channels/ChannelDeleteRequest.php b/src/Core/Request/Channels/ChannelDeleteRequest.php
similarity index 100%
rename from src/Request/Channels/ChannelDeleteRequest.php
rename to src/Core/Request/Channels/ChannelDeleteRequest.php
diff --git a/src/Request/Channels/ChannelQueryRequest.php b/src/Core/Request/Channels/ChannelQueryRequest.php
similarity index 100%
rename from src/Request/Channels/ChannelQueryRequest.php
rename to src/Core/Request/Channels/ChannelQueryRequest.php
diff --git a/src/Request/Channels/ChannelUpdateRequest.php b/src/Core/Request/Channels/ChannelUpdateRequest.php
similarity index 100%
rename from src/Request/Channels/ChannelUpdateRequest.php
rename to src/Core/Request/Channels/ChannelUpdateRequest.php
diff --git a/src/Request/Channels/ChannelsEndpoint.php b/src/Core/Request/Channels/ChannelsEndpoint.php
similarity index 100%
rename from src/Request/Channels/ChannelsEndpoint.php
rename to src/Core/Request/Channels/ChannelsEndpoint.php
diff --git a/src/Request/Channels/Command/ChannelAddRolesAction.php b/src/Core/Request/Channels/Command/ChannelAddRolesAction.php
similarity index 100%
rename from src/Request/Channels/Command/ChannelAddRolesAction.php
rename to src/Core/Request/Channels/Command/ChannelAddRolesAction.php
diff --git a/src/Request/Channels/Command/ChannelChangeDescriptionAction.php b/src/Core/Request/Channels/Command/ChannelChangeDescriptionAction.php
similarity index 100%
rename from src/Request/Channels/Command/ChannelChangeDescriptionAction.php
rename to src/Core/Request/Channels/Command/ChannelChangeDescriptionAction.php
diff --git a/src/Request/Channels/Command/ChannelChangeKeyAction.php b/src/Core/Request/Channels/Command/ChannelChangeKeyAction.php
similarity index 100%
rename from src/Request/Channels/Command/ChannelChangeKeyAction.php
rename to src/Core/Request/Channels/Command/ChannelChangeKeyAction.php
diff --git a/src/Request/Channels/Command/ChannelChangeNameAction.php b/src/Core/Request/Channels/Command/ChannelChangeNameAction.php
similarity index 100%
rename from src/Request/Channels/Command/ChannelChangeNameAction.php
rename to src/Core/Request/Channels/Command/ChannelChangeNameAction.php
diff --git a/src/Request/Channels/Command/ChannelRemoveRolesAction.php b/src/Core/Request/Channels/Command/ChannelRemoveRolesAction.php
similarity index 100%
rename from src/Request/Channels/Command/ChannelRemoveRolesAction.php
rename to src/Core/Request/Channels/Command/ChannelRemoveRolesAction.php
diff --git a/src/Request/Channels/Command/ChannelSetAddressAction.php b/src/Core/Request/Channels/Command/ChannelSetAddressAction.php
similarity index 100%
rename from src/Request/Channels/Command/ChannelSetAddressAction.php
rename to src/Core/Request/Channels/Command/ChannelSetAddressAction.php
diff --git a/src/Request/Channels/Command/ChannelSetGeoLocation.php b/src/Core/Request/Channels/Command/ChannelSetGeoLocation.php
similarity index 100%
rename from src/Request/Channels/Command/ChannelSetGeoLocation.php
rename to src/Core/Request/Channels/Command/ChannelSetGeoLocation.php
diff --git a/src/Request/Channels/Command/ChannelSetRolesAction.php b/src/Core/Request/Channels/Command/ChannelSetRolesAction.php
similarity index 100%
rename from src/Request/Channels/Command/ChannelSetRolesAction.php
rename to src/Core/Request/Channels/Command/ChannelSetRolesAction.php
diff --git a/src/Request/ClientRequestInterface.php b/src/Core/Request/ClientRequestInterface.php
similarity index 100%
rename from src/Request/ClientRequestInterface.php
rename to src/Core/Request/ClientRequestInterface.php
diff --git a/src/Request/CustomField/Command/SetCustomFieldAction.php b/src/Core/Request/CustomField/Command/SetCustomFieldAction.php
similarity index 100%
rename from src/Request/CustomField/Command/SetCustomFieldAction.php
rename to src/Core/Request/CustomField/Command/SetCustomFieldAction.php
diff --git a/src/Request/CustomField/Command/SetCustomTypeAction.php b/src/Core/Request/CustomField/Command/SetCustomTypeAction.php
similarity index 100%
rename from src/Request/CustomField/Command/SetCustomTypeAction.php
rename to src/Core/Request/CustomField/Command/SetCustomTypeAction.php
diff --git a/src/Request/CustomObjects/AbstractCustomObjectRequest.php b/src/Core/Request/CustomObjects/AbstractCustomObjectRequest.php
similarity index 100%
rename from src/Request/CustomObjects/AbstractCustomObjectRequest.php
rename to src/Core/Request/CustomObjects/AbstractCustomObjectRequest.php
diff --git a/src/Request/CustomObjects/CustomObjectByKeyGetRequest.php b/src/Core/Request/CustomObjects/CustomObjectByKeyGetRequest.php
similarity index 100%
rename from src/Request/CustomObjects/CustomObjectByKeyGetRequest.php
rename to src/Core/Request/CustomObjects/CustomObjectByKeyGetRequest.php
diff --git a/src/Request/CustomObjects/CustomObjectCreateRequest.php b/src/Core/Request/CustomObjects/CustomObjectCreateRequest.php
similarity index 100%
rename from src/Request/CustomObjects/CustomObjectCreateRequest.php
rename to src/Core/Request/CustomObjects/CustomObjectCreateRequest.php
diff --git a/src/Request/CustomObjects/CustomObjectDeleteByKeyRequest.php b/src/Core/Request/CustomObjects/CustomObjectDeleteByKeyRequest.php
similarity index 100%
rename from src/Request/CustomObjects/CustomObjectDeleteByKeyRequest.php
rename to src/Core/Request/CustomObjects/CustomObjectDeleteByKeyRequest.php
diff --git a/src/Request/CustomObjects/CustomObjectDeleteRequest.php b/src/Core/Request/CustomObjects/CustomObjectDeleteRequest.php
similarity index 100%
rename from src/Request/CustomObjects/CustomObjectDeleteRequest.php
rename to src/Core/Request/CustomObjects/CustomObjectDeleteRequest.php
diff --git a/src/Request/CustomObjects/CustomObjectQueryRequest.php b/src/Core/Request/CustomObjects/CustomObjectQueryRequest.php
similarity index 100%
rename from src/Request/CustomObjects/CustomObjectQueryRequest.php
rename to src/Core/Request/CustomObjects/CustomObjectQueryRequest.php
diff --git a/src/Request/CustomObjects/CustomObjectsEndpoint.php b/src/Core/Request/CustomObjects/CustomObjectsEndpoint.php
similarity index 100%
rename from src/Request/CustomObjects/CustomObjectsEndpoint.php
rename to src/Core/Request/CustomObjects/CustomObjectsEndpoint.php
diff --git a/src/Request/CustomerGroups/Command/CustomerGroupChangeNameAction.php b/src/Core/Request/CustomerGroups/Command/CustomerGroupChangeNameAction.php
similarity index 100%
rename from src/Request/CustomerGroups/Command/CustomerGroupChangeNameAction.php
rename to src/Core/Request/CustomerGroups/Command/CustomerGroupChangeNameAction.php
diff --git a/src/Request/CustomerGroups/CustomerGroupByIdGetRequest.php b/src/Core/Request/CustomerGroups/CustomerGroupByIdGetRequest.php
similarity index 100%
rename from src/Request/CustomerGroups/CustomerGroupByIdGetRequest.php
rename to src/Core/Request/CustomerGroups/CustomerGroupByIdGetRequest.php
diff --git a/src/Request/CustomerGroups/CustomerGroupCreateRequest.php b/src/Core/Request/CustomerGroups/CustomerGroupCreateRequest.php
similarity index 100%
rename from src/Request/CustomerGroups/CustomerGroupCreateRequest.php
rename to src/Core/Request/CustomerGroups/CustomerGroupCreateRequest.php
diff --git a/src/Request/CustomerGroups/CustomerGroupDeleteRequest.php b/src/Core/Request/CustomerGroups/CustomerGroupDeleteRequest.php
similarity index 100%
rename from src/Request/CustomerGroups/CustomerGroupDeleteRequest.php
rename to src/Core/Request/CustomerGroups/CustomerGroupDeleteRequest.php
diff --git a/src/Request/CustomerGroups/CustomerGroupQueryRequest.php b/src/Core/Request/CustomerGroups/CustomerGroupQueryRequest.php
similarity index 100%
rename from src/Request/CustomerGroups/CustomerGroupQueryRequest.php
rename to src/Core/Request/CustomerGroups/CustomerGroupQueryRequest.php
diff --git a/src/Request/CustomerGroups/CustomerGroupUpdateRequest.php b/src/Core/Request/CustomerGroups/CustomerGroupUpdateRequest.php
similarity index 100%
rename from src/Request/CustomerGroups/CustomerGroupUpdateRequest.php
rename to src/Core/Request/CustomerGroups/CustomerGroupUpdateRequest.php
diff --git a/src/Request/CustomerGroups/CustomerGroupsEndpoint.php b/src/Core/Request/CustomerGroups/CustomerGroupsEndpoint.php
similarity index 100%
rename from src/Request/CustomerGroups/CustomerGroupsEndpoint.php
rename to src/Core/Request/CustomerGroups/CustomerGroupsEndpoint.php
diff --git a/src/Request/CustomerIdTrait.php b/src/Core/Request/CustomerIdTrait.php
similarity index 100%
rename from src/Request/CustomerIdTrait.php
rename to src/Core/Request/CustomerIdTrait.php
diff --git a/src/Request/Customers/Command/CustomerAddAddressAction.php b/src/Core/Request/Customers/Command/CustomerAddAddressAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerAddAddressAction.php
rename to src/Core/Request/Customers/Command/CustomerAddAddressAction.php
diff --git a/src/Request/Customers/Command/CustomerAddBillingAddressAction.php b/src/Core/Request/Customers/Command/CustomerAddBillingAddressAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerAddBillingAddressAction.php
rename to src/Core/Request/Customers/Command/CustomerAddBillingAddressAction.php
diff --git a/src/Request/Customers/Command/CustomerAddShippingAddressAction.php b/src/Core/Request/Customers/Command/CustomerAddShippingAddressAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerAddShippingAddressAction.php
rename to src/Core/Request/Customers/Command/CustomerAddShippingAddressAction.php
diff --git a/src/Request/Customers/Command/CustomerChangeAddressAction.php b/src/Core/Request/Customers/Command/CustomerChangeAddressAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerChangeAddressAction.php
rename to src/Core/Request/Customers/Command/CustomerChangeAddressAction.php
diff --git a/src/Request/Customers/Command/CustomerChangeEmailAction.php b/src/Core/Request/Customers/Command/CustomerChangeEmailAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerChangeEmailAction.php
rename to src/Core/Request/Customers/Command/CustomerChangeEmailAction.php
diff --git a/src/Request/Customers/Command/CustomerRemoveAddressAction.php b/src/Core/Request/Customers/Command/CustomerRemoveAddressAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerRemoveAddressAction.php
rename to src/Core/Request/Customers/Command/CustomerRemoveAddressAction.php
diff --git a/src/Request/Customers/Command/CustomerRemoveBillingAddressAction.php b/src/Core/Request/Customers/Command/CustomerRemoveBillingAddressAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerRemoveBillingAddressAction.php
rename to src/Core/Request/Customers/Command/CustomerRemoveBillingAddressAction.php
diff --git a/src/Request/Customers/Command/CustomerRemoveShippingAddressAction.php b/src/Core/Request/Customers/Command/CustomerRemoveShippingAddressAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerRemoveShippingAddressAction.php
rename to src/Core/Request/Customers/Command/CustomerRemoveShippingAddressAction.php
diff --git a/src/Request/Customers/Command/CustomerSetCompanyNameAction.php b/src/Core/Request/Customers/Command/CustomerSetCompanyNameAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetCompanyNameAction.php
rename to src/Core/Request/Customers/Command/CustomerSetCompanyNameAction.php
diff --git a/src/Request/Customers/Command/CustomerSetCustomerGroupAction.php b/src/Core/Request/Customers/Command/CustomerSetCustomerGroupAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetCustomerGroupAction.php
rename to src/Core/Request/Customers/Command/CustomerSetCustomerGroupAction.php
diff --git a/src/Request/Customers/Command/CustomerSetCustomerNumberAction.php b/src/Core/Request/Customers/Command/CustomerSetCustomerNumberAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetCustomerNumberAction.php
rename to src/Core/Request/Customers/Command/CustomerSetCustomerNumberAction.php
diff --git a/src/Request/Customers/Command/CustomerSetDateOfBirthAction.php b/src/Core/Request/Customers/Command/CustomerSetDateOfBirthAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetDateOfBirthAction.php
rename to src/Core/Request/Customers/Command/CustomerSetDateOfBirthAction.php
diff --git a/src/Request/Customers/Command/CustomerSetDefaultBillingAddressAction.php b/src/Core/Request/Customers/Command/CustomerSetDefaultBillingAddressAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetDefaultBillingAddressAction.php
rename to src/Core/Request/Customers/Command/CustomerSetDefaultBillingAddressAction.php
diff --git a/src/Request/Customers/Command/CustomerSetDefaultShippingAddressAction.php b/src/Core/Request/Customers/Command/CustomerSetDefaultShippingAddressAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetDefaultShippingAddressAction.php
rename to src/Core/Request/Customers/Command/CustomerSetDefaultShippingAddressAction.php
diff --git a/src/Request/Customers/Command/CustomerSetExternalIdAction.php b/src/Core/Request/Customers/Command/CustomerSetExternalIdAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetExternalIdAction.php
rename to src/Core/Request/Customers/Command/CustomerSetExternalIdAction.php
diff --git a/src/Request/Customers/Command/CustomerSetFirstNameAction.php b/src/Core/Request/Customers/Command/CustomerSetFirstNameAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetFirstNameAction.php
rename to src/Core/Request/Customers/Command/CustomerSetFirstNameAction.php
diff --git a/src/Request/Customers/Command/CustomerSetLastNameAction.php b/src/Core/Request/Customers/Command/CustomerSetLastNameAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetLastNameAction.php
rename to src/Core/Request/Customers/Command/CustomerSetLastNameAction.php
diff --git a/src/Request/Customers/Command/CustomerSetLocaleAction.php b/src/Core/Request/Customers/Command/CustomerSetLocaleAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetLocaleAction.php
rename to src/Core/Request/Customers/Command/CustomerSetLocaleAction.php
diff --git a/src/Request/Customers/Command/CustomerSetMiddleNameAction.php b/src/Core/Request/Customers/Command/CustomerSetMiddleNameAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetMiddleNameAction.php
rename to src/Core/Request/Customers/Command/CustomerSetMiddleNameAction.php
diff --git a/src/Request/Customers/Command/CustomerSetTitleAction.php b/src/Core/Request/Customers/Command/CustomerSetTitleAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetTitleAction.php
rename to src/Core/Request/Customers/Command/CustomerSetTitleAction.php
diff --git a/src/Request/Customers/Command/CustomerSetVatIdAction.php b/src/Core/Request/Customers/Command/CustomerSetVatIdAction.php
similarity index 100%
rename from src/Request/Customers/Command/CustomerSetVatIdAction.php
rename to src/Core/Request/Customers/Command/CustomerSetVatIdAction.php
diff --git a/src/Request/Customers/CustomerByIdGetRequest.php b/src/Core/Request/Customers/CustomerByIdGetRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerByIdGetRequest.php
rename to src/Core/Request/Customers/CustomerByIdGetRequest.php
diff --git a/src/Request/Customers/CustomerByTokenGetRequest.php b/src/Core/Request/Customers/CustomerByTokenGetRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerByTokenGetRequest.php
rename to src/Core/Request/Customers/CustomerByTokenGetRequest.php
diff --git a/src/Request/Customers/CustomerCreateRequest.php b/src/Core/Request/Customers/CustomerCreateRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerCreateRequest.php
rename to src/Core/Request/Customers/CustomerCreateRequest.php
diff --git a/src/Request/Customers/CustomerDeleteRequest.php b/src/Core/Request/Customers/CustomerDeleteRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerDeleteRequest.php
rename to src/Core/Request/Customers/CustomerDeleteRequest.php
diff --git a/src/Request/Customers/CustomerEmailConfirmRequest.php b/src/Core/Request/Customers/CustomerEmailConfirmRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerEmailConfirmRequest.php
rename to src/Core/Request/Customers/CustomerEmailConfirmRequest.php
diff --git a/src/Request/Customers/CustomerEmailTokenRequest.php b/src/Core/Request/Customers/CustomerEmailTokenRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerEmailTokenRequest.php
rename to src/Core/Request/Customers/CustomerEmailTokenRequest.php
diff --git a/src/Request/Customers/CustomerLoginRequest.php b/src/Core/Request/Customers/CustomerLoginRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerLoginRequest.php
rename to src/Core/Request/Customers/CustomerLoginRequest.php
diff --git a/src/Request/Customers/CustomerPasswordChangeRequest.php b/src/Core/Request/Customers/CustomerPasswordChangeRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerPasswordChangeRequest.php
rename to src/Core/Request/Customers/CustomerPasswordChangeRequest.php
diff --git a/src/Request/Customers/CustomerPasswordResetRequest.php b/src/Core/Request/Customers/CustomerPasswordResetRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerPasswordResetRequest.php
rename to src/Core/Request/Customers/CustomerPasswordResetRequest.php
diff --git a/src/Request/Customers/CustomerPasswordTokenRequest.php b/src/Core/Request/Customers/CustomerPasswordTokenRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerPasswordTokenRequest.php
rename to src/Core/Request/Customers/CustomerPasswordTokenRequest.php
diff --git a/src/Request/Customers/CustomerQueryRequest.php b/src/Core/Request/Customers/CustomerQueryRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerQueryRequest.php
rename to src/Core/Request/Customers/CustomerQueryRequest.php
diff --git a/src/Request/Customers/CustomerUpdateRequest.php b/src/Core/Request/Customers/CustomerUpdateRequest.php
similarity index 100%
rename from src/Request/Customers/CustomerUpdateRequest.php
rename to src/Core/Request/Customers/CustomerUpdateRequest.php
diff --git a/src/Request/Customers/CustomersEndpoint.php b/src/Core/Request/Customers/CustomersEndpoint.php
similarity index 100%
rename from src/Request/Customers/CustomersEndpoint.php
rename to src/Core/Request/Customers/CustomersEndpoint.php
diff --git a/src/Request/Customers/LoginEndpoint.php b/src/Core/Request/Customers/LoginEndpoint.php
similarity index 100%
rename from src/Request/Customers/LoginEndpoint.php
rename to src/Core/Request/Customers/LoginEndpoint.php
diff --git a/src/Request/DiscountCodes/Command/DiscountCodeChangeCartDiscountsAction.php b/src/Core/Request/DiscountCodes/Command/DiscountCodeChangeCartDiscountsAction.php
similarity index 100%
rename from src/Request/DiscountCodes/Command/DiscountCodeChangeCartDiscountsAction.php
rename to src/Core/Request/DiscountCodes/Command/DiscountCodeChangeCartDiscountsAction.php
diff --git a/src/Request/DiscountCodes/Command/DiscountCodeChangeIsActiveAction.php b/src/Core/Request/DiscountCodes/Command/DiscountCodeChangeIsActiveAction.php
similarity index 100%
rename from src/Request/DiscountCodes/Command/DiscountCodeChangeIsActiveAction.php
rename to src/Core/Request/DiscountCodes/Command/DiscountCodeChangeIsActiveAction.php
diff --git a/src/Request/DiscountCodes/Command/DiscountCodeSetCartPredicateAction.php b/src/Core/Request/DiscountCodes/Command/DiscountCodeSetCartPredicateAction.php
similarity index 100%
rename from src/Request/DiscountCodes/Command/DiscountCodeSetCartPredicateAction.php
rename to src/Core/Request/DiscountCodes/Command/DiscountCodeSetCartPredicateAction.php
diff --git a/src/Request/DiscountCodes/Command/DiscountCodeSetDescriptionAction.php b/src/Core/Request/DiscountCodes/Command/DiscountCodeSetDescriptionAction.php
similarity index 100%
rename from src/Request/DiscountCodes/Command/DiscountCodeSetDescriptionAction.php
rename to src/Core/Request/DiscountCodes/Command/DiscountCodeSetDescriptionAction.php
diff --git a/src/Request/DiscountCodes/Command/DiscountCodeSetMaxApplicationsAction.php b/src/Core/Request/DiscountCodes/Command/DiscountCodeSetMaxApplicationsAction.php
similarity index 100%
rename from src/Request/DiscountCodes/Command/DiscountCodeSetMaxApplicationsAction.php
rename to src/Core/Request/DiscountCodes/Command/DiscountCodeSetMaxApplicationsAction.php
diff --git a/src/Request/DiscountCodes/Command/DiscountCodeSetMaxApplicationsPerCustomerAction.php b/src/Core/Request/DiscountCodes/Command/DiscountCodeSetMaxApplicationsPerCustomerAction.php
similarity index 100%
rename from src/Request/DiscountCodes/Command/DiscountCodeSetMaxApplicationsPerCustomerAction.php
rename to src/Core/Request/DiscountCodes/Command/DiscountCodeSetMaxApplicationsPerCustomerAction.php
diff --git a/src/Request/DiscountCodes/Command/DiscountCodeSetNameAction.php b/src/Core/Request/DiscountCodes/Command/DiscountCodeSetNameAction.php
similarity index 100%
rename from src/Request/DiscountCodes/Command/DiscountCodeSetNameAction.php
rename to src/Core/Request/DiscountCodes/Command/DiscountCodeSetNameAction.php
diff --git a/src/Request/DiscountCodes/DiscountCodeByIdGetRequest.php b/src/Core/Request/DiscountCodes/DiscountCodeByIdGetRequest.php
similarity index 100%
rename from src/Request/DiscountCodes/DiscountCodeByIdGetRequest.php
rename to src/Core/Request/DiscountCodes/DiscountCodeByIdGetRequest.php
diff --git a/src/Request/DiscountCodes/DiscountCodeCreateRequest.php b/src/Core/Request/DiscountCodes/DiscountCodeCreateRequest.php
similarity index 100%
rename from src/Request/DiscountCodes/DiscountCodeCreateRequest.php
rename to src/Core/Request/DiscountCodes/DiscountCodeCreateRequest.php
diff --git a/src/Request/DiscountCodes/DiscountCodeDeleteRequest.php b/src/Core/Request/DiscountCodes/DiscountCodeDeleteRequest.php
similarity index 100%
rename from src/Request/DiscountCodes/DiscountCodeDeleteRequest.php
rename to src/Core/Request/DiscountCodes/DiscountCodeDeleteRequest.php
diff --git a/src/Request/DiscountCodes/DiscountCodeQueryRequest.php b/src/Core/Request/DiscountCodes/DiscountCodeQueryRequest.php
similarity index 100%
rename from src/Request/DiscountCodes/DiscountCodeQueryRequest.php
rename to src/Core/Request/DiscountCodes/DiscountCodeQueryRequest.php
diff --git a/src/Request/DiscountCodes/DiscountCodeUpdateRequest.php b/src/Core/Request/DiscountCodes/DiscountCodeUpdateRequest.php
similarity index 100%
rename from src/Request/DiscountCodes/DiscountCodeUpdateRequest.php
rename to src/Core/Request/DiscountCodes/DiscountCodeUpdateRequest.php
diff --git a/src/Request/DiscountCodes/DiscountCodesEndpoint.php b/src/Core/Request/DiscountCodes/DiscountCodesEndpoint.php
similarity index 100%
rename from src/Request/DiscountCodes/DiscountCodesEndpoint.php
rename to src/Core/Request/DiscountCodes/DiscountCodesEndpoint.php
diff --git a/src/Request/ExpandTrait.php b/src/Core/Request/ExpandTrait.php
similarity index 100%
rename from src/Request/ExpandTrait.php
rename to src/Core/Request/ExpandTrait.php
diff --git a/src/Request/GraphQL/GraphQLEndpoint.php b/src/Core/Request/GraphQL/GraphQLEndpoint.php
similarity index 100%
rename from src/Request/GraphQL/GraphQLEndpoint.php
rename to src/Core/Request/GraphQL/GraphQLEndpoint.php
diff --git a/src/Request/GraphQL/GraphQLQueryRequest.php b/src/Core/Request/GraphQL/GraphQLQueryRequest.php
similarity index 100%
rename from src/Request/GraphQL/GraphQLQueryRequest.php
rename to src/Core/Request/GraphQL/GraphQLQueryRequest.php
diff --git a/src/Request/Inventory/Command/InventoryAddQuantityAction.php b/src/Core/Request/Inventory/Command/InventoryAddQuantityAction.php
similarity index 100%
rename from src/Request/Inventory/Command/InventoryAddQuantityAction.php
rename to src/Core/Request/Inventory/Command/InventoryAddQuantityAction.php
diff --git a/src/Request/Inventory/Command/InventoryChangeQuantityAction.php b/src/Core/Request/Inventory/Command/InventoryChangeQuantityAction.php
similarity index 100%
rename from src/Request/Inventory/Command/InventoryChangeQuantityAction.php
rename to src/Core/Request/Inventory/Command/InventoryChangeQuantityAction.php
diff --git a/src/Request/Inventory/Command/InventoryRemoveQuantityAction.php b/src/Core/Request/Inventory/Command/InventoryRemoveQuantityAction.php
similarity index 100%
rename from src/Request/Inventory/Command/InventoryRemoveQuantityAction.php
rename to src/Core/Request/Inventory/Command/InventoryRemoveQuantityAction.php
diff --git a/src/Request/Inventory/Command/InventorySetExpectedDeliveryAction.php b/src/Core/Request/Inventory/Command/InventorySetExpectedDeliveryAction.php
similarity index 100%
rename from src/Request/Inventory/Command/InventorySetExpectedDeliveryAction.php
rename to src/Core/Request/Inventory/Command/InventorySetExpectedDeliveryAction.php
diff --git a/src/Request/Inventory/Command/InventorySetRestockableInDaysAction.php b/src/Core/Request/Inventory/Command/InventorySetRestockableInDaysAction.php
similarity index 100%
rename from src/Request/Inventory/Command/InventorySetRestockableInDaysAction.php
rename to src/Core/Request/Inventory/Command/InventorySetRestockableInDaysAction.php
diff --git a/src/Request/Inventory/Command/InventorySetSupplyChannelAction.php b/src/Core/Request/Inventory/Command/InventorySetSupplyChannelAction.php
similarity index 100%
rename from src/Request/Inventory/Command/InventorySetSupplyChannelAction.php
rename to src/Core/Request/Inventory/Command/InventorySetSupplyChannelAction.php
diff --git a/src/Request/Inventory/InventoryByIdGetRequest.php b/src/Core/Request/Inventory/InventoryByIdGetRequest.php
similarity index 100%
rename from src/Request/Inventory/InventoryByIdGetRequest.php
rename to src/Core/Request/Inventory/InventoryByIdGetRequest.php
diff --git a/src/Request/Inventory/InventoryCreateRequest.php b/src/Core/Request/Inventory/InventoryCreateRequest.php
similarity index 100%
rename from src/Request/Inventory/InventoryCreateRequest.php
rename to src/Core/Request/Inventory/InventoryCreateRequest.php
diff --git a/src/Request/Inventory/InventoryDeleteRequest.php b/src/Core/Request/Inventory/InventoryDeleteRequest.php
similarity index 100%
rename from src/Request/Inventory/InventoryDeleteRequest.php
rename to src/Core/Request/Inventory/InventoryDeleteRequest.php
diff --git a/src/Request/Inventory/InventoryEndpoint.php b/src/Core/Request/Inventory/InventoryEndpoint.php
similarity index 100%
rename from src/Request/Inventory/InventoryEndpoint.php
rename to src/Core/Request/Inventory/InventoryEndpoint.php
diff --git a/src/Request/Inventory/InventoryQueryRequest.php b/src/Core/Request/Inventory/InventoryQueryRequest.php
similarity index 100%
rename from src/Request/Inventory/InventoryQueryRequest.php
rename to src/Core/Request/Inventory/InventoryQueryRequest.php
diff --git a/src/Request/Inventory/InventoryUpdateRequest.php b/src/Core/Request/Inventory/InventoryUpdateRequest.php
similarity index 100%
rename from src/Request/Inventory/InventoryUpdateRequest.php
rename to src/Core/Request/Inventory/InventoryUpdateRequest.php
diff --git a/src/Request/Me/MeActiveCartRequest.php b/src/Core/Request/Me/MeActiveCartRequest.php
similarity index 100%
rename from src/Request/Me/MeActiveCartRequest.php
rename to src/Core/Request/Me/MeActiveCartRequest.php
diff --git a/src/Request/Me/MeCartByIdRequest.php b/src/Core/Request/Me/MeCartByIdRequest.php
similarity index 100%
rename from src/Request/Me/MeCartByIdRequest.php
rename to src/Core/Request/Me/MeCartByIdRequest.php
diff --git a/src/Request/Me/MeCartCreateRequest.php b/src/Core/Request/Me/MeCartCreateRequest.php
similarity index 100%
rename from src/Request/Me/MeCartCreateRequest.php
rename to src/Core/Request/Me/MeCartCreateRequest.php
diff --git a/src/Request/Me/MeCartQueryRequest.php b/src/Core/Request/Me/MeCartQueryRequest.php
similarity index 100%
rename from src/Request/Me/MeCartQueryRequest.php
rename to src/Core/Request/Me/MeCartQueryRequest.php
diff --git a/src/Request/Me/MeCartUpdateRequest.php b/src/Core/Request/Me/MeCartUpdateRequest.php
similarity index 100%
rename from src/Request/Me/MeCartUpdateRequest.php
rename to src/Core/Request/Me/MeCartUpdateRequest.php
diff --git a/src/Request/Me/MeCartsEndpoint.php b/src/Core/Request/Me/MeCartsEndpoint.php
similarity index 100%
rename from src/Request/Me/MeCartsEndpoint.php
rename to src/Core/Request/Me/MeCartsEndpoint.php
diff --git a/src/Request/Me/MeDeleteRequest.php b/src/Core/Request/Me/MeDeleteRequest.php
similarity index 100%
rename from src/Request/Me/MeDeleteRequest.php
rename to src/Core/Request/Me/MeDeleteRequest.php
diff --git a/src/Request/Me/MeEmailConfirmRequest.php b/src/Core/Request/Me/MeEmailConfirmRequest.php
similarity index 100%
rename from src/Request/Me/MeEmailConfirmRequest.php
rename to src/Core/Request/Me/MeEmailConfirmRequest.php
diff --git a/src/Request/Me/MeEndpoint.php b/src/Core/Request/Me/MeEndpoint.php
similarity index 100%
rename from src/Request/Me/MeEndpoint.php
rename to src/Core/Request/Me/MeEndpoint.php
diff --git a/src/Request/Me/MeGetRequest.php b/src/Core/Request/Me/MeGetRequest.php
similarity index 100%
rename from src/Request/Me/MeGetRequest.php
rename to src/Core/Request/Me/MeGetRequest.php
diff --git a/src/Request/Me/MeLoginRequest.php b/src/Core/Request/Me/MeLoginRequest.php
similarity index 100%
rename from src/Request/Me/MeLoginRequest.php
rename to src/Core/Request/Me/MeLoginRequest.php
diff --git a/src/Request/Me/MeOrderByIdRequest.php b/src/Core/Request/Me/MeOrderByIdRequest.php
similarity index 100%
rename from src/Request/Me/MeOrderByIdRequest.php
rename to src/Core/Request/Me/MeOrderByIdRequest.php
diff --git a/src/Request/Me/MeOrderCreateFromCartRequest.php b/src/Core/Request/Me/MeOrderCreateFromCartRequest.php
similarity index 100%
rename from src/Request/Me/MeOrderCreateFromCartRequest.php
rename to src/Core/Request/Me/MeOrderCreateFromCartRequest.php
diff --git a/src/Request/Me/MeOrderQueryRequest.php b/src/Core/Request/Me/MeOrderQueryRequest.php
similarity index 100%
rename from src/Request/Me/MeOrderQueryRequest.php
rename to src/Core/Request/Me/MeOrderQueryRequest.php
diff --git a/src/Request/Me/MeOrdersEndpoint.php b/src/Core/Request/Me/MeOrdersEndpoint.php
similarity index 100%
rename from src/Request/Me/MeOrdersEndpoint.php
rename to src/Core/Request/Me/MeOrdersEndpoint.php
diff --git a/src/Request/Me/MePasswordChangeRequest.php b/src/Core/Request/Me/MePasswordChangeRequest.php
similarity index 100%
rename from src/Request/Me/MePasswordChangeRequest.php
rename to src/Core/Request/Me/MePasswordChangeRequest.php
diff --git a/src/Request/Me/MePasswordResetRequest.php b/src/Core/Request/Me/MePasswordResetRequest.php
similarity index 100%
rename from src/Request/Me/MePasswordResetRequest.php
rename to src/Core/Request/Me/MePasswordResetRequest.php
diff --git a/src/Request/Me/MeSignupRequest.php b/src/Core/Request/Me/MeSignupRequest.php
similarity index 100%
rename from src/Request/Me/MeSignupRequest.php
rename to src/Core/Request/Me/MeSignupRequest.php
diff --git a/src/Request/Me/MeUpdateRequest.php b/src/Core/Request/Me/MeUpdateRequest.php
similarity index 100%
rename from src/Request/Me/MeUpdateRequest.php
rename to src/Core/Request/Me/MeUpdateRequest.php
diff --git a/src/Request/Messages/MessageByIdGetRequest.php b/src/Core/Request/Messages/MessageByIdGetRequest.php
similarity index 100%
rename from src/Request/Messages/MessageByIdGetRequest.php
rename to src/Core/Request/Messages/MessageByIdGetRequest.php
diff --git a/src/Request/Messages/MessageQueryRequest.php b/src/Core/Request/Messages/MessageQueryRequest.php
similarity index 100%
rename from src/Request/Messages/MessageQueryRequest.php
rename to src/Core/Request/Messages/MessageQueryRequest.php
diff --git a/src/Request/Messages/MessagesEndpoint.php b/src/Core/Request/Messages/MessagesEndpoint.php
similarity index 100%
rename from src/Request/Messages/MessagesEndpoint.php
rename to src/Core/Request/Messages/MessagesEndpoint.php
diff --git a/src/Request/Orders/Command/OrderAddDeliveryAction.php b/src/Core/Request/Orders/Command/OrderAddDeliveryAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderAddDeliveryAction.php
rename to src/Core/Request/Orders/Command/OrderAddDeliveryAction.php
diff --git a/src/Request/Orders/Command/OrderAddParcelToDeliveryAction.php b/src/Core/Request/Orders/Command/OrderAddParcelToDeliveryAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderAddParcelToDeliveryAction.php
rename to src/Core/Request/Orders/Command/OrderAddParcelToDeliveryAction.php
diff --git a/src/Request/Orders/Command/OrderAddPaymentAction.php b/src/Core/Request/Orders/Command/OrderAddPaymentAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderAddPaymentAction.php
rename to src/Core/Request/Orders/Command/OrderAddPaymentAction.php
diff --git a/src/Request/Orders/Command/OrderAddReturnInfoAction.php b/src/Core/Request/Orders/Command/OrderAddReturnInfoAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderAddReturnInfoAction.php
rename to src/Core/Request/Orders/Command/OrderAddReturnInfoAction.php
diff --git a/src/Request/Orders/Command/OrderChangeOrderStateAction.php b/src/Core/Request/Orders/Command/OrderChangeOrderStateAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderChangeOrderStateAction.php
rename to src/Core/Request/Orders/Command/OrderChangeOrderStateAction.php
diff --git a/src/Request/Orders/Command/OrderChangePaymentStateAction.php b/src/Core/Request/Orders/Command/OrderChangePaymentStateAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderChangePaymentStateAction.php
rename to src/Core/Request/Orders/Command/OrderChangePaymentStateAction.php
diff --git a/src/Request/Orders/Command/OrderChangeShipmentStateAction.php b/src/Core/Request/Orders/Command/OrderChangeShipmentStateAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderChangeShipmentStateAction.php
rename to src/Core/Request/Orders/Command/OrderChangeShipmentStateAction.php
diff --git a/src/Request/Orders/Command/OrderImportCustomLineItemStateAction.php b/src/Core/Request/Orders/Command/OrderImportCustomLineItemStateAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderImportCustomLineItemStateAction.php
rename to src/Core/Request/Orders/Command/OrderImportCustomLineItemStateAction.php
diff --git a/src/Request/Orders/Command/OrderImportLineItemStateAction.php b/src/Core/Request/Orders/Command/OrderImportLineItemStateAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderImportLineItemStateAction.php
rename to src/Core/Request/Orders/Command/OrderImportLineItemStateAction.php
diff --git a/src/Request/Orders/Command/OrderRemovePaymentAction.php b/src/Core/Request/Orders/Command/OrderRemovePaymentAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderRemovePaymentAction.php
rename to src/Core/Request/Orders/Command/OrderRemovePaymentAction.php
diff --git a/src/Request/Orders/Command/OrderSetBillingAddress.php b/src/Core/Request/Orders/Command/OrderSetBillingAddress.php
similarity index 100%
rename from src/Request/Orders/Command/OrderSetBillingAddress.php
rename to src/Core/Request/Orders/Command/OrderSetBillingAddress.php
diff --git a/src/Request/Orders/Command/OrderSetCustomerEmail.php b/src/Core/Request/Orders/Command/OrderSetCustomerEmail.php
similarity index 100%
rename from src/Request/Orders/Command/OrderSetCustomerEmail.php
rename to src/Core/Request/Orders/Command/OrderSetCustomerEmail.php
diff --git a/src/Request/Orders/Command/OrderSetLocaleAction.php b/src/Core/Request/Orders/Command/OrderSetLocaleAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderSetLocaleAction.php
rename to src/Core/Request/Orders/Command/OrderSetLocaleAction.php
diff --git a/src/Request/Orders/Command/OrderSetOrderNumberAction.php b/src/Core/Request/Orders/Command/OrderSetOrderNumberAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderSetOrderNumberAction.php
rename to src/Core/Request/Orders/Command/OrderSetOrderNumberAction.php
diff --git a/src/Request/Orders/Command/OrderSetReturnPaymentStateAction.php b/src/Core/Request/Orders/Command/OrderSetReturnPaymentStateAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderSetReturnPaymentStateAction.php
rename to src/Core/Request/Orders/Command/OrderSetReturnPaymentStateAction.php
diff --git a/src/Request/Orders/Command/OrderSetReturnShipmentStateAction.php b/src/Core/Request/Orders/Command/OrderSetReturnShipmentStateAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderSetReturnShipmentStateAction.php
rename to src/Core/Request/Orders/Command/OrderSetReturnShipmentStateAction.php
diff --git a/src/Request/Orders/Command/OrderSetShippingAddress.php b/src/Core/Request/Orders/Command/OrderSetShippingAddress.php
similarity index 100%
rename from src/Request/Orders/Command/OrderSetShippingAddress.php
rename to src/Core/Request/Orders/Command/OrderSetShippingAddress.php
diff --git a/src/Request/Orders/Command/OrderTransitionCustomLineItemStateAction.php b/src/Core/Request/Orders/Command/OrderTransitionCustomLineItemStateAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderTransitionCustomLineItemStateAction.php
rename to src/Core/Request/Orders/Command/OrderTransitionCustomLineItemStateAction.php
diff --git a/src/Request/Orders/Command/OrderTransitionLineItemStateAction.php b/src/Core/Request/Orders/Command/OrderTransitionLineItemStateAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderTransitionLineItemStateAction.php
rename to src/Core/Request/Orders/Command/OrderTransitionLineItemStateAction.php
diff --git a/src/Request/Orders/Command/OrderTransitionStateAction.php b/src/Core/Request/Orders/Command/OrderTransitionStateAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderTransitionStateAction.php
rename to src/Core/Request/Orders/Command/OrderTransitionStateAction.php
diff --git a/src/Request/Orders/Command/OrderUpdateSyncInfoAction.php b/src/Core/Request/Orders/Command/OrderUpdateSyncInfoAction.php
similarity index 100%
rename from src/Request/Orders/Command/OrderUpdateSyncInfoAction.php
rename to src/Core/Request/Orders/Command/OrderUpdateSyncInfoAction.php
diff --git a/src/Request/Orders/OrderByIdGetRequest.php b/src/Core/Request/Orders/OrderByIdGetRequest.php
similarity index 100%
rename from src/Request/Orders/OrderByIdGetRequest.php
rename to src/Core/Request/Orders/OrderByIdGetRequest.php
diff --git a/src/Request/Orders/OrderCreateFromCartRequest.php b/src/Core/Request/Orders/OrderCreateFromCartRequest.php
similarity index 100%
rename from src/Request/Orders/OrderCreateFromCartRequest.php
rename to src/Core/Request/Orders/OrderCreateFromCartRequest.php
diff --git a/src/Request/Orders/OrderDeleteRequest.php b/src/Core/Request/Orders/OrderDeleteRequest.php
similarity index 100%
rename from src/Request/Orders/OrderDeleteRequest.php
rename to src/Core/Request/Orders/OrderDeleteRequest.php
diff --git a/src/Request/Orders/OrderImportRequest.php b/src/Core/Request/Orders/OrderImportRequest.php
similarity index 100%
rename from src/Request/Orders/OrderImportRequest.php
rename to src/Core/Request/Orders/OrderImportRequest.php
diff --git a/src/Request/Orders/OrderQueryRequest.php b/src/Core/Request/Orders/OrderQueryRequest.php
similarity index 100%
rename from src/Request/Orders/OrderQueryRequest.php
rename to src/Core/Request/Orders/OrderQueryRequest.php
diff --git a/src/Request/Orders/OrderUpdateRequest.php b/src/Core/Request/Orders/OrderUpdateRequest.php
similarity index 100%
rename from src/Request/Orders/OrderUpdateRequest.php
rename to src/Core/Request/Orders/OrderUpdateRequest.php
diff --git a/src/Request/Orders/OrdersEndpoint.php b/src/Core/Request/Orders/OrdersEndpoint.php
similarity index 100%
rename from src/Request/Orders/OrdersEndpoint.php
rename to src/Core/Request/Orders/OrdersEndpoint.php
diff --git a/src/Request/PageRequestInterface.php b/src/Core/Request/PageRequestInterface.php
similarity index 100%
rename from src/Request/PageRequestInterface.php
rename to src/Core/Request/PageRequestInterface.php
diff --git a/src/Request/PageTrait.php b/src/Core/Request/PageTrait.php
similarity index 100%
rename from src/Request/PageTrait.php
rename to src/Core/Request/PageTrait.php
diff --git a/src/Request/Payments/Command/PaymentAddInterfaceInteractionAction.php b/src/Core/Request/Payments/Command/PaymentAddInterfaceInteractionAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentAddInterfaceInteractionAction.php
rename to src/Core/Request/Payments/Command/PaymentAddInterfaceInteractionAction.php
diff --git a/src/Request/Payments/Command/PaymentAddTransactionAction.php b/src/Core/Request/Payments/Command/PaymentAddTransactionAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentAddTransactionAction.php
rename to src/Core/Request/Payments/Command/PaymentAddTransactionAction.php
diff --git a/src/Request/Payments/Command/PaymentChangeAmountPlannedAction.php b/src/Core/Request/Payments/Command/PaymentChangeAmountPlannedAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentChangeAmountPlannedAction.php
rename to src/Core/Request/Payments/Command/PaymentChangeAmountPlannedAction.php
diff --git a/src/Request/Payments/Command/PaymentChangeTransactionInteractionIdAction.php b/src/Core/Request/Payments/Command/PaymentChangeTransactionInteractionIdAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentChangeTransactionInteractionIdAction.php
rename to src/Core/Request/Payments/Command/PaymentChangeTransactionInteractionIdAction.php
diff --git a/src/Request/Payments/Command/PaymentChangeTransactionStateAction.php b/src/Core/Request/Payments/Command/PaymentChangeTransactionStateAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentChangeTransactionStateAction.php
rename to src/Core/Request/Payments/Command/PaymentChangeTransactionStateAction.php
diff --git a/src/Request/Payments/Command/PaymentChangeTransactionTimestampAction.php b/src/Core/Request/Payments/Command/PaymentChangeTransactionTimestampAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentChangeTransactionTimestampAction.php
rename to src/Core/Request/Payments/Command/PaymentChangeTransactionTimestampAction.php
diff --git a/src/Request/Payments/Command/PaymentSetAmountPaidAction.php b/src/Core/Request/Payments/Command/PaymentSetAmountPaidAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetAmountPaidAction.php
rename to src/Core/Request/Payments/Command/PaymentSetAmountPaidAction.php
diff --git a/src/Request/Payments/Command/PaymentSetAmountRefundedAction.php b/src/Core/Request/Payments/Command/PaymentSetAmountRefundedAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetAmountRefundedAction.php
rename to src/Core/Request/Payments/Command/PaymentSetAmountRefundedAction.php
diff --git a/src/Request/Payments/Command/PaymentSetAuthorizationAction.php b/src/Core/Request/Payments/Command/PaymentSetAuthorizationAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetAuthorizationAction.php
rename to src/Core/Request/Payments/Command/PaymentSetAuthorizationAction.php
diff --git a/src/Request/Payments/Command/PaymentSetCustomFieldAction.php b/src/Core/Request/Payments/Command/PaymentSetCustomFieldAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetCustomFieldAction.php
rename to src/Core/Request/Payments/Command/PaymentSetCustomFieldAction.php
diff --git a/src/Request/Payments/Command/PaymentSetCustomTypeAction.php b/src/Core/Request/Payments/Command/PaymentSetCustomTypeAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetCustomTypeAction.php
rename to src/Core/Request/Payments/Command/PaymentSetCustomTypeAction.php
diff --git a/src/Request/Payments/Command/PaymentSetCustomerAction.php b/src/Core/Request/Payments/Command/PaymentSetCustomerAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetCustomerAction.php
rename to src/Core/Request/Payments/Command/PaymentSetCustomerAction.php
diff --git a/src/Request/Payments/Command/PaymentSetExternalIdAction.php b/src/Core/Request/Payments/Command/PaymentSetExternalIdAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetExternalIdAction.php
rename to src/Core/Request/Payments/Command/PaymentSetExternalIdAction.php
diff --git a/src/Request/Payments/Command/PaymentSetInterfaceIdAction.php b/src/Core/Request/Payments/Command/PaymentSetInterfaceIdAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetInterfaceIdAction.php
rename to src/Core/Request/Payments/Command/PaymentSetInterfaceIdAction.php
diff --git a/src/Request/Payments/Command/PaymentSetMethodInfoInterfaceAction.php b/src/Core/Request/Payments/Command/PaymentSetMethodInfoInterfaceAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetMethodInfoInterfaceAction.php
rename to src/Core/Request/Payments/Command/PaymentSetMethodInfoInterfaceAction.php
diff --git a/src/Request/Payments/Command/PaymentSetMethodInfoMethodAction.php b/src/Core/Request/Payments/Command/PaymentSetMethodInfoMethodAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetMethodInfoMethodAction.php
rename to src/Core/Request/Payments/Command/PaymentSetMethodInfoMethodAction.php
diff --git a/src/Request/Payments/Command/PaymentSetMethodInfoNameAction.php b/src/Core/Request/Payments/Command/PaymentSetMethodInfoNameAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetMethodInfoNameAction.php
rename to src/Core/Request/Payments/Command/PaymentSetMethodInfoNameAction.php
diff --git a/src/Request/Payments/Command/PaymentSetStatusInterfaceCodeAction.php b/src/Core/Request/Payments/Command/PaymentSetStatusInterfaceCodeAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetStatusInterfaceCodeAction.php
rename to src/Core/Request/Payments/Command/PaymentSetStatusInterfaceCodeAction.php
diff --git a/src/Request/Payments/Command/PaymentSetStatusInterfaceTextAction.php b/src/Core/Request/Payments/Command/PaymentSetStatusInterfaceTextAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentSetStatusInterfaceTextAction.php
rename to src/Core/Request/Payments/Command/PaymentSetStatusInterfaceTextAction.php
diff --git a/src/Request/Payments/Command/PaymentTransitionStateAction.php b/src/Core/Request/Payments/Command/PaymentTransitionStateAction.php
similarity index 100%
rename from src/Request/Payments/Command/PaymentTransitionStateAction.php
rename to src/Core/Request/Payments/Command/PaymentTransitionStateAction.php
diff --git a/src/Request/Payments/PaymentByIdGetRequest.php b/src/Core/Request/Payments/PaymentByIdGetRequest.php
similarity index 100%
rename from src/Request/Payments/PaymentByIdGetRequest.php
rename to src/Core/Request/Payments/PaymentByIdGetRequest.php
diff --git a/src/Request/Payments/PaymentCreateRequest.php b/src/Core/Request/Payments/PaymentCreateRequest.php
similarity index 100%
rename from src/Request/Payments/PaymentCreateRequest.php
rename to src/Core/Request/Payments/PaymentCreateRequest.php
diff --git a/src/Request/Payments/PaymentDeleteRequest.php b/src/Core/Request/Payments/PaymentDeleteRequest.php
similarity index 100%
rename from src/Request/Payments/PaymentDeleteRequest.php
rename to src/Core/Request/Payments/PaymentDeleteRequest.php
diff --git a/src/Request/Payments/PaymentQueryRequest.php b/src/Core/Request/Payments/PaymentQueryRequest.php
similarity index 100%
rename from src/Request/Payments/PaymentQueryRequest.php
rename to src/Core/Request/Payments/PaymentQueryRequest.php
diff --git a/src/Request/Payments/PaymentUpdateRequest.php b/src/Core/Request/Payments/PaymentUpdateRequest.php
similarity index 100%
rename from src/Request/Payments/PaymentUpdateRequest.php
rename to src/Core/Request/Payments/PaymentUpdateRequest.php
diff --git a/src/Request/Payments/PaymentsEndpoint.php b/src/Core/Request/Payments/PaymentsEndpoint.php
similarity index 100%
rename from src/Request/Payments/PaymentsEndpoint.php
rename to src/Core/Request/Payments/PaymentsEndpoint.php
diff --git a/src/Request/PriceSelectTrait.php b/src/Core/Request/PriceSelectTrait.php
similarity index 100%
rename from src/Request/PriceSelectTrait.php
rename to src/Core/Request/PriceSelectTrait.php
diff --git a/src/Request/ProductDiscounts/Command/ProductDiscountChangeIsActiveAction.php b/src/Core/Request/ProductDiscounts/Command/ProductDiscountChangeIsActiveAction.php
similarity index 100%
rename from src/Request/ProductDiscounts/Command/ProductDiscountChangeIsActiveAction.php
rename to src/Core/Request/ProductDiscounts/Command/ProductDiscountChangeIsActiveAction.php
diff --git a/src/Request/ProductDiscounts/Command/ProductDiscountChangeNameAction.php b/src/Core/Request/ProductDiscounts/Command/ProductDiscountChangeNameAction.php
similarity index 100%
rename from src/Request/ProductDiscounts/Command/ProductDiscountChangeNameAction.php
rename to src/Core/Request/ProductDiscounts/Command/ProductDiscountChangeNameAction.php
diff --git a/src/Request/ProductDiscounts/Command/ProductDiscountChangePredicateAction.php b/src/Core/Request/ProductDiscounts/Command/ProductDiscountChangePredicateAction.php
similarity index 100%
rename from src/Request/ProductDiscounts/Command/ProductDiscountChangePredicateAction.php
rename to src/Core/Request/ProductDiscounts/Command/ProductDiscountChangePredicateAction.php
diff --git a/src/Request/ProductDiscounts/Command/ProductDiscountChangeSortOrderAction.php b/src/Core/Request/ProductDiscounts/Command/ProductDiscountChangeSortOrderAction.php
similarity index 100%
rename from src/Request/ProductDiscounts/Command/ProductDiscountChangeSortOrderAction.php
rename to src/Core/Request/ProductDiscounts/Command/ProductDiscountChangeSortOrderAction.php
diff --git a/src/Request/ProductDiscounts/Command/ProductDiscountChangeValueAction.php b/src/Core/Request/ProductDiscounts/Command/ProductDiscountChangeValueAction.php
similarity index 100%
rename from src/Request/ProductDiscounts/Command/ProductDiscountChangeValueAction.php
rename to src/Core/Request/ProductDiscounts/Command/ProductDiscountChangeValueAction.php
diff --git a/src/Request/ProductDiscounts/Command/ProductDiscountSetDescriptionAction.php b/src/Core/Request/ProductDiscounts/Command/ProductDiscountSetDescriptionAction.php
similarity index 100%
rename from src/Request/ProductDiscounts/Command/ProductDiscountSetDescriptionAction.php
rename to src/Core/Request/ProductDiscounts/Command/ProductDiscountSetDescriptionAction.php
diff --git a/src/Request/ProductDiscounts/ProductDiscountByIdGetRequest.php b/src/Core/Request/ProductDiscounts/ProductDiscountByIdGetRequest.php
similarity index 100%
rename from src/Request/ProductDiscounts/ProductDiscountByIdGetRequest.php
rename to src/Core/Request/ProductDiscounts/ProductDiscountByIdGetRequest.php
diff --git a/src/Request/ProductDiscounts/ProductDiscountCreateRequest.php b/src/Core/Request/ProductDiscounts/ProductDiscountCreateRequest.php
similarity index 100%
rename from src/Request/ProductDiscounts/ProductDiscountCreateRequest.php
rename to src/Core/Request/ProductDiscounts/ProductDiscountCreateRequest.php
diff --git a/src/Request/ProductDiscounts/ProductDiscountDeleteRequest.php b/src/Core/Request/ProductDiscounts/ProductDiscountDeleteRequest.php
similarity index 100%
rename from src/Request/ProductDiscounts/ProductDiscountDeleteRequest.php
rename to src/Core/Request/ProductDiscounts/ProductDiscountDeleteRequest.php
diff --git a/src/Request/ProductDiscounts/ProductDiscountQueryRequest.php b/src/Core/Request/ProductDiscounts/ProductDiscountQueryRequest.php
similarity index 100%
rename from src/Request/ProductDiscounts/ProductDiscountQueryRequest.php
rename to src/Core/Request/ProductDiscounts/ProductDiscountQueryRequest.php
diff --git a/src/Request/ProductDiscounts/ProductDiscountUpdateRequest.php b/src/Core/Request/ProductDiscounts/ProductDiscountUpdateRequest.php
similarity index 100%
rename from src/Request/ProductDiscounts/ProductDiscountUpdateRequest.php
rename to src/Core/Request/ProductDiscounts/ProductDiscountUpdateRequest.php
diff --git a/src/Request/ProductDiscounts/ProductDiscountsEndpoint.php b/src/Core/Request/ProductDiscounts/ProductDiscountsEndpoint.php
similarity index 100%
rename from src/Request/ProductDiscounts/ProductDiscountsEndpoint.php
rename to src/Core/Request/ProductDiscounts/ProductDiscountsEndpoint.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeAddAttributeDefinitionAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeAddAttributeDefinitionAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeAddAttributeDefinitionAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeAddAttributeDefinitionAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeAddLocalizedEnumValueAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeAddLocalizedEnumValueAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeAddLocalizedEnumValueAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeAddLocalizedEnumValueAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeAddPlainEnumValueAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeAddPlainEnumValueAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeAddPlainEnumValueAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeAddPlainEnumValueAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeChangeAttributeOrderAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeChangeAttributeOrderAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeChangeAttributeOrderAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeChangeAttributeOrderAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeChangeDescriptionAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeChangeDescriptionAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeChangeDescriptionAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeChangeDescriptionAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeChangeIsSearchableAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeChangeIsSearchableAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeChangeIsSearchableAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeChangeIsSearchableAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeChangeLabelAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeChangeLabelAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeChangeLabelAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeChangeLabelAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeChangeLocalizedEnumLabelAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeChangeLocalizedEnumLabelAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeChangeLocalizedEnumLabelAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeChangeLocalizedEnumLabelAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeChangeLocalizedEnumValueOrderAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeChangeLocalizedEnumValueOrderAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeChangeLocalizedEnumValueOrderAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeChangeLocalizedEnumValueOrderAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeChangeNameAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeChangeNameAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeChangeNameAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeChangeNameAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeChangePlainEnumLabelAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeChangePlainEnumLabelAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeChangePlainEnumLabelAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeChangePlainEnumLabelAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeChangePlainEnumValueOrderAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeChangePlainEnumValueOrderAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeChangePlainEnumValueOrderAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeChangePlainEnumValueOrderAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeRemoveAttributeDefinitionAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeRemoveAttributeDefinitionAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeRemoveAttributeDefinitionAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeRemoveAttributeDefinitionAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeSetInputTipAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeSetInputTipAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeSetInputTipAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeSetInputTipAction.php
diff --git a/src/Request/ProductTypes/Command/ProductTypeSetKeyAction.php b/src/Core/Request/ProductTypes/Command/ProductTypeSetKeyAction.php
similarity index 100%
rename from src/Request/ProductTypes/Command/ProductTypeSetKeyAction.php
rename to src/Core/Request/ProductTypes/Command/ProductTypeSetKeyAction.php
diff --git a/src/Request/ProductTypes/ProductTypeByIdGetRequest.php b/src/Core/Request/ProductTypes/ProductTypeByIdGetRequest.php
similarity index 100%
rename from src/Request/ProductTypes/ProductTypeByIdGetRequest.php
rename to src/Core/Request/ProductTypes/ProductTypeByIdGetRequest.php
diff --git a/src/Request/ProductTypes/ProductTypeByKeyGetRequest.php b/src/Core/Request/ProductTypes/ProductTypeByKeyGetRequest.php
similarity index 100%
rename from src/Request/ProductTypes/ProductTypeByKeyGetRequest.php
rename to src/Core/Request/ProductTypes/ProductTypeByKeyGetRequest.php
diff --git a/src/Request/ProductTypes/ProductTypeCreateRequest.php b/src/Core/Request/ProductTypes/ProductTypeCreateRequest.php
similarity index 100%
rename from src/Request/ProductTypes/ProductTypeCreateRequest.php
rename to src/Core/Request/ProductTypes/ProductTypeCreateRequest.php
diff --git a/src/Request/ProductTypes/ProductTypeDeleteByKeyRequest.php b/src/Core/Request/ProductTypes/ProductTypeDeleteByKeyRequest.php
similarity index 100%
rename from src/Request/ProductTypes/ProductTypeDeleteByKeyRequest.php
rename to src/Core/Request/ProductTypes/ProductTypeDeleteByKeyRequest.php
diff --git a/src/Request/ProductTypes/ProductTypeDeleteRequest.php b/src/Core/Request/ProductTypes/ProductTypeDeleteRequest.php
similarity index 100%
rename from src/Request/ProductTypes/ProductTypeDeleteRequest.php
rename to src/Core/Request/ProductTypes/ProductTypeDeleteRequest.php
diff --git a/src/Request/ProductTypes/ProductTypeQueryRequest.php b/src/Core/Request/ProductTypes/ProductTypeQueryRequest.php
similarity index 100%
rename from src/Request/ProductTypes/ProductTypeQueryRequest.php
rename to src/Core/Request/ProductTypes/ProductTypeQueryRequest.php
diff --git a/src/Request/ProductTypes/ProductTypeUpdateByKeyRequest.php b/src/Core/Request/ProductTypes/ProductTypeUpdateByKeyRequest.php
similarity index 100%
rename from src/Request/ProductTypes/ProductTypeUpdateByKeyRequest.php
rename to src/Core/Request/ProductTypes/ProductTypeUpdateByKeyRequest.php
diff --git a/src/Request/ProductTypes/ProductTypeUpdateRequest.php b/src/Core/Request/ProductTypes/ProductTypeUpdateRequest.php
similarity index 100%
rename from src/Request/ProductTypes/ProductTypeUpdateRequest.php
rename to src/Core/Request/ProductTypes/ProductTypeUpdateRequest.php
diff --git a/src/Request/ProductTypes/ProductTypesEndpoint.php b/src/Core/Request/ProductTypes/ProductTypesEndpoint.php
similarity index 100%
rename from src/Request/ProductTypes/ProductTypesEndpoint.php
rename to src/Core/Request/ProductTypes/ProductTypesEndpoint.php
diff --git a/src/Request/Products/Command/ProductAddAssetAction.php b/src/Core/Request/Products/Command/ProductAddAssetAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductAddAssetAction.php
rename to src/Core/Request/Products/Command/ProductAddAssetAction.php
diff --git a/src/Request/Products/Command/ProductAddExternalImageAction.php b/src/Core/Request/Products/Command/ProductAddExternalImageAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductAddExternalImageAction.php
rename to src/Core/Request/Products/Command/ProductAddExternalImageAction.php
diff --git a/src/Request/Products/Command/ProductAddPriceAction.php b/src/Core/Request/Products/Command/ProductAddPriceAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductAddPriceAction.php
rename to src/Core/Request/Products/Command/ProductAddPriceAction.php
diff --git a/src/Request/Products/Command/ProductAddToCategoryAction.php b/src/Core/Request/Products/Command/ProductAddToCategoryAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductAddToCategoryAction.php
rename to src/Core/Request/Products/Command/ProductAddToCategoryAction.php
diff --git a/src/Request/Products/Command/ProductAddVariantAction.php b/src/Core/Request/Products/Command/ProductAddVariantAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductAddVariantAction.php
rename to src/Core/Request/Products/Command/ProductAddVariantAction.php
diff --git a/src/Request/Products/Command/ProductChangeAssetNameAction.php b/src/Core/Request/Products/Command/ProductChangeAssetNameAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductChangeAssetNameAction.php
rename to src/Core/Request/Products/Command/ProductChangeAssetNameAction.php
diff --git a/src/Request/Products/Command/ProductChangeAssetOrderAction.php b/src/Core/Request/Products/Command/ProductChangeAssetOrderAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductChangeAssetOrderAction.php
rename to src/Core/Request/Products/Command/ProductChangeAssetOrderAction.php
diff --git a/src/Request/Products/Command/ProductChangeMasterVariantAction.php b/src/Core/Request/Products/Command/ProductChangeMasterVariantAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductChangeMasterVariantAction.php
rename to src/Core/Request/Products/Command/ProductChangeMasterVariantAction.php
diff --git a/src/Request/Products/Command/ProductChangeNameAction.php b/src/Core/Request/Products/Command/ProductChangeNameAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductChangeNameAction.php
rename to src/Core/Request/Products/Command/ProductChangeNameAction.php
diff --git a/src/Request/Products/Command/ProductChangePriceAction.php b/src/Core/Request/Products/Command/ProductChangePriceAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductChangePriceAction.php
rename to src/Core/Request/Products/Command/ProductChangePriceAction.php
diff --git a/src/Request/Products/Command/ProductChangeSlugAction.php b/src/Core/Request/Products/Command/ProductChangeSlugAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductChangeSlugAction.php
rename to src/Core/Request/Products/Command/ProductChangeSlugAction.php
diff --git a/src/Request/Products/Command/ProductMoveImageToPositionAction.php b/src/Core/Request/Products/Command/ProductMoveImageToPositionAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductMoveImageToPositionAction.php
rename to src/Core/Request/Products/Command/ProductMoveImageToPositionAction.php
diff --git a/src/Request/Products/Command/ProductPublishAction.php b/src/Core/Request/Products/Command/ProductPublishAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductPublishAction.php
rename to src/Core/Request/Products/Command/ProductPublishAction.php
diff --git a/src/Request/Products/Command/ProductRemoveAssetAction.php b/src/Core/Request/Products/Command/ProductRemoveAssetAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductRemoveAssetAction.php
rename to src/Core/Request/Products/Command/ProductRemoveAssetAction.php
diff --git a/src/Request/Products/Command/ProductRemoveFromCategoryAction.php b/src/Core/Request/Products/Command/ProductRemoveFromCategoryAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductRemoveFromCategoryAction.php
rename to src/Core/Request/Products/Command/ProductRemoveFromCategoryAction.php
diff --git a/src/Request/Products/Command/ProductRemoveImageAction.php b/src/Core/Request/Products/Command/ProductRemoveImageAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductRemoveImageAction.php
rename to src/Core/Request/Products/Command/ProductRemoveImageAction.php
diff --git a/src/Request/Products/Command/ProductRemovePriceAction.php b/src/Core/Request/Products/Command/ProductRemovePriceAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductRemovePriceAction.php
rename to src/Core/Request/Products/Command/ProductRemovePriceAction.php
diff --git a/src/Request/Products/Command/ProductRemoveVariantAction.php b/src/Core/Request/Products/Command/ProductRemoveVariantAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductRemoveVariantAction.php
rename to src/Core/Request/Products/Command/ProductRemoveVariantAction.php
diff --git a/src/Request/Products/Command/ProductRevertStagedChangesAction.php b/src/Core/Request/Products/Command/ProductRevertStagedChangesAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductRevertStagedChangesAction.php
rename to src/Core/Request/Products/Command/ProductRevertStagedChangesAction.php
diff --git a/src/Request/Products/Command/ProductSetAssetCustomFieldAction.php b/src/Core/Request/Products/Command/ProductSetAssetCustomFieldAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetAssetCustomFieldAction.php
rename to src/Core/Request/Products/Command/ProductSetAssetCustomFieldAction.php
diff --git a/src/Request/Products/Command/ProductSetAssetCustomTypeAction.php b/src/Core/Request/Products/Command/ProductSetAssetCustomTypeAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetAssetCustomTypeAction.php
rename to src/Core/Request/Products/Command/ProductSetAssetCustomTypeAction.php
diff --git a/src/Request/Products/Command/ProductSetAssetDescriptionAction.php b/src/Core/Request/Products/Command/ProductSetAssetDescriptionAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetAssetDescriptionAction.php
rename to src/Core/Request/Products/Command/ProductSetAssetDescriptionAction.php
diff --git a/src/Request/Products/Command/ProductSetAssetSourcesAction.php b/src/Core/Request/Products/Command/ProductSetAssetSourcesAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetAssetSourcesAction.php
rename to src/Core/Request/Products/Command/ProductSetAssetSourcesAction.php
diff --git a/src/Request/Products/Command/ProductSetAssetTagsAction.php b/src/Core/Request/Products/Command/ProductSetAssetTagsAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetAssetTagsAction.php
rename to src/Core/Request/Products/Command/ProductSetAssetTagsAction.php
diff --git a/src/Request/Products/Command/ProductSetAttributeAction.php b/src/Core/Request/Products/Command/ProductSetAttributeAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetAttributeAction.php
rename to src/Core/Request/Products/Command/ProductSetAttributeAction.php
diff --git a/src/Request/Products/Command/ProductSetAttributeInAllVariantsAction.php b/src/Core/Request/Products/Command/ProductSetAttributeInAllVariantsAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetAttributeInAllVariantsAction.php
rename to src/Core/Request/Products/Command/ProductSetAttributeInAllVariantsAction.php
diff --git a/src/Request/Products/Command/ProductSetCategoryOrderHintAction.php b/src/Core/Request/Products/Command/ProductSetCategoryOrderHintAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetCategoryOrderHintAction.php
rename to src/Core/Request/Products/Command/ProductSetCategoryOrderHintAction.php
diff --git a/src/Request/Products/Command/ProductSetDescriptionAction.php b/src/Core/Request/Products/Command/ProductSetDescriptionAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetDescriptionAction.php
rename to src/Core/Request/Products/Command/ProductSetDescriptionAction.php
diff --git a/src/Request/Products/Command/ProductSetDiscountedPriceAction.php b/src/Core/Request/Products/Command/ProductSetDiscountedPriceAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetDiscountedPriceAction.php
rename to src/Core/Request/Products/Command/ProductSetDiscountedPriceAction.php
diff --git a/src/Request/Products/Command/ProductSetKeyAction.php b/src/Core/Request/Products/Command/ProductSetKeyAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetKeyAction.php
rename to src/Core/Request/Products/Command/ProductSetKeyAction.php
diff --git a/src/Request/Products/Command/ProductSetMetaDescriptionAction.php b/src/Core/Request/Products/Command/ProductSetMetaDescriptionAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetMetaDescriptionAction.php
rename to src/Core/Request/Products/Command/ProductSetMetaDescriptionAction.php
diff --git a/src/Request/Products/Command/ProductSetMetaKeywordsAction.php b/src/Core/Request/Products/Command/ProductSetMetaKeywordsAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetMetaKeywordsAction.php
rename to src/Core/Request/Products/Command/ProductSetMetaKeywordsAction.php
diff --git a/src/Request/Products/Command/ProductSetMetaTitleAction.php b/src/Core/Request/Products/Command/ProductSetMetaTitleAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetMetaTitleAction.php
rename to src/Core/Request/Products/Command/ProductSetMetaTitleAction.php
diff --git a/src/Request/Products/Command/ProductSetPriceCustomFieldAction.php b/src/Core/Request/Products/Command/ProductSetPriceCustomFieldAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetPriceCustomFieldAction.php
rename to src/Core/Request/Products/Command/ProductSetPriceCustomFieldAction.php
diff --git a/src/Request/Products/Command/ProductSetPriceCustomTypeAction.php b/src/Core/Request/Products/Command/ProductSetPriceCustomTypeAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetPriceCustomTypeAction.php
rename to src/Core/Request/Products/Command/ProductSetPriceCustomTypeAction.php
diff --git a/src/Request/Products/Command/ProductSetPricesAction.php b/src/Core/Request/Products/Command/ProductSetPricesAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetPricesAction.php
rename to src/Core/Request/Products/Command/ProductSetPricesAction.php
diff --git a/src/Request/Products/Command/ProductSetProductVariantKeyAction.php b/src/Core/Request/Products/Command/ProductSetProductVariantKeyAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetProductVariantKeyAction.php
rename to src/Core/Request/Products/Command/ProductSetProductVariantKeyAction.php
diff --git a/src/Request/Products/Command/ProductSetSearchKeywordsAction.php b/src/Core/Request/Products/Command/ProductSetSearchKeywordsAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetSearchKeywordsAction.php
rename to src/Core/Request/Products/Command/ProductSetSearchKeywordsAction.php
diff --git a/src/Request/Products/Command/ProductSetSkuAction.php b/src/Core/Request/Products/Command/ProductSetSkuAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetSkuAction.php
rename to src/Core/Request/Products/Command/ProductSetSkuAction.php
diff --git a/src/Request/Products/Command/ProductSetTaxCategoryAction.php b/src/Core/Request/Products/Command/ProductSetTaxCategoryAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductSetTaxCategoryAction.php
rename to src/Core/Request/Products/Command/ProductSetTaxCategoryAction.php
diff --git a/src/Request/Products/Command/ProductTransitionStateAction.php b/src/Core/Request/Products/Command/ProductTransitionStateAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductTransitionStateAction.php
rename to src/Core/Request/Products/Command/ProductTransitionStateAction.php
diff --git a/src/Request/Products/Command/ProductUnpublishAction.php b/src/Core/Request/Products/Command/ProductUnpublishAction.php
similarity index 100%
rename from src/Request/Products/Command/ProductUnpublishAction.php
rename to src/Core/Request/Products/Command/ProductUnpublishAction.php
diff --git a/src/Request/Products/ProductByIdGetRequest.php b/src/Core/Request/Products/ProductByIdGetRequest.php
similarity index 100%
rename from src/Request/Products/ProductByIdGetRequest.php
rename to src/Core/Request/Products/ProductByIdGetRequest.php
diff --git a/src/Request/Products/ProductByKeyGetRequest.php b/src/Core/Request/Products/ProductByKeyGetRequest.php
similarity index 100%
rename from src/Request/Products/ProductByKeyGetRequest.php
rename to src/Core/Request/Products/ProductByKeyGetRequest.php
diff --git a/src/Request/Products/ProductCreateRequest.php b/src/Core/Request/Products/ProductCreateRequest.php
similarity index 100%
rename from src/Request/Products/ProductCreateRequest.php
rename to src/Core/Request/Products/ProductCreateRequest.php
diff --git a/src/Request/Products/ProductDeleteByKeyRequest.php b/src/Core/Request/Products/ProductDeleteByKeyRequest.php
similarity index 100%
rename from src/Request/Products/ProductDeleteByKeyRequest.php
rename to src/Core/Request/Products/ProductDeleteByKeyRequest.php
diff --git a/src/Request/Products/ProductDeleteRequest.php b/src/Core/Request/Products/ProductDeleteRequest.php
similarity index 100%
rename from src/Request/Products/ProductDeleteRequest.php
rename to src/Core/Request/Products/ProductDeleteRequest.php
diff --git a/src/Request/Products/ProductImageUploadRequest.php b/src/Core/Request/Products/ProductImageUploadRequest.php
similarity index 98%
rename from src/Request/Products/ProductImageUploadRequest.php
rename to src/Core/Request/Products/ProductImageUploadRequest.php
index 008c785f49..8002919a23 100644
--- a/src/Request/Products/ProductImageUploadRequest.php
+++ b/src/Core/Request/Products/ProductImageUploadRequest.php
@@ -26,7 +26,7 @@
class ProductImageUploadRequest extends AbstractApiRequest
{
use StagedTrait;
-
+
protected $resultClass = Product::class;
/**
@@ -63,7 +63,7 @@ public function __construct($id, UploadedFileInterface $file, Context $context =
parent::__construct(ProductsEndpoint::endpoint(), $context);
}
-
+
public function buildResponse(ResponseInterface $response)
{
return new ResourceResponse($response, $this, $this->getContext());
@@ -117,7 +117,7 @@ public function getVariantId()
protected function setVariantId($variantId)
{
$this->variantId = $variantId;
- $this->addParamObject(new Parameter('variantId', $variantId));
+ $this->addParamObject(new Parameter('variant', $variantId));
return $this;
}
diff --git a/src/Request/Products/ProductProjectionByIdGetRequest.php b/src/Core/Request/Products/ProductProjectionByIdGetRequest.php
similarity index 100%
rename from src/Request/Products/ProductProjectionByIdGetRequest.php
rename to src/Core/Request/Products/ProductProjectionByIdGetRequest.php
diff --git a/src/Request/Products/ProductProjectionByKeyGetRequest.php b/src/Core/Request/Products/ProductProjectionByKeyGetRequest.php
similarity index 100%
rename from src/Request/Products/ProductProjectionByKeyGetRequest.php
rename to src/Core/Request/Products/ProductProjectionByKeyGetRequest.php
diff --git a/src/Request/Products/ProductProjectionBySkuGetRequest.php b/src/Core/Request/Products/ProductProjectionBySkuGetRequest.php
similarity index 100%
rename from src/Request/Products/ProductProjectionBySkuGetRequest.php
rename to src/Core/Request/Products/ProductProjectionBySkuGetRequest.php
diff --git a/src/Request/Products/ProductProjectionBySlugGetRequest.php b/src/Core/Request/Products/ProductProjectionBySlugGetRequest.php
similarity index 100%
rename from src/Request/Products/ProductProjectionBySlugGetRequest.php
rename to src/Core/Request/Products/ProductProjectionBySlugGetRequest.php
diff --git a/src/Request/Products/ProductProjectionEndpoint.php b/src/Core/Request/Products/ProductProjectionEndpoint.php
similarity index 100%
rename from src/Request/Products/ProductProjectionEndpoint.php
rename to src/Core/Request/Products/ProductProjectionEndpoint.php
diff --git a/src/Request/Products/ProductProjectionQueryRequest.php b/src/Core/Request/Products/ProductProjectionQueryRequest.php
similarity index 100%
rename from src/Request/Products/ProductProjectionQueryRequest.php
rename to src/Core/Request/Products/ProductProjectionQueryRequest.php
diff --git a/src/Request/Products/ProductProjectionSearchRequest.php b/src/Core/Request/Products/ProductProjectionSearchRequest.php
similarity index 100%
rename from src/Request/Products/ProductProjectionSearchRequest.php
rename to src/Core/Request/Products/ProductProjectionSearchRequest.php
diff --git a/src/Request/Products/ProductQueryRequest.php b/src/Core/Request/Products/ProductQueryRequest.php
similarity index 100%
rename from src/Request/Products/ProductQueryRequest.php
rename to src/Core/Request/Products/ProductQueryRequest.php
diff --git a/src/Request/Products/ProductUpdateByKeyRequest.php b/src/Core/Request/Products/ProductUpdateByKeyRequest.php
similarity index 100%
rename from src/Request/Products/ProductUpdateByKeyRequest.php
rename to src/Core/Request/Products/ProductUpdateByKeyRequest.php
diff --git a/src/Request/Products/ProductUpdateRequest.php b/src/Core/Request/Products/ProductUpdateRequest.php
similarity index 100%
rename from src/Request/Products/ProductUpdateRequest.php
rename to src/Core/Request/Products/ProductUpdateRequest.php
diff --git a/src/Request/Products/ProductsEndpoint.php b/src/Core/Request/Products/ProductsEndpoint.php
similarity index 100%
rename from src/Request/Products/ProductsEndpoint.php
rename to src/Core/Request/Products/ProductsEndpoint.php
diff --git a/src/Request/Products/ProductsSuggestRequest.php b/src/Core/Request/Products/ProductsSuggestRequest.php
similarity index 87%
rename from src/Request/Products/ProductsSuggestRequest.php
rename to src/Core/Request/Products/ProductsSuggestRequest.php
index d0368f9ad5..ee503850da 100644
--- a/src/Request/Products/ProductsSuggestRequest.php
+++ b/src/Core/Request/Products/ProductsSuggestRequest.php
@@ -79,13 +79,19 @@ protected function getProjectionAction()
}
/**
- * @param bool $fuzzy
+ * @param bool|int $level
* @return $this
*/
- public function fuzzy($fuzzy)
+ public function fuzzy($level)
{
- if (!is_null($fuzzy)) {
- $this->addParamObject(new Parameter('fuzzy', (bool)$fuzzy));
+ if (!is_bool($level)) {
+ $level = min(2, max(0, (int)$level));
+ }
+ $fuzzy = (bool)$level;
+ $this->addParamObject(new Parameter('fuzzy', $fuzzy));
+
+ if (!is_bool($level) && $fuzzy) {
+ $this->addParamObject(new Parameter('fuzzyLevel', $level));
}
return $this;
@@ -142,14 +148,12 @@ public function setSearchKeywords(LocalizedString $searchKeywords)
public function getParamString()
{
$params = [];
- foreach ($this->searchKeywords->toArray() as $lang => $keyword) {
- $params[] = 'searchKeywords.' . $lang . '=' . urlencode($keyword);
+ foreach ($this->getSearchKeywords()->toArray() as $lang => $keyword) {
+ $param = new Parameter('searchKeywords.' . $lang, $keyword);
+ $params[$param->getId()] = $param;
}
- $params = array_merge($params, array_keys($this->params));
- sort($params);
- $params = implode('&', $params);
-
+ $params = $this->convertToString(array_merge($this->params, $params));
return (!empty($params) ? '?' . $params : '');
}
diff --git a/src/Request/Project/ProjectGetRequest.php b/src/Core/Request/Project/ProjectGetRequest.php
similarity index 100%
rename from src/Request/Project/ProjectGetRequest.php
rename to src/Core/Request/Project/ProjectGetRequest.php
diff --git a/src/Request/PsrRequest.php b/src/Core/Request/PsrRequest.php
similarity index 100%
rename from src/Request/PsrRequest.php
rename to src/Core/Request/PsrRequest.php
diff --git a/src/Request/Query/MultiParameter.php b/src/Core/Request/Query/MultiParameter.php
similarity index 100%
rename from src/Request/Query/MultiParameter.php
rename to src/Core/Request/Query/MultiParameter.php
diff --git a/src/Request/Query/Parameter.php b/src/Core/Request/Query/Parameter.php
similarity index 100%
rename from src/Request/Query/Parameter.php
rename to src/Core/Request/Query/Parameter.php
diff --git a/src/Request/Query/ParameterInterface.php b/src/Core/Request/Query/ParameterInterface.php
similarity index 100%
rename from src/Request/Query/ParameterInterface.php
rename to src/Core/Request/Query/ParameterInterface.php
diff --git a/src/Request/QueryAllRequestInterface.php b/src/Core/Request/QueryAllRequestInterface.php
similarity index 100%
rename from src/Request/QueryAllRequestInterface.php
rename to src/Core/Request/QueryAllRequestInterface.php
diff --git a/src/Request/QueryRequestInterface.php b/src/Core/Request/QueryRequestInterface.php
similarity index 100%
rename from src/Request/QueryRequestInterface.php
rename to src/Core/Request/QueryRequestInterface.php
diff --git a/src/Request/QueryTrait.php b/src/Core/Request/QueryTrait.php
similarity index 100%
rename from src/Request/QueryTrait.php
rename to src/Core/Request/QueryTrait.php
diff --git a/src/Request/Reviews/Command/ReviewSetAuthorNameAction.php b/src/Core/Request/Reviews/Command/ReviewSetAuthorNameAction.php
similarity index 100%
rename from src/Request/Reviews/Command/ReviewSetAuthorNameAction.php
rename to src/Core/Request/Reviews/Command/ReviewSetAuthorNameAction.php
diff --git a/src/Request/Reviews/Command/ReviewSetCustomerAction.php b/src/Core/Request/Reviews/Command/ReviewSetCustomerAction.php
similarity index 100%
rename from src/Request/Reviews/Command/ReviewSetCustomerAction.php
rename to src/Core/Request/Reviews/Command/ReviewSetCustomerAction.php
diff --git a/src/Request/Reviews/Command/ReviewSetKeyAction.php b/src/Core/Request/Reviews/Command/ReviewSetKeyAction.php
similarity index 100%
rename from src/Request/Reviews/Command/ReviewSetKeyAction.php
rename to src/Core/Request/Reviews/Command/ReviewSetKeyAction.php
diff --git a/src/Request/Reviews/Command/ReviewSetLocaleAction.php b/src/Core/Request/Reviews/Command/ReviewSetLocaleAction.php
similarity index 100%
rename from src/Request/Reviews/Command/ReviewSetLocaleAction.php
rename to src/Core/Request/Reviews/Command/ReviewSetLocaleAction.php
diff --git a/src/Request/Reviews/Command/ReviewSetRatingAction.php b/src/Core/Request/Reviews/Command/ReviewSetRatingAction.php
similarity index 100%
rename from src/Request/Reviews/Command/ReviewSetRatingAction.php
rename to src/Core/Request/Reviews/Command/ReviewSetRatingAction.php
diff --git a/src/Request/Reviews/Command/ReviewSetTargetAction.php b/src/Core/Request/Reviews/Command/ReviewSetTargetAction.php
similarity index 100%
rename from src/Request/Reviews/Command/ReviewSetTargetAction.php
rename to src/Core/Request/Reviews/Command/ReviewSetTargetAction.php
diff --git a/src/Request/Reviews/Command/ReviewSetTextAction.php b/src/Core/Request/Reviews/Command/ReviewSetTextAction.php
similarity index 100%
rename from src/Request/Reviews/Command/ReviewSetTextAction.php
rename to src/Core/Request/Reviews/Command/ReviewSetTextAction.php
diff --git a/src/Request/Reviews/Command/ReviewSetTitleAction.php b/src/Core/Request/Reviews/Command/ReviewSetTitleAction.php
similarity index 100%
rename from src/Request/Reviews/Command/ReviewSetTitleAction.php
rename to src/Core/Request/Reviews/Command/ReviewSetTitleAction.php
diff --git a/src/Request/Reviews/Command/ReviewTransitionStateAction.php b/src/Core/Request/Reviews/Command/ReviewTransitionStateAction.php
similarity index 100%
rename from src/Request/Reviews/Command/ReviewTransitionStateAction.php
rename to src/Core/Request/Reviews/Command/ReviewTransitionStateAction.php
diff --git a/src/Request/Reviews/ReviewByIdGetRequest.php b/src/Core/Request/Reviews/ReviewByIdGetRequest.php
similarity index 100%
rename from src/Request/Reviews/ReviewByIdGetRequest.php
rename to src/Core/Request/Reviews/ReviewByIdGetRequest.php
diff --git a/src/Request/Reviews/ReviewByKeyGetRequest.php b/src/Core/Request/Reviews/ReviewByKeyGetRequest.php
similarity index 100%
rename from src/Request/Reviews/ReviewByKeyGetRequest.php
rename to src/Core/Request/Reviews/ReviewByKeyGetRequest.php
diff --git a/src/Request/Reviews/ReviewCreateRequest.php b/src/Core/Request/Reviews/ReviewCreateRequest.php
similarity index 100%
rename from src/Request/Reviews/ReviewCreateRequest.php
rename to src/Core/Request/Reviews/ReviewCreateRequest.php
diff --git a/src/Request/Reviews/ReviewDeleteByKeyRequest.php b/src/Core/Request/Reviews/ReviewDeleteByKeyRequest.php
similarity index 100%
rename from src/Request/Reviews/ReviewDeleteByKeyRequest.php
rename to src/Core/Request/Reviews/ReviewDeleteByKeyRequest.php
diff --git a/src/Request/Reviews/ReviewDeleteRequest.php b/src/Core/Request/Reviews/ReviewDeleteRequest.php
similarity index 100%
rename from src/Request/Reviews/ReviewDeleteRequest.php
rename to src/Core/Request/Reviews/ReviewDeleteRequest.php
diff --git a/src/Request/Reviews/ReviewQueryRequest.php b/src/Core/Request/Reviews/ReviewQueryRequest.php
similarity index 100%
rename from src/Request/Reviews/ReviewQueryRequest.php
rename to src/Core/Request/Reviews/ReviewQueryRequest.php
diff --git a/src/Request/Reviews/ReviewUpdateByKeyRequest.php b/src/Core/Request/Reviews/ReviewUpdateByKeyRequest.php
similarity index 100%
rename from src/Request/Reviews/ReviewUpdateByKeyRequest.php
rename to src/Core/Request/Reviews/ReviewUpdateByKeyRequest.php
diff --git a/src/Request/Reviews/ReviewUpdateRequest.php b/src/Core/Request/Reviews/ReviewUpdateRequest.php
similarity index 100%
rename from src/Request/Reviews/ReviewUpdateRequest.php
rename to src/Core/Request/Reviews/ReviewUpdateRequest.php
diff --git a/src/Request/Reviews/ReviewsEndpoint.php b/src/Core/Request/Reviews/ReviewsEndpoint.php
similarity index 100%
rename from src/Request/Reviews/ReviewsEndpoint.php
rename to src/Core/Request/Reviews/ReviewsEndpoint.php
diff --git a/src/Request/ShippingMethods/Command/ShippingMethodAddShippingRateAction.php b/src/Core/Request/ShippingMethods/Command/ShippingMethodAddShippingRateAction.php
similarity index 100%
rename from src/Request/ShippingMethods/Command/ShippingMethodAddShippingRateAction.php
rename to src/Core/Request/ShippingMethods/Command/ShippingMethodAddShippingRateAction.php
diff --git a/src/Request/ShippingMethods/Command/ShippingMethodAddZoneAction.php b/src/Core/Request/ShippingMethods/Command/ShippingMethodAddZoneAction.php
similarity index 100%
rename from src/Request/ShippingMethods/Command/ShippingMethodAddZoneAction.php
rename to src/Core/Request/ShippingMethods/Command/ShippingMethodAddZoneAction.php
diff --git a/src/Request/ShippingMethods/Command/ShippingMethodChangeIsDefaultAction.php b/src/Core/Request/ShippingMethods/Command/ShippingMethodChangeIsDefaultAction.php
similarity index 100%
rename from src/Request/ShippingMethods/Command/ShippingMethodChangeIsDefaultAction.php
rename to src/Core/Request/ShippingMethods/Command/ShippingMethodChangeIsDefaultAction.php
diff --git a/src/Request/ShippingMethods/Command/ShippingMethodChangeNameAction.php b/src/Core/Request/ShippingMethods/Command/ShippingMethodChangeNameAction.php
similarity index 100%
rename from src/Request/ShippingMethods/Command/ShippingMethodChangeNameAction.php
rename to src/Core/Request/ShippingMethods/Command/ShippingMethodChangeNameAction.php
diff --git a/src/Request/ShippingMethods/Command/ShippingMethodChangeTaxCategoryAction.php b/src/Core/Request/ShippingMethods/Command/ShippingMethodChangeTaxCategoryAction.php
similarity index 100%
rename from src/Request/ShippingMethods/Command/ShippingMethodChangeTaxCategoryAction.php
rename to src/Core/Request/ShippingMethods/Command/ShippingMethodChangeTaxCategoryAction.php
diff --git a/src/Request/ShippingMethods/Command/ShippingMethodRemoveShippingRateAction.php b/src/Core/Request/ShippingMethods/Command/ShippingMethodRemoveShippingRateAction.php
similarity index 100%
rename from src/Request/ShippingMethods/Command/ShippingMethodRemoveShippingRateAction.php
rename to src/Core/Request/ShippingMethods/Command/ShippingMethodRemoveShippingRateAction.php
diff --git a/src/Request/ShippingMethods/Command/ShippingMethodRemoveZoneAction.php b/src/Core/Request/ShippingMethods/Command/ShippingMethodRemoveZoneAction.php
similarity index 100%
rename from src/Request/ShippingMethods/Command/ShippingMethodRemoveZoneAction.php
rename to src/Core/Request/ShippingMethods/Command/ShippingMethodRemoveZoneAction.php
diff --git a/src/Request/ShippingMethods/Command/ShippingMethodSetDescriptionAction.php b/src/Core/Request/ShippingMethods/Command/ShippingMethodSetDescriptionAction.php
similarity index 100%
rename from src/Request/ShippingMethods/Command/ShippingMethodSetDescriptionAction.php
rename to src/Core/Request/ShippingMethods/Command/ShippingMethodSetDescriptionAction.php
diff --git a/src/Request/ShippingMethods/ShippingMethodByCartIdGetRequest.php b/src/Core/Request/ShippingMethods/ShippingMethodByCartIdGetRequest.php
similarity index 100%
rename from src/Request/ShippingMethods/ShippingMethodByCartIdGetRequest.php
rename to src/Core/Request/ShippingMethods/ShippingMethodByCartIdGetRequest.php
diff --git a/src/Request/ShippingMethods/ShippingMethodByIdGetRequest.php b/src/Core/Request/ShippingMethods/ShippingMethodByIdGetRequest.php
similarity index 100%
rename from src/Request/ShippingMethods/ShippingMethodByIdGetRequest.php
rename to src/Core/Request/ShippingMethods/ShippingMethodByIdGetRequest.php
diff --git a/src/Request/ShippingMethods/ShippingMethodByLocationGetRequest.php b/src/Core/Request/ShippingMethods/ShippingMethodByLocationGetRequest.php
similarity index 100%
rename from src/Request/ShippingMethods/ShippingMethodByLocationGetRequest.php
rename to src/Core/Request/ShippingMethods/ShippingMethodByLocationGetRequest.php
diff --git a/src/Request/ShippingMethods/ShippingMethodCreateRequest.php b/src/Core/Request/ShippingMethods/ShippingMethodCreateRequest.php
similarity index 100%
rename from src/Request/ShippingMethods/ShippingMethodCreateRequest.php
rename to src/Core/Request/ShippingMethods/ShippingMethodCreateRequest.php
diff --git a/src/Request/ShippingMethods/ShippingMethodDeleteRequest.php b/src/Core/Request/ShippingMethods/ShippingMethodDeleteRequest.php
similarity index 100%
rename from src/Request/ShippingMethods/ShippingMethodDeleteRequest.php
rename to src/Core/Request/ShippingMethods/ShippingMethodDeleteRequest.php
diff --git a/src/Request/ShippingMethods/ShippingMethodQueryRequest.php b/src/Core/Request/ShippingMethods/ShippingMethodQueryRequest.php
similarity index 100%
rename from src/Request/ShippingMethods/ShippingMethodQueryRequest.php
rename to src/Core/Request/ShippingMethods/ShippingMethodQueryRequest.php
diff --git a/src/Request/ShippingMethods/ShippingMethodUpdateRequest.php b/src/Core/Request/ShippingMethods/ShippingMethodUpdateRequest.php
similarity index 100%
rename from src/Request/ShippingMethods/ShippingMethodUpdateRequest.php
rename to src/Core/Request/ShippingMethods/ShippingMethodUpdateRequest.php
diff --git a/src/Request/ShippingMethods/ShippingMethodsEndpoint.php b/src/Core/Request/ShippingMethods/ShippingMethodsEndpoint.php
similarity index 100%
rename from src/Request/ShippingMethods/ShippingMethodsEndpoint.php
rename to src/Core/Request/ShippingMethods/ShippingMethodsEndpoint.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListAddLineItemAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListAddLineItemAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListAddLineItemAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListAddLineItemAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListAddTextLineItemAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListAddTextLineItemAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListAddTextLineItemAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListAddTextLineItemAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListChangeLineItemQuantityAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListChangeLineItemQuantityAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListChangeLineItemQuantityAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListChangeLineItemQuantityAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListChangeLineItemsOrderAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListChangeLineItemsOrderAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListChangeLineItemsOrderAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListChangeLineItemsOrderAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListChangeNameAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListChangeNameAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListChangeNameAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListChangeNameAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemNameAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemNameAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemNameAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemNameAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemQuantityAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemQuantityAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemQuantityAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemQuantityAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemsOrderAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemsOrderAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemsOrderAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListChangeTextLineItemsOrderAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListRemoveLineItemAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListRemoveLineItemAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListRemoveLineItemAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListRemoveLineItemAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListRemoveTextLineItemAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListRemoveTextLineItemAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListRemoveTextLineItemAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListRemoveTextLineItemAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListSetCustomFieldAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetCustomFieldAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListSetCustomFieldAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListSetCustomFieldAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListSetCustomTypeAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetCustomTypeAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListSetCustomTypeAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListSetCustomTypeAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListSetCustomerAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetCustomerAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListSetCustomerAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListSetCustomerAction.php
diff --git a/src/Core/Request/ShoppingLists/Command/ShoppingListSetDeleteDaysAfterLastModificationAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetDeleteDaysAfterLastModificationAction.php
new file mode 100644
index 0000000000..0a19afae33
--- /dev/null
+++ b/src/Core/Request/ShoppingLists/Command/ShoppingListSetDeleteDaysAfterLastModificationAction.php
@@ -0,0 +1,37 @@
+ [static::TYPE => 'string'],
+ 'deleteDaysAfterLastModification' => [static::TYPE => 'int']
+ ];
+ }
+
+ /**
+ * @param array $data
+ * @param Context|callable $context
+ */
+ public function __construct(array $data = [], $context = null)
+ {
+ parent::__construct($data, $context);
+ $this->setAction('setDeleteDaysAfterLastModification');
+ }
+}
diff --git a/src/Request/ShoppingLists/Command/ShoppingListSetDescriptionAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetDescriptionAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListSetDescriptionAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListSetDescriptionAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListSetKeyAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetKeyAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListSetKeyAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListSetKeyAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListSetLineItemCustomFieldAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetLineItemCustomFieldAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListSetLineItemCustomFieldAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListSetLineItemCustomFieldAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListSetLineItemCustomTypeAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetLineItemCustomTypeAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListSetLineItemCustomTypeAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListSetLineItemCustomTypeAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListSetSlugAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetSlugAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListSetSlugAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListSetSlugAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListSetTextLineItemCustomFieldAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetTextLineItemCustomFieldAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListSetTextLineItemCustomFieldAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListSetTextLineItemCustomFieldAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListSetTextLineItemCustomTypeAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetTextLineItemCustomTypeAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListSetTextLineItemCustomTypeAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListSetTextLineItemCustomTypeAction.php
diff --git a/src/Request/ShoppingLists/Command/ShoppingListSetTextLineItemDescriptionAction.php b/src/Core/Request/ShoppingLists/Command/ShoppingListSetTextLineItemDescriptionAction.php
similarity index 100%
rename from src/Request/ShoppingLists/Command/ShoppingListSetTextLineItemDescriptionAction.php
rename to src/Core/Request/ShoppingLists/Command/ShoppingListSetTextLineItemDescriptionAction.php
diff --git a/src/Request/ShoppingLists/ShoppingListByIdGetRequest.php b/src/Core/Request/ShoppingLists/ShoppingListByIdGetRequest.php
similarity index 100%
rename from src/Request/ShoppingLists/ShoppingListByIdGetRequest.php
rename to src/Core/Request/ShoppingLists/ShoppingListByIdGetRequest.php
diff --git a/src/Request/ShoppingLists/ShoppingListByKeyGetRequest.php b/src/Core/Request/ShoppingLists/ShoppingListByKeyGetRequest.php
similarity index 100%
rename from src/Request/ShoppingLists/ShoppingListByKeyGetRequest.php
rename to src/Core/Request/ShoppingLists/ShoppingListByKeyGetRequest.php
diff --git a/src/Request/ShoppingLists/ShoppingListCreateRequest.php b/src/Core/Request/ShoppingLists/ShoppingListCreateRequest.php
similarity index 100%
rename from src/Request/ShoppingLists/ShoppingListCreateRequest.php
rename to src/Core/Request/ShoppingLists/ShoppingListCreateRequest.php
diff --git a/src/Request/ShoppingLists/ShoppingListDeleteByKeyRequest.php b/src/Core/Request/ShoppingLists/ShoppingListDeleteByKeyRequest.php
similarity index 100%
rename from src/Request/ShoppingLists/ShoppingListDeleteByKeyRequest.php
rename to src/Core/Request/ShoppingLists/ShoppingListDeleteByKeyRequest.php
diff --git a/src/Request/ShoppingLists/ShoppingListDeleteRequest.php b/src/Core/Request/ShoppingLists/ShoppingListDeleteRequest.php
similarity index 100%
rename from src/Request/ShoppingLists/ShoppingListDeleteRequest.php
rename to src/Core/Request/ShoppingLists/ShoppingListDeleteRequest.php
diff --git a/src/Request/ShoppingLists/ShoppingListQueryRequest.php b/src/Core/Request/ShoppingLists/ShoppingListQueryRequest.php
similarity index 100%
rename from src/Request/ShoppingLists/ShoppingListQueryRequest.php
rename to src/Core/Request/ShoppingLists/ShoppingListQueryRequest.php
diff --git a/src/Request/ShoppingLists/ShoppingListUpdateByKeyRequest.php b/src/Core/Request/ShoppingLists/ShoppingListUpdateByKeyRequest.php
similarity index 100%
rename from src/Request/ShoppingLists/ShoppingListUpdateByKeyRequest.php
rename to src/Core/Request/ShoppingLists/ShoppingListUpdateByKeyRequest.php
diff --git a/src/Request/ShoppingLists/ShoppingListUpdateRequest.php b/src/Core/Request/ShoppingLists/ShoppingListUpdateRequest.php
similarity index 100%
rename from src/Request/ShoppingLists/ShoppingListUpdateRequest.php
rename to src/Core/Request/ShoppingLists/ShoppingListUpdateRequest.php
diff --git a/src/Request/ShoppingLists/ShoppingListsEndpoint.php b/src/Core/Request/ShoppingLists/ShoppingListsEndpoint.php
similarity index 100%
rename from src/Request/ShoppingLists/ShoppingListsEndpoint.php
rename to src/Core/Request/ShoppingLists/ShoppingListsEndpoint.php
diff --git a/src/Request/SortRequestInterface.php b/src/Core/Request/SortRequestInterface.php
similarity index 100%
rename from src/Request/SortRequestInterface.php
rename to src/Core/Request/SortRequestInterface.php
diff --git a/src/Request/SortTrait.php b/src/Core/Request/SortTrait.php
similarity index 100%
rename from src/Request/SortTrait.php
rename to src/Core/Request/SortTrait.php
diff --git a/src/Request/StagedTrait.php b/src/Core/Request/StagedTrait.php
similarity index 100%
rename from src/Request/StagedTrait.php
rename to src/Core/Request/StagedTrait.php
diff --git a/src/Request/States/Command/StateAddRolesAction.php b/src/Core/Request/States/Command/StateAddRolesAction.php
similarity index 100%
rename from src/Request/States/Command/StateAddRolesAction.php
rename to src/Core/Request/States/Command/StateAddRolesAction.php
diff --git a/src/Request/States/Command/StateChangeInitialAction.php b/src/Core/Request/States/Command/StateChangeInitialAction.php
similarity index 100%
rename from src/Request/States/Command/StateChangeInitialAction.php
rename to src/Core/Request/States/Command/StateChangeInitialAction.php
diff --git a/src/Request/States/Command/StateChangeKeyAction.php b/src/Core/Request/States/Command/StateChangeKeyAction.php
similarity index 100%
rename from src/Request/States/Command/StateChangeKeyAction.php
rename to src/Core/Request/States/Command/StateChangeKeyAction.php
diff --git a/src/Request/States/Command/StateChangeTypeAction.php b/src/Core/Request/States/Command/StateChangeTypeAction.php
similarity index 100%
rename from src/Request/States/Command/StateChangeTypeAction.php
rename to src/Core/Request/States/Command/StateChangeTypeAction.php
diff --git a/src/Request/States/Command/StateRemoveRolesAction.php b/src/Core/Request/States/Command/StateRemoveRolesAction.php
similarity index 100%
rename from src/Request/States/Command/StateRemoveRolesAction.php
rename to src/Core/Request/States/Command/StateRemoveRolesAction.php
diff --git a/src/Request/States/Command/StateSetDescriptionAction.php b/src/Core/Request/States/Command/StateSetDescriptionAction.php
similarity index 100%
rename from src/Request/States/Command/StateSetDescriptionAction.php
rename to src/Core/Request/States/Command/StateSetDescriptionAction.php
diff --git a/src/Request/States/Command/StateSetNameAction.php b/src/Core/Request/States/Command/StateSetNameAction.php
similarity index 100%
rename from src/Request/States/Command/StateSetNameAction.php
rename to src/Core/Request/States/Command/StateSetNameAction.php
diff --git a/src/Request/States/Command/StateSetRolesAction.php b/src/Core/Request/States/Command/StateSetRolesAction.php
similarity index 100%
rename from src/Request/States/Command/StateSetRolesAction.php
rename to src/Core/Request/States/Command/StateSetRolesAction.php
diff --git a/src/Request/States/Command/StateSetTransitionsAction.php b/src/Core/Request/States/Command/StateSetTransitionsAction.php
similarity index 100%
rename from src/Request/States/Command/StateSetTransitionsAction.php
rename to src/Core/Request/States/Command/StateSetTransitionsAction.php
diff --git a/src/Request/States/Command/TransitionStateAction.php b/src/Core/Request/States/Command/TransitionStateAction.php
similarity index 100%
rename from src/Request/States/Command/TransitionStateAction.php
rename to src/Core/Request/States/Command/TransitionStateAction.php
diff --git a/src/Request/States/StateByIdGetRequest.php b/src/Core/Request/States/StateByIdGetRequest.php
similarity index 100%
rename from src/Request/States/StateByIdGetRequest.php
rename to src/Core/Request/States/StateByIdGetRequest.php
diff --git a/src/Request/States/StateCreateRequest.php b/src/Core/Request/States/StateCreateRequest.php
similarity index 100%
rename from src/Request/States/StateCreateRequest.php
rename to src/Core/Request/States/StateCreateRequest.php
diff --git a/src/Request/States/StateDeleteRequest.php b/src/Core/Request/States/StateDeleteRequest.php
similarity index 100%
rename from src/Request/States/StateDeleteRequest.php
rename to src/Core/Request/States/StateDeleteRequest.php
diff --git a/src/Request/States/StateQueryRequest.php b/src/Core/Request/States/StateQueryRequest.php
similarity index 100%
rename from src/Request/States/StateQueryRequest.php
rename to src/Core/Request/States/StateQueryRequest.php
diff --git a/src/Request/States/StateUpdateRequest.php b/src/Core/Request/States/StateUpdateRequest.php
similarity index 100%
rename from src/Request/States/StateUpdateRequest.php
rename to src/Core/Request/States/StateUpdateRequest.php
diff --git a/src/Request/States/StatesEndpoint.php b/src/Core/Request/States/StatesEndpoint.php
similarity index 100%
rename from src/Request/States/StatesEndpoint.php
rename to src/Core/Request/States/StatesEndpoint.php
diff --git a/src/Request/Subscriptions/Command/SubscriptionSetChangesAction.php b/src/Core/Request/Subscriptions/Command/SubscriptionSetChangesAction.php
similarity index 100%
rename from src/Request/Subscriptions/Command/SubscriptionSetChangesAction.php
rename to src/Core/Request/Subscriptions/Command/SubscriptionSetChangesAction.php
diff --git a/src/Request/Subscriptions/Command/SubscriptionSetKeyAction.php b/src/Core/Request/Subscriptions/Command/SubscriptionSetKeyAction.php
similarity index 100%
rename from src/Request/Subscriptions/Command/SubscriptionSetKeyAction.php
rename to src/Core/Request/Subscriptions/Command/SubscriptionSetKeyAction.php
diff --git a/src/Request/Subscriptions/Command/SubscriptionSetMessagesAction.php b/src/Core/Request/Subscriptions/Command/SubscriptionSetMessagesAction.php
similarity index 100%
rename from src/Request/Subscriptions/Command/SubscriptionSetMessagesAction.php
rename to src/Core/Request/Subscriptions/Command/SubscriptionSetMessagesAction.php
diff --git a/src/Request/Subscriptions/SubscriptionByIdGetRequest.php b/src/Core/Request/Subscriptions/SubscriptionByIdGetRequest.php
similarity index 100%
rename from src/Request/Subscriptions/SubscriptionByIdGetRequest.php
rename to src/Core/Request/Subscriptions/SubscriptionByIdGetRequest.php
diff --git a/src/Request/Subscriptions/SubscriptionByKeyGetRequest.php b/src/Core/Request/Subscriptions/SubscriptionByKeyGetRequest.php
similarity index 100%
rename from src/Request/Subscriptions/SubscriptionByKeyGetRequest.php
rename to src/Core/Request/Subscriptions/SubscriptionByKeyGetRequest.php
diff --git a/src/Request/Subscriptions/SubscriptionCreateRequest.php b/src/Core/Request/Subscriptions/SubscriptionCreateRequest.php
similarity index 100%
rename from src/Request/Subscriptions/SubscriptionCreateRequest.php
rename to src/Core/Request/Subscriptions/SubscriptionCreateRequest.php
diff --git a/src/Request/Subscriptions/SubscriptionDeleteByKeyRequest.php b/src/Core/Request/Subscriptions/SubscriptionDeleteByKeyRequest.php
similarity index 100%
rename from src/Request/Subscriptions/SubscriptionDeleteByKeyRequest.php
rename to src/Core/Request/Subscriptions/SubscriptionDeleteByKeyRequest.php
diff --git a/src/Request/Subscriptions/SubscriptionDeleteRequest.php b/src/Core/Request/Subscriptions/SubscriptionDeleteRequest.php
similarity index 100%
rename from src/Request/Subscriptions/SubscriptionDeleteRequest.php
rename to src/Core/Request/Subscriptions/SubscriptionDeleteRequest.php
diff --git a/src/Request/Subscriptions/SubscriptionQueryRequest.php b/src/Core/Request/Subscriptions/SubscriptionQueryRequest.php
similarity index 100%
rename from src/Request/Subscriptions/SubscriptionQueryRequest.php
rename to src/Core/Request/Subscriptions/SubscriptionQueryRequest.php
diff --git a/src/Request/Subscriptions/SubscriptionUpdateByKeyRequest.php b/src/Core/Request/Subscriptions/SubscriptionUpdateByKeyRequest.php
similarity index 100%
rename from src/Request/Subscriptions/SubscriptionUpdateByKeyRequest.php
rename to src/Core/Request/Subscriptions/SubscriptionUpdateByKeyRequest.php
diff --git a/src/Request/Subscriptions/SubscriptionUpdateRequest.php b/src/Core/Request/Subscriptions/SubscriptionUpdateRequest.php
similarity index 100%
rename from src/Request/Subscriptions/SubscriptionUpdateRequest.php
rename to src/Core/Request/Subscriptions/SubscriptionUpdateRequest.php
diff --git a/src/Request/Subscriptions/SubscriptionsEndpoint.php b/src/Core/Request/Subscriptions/SubscriptionsEndpoint.php
similarity index 100%
rename from src/Request/Subscriptions/SubscriptionsEndpoint.php
rename to src/Core/Request/Subscriptions/SubscriptionsEndpoint.php
diff --git a/src/Request/TaxCategories/Command/TaxCategoryAddTaxRateAction.php b/src/Core/Request/TaxCategories/Command/TaxCategoryAddTaxRateAction.php
similarity index 100%
rename from src/Request/TaxCategories/Command/TaxCategoryAddTaxRateAction.php
rename to src/Core/Request/TaxCategories/Command/TaxCategoryAddTaxRateAction.php
diff --git a/src/Request/TaxCategories/Command/TaxCategoryChangeNameAction.php b/src/Core/Request/TaxCategories/Command/TaxCategoryChangeNameAction.php
similarity index 100%
rename from src/Request/TaxCategories/Command/TaxCategoryChangeNameAction.php
rename to src/Core/Request/TaxCategories/Command/TaxCategoryChangeNameAction.php
diff --git a/src/Request/TaxCategories/Command/TaxCategoryRemoveTaxRateAction.php b/src/Core/Request/TaxCategories/Command/TaxCategoryRemoveTaxRateAction.php
similarity index 100%
rename from src/Request/TaxCategories/Command/TaxCategoryRemoveTaxRateAction.php
rename to src/Core/Request/TaxCategories/Command/TaxCategoryRemoveTaxRateAction.php
diff --git a/src/Request/TaxCategories/Command/TaxCategoryReplaceTaxRateAction.php b/src/Core/Request/TaxCategories/Command/TaxCategoryReplaceTaxRateAction.php
similarity index 100%
rename from src/Request/TaxCategories/Command/TaxCategoryReplaceTaxRateAction.php
rename to src/Core/Request/TaxCategories/Command/TaxCategoryReplaceTaxRateAction.php
diff --git a/src/Request/TaxCategories/Command/TaxCategorySetDescriptionAction.php b/src/Core/Request/TaxCategories/Command/TaxCategorySetDescriptionAction.php
similarity index 100%
rename from src/Request/TaxCategories/Command/TaxCategorySetDescriptionAction.php
rename to src/Core/Request/TaxCategories/Command/TaxCategorySetDescriptionAction.php
diff --git a/src/Request/TaxCategories/TaxCategoriesEndpoint.php b/src/Core/Request/TaxCategories/TaxCategoriesEndpoint.php
similarity index 100%
rename from src/Request/TaxCategories/TaxCategoriesEndpoint.php
rename to src/Core/Request/TaxCategories/TaxCategoriesEndpoint.php
diff --git a/src/Request/TaxCategories/TaxCategoryByIdGetRequest.php b/src/Core/Request/TaxCategories/TaxCategoryByIdGetRequest.php
similarity index 100%
rename from src/Request/TaxCategories/TaxCategoryByIdGetRequest.php
rename to src/Core/Request/TaxCategories/TaxCategoryByIdGetRequest.php
diff --git a/src/Request/TaxCategories/TaxCategoryCreateRequest.php b/src/Core/Request/TaxCategories/TaxCategoryCreateRequest.php
similarity index 100%
rename from src/Request/TaxCategories/TaxCategoryCreateRequest.php
rename to src/Core/Request/TaxCategories/TaxCategoryCreateRequest.php
diff --git a/src/Request/TaxCategories/TaxCategoryDeleteRequest.php b/src/Core/Request/TaxCategories/TaxCategoryDeleteRequest.php
similarity index 100%
rename from src/Request/TaxCategories/TaxCategoryDeleteRequest.php
rename to src/Core/Request/TaxCategories/TaxCategoryDeleteRequest.php
diff --git a/src/Request/TaxCategories/TaxCategoryQueryRequest.php b/src/Core/Request/TaxCategories/TaxCategoryQueryRequest.php
similarity index 100%
rename from src/Request/TaxCategories/TaxCategoryQueryRequest.php
rename to src/Core/Request/TaxCategories/TaxCategoryQueryRequest.php
diff --git a/src/Request/TaxCategories/TaxCategoryUpdateRequest.php b/src/Core/Request/TaxCategories/TaxCategoryUpdateRequest.php
similarity index 100%
rename from src/Request/TaxCategories/TaxCategoryUpdateRequest.php
rename to src/Core/Request/TaxCategories/TaxCategoryUpdateRequest.php
diff --git a/src/Request/Types/Command/TypeAddEnumValueAction.php b/src/Core/Request/Types/Command/TypeAddEnumValueAction.php
similarity index 100%
rename from src/Request/Types/Command/TypeAddEnumValueAction.php
rename to src/Core/Request/Types/Command/TypeAddEnumValueAction.php
diff --git a/src/Request/Types/Command/TypeAddFieldDefinitionAction.php b/src/Core/Request/Types/Command/TypeAddFieldDefinitionAction.php
similarity index 100%
rename from src/Request/Types/Command/TypeAddFieldDefinitionAction.php
rename to src/Core/Request/Types/Command/TypeAddFieldDefinitionAction.php
diff --git a/src/Request/Types/Command/TypeAddLocalizedEnumValueAction.php b/src/Core/Request/Types/Command/TypeAddLocalizedEnumValueAction.php
similarity index 100%
rename from src/Request/Types/Command/TypeAddLocalizedEnumValueAction.php
rename to src/Core/Request/Types/Command/TypeAddLocalizedEnumValueAction.php
diff --git a/src/Request/Types/Command/TypeChangeEnumValueOrderAction.php b/src/Core/Request/Types/Command/TypeChangeEnumValueOrderAction.php
similarity index 100%
rename from src/Request/Types/Command/TypeChangeEnumValueOrderAction.php
rename to src/Core/Request/Types/Command/TypeChangeEnumValueOrderAction.php
diff --git a/src/Request/Types/Command/TypeChangeFieldDefinitionOrderAction.php b/src/Core/Request/Types/Command/TypeChangeFieldDefinitionOrderAction.php
similarity index 100%
rename from src/Request/Types/Command/TypeChangeFieldDefinitionOrderAction.php
rename to src/Core/Request/Types/Command/TypeChangeFieldDefinitionOrderAction.php
diff --git a/src/Request/Types/Command/TypeChangeKeyAction.php b/src/Core/Request/Types/Command/TypeChangeKeyAction.php
similarity index 100%
rename from src/Request/Types/Command/TypeChangeKeyAction.php
rename to src/Core/Request/Types/Command/TypeChangeKeyAction.php
diff --git a/src/Request/Types/Command/TypeChangeLabelAction.php b/src/Core/Request/Types/Command/TypeChangeLabelAction.php
similarity index 100%
rename from src/Request/Types/Command/TypeChangeLabelAction.php
rename to src/Core/Request/Types/Command/TypeChangeLabelAction.php
diff --git a/src/Request/Types/Command/TypeChangeLocalizedEnumValueOrderAction.php b/src/Core/Request/Types/Command/TypeChangeLocalizedEnumValueOrderAction.php
similarity index 100%
rename from src/Request/Types/Command/TypeChangeLocalizedEnumValueOrderAction.php
rename to src/Core/Request/Types/Command/TypeChangeLocalizedEnumValueOrderAction.php
diff --git a/src/Request/Types/Command/TypeChangeNameAction.php b/src/Core/Request/Types/Command/TypeChangeNameAction.php
similarity index 100%
rename from src/Request/Types/Command/TypeChangeNameAction.php
rename to src/Core/Request/Types/Command/TypeChangeNameAction.php
diff --git a/src/Request/Types/Command/TypeRemoveFieldDefinitionAction.php b/src/Core/Request/Types/Command/TypeRemoveFieldDefinitionAction.php
similarity index 100%
rename from src/Request/Types/Command/TypeRemoveFieldDefinitionAction.php
rename to src/Core/Request/Types/Command/TypeRemoveFieldDefinitionAction.php
diff --git a/src/Request/Types/Command/TypeSetDescriptionAction.php b/src/Core/Request/Types/Command/TypeSetDescriptionAction.php
similarity index 100%
rename from src/Request/Types/Command/TypeSetDescriptionAction.php
rename to src/Core/Request/Types/Command/TypeSetDescriptionAction.php
diff --git a/src/Request/Types/TypeByIdGetRequest.php b/src/Core/Request/Types/TypeByIdGetRequest.php
similarity index 100%
rename from src/Request/Types/TypeByIdGetRequest.php
rename to src/Core/Request/Types/TypeByIdGetRequest.php
diff --git a/src/Request/Types/TypeByKeyGetRequest.php b/src/Core/Request/Types/TypeByKeyGetRequest.php
similarity index 100%
rename from src/Request/Types/TypeByKeyGetRequest.php
rename to src/Core/Request/Types/TypeByKeyGetRequest.php
diff --git a/src/Request/Types/TypeCreateRequest.php b/src/Core/Request/Types/TypeCreateRequest.php
similarity index 100%
rename from src/Request/Types/TypeCreateRequest.php
rename to src/Core/Request/Types/TypeCreateRequest.php
diff --git a/src/Request/Types/TypeDeleteByKeyRequest.php b/src/Core/Request/Types/TypeDeleteByKeyRequest.php
similarity index 100%
rename from src/Request/Types/TypeDeleteByKeyRequest.php
rename to src/Core/Request/Types/TypeDeleteByKeyRequest.php
diff --git a/src/Request/Types/TypeDeleteRequest.php b/src/Core/Request/Types/TypeDeleteRequest.php
similarity index 100%
rename from src/Request/Types/TypeDeleteRequest.php
rename to src/Core/Request/Types/TypeDeleteRequest.php
diff --git a/src/Request/Types/TypeQueryRequest.php b/src/Core/Request/Types/TypeQueryRequest.php
similarity index 100%
rename from src/Request/Types/TypeQueryRequest.php
rename to src/Core/Request/Types/TypeQueryRequest.php
diff --git a/src/Request/Types/TypeUpdateByKeyRequest.php b/src/Core/Request/Types/TypeUpdateByKeyRequest.php
similarity index 100%
rename from src/Request/Types/TypeUpdateByKeyRequest.php
rename to src/Core/Request/Types/TypeUpdateByKeyRequest.php
diff --git a/src/Request/Types/TypeUpdateRequest.php b/src/Core/Request/Types/TypeUpdateRequest.php
similarity index 100%
rename from src/Request/Types/TypeUpdateRequest.php
rename to src/Core/Request/Types/TypeUpdateRequest.php
diff --git a/src/Request/Types/TypesEndpoint.php b/src/Core/Request/Types/TypesEndpoint.php
similarity index 100%
rename from src/Request/Types/TypesEndpoint.php
rename to src/Core/Request/Types/TypesEndpoint.php
diff --git a/src/Request/WithTotalRequestInterface.php b/src/Core/Request/WithTotalRequestInterface.php
similarity index 100%
rename from src/Request/WithTotalRequestInterface.php
rename to src/Core/Request/WithTotalRequestInterface.php
diff --git a/src/Request/WithTotalTrait.php b/src/Core/Request/WithTotalTrait.php
similarity index 100%
rename from src/Request/WithTotalTrait.php
rename to src/Core/Request/WithTotalTrait.php
diff --git a/src/Request/Zones/Command/ZoneAddLocationAction.php b/src/Core/Request/Zones/Command/ZoneAddLocationAction.php
similarity index 100%
rename from src/Request/Zones/Command/ZoneAddLocationAction.php
rename to src/Core/Request/Zones/Command/ZoneAddLocationAction.php
diff --git a/src/Request/Zones/Command/ZoneChangeNameAction.php b/src/Core/Request/Zones/Command/ZoneChangeNameAction.php
similarity index 100%
rename from src/Request/Zones/Command/ZoneChangeNameAction.php
rename to src/Core/Request/Zones/Command/ZoneChangeNameAction.php
diff --git a/src/Request/Zones/Command/ZoneRemoveLocationAction.php b/src/Core/Request/Zones/Command/ZoneRemoveLocationAction.php
similarity index 100%
rename from src/Request/Zones/Command/ZoneRemoveLocationAction.php
rename to src/Core/Request/Zones/Command/ZoneRemoveLocationAction.php
diff --git a/src/Request/Zones/Command/ZoneSetDescriptionAction.php b/src/Core/Request/Zones/Command/ZoneSetDescriptionAction.php
similarity index 100%
rename from src/Request/Zones/Command/ZoneSetDescriptionAction.php
rename to src/Core/Request/Zones/Command/ZoneSetDescriptionAction.php
diff --git a/src/Request/Zones/ZoneByIdGetRequest.php b/src/Core/Request/Zones/ZoneByIdGetRequest.php
similarity index 100%
rename from src/Request/Zones/ZoneByIdGetRequest.php
rename to src/Core/Request/Zones/ZoneByIdGetRequest.php
diff --git a/src/Request/Zones/ZoneCreateRequest.php b/src/Core/Request/Zones/ZoneCreateRequest.php
similarity index 100%
rename from src/Request/Zones/ZoneCreateRequest.php
rename to src/Core/Request/Zones/ZoneCreateRequest.php
diff --git a/src/Request/Zones/ZoneDeleteRequest.php b/src/Core/Request/Zones/ZoneDeleteRequest.php
similarity index 100%
rename from src/Request/Zones/ZoneDeleteRequest.php
rename to src/Core/Request/Zones/ZoneDeleteRequest.php
diff --git a/src/Request/Zones/ZoneQueryRequest.php b/src/Core/Request/Zones/ZoneQueryRequest.php
similarity index 100%
rename from src/Request/Zones/ZoneQueryRequest.php
rename to src/Core/Request/Zones/ZoneQueryRequest.php
diff --git a/src/Request/Zones/ZoneUpdateRequest.php b/src/Core/Request/Zones/ZoneUpdateRequest.php
similarity index 100%
rename from src/Request/Zones/ZoneUpdateRequest.php
rename to src/Core/Request/Zones/ZoneUpdateRequest.php
diff --git a/src/Request/Zones/ZonesEndpoint.php b/src/Core/Request/Zones/ZonesEndpoint.php
similarity index 100%
rename from src/Request/Zones/ZonesEndpoint.php
rename to src/Core/Request/Zones/ZonesEndpoint.php
diff --git a/src/Response/AbstractApiResponse.php b/src/Core/Response/AbstractApiResponse.php
similarity index 100%
rename from src/Response/AbstractApiResponse.php
rename to src/Core/Response/AbstractApiResponse.php
diff --git a/src/Response/ApiResponseInterface.php b/src/Core/Response/ApiResponseInterface.php
similarity index 100%
rename from src/Response/ApiResponseInterface.php
rename to src/Core/Response/ApiResponseInterface.php
diff --git a/src/Response/ErrorResponse.php b/src/Core/Response/ErrorResponse.php
similarity index 87%
rename from src/Response/ErrorResponse.php
rename to src/Core/Response/ErrorResponse.php
index 5f1dafb876..585ee61edb 100644
--- a/src/Response/ErrorResponse.php
+++ b/src/Core/Response/ErrorResponse.php
@@ -47,7 +47,8 @@ public function isError()
public function getMessage()
{
if (is_null($this->message)) {
- $this->message = $this->getResponseField('message');
+ $message = $this->getResponseField('message', null);
+ $this->message = !is_null($message) ? $message : $this->getResponse()->getReasonPhrase();
}
return $this->message;
}
diff --git a/src/Response/PagedQueryResponse.php b/src/Core/Response/PagedQueryResponse.php
similarity index 100%
rename from src/Response/PagedQueryResponse.php
rename to src/Core/Response/PagedQueryResponse.php
diff --git a/src/Response/PagedSearchResponse.php b/src/Core/Response/PagedSearchResponse.php
similarity index 100%
rename from src/Response/PagedSearchResponse.php
rename to src/Core/Response/PagedSearchResponse.php
diff --git a/src/Response/ResourceResponse.php b/src/Core/Response/ResourceResponse.php
similarity index 100%
rename from src/Response/ResourceResponse.php
rename to src/Core/Response/ResourceResponse.php
diff --git a/tests/fixtures/ManuelActivationStrategy.php b/tests/fixtures/ManuelActivationStrategy.php
new file mode 100644
index 0000000000..bc6646cfef
--- /dev/null
+++ b/tests/fixtures/ManuelActivationStrategy.php
@@ -0,0 +1,20 @@
+
+ */
+
+namespace Commercetools\Core\Fixtures;
+
+use Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
+
+class ManuelActivationStrategy implements ActivationStrategyInterface
+{
+ /**
+ * @inheritDoc
+ */
+ public function isHandlerActivated(array $record)
+ {
+ return false;
+ }
+
+}
diff --git a/tests/fixtures/TeamCityFormatter.php b/tests/fixtures/TeamCityFormatter.php
new file mode 100644
index 0000000000..218448f8d2
--- /dev/null
+++ b/tests/fixtures/TeamCityFormatter.php
@@ -0,0 +1,58 @@
+ "||",
+ "'" => "|'",
+ "\n" => "|n",
+ "\r" => "|r",
+ "[" => "|[",
+ "]" => "|]",
+ );
+
+ /**
+ * Return the JSON representation of a value
+ *
+ * @param mixed $data
+ * @param bool $ignoreErrors
+ * @throws \RuntimeException if encoding fails and errors are not ignored
+ * @return string
+ */
+ protected function toJson($data, $ignoreErrors = false)
+ {
+ $json = $this->jsonEncode($data);
+
+ if ($json == false) {
+ return parent::toJson($data, $ignoreErrors);
+ }
+
+ return $json;
+ }
+
+ private function jsonEncode($data)
+ {
+ return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function format(array $record)
+ {
+ if (isset($record['context']['responseBody']) &&
+ isset($record['context']['responseHeaders']['content-type']) &&
+ strpos(current($record['context']['responseHeaders']['content-type']), 'application/json') !== false
+ ) {
+ $record['context']['responseBody'] = json_decode((string)$record['context']['responseBody']);
+ }
+ $str = str_replace(array_keys(self::$REPLACEMENTS), array_values(self::$REPLACEMENTS), parent::format($record));
+
+ return sprintf(self::TC_FORMAT, $str, $record['level_name']);
+ }
+}
diff --git a/tests/fixtures/models.yaml b/tests/fixtures/models.yaml
index 7e5f517d72..54fcbba538 100644
--- a/tests/fixtures/models.yaml
+++ b/tests/fixtures/models.yaml
@@ -273,6 +273,7 @@ price:
- validUntil
- discounted
- custom
+ - tiers
customer:
domain: customer
diff --git a/tests/integration/ApiTestCase.php b/tests/integration/ApiTestCase.php
index 1e50e93cdb..d9da92f4dc 100644
--- a/tests/integration/ApiTestCase.php
+++ b/tests/integration/ApiTestCase.php
@@ -6,6 +6,8 @@
namespace Commercetools\Core;
use Cache\Adapter\Filesystem\FilesystemCachePool;
+use Commercetools\Core\Fixtures\ManuelActivationStrategy;
+use Commercetools\Core\Fixtures\TeamCityFormatter;
use Commercetools\Core\Model\Cart\Cart;
use Commercetools\Core\Model\Cart\CartDraft;
use Commercetools\Core\Model\CartDiscount\CartDiscount;
@@ -103,18 +105,23 @@
use Commercetools\Core\Request\Types\TypeDeleteRequest;
use Commercetools\Core\Request\Zones\ZoneCreateRequest;
use Commercetools\Core\Request\Zones\ZoneDeleteRequest;
+use GuzzleHttp\MessageFormatter;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
+use Monolog\Formatter\LineFormatter;
use Monolog\Handler\ErrorLogHandler;
+use Monolog\Handler\FingersCrossedHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
+use PHPUnit\Framework\TestCase;
use Psr\Log\LogLevel;
use Symfony\Component\Yaml\Yaml;
-class ApiTestCase extends \PHPUnit\Framework\TestCase
+class ApiTestCase extends TestCase
{
private static $testRun;
private static $client = [];
+ private static $errorHandler;
protected $cleanupRequests = [];
@@ -224,6 +231,9 @@ class ApiTestCase extends \PHPUnit\Framework\TestCase
public function setUp()
{
+ if (self::$errorHandler instanceof FingersCrossedHandler) {
+ self::$errorHandler->clear();
+ }
self::$testRun = md5(microtime());
}
@@ -241,6 +251,18 @@ public function tearDown()
$this->cleanup();
}
+ /**
+ * @inheritDoc
+ */
+ protected function onNotSuccessfulTest($e)
+ {
+ if (self::$errorHandler instanceof FingersCrossedHandler) {
+ self::$errorHandler->activate();
+ }
+ parent::onNotSuccessfulTest($e);
+ }
+
+
/**
* @param $scope
* @return Config
@@ -272,6 +294,9 @@ public function getClientConfig($scope)
'project' => $_SERVER['COMMERCETOOLS_PROJECT']
]);
}
+// if (getenv('TEAMCITY_FORMATTER') == "true") {
+// $config->setMessageFormatter(new MessageFormatter(self::TEAMCITY_LF));
+// }
$config->setContext($context);
$config->setScope($scope);
$config = $this->getAcceptEncoding($config);
@@ -282,20 +307,36 @@ public function getClientConfig($scope)
protected function getLogger()
{
if (is_null($this->logger)) {
+ if (file_exists(__DIR__ .'/requests.log')) {
+ file_put_contents(__DIR__ .'/requests.log', "");
+ }
$loggerOut = getenv('LOGGER_OUT');
$this->logger = new Logger('test');
if ($loggerOut == 'CLI') {
- $this->logger->pushHandler(new ErrorLogHandler());
+ $this->logger->pushHandler($this->getCliHandler());
} else {
- $this->logger->pushHandler(new StreamHandler(__DIR__ .'/requests.log', LogLevel::NOTICE));
+ $this->logger->pushHandler(new StreamHandler(__DIR__ .'/requests.log', LogLevel::INFO));
}
-
}
return $this->logger;
}
+ public function getCliHandler()
+ {
+ if (is_null(self::$errorHandler)) {
+ $handler = new ErrorLogHandler();
+ if (getenv("TEAMCITY_FORMATTER") == "true") {
+ $handler->setFormatter(new TeamCityFormatter());
+ $handler = new FingersCrossedHandler($handler, new ManuelActivationStrategy());
+ }
+ self::$errorHandler = $handler;
+ }
+
+ return self::$errorHandler;
+ }
+
protected function getCache()
{
if (is_null($this->cache)) {
@@ -606,10 +647,13 @@ protected function getProductDraft()
return $draft;
}
- protected function getProduct()
+ protected function getProduct(ProductDraft $draft = null)
{
if (is_null($this->product)) {
- $request = ProductCreateRequest::ofDraft($this->getProductDraft());
+ if (is_null($draft)) {
+ $draft = $this->getProductDraft();
+ }
+ $request = ProductCreateRequest::ofDraft($draft);
$response = $request->executeWithClient($this->getClient());
$product = $request->mapResponse($response);
$request = ProductUpdateRequest::ofIdAndVersion($product->getId(), $product->getVersion())
diff --git a/tests/integration/Cart/CartQueryRequestTest.php b/tests/integration/Cart/CartQueryRequestTest.php
index 0ca4bf3de8..686e731892 100644
--- a/tests/integration/Cart/CartQueryRequestTest.php
+++ b/tests/integration/Cart/CartQueryRequestTest.php
@@ -96,7 +96,7 @@ public function testGetByCustomerId()
$cart = $this->createCart($draft);
$request = CartByCustomerIdGetRequest::ofCustomerId($cart->getCustomerId());
- $response = $request->executeWithClient($this->getClient());
+ $response = $request->executeWithClient($this->getClient(), ['X-Vrap-Disable-Validation' => 'response']);
$result = $request->mapResponse($response);
$this->assertInstanceOf(Cart::class, $result);
diff --git a/tests/integration/Cart/CartUpdateRequestTest.php b/tests/integration/Cart/CartUpdateRequestTest.php
index a18751a5a1..598136d3cd 100644
--- a/tests/integration/Cart/CartUpdateRequestTest.php
+++ b/tests/integration/Cart/CartUpdateRequestTest.php
@@ -23,6 +23,8 @@
use Commercetools\Core\Model\Common\Money;
use Commercetools\Core\Model\Common\MoneyCollection;
use Commercetools\Core\Model\Common\PriceDraft;
+use Commercetools\Core\Model\Common\PriceTier;
+use Commercetools\Core\Model\Common\PriceTierCollection;
use Commercetools\Core\Model\CustomField\CustomFieldObject;
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraft;
use Commercetools\Core\Model\CustomField\FieldContainer;
@@ -1161,6 +1163,98 @@ public function testAutomaticDelete()
$this->assertSame(2, $cart->getDeleteDaysAfterLastModification());
}
+ public function testPriceTiersOnAddLineItem()
+ {
+ $productDraft = $this->getProductDraft();
+ $productDraft->getMasterVariant()->getPrices()->current()->setTiers(PriceTierCollection::of()
+ ->add(
+ PriceTier::of()->setValue(Money::ofCurrencyAndAmount('EUR', 10))->setMinimumQuantity(2)
+ )
+ ->add(
+ PriceTier::of()->setValue(Money::ofCurrencyAndAmount('EUR', 1))->setMinimumQuantity(3)
+ )
+ );
+ $product = $this->getProduct($productDraft);
+ $variant = $product->getMasterData()->getCurrent()->getMasterVariant();
+
+ $draft = $this->getDraft();
+ $draft->setLineItems(
+ LineItemDraftCollection::of()
+ ->add(LineItemDraft::of()->setProductId($product->getId())->setVariantId($variant->getId())->setQuantity(1))
+ );
+ $cart = $this->createCart($draft);
+
+ $this->deleteRequest->setVersion($cart->getVersion());
+
+ $this->assertSame($product->getId(), $cart->getLineItems()->current()->getProductId());
+ $this->assertSame(
+ $product->getProductType()->getId(),
+ $cart->getLineItems()->current()->getProductType()->getId()
+ );
+ $this->assertSame(
+ 100,
+ $cart->getLineItems()->current()->getPrice()->getValue()->getCentAmount()
+ );
+
+ $request = CartUpdateRequest::ofIdAndVersion($cart->getId(), $cart->getVersion())
+ ->addAction(
+ CartAddLineItemAction::ofProductIdVariantIdAndQuantity($product->getId(), $variant->getId(), 1)
+ );
+
+ $response = $request->executeWithClient($this->getClient());
+ $cart = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($cart->getVersion());
+
+ $this->assertSame($product->getId(), $cart->getLineItems()->current()->getProductId());
+ $this->assertSame(
+ $product->getProductType()->getId(),
+ $cart->getLineItems()->current()->getProductType()->getId()
+ );
+ $this->assertSame(
+ 10,
+ $cart->getLineItems()->current()->getPrice()->getValue()->getCentAmount()
+ );
+
+ $request = CartUpdateRequest::ofIdAndVersion($cart->getId(), $cart->getVersion())
+ ->addAction(
+ CartChangeLineItemQuantityAction::ofLineItemIdAndQuantity($cart->getLineItems()->current()->getId(), 3)
+ )
+ ;
+ $response = $request->executeWithClient($this->getClient());
+ $cart = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($cart->getVersion());
+ $this->assertSame(3, $cart->getLineItems()->current()->getQuantity());
+ $this->assertSame(
+ 1,
+ $cart->getLineItems()->current()->getPrice()->getValue()->getCentAmount()
+ );
+
+ $request = CartUpdateRequest::ofIdAndVersion($cart->getId(), $cart->getVersion())
+ ->addAction(
+ CartRemoveLineItemAction::ofLineItemId($cart->getLineItems()->current()->getId())->setQuantity(1)
+ )
+ ;
+ $response = $request->executeWithClient($this->getClient());
+ $cart = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($cart->getVersion());
+
+ $this->assertSame(2, $cart->getLineItems()->current()->getQuantity());
+ $this->assertSame(
+ 10,
+ $cart->getLineItems()->current()->getPrice()->getValue()->getCentAmount()
+ );
+
+ $request = CartUpdateRequest::ofIdAndVersion($cart->getId(), $cart->getVersion())
+ ->addAction(
+ CartRemoveLineItemAction::ofLineItemId($cart->getLineItems()->current()->getId())
+ )
+ ;
+ $response = $request->executeWithClient($this->getClient());
+ $cart = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($cart->getVersion());
+ $this->assertCount(0, $cart->getLineItems());
+ }
+
/**
* @return CartDraft
*/
diff --git a/tests/integration/CartDiscount/CartDiscountUpdateRequestTest.php b/tests/integration/CartDiscount/CartDiscountUpdateRequestTest.php
index 8f809d882e..ccb0e1e9dc 100644
--- a/tests/integration/CartDiscount/CartDiscountUpdateRequestTest.php
+++ b/tests/integration/CartDiscount/CartDiscountUpdateRequestTest.php
@@ -49,6 +49,7 @@ public function testChangeValue()
;
$response = $request->executeWithClient($this->getClient());
$result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
$this->assertInstanceOf(CartDiscount::class, $result);
$this->assertSame(
@@ -56,12 +57,6 @@ public function testChangeValue()
$result->getValue()->getMoney()->current()->getCentAmount()
);
$this->assertNotSame($cartDiscount->getVersion(), $result->getVersion());
-
- $deleteRequest = array_pop($this->cleanupRequests);
- $deleteRequest->setVersion($result->getVersion());
- $result = $this->getClient()->execute($deleteRequest)->toObject();
-
- $this->assertInstanceOf(CartDiscount::class, $result);
}
public function testChangeCartPredicate()
@@ -81,16 +76,11 @@ public function testChangeCartPredicate()
;
$response = $request->executeWithClient($this->getClient());
$result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
$this->assertInstanceOf(CartDiscount::class, $result);
$this->assertSame($predicate, $result->getCartPredicate());
$this->assertNotSame($cartDiscount->getVersion(), $result->getVersion());
-
- $deleteRequest = array_pop($this->cleanupRequests);
- $deleteRequest->setVersion($result->getVersion());
- $result = $this->getClient()->execute($deleteRequest)->toObject();
-
- $this->assertInstanceOf(CartDiscount::class, $result);
}
public function testChangeTarget()
@@ -110,16 +100,11 @@ public function testChangeTarget()
;
$response = $request->executeWithClient($this->getClient());
$result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
$this->assertInstanceOf(CartDiscount::class, $result);
$this->assertSame($target->getPredicate(), $result->getTarget()->getPredicate());
$this->assertNotSame($cartDiscount->getVersion(), $result->getVersion());
-
- $deleteRequest = array_pop($this->cleanupRequests);
- $deleteRequest->setVersion($result->getVersion());
- $result = $this->getClient()->execute($deleteRequest)->toObject();
-
- $this->assertInstanceOf(CartDiscount::class, $result);
}
public function testChangeIsActive()
@@ -139,16 +124,11 @@ public function testChangeIsActive()
;
$response = $request->executeWithClient($this->getClient());
$result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
$this->assertInstanceOf(CartDiscount::class, $result);
$this->assertSame($isActive, $result->getIsActive());
$this->assertNotSame($cartDiscount->getVersion(), $result->getVersion());
-
- $deleteRequest = array_pop($this->cleanupRequests);
- $deleteRequest->setVersion($result->getVersion());
- $result = $this->getClient()->execute($deleteRequest)->toObject();
-
- $this->assertInstanceOf(CartDiscount::class, $result);
}
public function testChangeName()
@@ -166,16 +146,11 @@ public function testChangeName()
;
$response = $request->executeWithClient($this->getClient());
$result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
$this->assertInstanceOf(CartDiscount::class, $result);
$this->assertSame($name->en, $result->getName()->en);
$this->assertNotSame($cartDiscount->getVersion(), $result->getVersion());
-
- $deleteRequest = array_pop($this->cleanupRequests);
- $deleteRequest->setVersion($result->getVersion());
- $result = $this->getClient()->execute($deleteRequest)->toObject();
-
- $this->assertInstanceOf(CartDiscount::class, $result);
}
public function testSetDescription()
@@ -193,16 +168,11 @@ public function testSetDescription()
;
$response = $request->executeWithClient($this->getClient());
$result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
$this->assertInstanceOf(CartDiscount::class, $result);
$this->assertSame($description->en, $result->getDescription()->en);
$this->assertNotSame($cartDiscount->getVersion(), $result->getVersion());
-
- $deleteRequest = array_pop($this->cleanupRequests);
- $deleteRequest->setVersion($result->getVersion());
- $result = $this->getClient()->execute($deleteRequest)->toObject();
-
- $this->assertInstanceOf(CartDiscount::class, $result);
}
public function testChangeSortOrder()
@@ -220,16 +190,11 @@ public function testChangeSortOrder()
;
$response = $request->executeWithClient($this->getClient());
$result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
$this->assertInstanceOf(CartDiscount::class, $result);
$this->assertSame($sortOrder, $result->getSortOrder());
$this->assertNotSame($cartDiscount->getVersion(), $result->getVersion());
-
- $deleteRequest = array_pop($this->cleanupRequests);
- $deleteRequest->setVersion($result->getVersion());
- $result = $this->getClient()->execute($deleteRequest)->toObject();
-
- $this->assertInstanceOf(CartDiscount::class, $result);
}
public function testChangeRequiresDiscountCode()
@@ -247,16 +212,11 @@ public function testChangeRequiresDiscountCode()
;
$response = $request->executeWithClient($this->getClient());
$result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
$this->assertInstanceOf(CartDiscount::class, $result);
$this->assertEquals($requiresDiscountCode, $result->getRequiresDiscountCode());
$this->assertNotSame($cartDiscount->getVersion(), $result->getVersion());
-
- $deleteRequest = array_pop($this->cleanupRequests);
- $deleteRequest->setVersion($result->getVersion());
- $result = $this->getClient()->execute($deleteRequest)->toObject();
-
- $this->assertInstanceOf(CartDiscount::class, $result);
}
public function testSetValidFrom()
@@ -274,16 +234,12 @@ public function testSetValidFrom()
;
$response = $request->executeWithClient($this->getClient());
$result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
$this->assertInstanceOf(CartDiscount::class, $result);
- $this->assertEquals($validFrom, $result->getValidFrom()->getDateTime());
+ $validFrom->setTimezone(new \DateTimeZone('UTC'));
+ $this->assertSame($validFrom->format('c'), $result->getValidFrom()->format('c'));
$this->assertNotSame($cartDiscount->getVersion(), $result->getVersion());
-
- $deleteRequest = array_pop($this->cleanupRequests);
- $deleteRequest->setVersion($result->getVersion());
- $result = $this->getClient()->execute($deleteRequest)->toObject();
-
- $this->assertInstanceOf(CartDiscount::class, $result);
}
public function testSetValidUntil()
@@ -292,25 +248,21 @@ public function testSetValidUntil()
$cartDiscount = $this->createCartDiscount($draft);
- $validFrom = new \DateTime();
+ $validUntil = new \DateTime();
$request = CartDiscountUpdateRequest::ofIdAndVersion(
$cartDiscount->getId(),
$cartDiscount->getVersion()
)
- ->addAction(CartDiscountSetValidUntilAction::of()->setValidUntil($validFrom))
+ ->addAction(CartDiscountSetValidUntilAction::of()->setValidUntil($validUntil))
;
$response = $request->executeWithClient($this->getClient());
$result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
$this->assertInstanceOf(CartDiscount::class, $result);
- $this->assertEquals($validFrom, $result->getValidUntil()->getDateTime());
+ $validUntil->setTimezone(new \DateTimeZone('UTC'));
+ $this->assertSame($validUntil->format('c'), $result->getValidUntil()->format('c'));
$this->assertNotSame($cartDiscount->getVersion(), $result->getVersion());
-
- $deleteRequest = array_pop($this->cleanupRequests);
- $deleteRequest->setVersion($result->getVersion());
- $result = $this->getClient()->execute($deleteRequest)->toObject();
-
- $this->assertInstanceOf(CartDiscount::class, $result);
}
/**
* @param $name
@@ -338,7 +290,7 @@ protected function createCartDiscount(CartDiscountDraft $draft)
$request = CartDiscountCreateRequest::ofDraft($draft);
$response = $request->executeWithClient($this->getClient());
$cartDiscount = $request->mapResponse($response);
- $this->cleanupRequests[] = CartDiscountDeleteRequest::ofIdAndVersion(
+ $this->cleanupRequests[] = $this->deleteRequest = CartDiscountDeleteRequest::ofIdAndVersion(
$cartDiscount->getId(),
$cartDiscount->getVersion()
);
diff --git a/tests/integration/Errors/ErrorResponseTest.php b/tests/integration/Errors/ErrorResponseTest.php
index f583bbbb29..f872fa6c6e 100644
--- a/tests/integration/Errors/ErrorResponseTest.php
+++ b/tests/integration/Errors/ErrorResponseTest.php
@@ -21,6 +21,7 @@
use Commercetools\Core\Error\DuplicateFieldError;
use Commercetools\Core\Error\DuplicatePriceScopeError;
use Commercetools\Core\Error\DuplicateVariantValuesError;
+use Commercetools\Core\Error\ErrorContainer;
use Commercetools\Core\Error\InsufficientScopeError;
use Commercetools\Core\Error\InvalidCredentialsError;
use Commercetools\Core\Error\InvalidCurrentPasswordError;
@@ -53,7 +54,9 @@
use Commercetools\Core\Request\Products\ProductUpdateRequest;
use Commercetools\Core\Request\ProductTypes\Command\ProductTypeAddAttributeDefinitionAction;
use Commercetools\Core\Request\ProductTypes\ProductTypeUpdateRequest;
+use Commercetools\Core\Request\PsrRequest;
use Commercetools\Core\Response\ErrorResponse;
+use GuzzleHttp\Psr7\Request;
use Psr\Cache\CacheItemPoolInterface;
class ErrorResponseTest extends ApiTestCase
@@ -672,4 +675,22 @@ public function testAccessDenied()
);
$this->assertSame(AccessDeniedError::CODE, $error->getCode());
}
+
+ public function testEmptyPost()
+ {
+ $psrRequest = new Request('POST', '/');
+
+ $request = PsrRequest::ofRequest($psrRequest);
+ $client = $this->getClient();
+ $response = $client->execute($request);
+
+ /**
+ * @var ErrorResponse $response
+ */
+ $this->assertInstanceOf(ErrorResponse::class, $response);
+ $this->assertSame(405, $response->getStatusCode());
+ $this->assertInstanceOf(ErrorContainer::class, $response->getErrors());
+ $this->assertEmpty($response->getErrors());
+ $this->assertSame('Method Not Allowed', $response->getMessage());
+ }
}
diff --git a/tests/integration/Inventory/InventoryUpdateRequestTest.php b/tests/integration/Inventory/InventoryUpdateRequestTest.php
index f326692225..fde323805b 100644
--- a/tests/integration/Inventory/InventoryUpdateRequestTest.php
+++ b/tests/integration/Inventory/InventoryUpdateRequestTest.php
@@ -136,7 +136,8 @@ public function testSetExpectedDelivery()
$result = $request->mapResponse($response);
$this->assertInstanceOf(InventoryEntry::class, $result);
- $this->assertEquals($expectedDelivery, $result->getExpectedDelivery()->getDateTime());
+ $expectedDelivery->setTimezone(new \DateTimeZone('UTC'));
+ $this->assertEquals($expectedDelivery->format('c'), $result->getExpectedDelivery()->getDateTime()->format('c'));
$this->assertNotSame($inventory->getVersion(), $result->getVersion());
$this->deleteRequest->setVersion($result->getVersion());
@@ -206,7 +207,7 @@ public function testQueryChannels()
} while ($result->count() == 0 && $retries <= 20);
if ($result->count() == 0) {
- $this->markTestSkipped('Product availability not updated in time');
+ $this->markTestSkipped('Product not updated in time');
}
$retries = 0;
@@ -222,6 +223,10 @@ public function testQueryChannels()
$result = $request->mapResponse($response);
} while ($result->count() == 0 && $retries <= 9);
+ if ($result->count() == 0) {
+ $this->markTestSkipped('Product channel availability not updated in time');
+ }
+
$this->assertSame(
$product->getId(),
$result->current()->getId()
@@ -297,7 +302,7 @@ public function testSetCustomField()
$typeKey = 'type-' . $this->getTestRun();
$type = $this->getType($typeKey, 'inventory-entry');
- $draft = $this->getDraft('set-custom-type');
+ $draft = $this->getDraft('set-custom-field');
$draft->setCustom(CustomFieldObject::of()->setType(TypeReference::ofKey($typeKey)));
$inventory = $this->createInventory($draft);
diff --git a/tests/integration/Order/OrderUpdateRequestTest.php b/tests/integration/Order/OrderUpdateRequestTest.php
index eb49878971..78c930942f 100644
--- a/tests/integration/Order/OrderUpdateRequestTest.php
+++ b/tests/integration/Order/OrderUpdateRequestTest.php
@@ -179,7 +179,9 @@ public function testUpdateSyncInfo()
$this->assertNotSame($order->getVersion(), $result->getVersion());
$this->assertInstanceOf(Order::class, $result);
$this->assertSame($channel->getId(), $result->getSyncInfo()->current()->getChannel()->getId());
- $this->assertEquals($syncedAt, $result->getSyncInfo()->current()->getSyncedAt()->getDateTime());
+ $syncedAt->setTimezone(new \DateTimeZone('UTC'));
+ $this->assertSame($syncedAt->format('c'), $result->getSyncInfo()->current()->getSyncedAt()->getDateTime()->format('c'));
+
}
public function testReturnInfo()
diff --git a/tests/integration/Payment/PaymentUpdateRequestTest.php b/tests/integration/Payment/PaymentUpdateRequestTest.php
index 24d7ff1191..33fff9264f 100644
--- a/tests/integration/Payment/PaymentUpdateRequestTest.php
+++ b/tests/integration/Payment/PaymentUpdateRequestTest.php
@@ -172,7 +172,8 @@ public function testSetAuthorization()
$this->assertInstanceOf(Payment::class, $result);
$this->assertSame($amount->getCentAmount(), $result->getAmountAuthorized()->getCentAmount());
- $this->assertEquals($authTime, $result->getAuthorizedUntil()->getDateTime());
+ $authTime->setTimezone(new \DateTimeZone('UTC'));
+ $this->assertSame($authTime->format('c'), $result->getAuthorizedUntil()->format('c'));
$this->assertNotSame($payment->getVersion(), $result->getVersion());
}
@@ -421,7 +422,8 @@ public function testTransactions()
$this->deleteRequest->setVersion($result->getVersion());
$this->assertInstanceOf(Payment::class, $result);
- $this->assertEquals($timestamp, $result->getTransactions()->current()->getTimestamp()->getDateTime());
+ $timestamp->setTimezone(new \DateTimeZone('UTC'));
+ $this->assertSame($timestamp->format('c'), $result->getTransactions()->current()->getTimestamp()->getDateTime()->format('c'));
$this->assertNotSame($payment->getVersion(), $result->getVersion());
$payment = $result;
$transaction = $payment->getTransactions()->current();
diff --git a/tests/integration/Product/ProductImageUploadRequestTest.php b/tests/integration/Product/ProductImageUploadRequestTest.php
index 277751de4c..c6993c3939 100644
--- a/tests/integration/Product/ProductImageUploadRequestTest.php
+++ b/tests/integration/Product/ProductImageUploadRequestTest.php
@@ -27,7 +27,7 @@ public function testUploadByVariantId()
$mimeType = finfo_file($fInfo, $fileName);
$file = new UploadedFile($fileName, filesize($fileName), UPLOAD_ERR_OK, $fileAlias, $mimeType);
-
+
$request = ProductImageUploadRequest::ofIdVariantIdAndFile(
$product->getId(), $product->getMasterData()->getCurrent()->getMasterVariant()->getId(),
$file
@@ -64,7 +64,7 @@ public function testUploadBySku()
$file = new UploadedFile($fileName, filesize($fileName), UPLOAD_ERR_OK, $fileAlias, $mimeType);
- $request = ProductImageUploadRequest::ofIdVariantIdAndFile(
+ $request = ProductImageUploadRequest::ofIdSkuAndFile(
$product->getId(), $product->getMasterData()->getCurrent()->getMasterVariant()->getSku(),
$file
);
@@ -101,21 +101,21 @@ public function testImageReorderSamePosition()
$file2 = new UploadedFile($fileName, filesize($fileName), UPLOAD_ERR_OK, '2', $mimeType);
$file3 = new UploadedFile($fileName, filesize($fileName), UPLOAD_ERR_OK, '3', $mimeType);
- $request = ProductImageUploadRequest::ofIdVariantIdAndFile(
+ $request = ProductImageUploadRequest::ofIdSkuAndFile(
$product->getId(), $product->getMasterData()->getCurrent()->getMasterVariant()->getSku(),
$file1
);
$response = $request->executeWithClient($this->getClient());
$this->product = $product = $request->mapResponse($response);
- $request = ProductImageUploadRequest::ofIdVariantIdAndFile(
+ $request = ProductImageUploadRequest::ofIdSkuAndFile(
$product->getId(), $product->getMasterData()->getCurrent()->getMasterVariant()->getSku(),
$file2
);
$response = $request->executeWithClient($this->getClient());
$this->product = $product = $request->mapResponse($response);
- $request = ProductImageUploadRequest::ofIdVariantIdAndFile(
+ $request = ProductImageUploadRequest::ofIdSkuAndFile(
$product->getId(), $product->getMasterData()->getCurrent()->getMasterVariant()->getSku(),
$file3
);
@@ -179,21 +179,21 @@ public function testImageReorder()
$file2 = new UploadedFile($fileName, filesize($fileName), UPLOAD_ERR_OK, '2', $mimeType);
$file3 = new UploadedFile($fileName, filesize($fileName), UPLOAD_ERR_OK, '3', $mimeType);
- $request = ProductImageUploadRequest::ofIdVariantIdAndFile(
+ $request = ProductImageUploadRequest::ofIdSkuAndFile(
$product->getId(), $product->getMasterData()->getCurrent()->getMasterVariant()->getSku(),
$file1
);
$response = $request->executeWithClient($this->getClient());
$this->product = $product = $request->mapResponse($response);
- $request = ProductImageUploadRequest::ofIdVariantIdAndFile(
+ $request = ProductImageUploadRequest::ofIdSkuAndFile(
$product->getId(), $product->getMasterData()->getCurrent()->getMasterVariant()->getSku(),
$file2
);
$response = $request->executeWithClient($this->getClient());
$this->product = $product = $request->mapResponse($response);
- $request = ProductImageUploadRequest::ofIdVariantIdAndFile(
+ $request = ProductImageUploadRequest::ofIdSkuAndFile(
$product->getId(), $product->getMasterData()->getCurrent()->getMasterVariant()->getSku(),
$file3
);
diff --git a/tests/integration/Product/ProductUpdateRequestTest.php b/tests/integration/Product/ProductUpdateRequestTest.php
index bc2772df3b..315b8c4af7 100644
--- a/tests/integration/Product/ProductUpdateRequestTest.php
+++ b/tests/integration/Product/ProductUpdateRequestTest.php
@@ -75,6 +75,22 @@
class ProductUpdateRequestTest extends ApiTestCase
{
+ private $productId;
+
+ public function tearDown()
+ {
+ $request = ProductUpdateRequest::ofIdAndVersion($this->productId, $this->deleteRequest->getVersion())
+ ->addAction(ProductUnpublishAction::of())
+ ;
+ $response = $request->executeWithClient($this->getClient());
+ if (!$response->isError()) {
+ $result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
+ }
+
+ parent::tearDown();
+ }
+
public function testCreatePublish()
{
$draft = $this->getDraft('create-publish');
@@ -1500,6 +1516,8 @@ public function testSetDiscountedPriceWithCart()
$result = $request->mapResponse($response);
$this->deleteRequest->setVersion($result->getVersion());
+ sleep(1);
+
$this->assertInstanceOf(Product::class, $result);
$this->assertNotSame($product->getVersion(), $result->getVersion());
@@ -1516,13 +1534,6 @@ public function testSetDiscountedPriceWithCart()
);
$cart = $this->getCart($cartDraft);
$this->assertSame(900, $cart->getTotalPrice()->getCentAmount());
-
- $request = ProductUpdateRequest::ofIdAndVersion($result->getId(), $result->getVersion())
- ->addAction(ProductUnpublishAction::of())
- ;
- $response = $request->executeWithClient($this->getClient());
- $result = $request->mapResponse($response);
- $this->deleteRequest->setVersion($result->getVersion());
}
/**
@@ -1549,6 +1560,7 @@ protected function createProduct(ProductDraft $draft)
$product->getId(),
$product->getVersion()
);
+ $this->productId = $product->getId();
return $product;
}
diff --git a/tests/integration/ShippingMethod/ShippingMethodQueryRequestTest.php b/tests/integration/ShippingMethod/ShippingMethodQueryRequestTest.php
index 054734e45e..4738993e8a 100644
--- a/tests/integration/ShippingMethod/ShippingMethodQueryRequestTest.php
+++ b/tests/integration/ShippingMethod/ShippingMethodQueryRequestTest.php
@@ -92,7 +92,7 @@ public function testByLocation()
$shippingMethod = $this->createShippingMethod($draft);
$request = ShippingMethodByLocationGetRequest::ofCountry('DE')->withState($this->getRegion());
- $response = $request->executeWithClient($this->getClient());
+ $response = $request->executeWithClient($this->getClient(), ['X-Vrap-Disable-Validation' => 'response']);
$result = $request->mapResponse($response);
$this->assertInstanceOf(ShippingMethodCollection::class, $result);
diff --git a/tests/integration/ShoppingList/ShoppingListUpdateRequestTest.php b/tests/integration/ShoppingList/ShoppingListUpdateRequestTest.php
index f291a90d5a..8e3afd5911 100644
--- a/tests/integration/ShoppingList/ShoppingListUpdateRequestTest.php
+++ b/tests/integration/ShoppingList/ShoppingListUpdateRequestTest.php
@@ -39,6 +39,7 @@
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetCustomerAction;
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetCustomFieldAction;
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetCustomTypeAction;
+use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetDeleteDaysAfterLastModificationAction;
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetDescriptionAction;
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetKeyAction;
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetLineItemCustomFieldAction;
@@ -486,4 +487,20 @@ public function testSetTextLineItemCustomField()
$this->assertInstanceOf(ShoppingList::class, $result);
$this->assertSame($fieldValue, $result->getTextLineItems()->current()->getCustom()->getFields()->getTestField());
}
+ public function testSetDeleteDaysAfterLastModification()
+ {
+ $draft = $this->getDraft('set-delete-days-after-last-modification');
+ $shoppingList = $this->createShoppingList($draft);
+
+ $days = 5;
+ $request = ShoppingListUpdateRequest::ofIdAndVersion($shoppingList->getId(), $shoppingList->getVersion())
+ ->addAction(ShoppingListSetDeleteDaysAfterLastModificationAction::of()->setDeleteDaysAfterLastModification($days))
+ ;
+ $response = $request->executeWithClient($this->getClient());
+ $result = $request->mapResponse($response);
+ $this->deleteRequest->setVersion($result->getVersion());
+
+ $this->assertInstanceOf(ShoppingList::class, $result);
+ $this->assertSame($days, $result->getDeleteDaysAfterLastModification());
+ }
}
diff --git a/tests/unit/ClientTest.php b/tests/unit/ClientTest.php
index 52e341304f..93838db3d1 100644
--- a/tests/unit/ClientTest.php
+++ b/tests/unit/ClientTest.php
@@ -9,6 +9,7 @@
use Commercetools\Core\Client\OAuth\Manager;
use Commercetools\Core\Error\BadGatewayException;
use Commercetools\Core\Error\ConcurrentModificationException;
+use Commercetools\Core\Error\ErrorContainer;
use Commercetools\Core\Error\ErrorResponseException;
use Commercetools\Core\Error\GatewayTimeoutException;
use Commercetools\Core\Error\InternalServerErrorException;
@@ -25,6 +26,7 @@
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Middleware;
+use GuzzleHttp\Psr7\BufferStream;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Subscriber\History;
@@ -33,6 +35,7 @@
use Commercetools\Core\Client\JsonEndpoint;
use Commercetools\Core\Client\OAuth\Token;
use Commercetools\Core\Request\ClientRequestInterface;
+use Psr\Log\LogLevel;
class ClientTest extends \PHPUnit\Framework\TestCase
{
@@ -56,7 +59,7 @@ protected function getConfig()
* @param array $headers
* @return Client
*/
- protected function getMockClient($config, $returnValue, $statusCode = 200, $logger = null, $headers = [])
+ protected function getMockClient($config, $returnValue, $statusCode = 200, $logger = null, $headers = [], $reason = null)
{
$oauthMockBuilder = $this->getMockBuilder(Manager::class);
$oauthMockBuilder->setMethods(['getToken', 'refreshToken'])->setConstructorArgs([$config]);
@@ -78,34 +81,18 @@ protected function getMockClient($config, $returnValue, $statusCode = 200, $logg
->will($this->returnValue($oauthMock));
if (version_compare(HttpClient::VERSION, '6.0.0', '>=')) {
- $mockBodyClass = '\GuzzleHttp\Psr7\BufferStream';
- $mockFactory = false;
- $responseClass = '\GuzzleHttp\Psr7\Response';
+ $mockFactory = 'createResponseGuzzle6';
} else {
- $mockBodyClass = '\GuzzleHttp\Stream\Stream';
- $mockFactory = 'factory';
- $responseClass = '\GuzzleHttp\Message\Response';
+ $mockFactory = 'createResponseGuzzle5';
}
$responses = [];
if (is_array($returnValue)) {
foreach ($returnValue as $value) {
- if ($mockFactory) {
- $mockBody = $mockBodyClass::$mockFactory($value);
- } else {
- $mockBody = new $mockBodyClass();
- $mockBody->write($value);
- }
- $responses[] = new $responseClass($statusCode, $headers, $mockBody);
+ $responses[] = $this->$mockFactory($statusCode, $headers, $value, $reason);
}
} else {
- if ($mockFactory) {
- $mockBody = $mockBodyClass::$mockFactory($returnValue);
- } else {
- $mockBody = new $mockBodyClass();
- $mockBody->write($returnValue);
- }
- $responses[] = new $responseClass($statusCode, $headers, $mockBody);
+ $responses[] = $this->$mockFactory($statusCode, $headers, $returnValue, $reason);
}
if (version_compare(HttpClient::VERSION, '6.0.0', '>=')) {
@@ -123,6 +110,21 @@ protected function getMockClient($config, $returnValue, $statusCode = 200, $logg
return $clientMock;
}
+ protected function createResponseGuzzle6($statusCode, $headers, $body, $reason = null, $version = '1.1')
+ {
+ $stream = new BufferStream();
+ $stream->write($body);
+ $response = new Response($statusCode, $headers, $stream, $version, $reason);
+ return $response;
+ }
+
+ protected function createResponseGuzzle5($statusCode, $headers, $body, $reason = null, $version = '1.1')
+ {
+ $mockBody = \GuzzleHttp\Stream\Stream::factory($body);
+ $response = new \GuzzleHttp\Message\Response($statusCode, $headers, $mockBody, ['reason_phrase' => $reason, 'protocol_version' => $version]);
+ return $response;
+ }
+
/**
* @return string
*/
@@ -297,7 +299,30 @@ public function testLogger()
$this->assertTrue($handler->hasInfo($record));
$this->assertContains('GET /project/test/id', (string)$record['message']);
- $this->assertSame(200, $record['level']);
+ $this->assertSame(Logger::INFO, $record['level']);
+ }
+
+ public function testLogLevel()
+ {
+ $handler = new TestHandler();
+ $logger = new Logger('test');
+ $logger->pushHandler($handler);
+ $config =$this->getConfig();
+ $config = $config->setLogLevel(LogLevel::DEBUG);
+
+ $client = $this->getMockClient($config, $this->getSingleOpResult(), 200, $logger);
+
+ $endpoint = new JsonEndpoint('test');
+ $request = $this->getMockForAbstractClass(
+ AbstractByIdGetRequest::class,
+ [$endpoint, 'id']
+ );
+ $client->execute($request);
+
+ $record = current($handler->getRecords());
+ $this->assertTrue($handler->hasDebug($record));
+ $this->assertContains('GET /project/test/id', (string)$record['message']);
+ $this->assertSame(Logger::DEBUG, $record['level']);
}
public function testFutureLogger()
@@ -320,7 +345,7 @@ public function testFutureLogger()
$record = current($handler->getRecords());
$this->assertTrue($handler->hasInfo($record));
$this->assertContains('GET /project/test/id', (string)$record['message']);
- $this->assertSame(200, $record['level']);
+ $this->assertSame(Logger::INFO, $record['level']);
}
public function testBatch()
@@ -708,4 +733,59 @@ public function testUserAgent()
}
}
+
+ public function testHtmlBody()
+ {
+ $handler = new TestHandler();
+ $logger = new Logger('test');
+ $logger->pushHandler($handler);
+
+ $errorBody = '
+
+
+
+
+
Error 411 (Length Required)!!1
+
+
+
411. That’s an error.
+
POST requests require a Content-length
header. That’s all we know.';
+ $client = $this->getMockClient(
+ $this->getConfig(),
+ $errorBody,
+ 411,
+ $logger,
+ [],
+ 'Length Required'
+ );
+
+ $endpoint = new JsonEndpoint('test');
+ /**
+ * @var ClientRequestInterface $request
+ */
+ $request = $this->getMockForAbstractClass(
+ AbstractByIdGetRequest::class,
+ [$endpoint, 'id']
+ );
+ /**
+ * @var ErrorResponse $response
+ */
+ $response = $client->execute($request);
+
+ $logEntry = $handler->getRecords()[1];
+ $this->assertSame(Logger::ERROR, $logEntry['level']);
+ $this->assertSame(
+ 'Client error response [url] test/id [status code] 411 [reason phrase] Length Required',
+ (string)$logEntry['message']
+ );
+
+ $this->assertInstanceOf(ErrorResponse::class, $response);
+ $this->assertSame(411, $response->getStatusCode());
+ $this->assertInstanceOf(ErrorContainer::class, $response->getErrors());
+ $this->assertEmpty($response->getErrors());
+ $this->assertSame('Length Required', $response->getMessage());
+
+ }
}
diff --git a/tests/unit/Model/Common/CollectionTest.php b/tests/unit/Model/Common/CollectionTest.php
index d60d327651..85945a2478 100644
--- a/tests/unit/Model/Common/CollectionTest.php
+++ b/tests/unit/Model/Common/CollectionTest.php
@@ -235,4 +235,17 @@ public function testAdd()
$this->assertCount(2, $collection);
}
+
+ public function testUnsetIterator()
+ {
+ $collection = Collection::fromArray([1]);
+ $collection[] = 2;
+ unset($collection[0]);
+
+ $this->assertCount(1, $collection);
+ $collection->rewind();
+ $this->assertSame(1, $collection->key());
+ $this->assertSame(2, $collection->current());
+ $this->assertJsonStringEqualsJsonString('[2]', json_encode($collection));
+ }
}
diff --git a/tests/unit/Model/Product/LocalizedSearchKeywordsTest.php b/tests/unit/Model/Product/LocalizedSearchKeywordsTest.php
index fe8a8515bd..83a10ab627 100644
--- a/tests/unit/Model/Product/LocalizedSearchKeywordsTest.php
+++ b/tests/unit/Model/Product/LocalizedSearchKeywordsTest.php
@@ -95,4 +95,25 @@ public function testFromArray()
$this->assertSame('Hello World', $keywords->en->getAt(0)->getText());
$this->assertSame('custom', $keywords->de->getAt(1)->getSuggestTokenizer()->getType());
}
+
+ public function testUnsetIterator()
+ {
+ $keywords = LocalizedSearchKeywords::fromArray(
+ [
+ 'de' => [
+ ['text'=>'Hallo Welt'],
+ ],
+ 'en' => [
+ ['text' => 'Hello World'],
+ ],
+ ],
+ Context::of()->setLanguages(['de', 'en'])
+ );
+ unset($keywords['de']);
+
+ $this->assertCount(1, $keywords);
+ $keywords->rewind();
+ $this->assertSame('en', $keywords->key());
+ $this->assertJsonStringEqualsJsonString('{"en": [{"text": "Hello World"}]}', json_encode($keywords));
+ }
}
diff --git a/tests/unit/Model/Subscription/DeliveryTest.php b/tests/unit/Model/Subscription/DeliveryTest.php
new file mode 100644
index 0000000000..0e0aca0941
--- /dev/null
+++ b/tests/unit/Model/Subscription/DeliveryTest.php
@@ -0,0 +1,111 @@
+
+ */
+
+
+namespace Commercetools\Core\Model\Subscription;
+
+
+use Commercetools\Core\Model\Message\Message;
+use Commercetools\Core\Model\Message\ProductCreatedMessage;
+
+class DeliveryTest extends \PHPUnit\Framework\TestCase
+{
+
+ public function testGetGenericMessage()
+ {
+ $payload = [
+ 'projectKey' => 'test',
+ 'notificationType' => 'Message',
+ 'resource' => [
+ 'typeId' => 'product',
+ 'id' => '123465678'
+ ],
+ 'id' => 'abcdef',
+ 'version' => 1,
+ 'sequenceNumber' => 1,
+ 'resourceVersion' => 1,
+ ];
+
+ $delivery = Delivery::fromArray($payload);
+
+ $this->assertInstanceOf(MessageDelivery::class, $delivery);
+ $this->assertInstanceOf(Message::class, $delivery->getMessage());
+ }
+
+ public function testGetSpecificMessage()
+ {
+ $payload = [
+ 'projectKey' => 'test',
+ 'notificationType' => 'Message',
+ 'resource' => [
+ 'typeId' => 'product',
+ 'id' => '123465678'
+ ],
+ 'id' => 'abcdef',
+ 'version' => 1,
+ 'sequenceNumber' => 1,
+ 'resourceVersion' => 1,
+ 'type' => 'ProductCreated',
+ 'productProjection' => []
+ ];
+
+ $delivery = Delivery::fromArray($payload);
+
+ $this->assertInstanceOf(MessageDelivery::class, $delivery);
+ $this->assertInstanceOf(ProductCreatedMessage::class, $delivery->getMessage());
+ }
+
+ public function testResourceCreatedPayload()
+ {
+ $payload = [
+ 'projectKey' => 'test',
+ 'notificationType' => 'ResourceCreated',
+ 'resource' => [
+ 'typeId' => 'product',
+ 'id' => '123465678'
+ ],
+ 'version' => 1,
+ ];
+
+ $delivery = Delivery::fromArray($payload);
+
+ $this->assertInstanceOf(ResourceCreatedDelivery::class, $delivery);
+ }
+
+ public function testResourceUpdatedPayload()
+ {
+ $payload = [
+ 'projectKey' => 'test',
+ 'notificationType' => 'ResourceUpdated',
+ 'resource' => [
+ 'typeId' => 'product',
+ 'id' => '123465678'
+ ],
+ 'oldVersion' => 1,
+ 'version' => 2,
+ ];
+
+ $delivery = Delivery::fromArray($payload);
+
+ $this->assertInstanceOf(ResourceUpdatedDelivery::class, $delivery);
+ }
+
+ public function testResourceDeletedPayload()
+ {
+ $payload = [
+ 'projectKey' => 'test',
+ 'notificationType' => 'ResourceDeleted',
+ 'resource' => [
+ 'typeId' => 'product',
+ 'id' => '123465678'
+ ],
+ 'version' => 2,
+ ];
+
+ $delivery = Delivery::fromArray($payload);
+
+ $this->assertInstanceOf(ResourceDeletedDelivery::class, $delivery);
+ }
+}
diff --git a/tests/unit/Request/Products/ProductsSuggestRequestTest.php b/tests/unit/Request/Products/ProductsSuggestRequestTest.php
index 2a2ccaaea9..aa2886d196 100644
--- a/tests/unit/Request/Products/ProductsSuggestRequestTest.php
+++ b/tests/unit/Request/Products/ProductsSuggestRequestTest.php
@@ -46,6 +46,49 @@ public function testMapEmptyResult()
$this->assertEmpty($result->toArray());
}
+ public function fuzzyProvider()
+ {
+ return [
+ [true, 'fuzzy=true'],
+ [false, 'fuzzy=false'],
+ [-1, 'fuzzy=false'],
+ [ 0, 'fuzzy=false'],
+ [ 1, 'fuzzy=true&fuzzyLevel=1'],
+ [ 2, 'fuzzy=true&fuzzyLevel=2'],
+ [ 3, 'fuzzy=true&fuzzyLevel=2'],
+ ['1', 'fuzzy=true&fuzzyLevel=1'],
+ ];
+ }
+
+ /**
+ * @dataProvider fuzzyProvider
+ */
+ public function testFuzzyLevel($level, $expected)
+ {
+ /**
+ * @var ProductsSuggestRequest $request
+ */
+ $request = $this->getRequest(static::PRODUCT_SUGGEST_REQUEST);
+ $request->fuzzy($level);
+ $httpRequest = $request->httpRequest();
+
+ $this->assertStringStartsWith('product-projections/suggest', (string)$httpRequest->getUri());
+ $this->assertContains($expected, (string)$httpRequest->getUri());
+ }
+
+ public function testFuzzyKeyword()
+ {
+ $request = $this->getRequest(static::PRODUCT_SUGGEST_REQUEST);
+ /**
+ * @var ProductsSuggestRequest $request
+ */
+ $request->fuzzy(true)->addKeyword('en', 'test');
+ $httpRequest = $request->httpRequest();
+
+ $this->assertStringStartsWith('product-projections/suggest', (string)$httpRequest->getUri());
+ $this->assertContains('fuzzy=true&searchKeywords.en=test', (string)$httpRequest->getUri());
+ }
+
public function testAddKeyword()
{
$request = ProductsSuggestRequest::of();
diff --git a/tools/package.json b/tools/package.json
index a9f061e6e3..05d0d7c885 100644
--- a/tools/package.json
+++ b/tools/package.json
@@ -1,6 +1,6 @@
{
"name": "commercetools-php-sdk-changelog",
- "version": "2.0.0-RC1",
+ "version": "2.0.0",
"description": "commercetools PHP SDK changelog generator package description",
"homepage": "https://github.com/commercetools/commercetools-php-sdk",
"bugs": "https://github.com/commercetools/commercetools-php-sdk/issues",