Skip to content

Commit

Permalink
TASK: Updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Auto Mation committed Jun 14, 2021
1 parent d1d05ea commit 0bf2ffb
Show file tree
Hide file tree
Showing 14 changed files with 237 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/commercetools-api-tests/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=834776908e37742cb9a8892b57a25733c74eb391
hash=2ad3d6c01ca5cf8f6f2cee54062ae5755e592837
2 changes: 1 addition & 1 deletion lib/commercetools-api/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=834776908e37742cb9a8892b57a25733c74eb391
hash=2ad3d6c01ca5cf8f6f2cee54062ae5755e592837
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Api\Models\Me;

use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;

interface MyCartSetCustomerEmailAction extends MyCartUpdateAction
{
public const FIELD_EMAIL = 'email';

/**
* @return null|string
*/
public function getEmail();

/**
* @param ?string $email
*/
public function setEmail(?string $email): void;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Api\Models\Me;

use Commercetools\Base\Builder;
use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;
use Commercetools\Base\JsonObjectModel;
use Commercetools\Base\MapperFactory;
use stdClass;

/**
* @implements Builder<MyCartSetCustomerEmailAction>
*/
final class MyCartSetCustomerEmailActionBuilder implements Builder
{
/**
* @var ?string
*/
private $email;

/**
* @return null|string
*/
public function getEmail()
{
return $this->email;
}

/**
* @param ?string $email
* @return $this
*/
public function withEmail(?string $email)
{
$this->email = $email;

return $this;
}


public function build(): MyCartSetCustomerEmailAction
{
return new MyCartSetCustomerEmailActionModel(
$this->email
);
}

public static function of(): MyCartSetCustomerEmailActionBuilder
{
return new self();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Api\Models\Me;

use Commercetools\Api\Models\Me\MyCartUpdateActionCollection;
use Commercetools\Exception\InvalidArgumentException;
use stdClass;

/**
* @extends MyCartUpdateActionCollection<MyCartSetCustomerEmailAction>
* @method MyCartSetCustomerEmailAction current()
* @method MyCartSetCustomerEmailAction at($offset)
*/
class MyCartSetCustomerEmailActionCollection extends MyCartUpdateActionCollection
{
/**
* @psalm-assert MyCartSetCustomerEmailAction $value
* @psalm-param MyCartSetCustomerEmailAction|stdClass $value
* @throws InvalidArgumentException
*
* @return MyCartSetCustomerEmailActionCollection
*/
public function add($value)
{
if (!$value instanceof MyCartSetCustomerEmailAction) {
throw new InvalidArgumentException();
}
$this->store($value);

return $this;
}

/**
* @psalm-return callable(int):?MyCartSetCustomerEmailAction
*/
protected function mapper()
{
return function (int $index): ?MyCartSetCustomerEmailAction {
$data = $this->get($index);
if ($data instanceof stdClass) {
/** @var MyCartSetCustomerEmailAction $data */
$data = MyCartSetCustomerEmailActionModel::of($data);
$this->set($data, $index);
}

return $data;
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Api\Models\Me;

use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;
use Commercetools\Base\JsonObjectModel;
use Commercetools\Base\MapperFactory;
use stdClass;

/**
* @internal
*/
final class MyCartSetCustomerEmailActionModel extends JsonObjectModel implements MyCartSetCustomerEmailAction
{
public const DISCRIMINATOR_VALUE = 'setCustomerEmail';
/**
* @var ?string
*/
protected $action;

/**
* @var ?string
*/
protected $email;


/**
* @psalm-suppress MissingParamType
*/
public function __construct(
?string $email = null
) {
$this->email = $email;
$this->action = static::DISCRIMINATOR_VALUE;
}

/**
* @return null|string
*/
public function getAction()
{
if (is_null($this->action)) {
/** @psalm-var ?string $data */
$data = $this->raw(self::FIELD_ACTION);
if (is_null($data)) {
return null;
}
$this->action = (string) $data;
}

return $this->action;
}

/**
* @return null|string
*/
public function getEmail()
{
if (is_null($this->email)) {
/** @psalm-var ?string $data */
$data = $this->raw(self::FIELD_EMAIL);
if (is_null($data)) {
return null;
}
$this->email = (string) $data;
}

return $this->email;
}


/**
* @param ?string $email
*/
public function setEmail(?string $email): void
{
$this->email = $email;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ final class MyCartUpdateActionModel extends JsonObjectModel implements MyCartUpd
'setCountry' => MyCartSetCountryActionModel::class,
'setCustomField' => MyCartSetCustomFieldActionModel::class,
'setCustomType' => MyCartSetCustomTypeActionModel::class,
'setCustomerEmail' => MyCartSetCustomerEmailActionModel::class,
'setDeleteDaysAfterLastModification' => MyCartSetDeleteDaysAfterLastModificationActionModel::class,
'setLineItemCustomField' => MyCartSetLineItemCustomFieldActionModel::class,
'setLineItemCustomType' => MyCartSetLineItemCustomTypeActionModel::class,
Expand Down
2 changes: 1 addition & 1 deletion lib/commercetools-base/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=834776908e37742cb9a8892b57a25733c74eb391
hash=2ad3d6c01ca5cf8f6f2cee54062ae5755e592837
2 changes: 1 addition & 1 deletion lib/commercetools-history-tests/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=834776908e37742cb9a8892b57a25733c74eb391
hash=2ad3d6c01ca5cf8f6f2cee54062ae5755e592837
2 changes: 1 addition & 1 deletion lib/commercetools-history/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=834776908e37742cb9a8892b57a25733c74eb391
hash=2ad3d6c01ca5cf8f6f2cee54062ae5755e592837
2 changes: 1 addition & 1 deletion lib/commercetools-import-tests/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=834776908e37742cb9a8892b57a25733c74eb391
hash=2ad3d6c01ca5cf8f6f2cee54062ae5755e592837
2 changes: 1 addition & 1 deletion lib/commercetools-import/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=834776908e37742cb9a8892b57a25733c74eb391
hash=2ad3d6c01ca5cf8f6f2cee54062ae5755e592837
2 changes: 1 addition & 1 deletion lib/commercetools-ml-tests/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=834776908e37742cb9a8892b57a25733c74eb391
hash=2ad3d6c01ca5cf8f6f2cee54062ae5755e592837
2 changes: 1 addition & 1 deletion lib/commercetools-ml/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=834776908e37742cb9a8892b57a25733c74eb391
hash=2ad3d6c01ca5cf8f6f2cee54062ae5755e592837

0 comments on commit 0bf2ffb

Please sign in to comment.