Skip to content

Commit 0b1efcc

Browse files
committed
build(codegen): updating SDK
1 parent afaf4d7 commit 0b1efcc

File tree

50 files changed

+5902
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+5902
-11
lines changed

changes.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,29 @@
1414
- added type `CustomerRemoveCustomerGroupAssignmentAction`
1515
- added type `CustomerSetCustomerGroupAssignmentsAction`
1616
- added type `BaseEvent`
17+
- added type `CheckoutOrderCreationFailedEvent`
18+
- added type `CheckoutPaymentAuthorizationCancelledEvent`
19+
- added type `CheckoutPaymentAuthorizationFailedEvent`
20+
- added type `CheckoutPaymentAuthorizedEvent`
21+
- added type `CheckoutPaymentCancelAuthorizationFailedEvent`
22+
- added type `CheckoutPaymentChargeFailedEvent`
23+
- added type `CheckoutPaymentChargedEvent`
24+
- added type `CheckoutPaymentRefundFailedEvent`
25+
- added type `CheckoutPaymentRefundedEvent`
1726
- added type `Event`
1827
- added type `ImportContainerCreatedEvent`
19-
- added type `ImportContainerCreatedEventData`
2028
- added type `ImportContainerDeletedEvent`
21-
- added type `ImportContainerDeletedEventData`
2229
- added type `ImportOperationRejectedEvent`
23-
- added type `ImportOperationRejectedEventData`
2430
- added type `ImportUnresolvedEvent`
25-
- added type `ImportUnresolvedEventData`
2631
- added type `ImportValidationFailedEvent`
27-
- added type `ImportValidationFailedEventData`
2832
- added type `ImportWaitForMasterVariantEvent`
33+
- added type `CheckoutMessageOrderPayloadBaseData`
34+
- added type `CheckoutMessagePaymentsPayloadBaseData`
35+
- added type `ImportContainerCreatedEventData`
36+
- added type `ImportContainerDeletedEventData`
37+
- added type `ImportOperationRejectedEventData`
38+
- added type `ImportUnresolvedEventData`
39+
- added type `ImportValidationFailedEventData`
2940
- added type `ImportWaitForMasterVariantEventData`
3041
- added type `AssociateRoleNameSetMessage`
3142
- added type `BusinessUnitTopLevelUnitSetMessage`
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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\Event;
10+
11+
use Commercetools\Api\Models\Cart\CartReference;
12+
use Commercetools\Api\Models\Error\ErrorObjectCollection;
13+
use Commercetools\Api\Models\Payment\PaymentReferenceCollection;
14+
use Commercetools\Base\DateTimeImmutableCollection;
15+
use Commercetools\Base\JsonObject;
16+
17+
interface CheckoutMessageOrderPayloadBaseData extends JsonObject
18+
{
19+
public const FIELD_PROJECT_KEY = 'projectKey';
20+
public const FIELD_CART = 'cart';
21+
public const FIELD_PAYMENTS = 'payments';
22+
public const FIELD_ERRORS = 'errors';
23+
24+
/**
25+
* <p><code>key</code> of the <a href="ctp:api:type:Project">Project</a> where the order would belong to.</p>
26+
*
27+
28+
* @return null|string
29+
*/
30+
public function getProjectKey();
31+
32+
/**
33+
* <p>The <a href="ctp:api:type:Cart">Cart</a> on which the change or action was performed.</p>
34+
*
35+
36+
* @return null|CartReference
37+
*/
38+
public function getCart();
39+
40+
/**
41+
* <p>The <a href="ctp:api:type:Payment">Payments</a> on which the change or action was performed.</p>
42+
*
43+
44+
* @return null|PaymentReferenceCollection
45+
*/
46+
public function getPayments();
47+
48+
/**
49+
* <p>Errors associated with the order event.</p>
50+
*
51+
52+
* @return null|ErrorObjectCollection
53+
*/
54+
public function getErrors();
55+
56+
/**
57+
* @param ?string $projectKey
58+
*/
59+
public function setProjectKey(?string $projectKey): void;
60+
61+
/**
62+
* @param ?CartReference $cart
63+
*/
64+
public function setCart(?CartReference $cart): void;
65+
66+
/**
67+
* @param ?PaymentReferenceCollection $payments
68+
*/
69+
public function setPayments(?PaymentReferenceCollection $payments): void;
70+
71+
/**
72+
* @param ?ErrorObjectCollection $errors
73+
*/
74+
public function setErrors(?ErrorObjectCollection $errors): void;
75+
}
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
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\Event;
10+
11+
use Commercetools\Api\Models\Cart\CartReference;
12+
use Commercetools\Api\Models\Cart\CartReferenceBuilder;
13+
use Commercetools\Api\Models\Error\ErrorObjectCollection;
14+
use Commercetools\Api\Models\Payment\PaymentReferenceCollection;
15+
use Commercetools\Base\Builder;
16+
use Commercetools\Base\DateTimeImmutableCollection;
17+
use Commercetools\Base\JsonObject;
18+
use Commercetools\Base\JsonObjectModel;
19+
use Commercetools\Base\MapperFactory;
20+
use stdClass;
21+
22+
/**
23+
* @implements Builder<CheckoutMessageOrderPayloadBaseData>
24+
*/
25+
final class CheckoutMessageOrderPayloadBaseDataBuilder implements Builder
26+
{
27+
/**
28+
29+
* @var ?string
30+
*/
31+
private $projectKey;
32+
33+
/**
34+
35+
* @var null|CartReference|CartReferenceBuilder
36+
*/
37+
private $cart;
38+
39+
/**
40+
41+
* @var ?PaymentReferenceCollection
42+
*/
43+
private $payments;
44+
45+
/**
46+
47+
* @var ?ErrorObjectCollection
48+
*/
49+
private $errors;
50+
51+
/**
52+
* <p><code>key</code> of the <a href="ctp:api:type:Project">Project</a> where the order would belong to.</p>
53+
*
54+
55+
* @return null|string
56+
*/
57+
public function getProjectKey()
58+
{
59+
return $this->projectKey;
60+
}
61+
62+
/**
63+
* <p>The <a href="ctp:api:type:Cart">Cart</a> on which the change or action was performed.</p>
64+
*
65+
66+
* @return null|CartReference
67+
*/
68+
public function getCart()
69+
{
70+
return $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart;
71+
}
72+
73+
/**
74+
* <p>The <a href="ctp:api:type:Payment">Payments</a> on which the change or action was performed.</p>
75+
*
76+
77+
* @return null|PaymentReferenceCollection
78+
*/
79+
public function getPayments()
80+
{
81+
return $this->payments;
82+
}
83+
84+
/**
85+
* <p>Errors associated with the order event.</p>
86+
*
87+
88+
* @return null|ErrorObjectCollection
89+
*/
90+
public function getErrors()
91+
{
92+
return $this->errors;
93+
}
94+
95+
/**
96+
* @param ?string $projectKey
97+
* @return $this
98+
*/
99+
public function withProjectKey(?string $projectKey)
100+
{
101+
$this->projectKey = $projectKey;
102+
103+
return $this;
104+
}
105+
106+
/**
107+
* @param ?CartReference $cart
108+
* @return $this
109+
*/
110+
public function withCart(?CartReference $cart)
111+
{
112+
$this->cart = $cart;
113+
114+
return $this;
115+
}
116+
117+
/**
118+
* @param ?PaymentReferenceCollection $payments
119+
* @return $this
120+
*/
121+
public function withPayments(?PaymentReferenceCollection $payments)
122+
{
123+
$this->payments = $payments;
124+
125+
return $this;
126+
}
127+
128+
/**
129+
* @param ?ErrorObjectCollection $errors
130+
* @return $this
131+
*/
132+
public function withErrors(?ErrorObjectCollection $errors)
133+
{
134+
$this->errors = $errors;
135+
136+
return $this;
137+
}
138+
139+
/**
140+
* @deprecated use withCart() instead
141+
* @return $this
142+
*/
143+
public function withCartBuilder(?CartReferenceBuilder $cart)
144+
{
145+
$this->cart = $cart;
146+
147+
return $this;
148+
}
149+
150+
public function build(): CheckoutMessageOrderPayloadBaseData
151+
{
152+
return new CheckoutMessageOrderPayloadBaseDataModel(
153+
$this->projectKey,
154+
$this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart,
155+
$this->payments,
156+
$this->errors
157+
);
158+
}
159+
160+
public static function of(): CheckoutMessageOrderPayloadBaseDataBuilder
161+
{
162+
return new self();
163+
}
164+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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\Event;
10+
11+
use Commercetools\Base\MapperSequence;
12+
use Commercetools\Exception\InvalidArgumentException;
13+
use stdClass;
14+
15+
/**
16+
* @extends MapperSequence<CheckoutMessageOrderPayloadBaseData>
17+
* @method CheckoutMessageOrderPayloadBaseData current()
18+
* @method CheckoutMessageOrderPayloadBaseData end()
19+
* @method CheckoutMessageOrderPayloadBaseData at($offset)
20+
*/
21+
class CheckoutMessageOrderPayloadBaseDataCollection extends MapperSequence
22+
{
23+
/**
24+
* @psalm-assert CheckoutMessageOrderPayloadBaseData $value
25+
* @psalm-param CheckoutMessageOrderPayloadBaseData|stdClass $value
26+
* @throws InvalidArgumentException
27+
*
28+
* @return CheckoutMessageOrderPayloadBaseDataCollection
29+
*/
30+
public function add($value)
31+
{
32+
if (!$value instanceof CheckoutMessageOrderPayloadBaseData) {
33+
throw new InvalidArgumentException();
34+
}
35+
$this->store($value);
36+
37+
return $this;
38+
}
39+
40+
/**
41+
* @psalm-return callable(int):?CheckoutMessageOrderPayloadBaseData
42+
*/
43+
protected function mapper()
44+
{
45+
return function (?int $index): ?CheckoutMessageOrderPayloadBaseData {
46+
$data = $this->get($index);
47+
if ($data instanceof stdClass) {
48+
/** @var CheckoutMessageOrderPayloadBaseData $data */
49+
$data = CheckoutMessageOrderPayloadBaseDataModel::of($data);
50+
$this->set($data, $index);
51+
}
52+
53+
return $data;
54+
};
55+
}
56+
}

0 commit comments

Comments
 (0)