Skip to content

Commit 487131a

Browse files
author
Auto Mation
committed
TASK: Updating SDK
1 parent b13dc94 commit 487131a

17 files changed

+467
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
hash=3194e55d008346997bba400b0bbca6a41dd3ac31
1+
hash=8f519721b7892ec5e446d0d1b552b772832c897f
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
hash=3194e55d008346997bba400b0bbca6a41dd3ac31
1+
hash=8f519721b7892ec5e446d0d1b552b772832c897f

lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueDraftModel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ final class CartDiscountValueDraftModel extends JsonObjectModel implements CartD
3131
*/
3232
private static $discriminatorClasses = [
3333
'absolute' => CartDiscountValueAbsoluteDraftModel::class,
34+
'fixed' => CartDiscountValueFixedDraftModel::class,
3435
'giftLineItem' => CartDiscountValueGiftLineItemDraftModel::class,
3536
'relative' => CartDiscountValueRelativeDraftModel::class,
3637
];
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\CartDiscount;
10+
11+
use Commercetools\Api\Models\Common\TypedMoneyCollection;
12+
use Commercetools\Base\DateTimeImmutableCollection;
13+
use Commercetools\Base\JsonObject;
14+
15+
interface CartDiscountValueFixed extends CartDiscountValue
16+
{
17+
public const FIELD_MONEY = 'money';
18+
19+
/**
20+
* @return null|TypedMoneyCollection
21+
*/
22+
public function getMoney();
23+
24+
/**
25+
* @param ?TypedMoneyCollection $money
26+
*/
27+
public function setMoney(?TypedMoneyCollection $money): void;
28+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\CartDiscount;
10+
11+
use Commercetools\Api\Models\Common\TypedMoneyCollection;
12+
use Commercetools\Base\Builder;
13+
use Commercetools\Base\DateTimeImmutableCollection;
14+
use Commercetools\Base\JsonObject;
15+
use Commercetools\Base\JsonObjectModel;
16+
use Commercetools\Base\MapperFactory;
17+
use stdClass;
18+
19+
/**
20+
* @implements Builder<CartDiscountValueFixed>
21+
*/
22+
final class CartDiscountValueFixedBuilder implements Builder
23+
{
24+
/**
25+
* @var ?TypedMoneyCollection
26+
*/
27+
private $money;
28+
29+
/**
30+
* @return null|TypedMoneyCollection
31+
*/
32+
public function getMoney()
33+
{
34+
return $this->money;
35+
}
36+
37+
/**
38+
* @param ?TypedMoneyCollection $money
39+
* @return $this
40+
*/
41+
public function withMoney(?TypedMoneyCollection $money)
42+
{
43+
$this->money = $money;
44+
45+
return $this;
46+
}
47+
48+
49+
public function build(): CartDiscountValueFixed
50+
{
51+
return new CartDiscountValueFixedModel(
52+
$this->money
53+
);
54+
}
55+
56+
public static function of(): CartDiscountValueFixedBuilder
57+
{
58+
return new self();
59+
}
60+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\CartDiscount;
10+
11+
use Commercetools\Base\MapperSequence;
12+
use Commercetools\Exception\InvalidArgumentException;
13+
use stdClass;
14+
15+
/**
16+
* @extends MapperSequence<CartDiscountValueFixed>
17+
* @method CartDiscountValueFixed current()
18+
* @method CartDiscountValueFixed at($offset)
19+
*/
20+
class CartDiscountValueFixedCollection extends MapperSequence
21+
{
22+
/**
23+
* @psalm-assert CartDiscountValueFixed $value
24+
* @psalm-param CartDiscountValueFixed|stdClass $value
25+
* @throws InvalidArgumentException
26+
*
27+
* @return CartDiscountValueFixedCollection
28+
*/
29+
public function add($value)
30+
{
31+
if (!$value instanceof CartDiscountValueFixed) {
32+
throw new InvalidArgumentException();
33+
}
34+
$this->store($value);
35+
36+
return $this;
37+
}
38+
39+
/**
40+
* @psalm-return callable(int):?CartDiscountValueFixed
41+
*/
42+
protected function mapper()
43+
{
44+
return function (int $index): ?CartDiscountValueFixed {
45+
$data = $this->get($index);
46+
if ($data instanceof stdClass) {
47+
$data = CartDiscountValueFixedModel::of($data);
48+
$this->set($data, $index);
49+
}
50+
51+
return $data;
52+
};
53+
}
54+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\CartDiscount;
10+
11+
use Commercetools\Api\Models\Common\MoneyCollection;
12+
use Commercetools\Base\DateTimeImmutableCollection;
13+
use Commercetools\Base\JsonObject;
14+
15+
interface CartDiscountValueFixedDraft extends CartDiscountValueDraft
16+
{
17+
public const FIELD_MONEY = 'money';
18+
19+
/**
20+
* @return null|MoneyCollection
21+
*/
22+
public function getMoney();
23+
24+
/**
25+
* @param ?MoneyCollection $money
26+
*/
27+
public function setMoney(?MoneyCollection $money): void;
28+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\CartDiscount;
10+
11+
use Commercetools\Api\Models\Common\MoneyCollection;
12+
use Commercetools\Base\Builder;
13+
use Commercetools\Base\DateTimeImmutableCollection;
14+
use Commercetools\Base\JsonObject;
15+
use Commercetools\Base\JsonObjectModel;
16+
use Commercetools\Base\MapperFactory;
17+
use stdClass;
18+
19+
/**
20+
* @implements Builder<CartDiscountValueFixedDraft>
21+
*/
22+
final class CartDiscountValueFixedDraftBuilder implements Builder
23+
{
24+
/**
25+
* @var ?MoneyCollection
26+
*/
27+
private $money;
28+
29+
/**
30+
* @return null|MoneyCollection
31+
*/
32+
public function getMoney()
33+
{
34+
return $this->money;
35+
}
36+
37+
/**
38+
* @param ?MoneyCollection $money
39+
* @return $this
40+
*/
41+
public function withMoney(?MoneyCollection $money)
42+
{
43+
$this->money = $money;
44+
45+
return $this;
46+
}
47+
48+
49+
public function build(): CartDiscountValueFixedDraft
50+
{
51+
return new CartDiscountValueFixedDraftModel(
52+
$this->money
53+
);
54+
}
55+
56+
public static function of(): CartDiscountValueFixedDraftBuilder
57+
{
58+
return new self();
59+
}
60+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\CartDiscount;
10+
11+
use Commercetools\Base\MapperSequence;
12+
use Commercetools\Exception\InvalidArgumentException;
13+
use stdClass;
14+
15+
/**
16+
* @extends MapperSequence<CartDiscountValueFixedDraft>
17+
* @method CartDiscountValueFixedDraft current()
18+
* @method CartDiscountValueFixedDraft at($offset)
19+
*/
20+
class CartDiscountValueFixedDraftCollection extends MapperSequence
21+
{
22+
/**
23+
* @psalm-assert CartDiscountValueFixedDraft $value
24+
* @psalm-param CartDiscountValueFixedDraft|stdClass $value
25+
* @throws InvalidArgumentException
26+
*
27+
* @return CartDiscountValueFixedDraftCollection
28+
*/
29+
public function add($value)
30+
{
31+
if (!$value instanceof CartDiscountValueFixedDraft) {
32+
throw new InvalidArgumentException();
33+
}
34+
$this->store($value);
35+
36+
return $this;
37+
}
38+
39+
/**
40+
* @psalm-return callable(int):?CartDiscountValueFixedDraft
41+
*/
42+
protected function mapper()
43+
{
44+
return function (int $index): ?CartDiscountValueFixedDraft {
45+
$data = $this->get($index);
46+
if ($data instanceof stdClass) {
47+
$data = CartDiscountValueFixedDraftModel::of($data);
48+
$this->set($data, $index);
49+
}
50+
51+
return $data;
52+
};
53+
}
54+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\CartDiscount;
10+
11+
use Commercetools\Api\Models\Common\MoneyCollection;
12+
use Commercetools\Base\DateTimeImmutableCollection;
13+
use Commercetools\Base\JsonObject;
14+
use Commercetools\Base\JsonObjectModel;
15+
use Commercetools\Base\MapperFactory;
16+
use stdClass;
17+
18+
/**
19+
* @internal
20+
*/
21+
final class CartDiscountValueFixedDraftModel extends JsonObjectModel implements CartDiscountValueFixedDraft
22+
{
23+
public const DISCRIMINATOR_VALUE = 'fixed';
24+
/**
25+
* @var ?string
26+
*/
27+
protected $type;
28+
29+
/**
30+
* @var ?MoneyCollection
31+
*/
32+
protected $money;
33+
34+
35+
/**
36+
* @psalm-suppress MissingParamType
37+
*/
38+
public function __construct(
39+
?MoneyCollection $money = null
40+
) {
41+
$this->money = $money;
42+
$this->type = static::DISCRIMINATOR_VALUE;
43+
}
44+
45+
/**
46+
* @return null|string
47+
*/
48+
public function getType()
49+
{
50+
if (is_null($this->type)) {
51+
/** @psalm-var ?string $data */
52+
$data = $this->raw(self::FIELD_TYPE);
53+
if (is_null($data)) {
54+
return null;
55+
}
56+
$this->type = (string) $data;
57+
}
58+
59+
return $this->type;
60+
}
61+
62+
/**
63+
* @return null|MoneyCollection
64+
*/
65+
public function getMoney()
66+
{
67+
if (is_null($this->money)) {
68+
/** @psalm-var ?list<stdClass> $data */
69+
$data = $this->raw(self::FIELD_MONEY);
70+
if (is_null($data)) {
71+
return null;
72+
}
73+
$this->money = MoneyCollection::fromArray($data);
74+
}
75+
76+
return $this->money;
77+
}
78+
79+
80+
/**
81+
* @param ?MoneyCollection $money
82+
*/
83+
public function setMoney(?MoneyCollection $money): void
84+
{
85+
$this->money = $money;
86+
}
87+
}

0 commit comments

Comments
 (0)