diff --git a/src/Request/Types/TypeUpdateByKeyRequest.php b/src/Request/Types/TypeUpdateByKeyRequest.php new file mode 100644 index 0000000000..517b96478c --- /dev/null +++ b/src/Request/Types/TypeUpdateByKeyRequest.php @@ -0,0 +1,43 @@ + + */ + +namespace Commercetools\Core\Request\Types; + +use Commercetools\Core\Model\Common\Context; +use Commercetools\Core\Request\AbstractUpdateByKeyRequest; +use Commercetools\Core\Model\Type\Type; +use Commercetools\Core\Response\ApiResponseInterface; + +/** + * @package Commercetools\Core\Request\Types + * @link https://dev.commercetools.com/http-api-projects-types.html#update-type-by-key + * @method Type mapResponse(ApiResponseInterface $response) + */ +class TypeUpdateByKeyRequest extends AbstractUpdateByKeyRequest +{ + protected $resultClass = '\Commercetools\Core\Model\Type\Type'; + + /** + * @param string $key + * @param string $version + * @param array $actions + * @param Context $context + */ + public function __construct($key, $version, array $actions = [], Context $context = null) + { + parent::__construct(TypesEndpoint::endpoint(), $key, $version, $actions, $context); + } + + /** + * @param string $key + * @param int $version + * @param Context $context + * @return static + */ + public static function ofKeyAndVersion($key, $version, Context $context = null) + { + return new static($key, $version, [], $context); + } +}