Skip to content

Commit 85f3890

Browse files
committed
build(codegen): updating SDK
1 parent 2eaaadf commit 85f3890

File tree

58 files changed

+5145
-2
lines changed

Some content is hidden

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

58 files changed

+5145
-2
lines changed

changes.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<summary>Added Type(s)</summary>
55

66
- added type `BusinessUnitAssociateResponse`
7+
- added type `BusinessUnitAddCustomerGroupAssignmentAction`
8+
- added type `BusinessUnitRemoveCustomerGroupAssignmentAction`
9+
- added type `BusinessUnitSetCustomerGroupAssignmentsAction`
710
- added type `BusinessUnitSetUnitTypeAction`
811
- added type `CartDiscountSetDiscountGroupAction`
912
- added type `BestDeal`
@@ -72,6 +75,9 @@
7275
- added type `MyPaymentSetMethodInfoCustomTypeAction`
7376
- added type `MyPaymentSetMethodInfoInterfaceAccountAction`
7477
- added type `AssociateRoleNameSetMessage`
78+
- added type `BusinessUnitCustomerGroupAssignmentAddedMessage`
79+
- added type `BusinessUnitCustomerGroupAssignmentRemovedMessage`
80+
- added type `BusinessUnitCustomerGroupAssignmentsSetMessage`
7581
- added type `BusinessUnitTopLevelUnitSetMessage`
7682
- added type `BusinessUnitTypeSetMessage`
7783
- added type `CartFrozenMessage`
@@ -136,6 +142,9 @@
136142
- added type `RecurringOrderStateChangedMessage`
137143
- added type `RecurringOrderStateTransitionMessage`
138144
- added type `AssociateRoleNameSetMessagePayload`
145+
- added type `BusinessUnitCustomerGroupAssignmentAddedMessagePayload`
146+
- added type `BusinessUnitCustomerGroupAssignmentRemovedMessagePayload`
147+
- added type `BusinessUnitCustomerGroupAssignmentsSetMessagePayload`
139148
- added type `BusinessUnitTopLevelUnitSetMessagePayload`
140149
- added type `BusinessUnitTypeSetMessagePayload`
141150
- added type `CartFrozenMessagePayload`
@@ -458,8 +467,14 @@
458467
<summary>Added Property(s)</summary>
459468

460469
- added property `inheritedStores` to type `BusinessUnit`
470+
- added property `customerGroupAssignments` to type `BusinessUnit`
471+
- added property `customerGroupAssignments` to type `BusinessUnitDraft`
461472
- added property `inheritedStores` to type `Company`
473+
- added property `customerGroupAssignments` to type `Company`
474+
- added property `customerGroupAssignments` to type `CompanyDraft`
462475
- added property `inheritedStores` to type `Division`
476+
- added property `customerGroupAssignments` to type `Division`
477+
- added property `customerGroupAssignments` to type `DivisionDraft`
463478
- added property `makeInheritedAssociatesExplicit` to type `BusinessUnitChangeAssociateModeAction`
464479
- added property `discountGroup` to type `CartDiscount`
465480
- added property `discountGroup` to type `CartDiscountDraft`

lib/commercetools-api/src/Models/BusinessUnit/BusinessUnit.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Commercetools\Api\Models\Common\BaseResource;
1313
use Commercetools\Api\Models\Common\CreatedBy;
1414
use Commercetools\Api\Models\Common\LastModifiedBy;
15+
use Commercetools\Api\Models\Customer\CustomerGroupAssignmentCollection;
1516
use Commercetools\Api\Models\Store\StoreKeyReferenceCollection;
1617
use Commercetools\Api\Models\Type\CustomFields;
1718
use Commercetools\Base\DateTimeImmutableCollection;
@@ -32,6 +33,7 @@ interface BusinessUnit extends BaseResource
3233
public const FIELD_NAME = 'name';
3334
public const FIELD_CONTACT_EMAIL = 'contactEmail';
3435
public const FIELD_CUSTOM = 'custom';
36+
public const FIELD_CUSTOMER_GROUP_ASSIGNMENTS = 'customerGroupAssignments';
3537
public const FIELD_ADDRESSES = 'addresses';
3638
public const FIELD_SHIPPING_ADDRESS_IDS = 'shippingAddressIds';
3739
public const FIELD_DEFAULT_SHIPPING_ADDRESS_ID = 'defaultShippingAddressId';
@@ -166,6 +168,15 @@ public function getContactEmail();
166168
*/
167169
public function getCustom();
168170

171+
/**
172+
* <p>Customer Groups assigned to the Business Unit.</p>
173+
* <p>They are considered during <a href="/../api/pricing-and-discounts-overview#line-item-price-selection">line Item price selection</a>, if provided (non-null).</p>
174+
*
175+
176+
* @return null|CustomerGroupAssignmentCollection
177+
*/
178+
public function getCustomerGroupAssignments();
179+
169180
/**
170181
* <p>Addresses used by the Business Unit.</p>
171182
*
@@ -325,6 +336,11 @@ public function setContactEmail(?string $contactEmail): void;
325336
*/
326337
public function setCustom(?CustomFields $custom): void;
327338

339+
/**
340+
* @param ?CustomerGroupAssignmentCollection $customerGroupAssignments
341+
*/
342+
public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void;
343+
328344
/**
329345
* @param ?AddressCollection $addresses
330346
*/
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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\BusinessUnit;
10+
11+
use Commercetools\Api\Models\Customer\CustomerGroupAssignmentDraft;
12+
use Commercetools\Base\DateTimeImmutableCollection;
13+
use Commercetools\Base\JsonObject;
14+
15+
interface BusinessUnitAddCustomerGroupAssignmentAction extends BusinessUnitUpdateAction
16+
{
17+
public const FIELD_CUSTOMER_GROUP_ASSIGNMENT = 'customerGroupAssignment';
18+
19+
/**
20+
* <p>Customer Group to assign the Business Unit to.</p>
21+
*
22+
23+
* @return null|CustomerGroupAssignmentDraft
24+
*/
25+
public function getCustomerGroupAssignment();
26+
27+
/**
28+
* @param ?CustomerGroupAssignmentDraft $customerGroupAssignment
29+
*/
30+
public function setCustomerGroupAssignment(?CustomerGroupAssignmentDraft $customerGroupAssignment): void;
31+
}
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\BusinessUnit;
10+
11+
use Commercetools\Api\Models\Customer\CustomerGroupAssignmentDraft;
12+
use Commercetools\Api\Models\Customer\CustomerGroupAssignmentDraftBuilder;
13+
use Commercetools\Base\Builder;
14+
use Commercetools\Base\DateTimeImmutableCollection;
15+
use Commercetools\Base\JsonObject;
16+
use Commercetools\Base\JsonObjectModel;
17+
use Commercetools\Base\MapperFactory;
18+
use stdClass;
19+
20+
/**
21+
* @implements Builder<BusinessUnitAddCustomerGroupAssignmentAction>
22+
*/
23+
final class BusinessUnitAddCustomerGroupAssignmentActionBuilder implements Builder
24+
{
25+
/**
26+
27+
* @var null|CustomerGroupAssignmentDraft|CustomerGroupAssignmentDraftBuilder
28+
*/
29+
private $customerGroupAssignment;
30+
31+
/**
32+
* <p>Customer Group to assign the Business Unit to.</p>
33+
*
34+
35+
* @return null|CustomerGroupAssignmentDraft
36+
*/
37+
public function getCustomerGroupAssignment()
38+
{
39+
return $this->customerGroupAssignment instanceof CustomerGroupAssignmentDraftBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment;
40+
}
41+
42+
/**
43+
* @param ?CustomerGroupAssignmentDraft $customerGroupAssignment
44+
* @return $this
45+
*/
46+
public function withCustomerGroupAssignment(?CustomerGroupAssignmentDraft $customerGroupAssignment)
47+
{
48+
$this->customerGroupAssignment = $customerGroupAssignment;
49+
50+
return $this;
51+
}
52+
53+
/**
54+
* @deprecated use withCustomerGroupAssignment() instead
55+
* @return $this
56+
*/
57+
public function withCustomerGroupAssignmentBuilder(?CustomerGroupAssignmentDraftBuilder $customerGroupAssignment)
58+
{
59+
$this->customerGroupAssignment = $customerGroupAssignment;
60+
61+
return $this;
62+
}
63+
64+
public function build(): BusinessUnitAddCustomerGroupAssignmentAction
65+
{
66+
return new BusinessUnitAddCustomerGroupAssignmentActionModel(
67+
$this->customerGroupAssignment instanceof CustomerGroupAssignmentDraftBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment
68+
);
69+
}
70+
71+
public static function of(): BusinessUnitAddCustomerGroupAssignmentActionBuilder
72+
{
73+
return new self();
74+
}
75+
}
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\BusinessUnit;
10+
11+
use Commercetools\Api\Models\BusinessUnit\BusinessUnitUpdateActionCollection;
12+
use Commercetools\Exception\InvalidArgumentException;
13+
use stdClass;
14+
15+
/**
16+
* @extends BusinessUnitUpdateActionCollection<BusinessUnitAddCustomerGroupAssignmentAction>
17+
* @method BusinessUnitAddCustomerGroupAssignmentAction current()
18+
* @method BusinessUnitAddCustomerGroupAssignmentAction end()
19+
* @method BusinessUnitAddCustomerGroupAssignmentAction at($offset)
20+
*/
21+
class BusinessUnitAddCustomerGroupAssignmentActionCollection extends BusinessUnitUpdateActionCollection
22+
{
23+
/**
24+
* @psalm-assert BusinessUnitAddCustomerGroupAssignmentAction $value
25+
* @psalm-param BusinessUnitAddCustomerGroupAssignmentAction|stdClass $value
26+
* @throws InvalidArgumentException
27+
*
28+
* @return BusinessUnitAddCustomerGroupAssignmentActionCollection
29+
*/
30+
public function add($value)
31+
{
32+
if (!$value instanceof BusinessUnitAddCustomerGroupAssignmentAction) {
33+
throw new InvalidArgumentException();
34+
}
35+
$this->store($value);
36+
37+
return $this;
38+
}
39+
40+
/**
41+
* @psalm-return callable(int):?BusinessUnitAddCustomerGroupAssignmentAction
42+
*/
43+
protected function mapper()
44+
{
45+
return function (?int $index): ?BusinessUnitAddCustomerGroupAssignmentAction {
46+
$data = $this->get($index);
47+
if ($data instanceof stdClass) {
48+
/** @var BusinessUnitAddCustomerGroupAssignmentAction $data */
49+
$data = BusinessUnitAddCustomerGroupAssignmentActionModel::of($data);
50+
$this->set($data, $index);
51+
}
52+
53+
return $data;
54+
};
55+
}
56+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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\BusinessUnit;
10+
11+
use Commercetools\Api\Models\Customer\CustomerGroupAssignmentDraft;
12+
use Commercetools\Api\Models\Customer\CustomerGroupAssignmentDraftModel;
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+
* @internal
21+
*/
22+
final class BusinessUnitAddCustomerGroupAssignmentActionModel extends JsonObjectModel implements BusinessUnitAddCustomerGroupAssignmentAction
23+
{
24+
public const DISCRIMINATOR_VALUE = 'addCustomerGroupAssignment';
25+
/**
26+
*
27+
* @var ?string
28+
*/
29+
protected $action;
30+
31+
/**
32+
*
33+
* @var ?CustomerGroupAssignmentDraft
34+
*/
35+
protected $customerGroupAssignment;
36+
37+
38+
/**
39+
* @psalm-suppress MissingParamType
40+
*/
41+
public function __construct(
42+
?CustomerGroupAssignmentDraft $customerGroupAssignment = null,
43+
?string $action = null
44+
) {
45+
$this->customerGroupAssignment = $customerGroupAssignment;
46+
$this->action = $action ?? self::DISCRIMINATOR_VALUE;
47+
}
48+
49+
/**
50+
*
51+
* @return null|string
52+
*/
53+
public function getAction()
54+
{
55+
if (is_null($this->action)) {
56+
/** @psalm-var ?string $data */
57+
$data = $this->raw(self::FIELD_ACTION);
58+
if (is_null($data)) {
59+
return null;
60+
}
61+
$this->action = (string) $data;
62+
}
63+
64+
return $this->action;
65+
}
66+
67+
/**
68+
* <p>Customer Group to assign the Business Unit to.</p>
69+
*
70+
*
71+
* @return null|CustomerGroupAssignmentDraft
72+
*/
73+
public function getCustomerGroupAssignment()
74+
{
75+
if (is_null($this->customerGroupAssignment)) {
76+
/** @psalm-var stdClass|array<string, mixed>|null $data */
77+
$data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENT);
78+
if (is_null($data)) {
79+
return null;
80+
}
81+
82+
$this->customerGroupAssignment = CustomerGroupAssignmentDraftModel::of($data);
83+
}
84+
85+
return $this->customerGroupAssignment;
86+
}
87+
88+
89+
/**
90+
* @param ?CustomerGroupAssignmentDraft $customerGroupAssignment
91+
*/
92+
public function setCustomerGroupAssignment(?CustomerGroupAssignmentDraft $customerGroupAssignment): void
93+
{
94+
$this->customerGroupAssignment = $customerGroupAssignment;
95+
}
96+
}

0 commit comments

Comments
 (0)