Skip to content

Commit 41ed19b

Browse files
committed
build(codegen): updating SDK
1 parent ad33a59 commit 41ed19b

7 files changed

Lines changed: 172 additions & 162 deletions

File tree

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ interface Customer extends BaseResource
4242
public const FIELD_BILLING_ADDRESS_IDS = 'billingAddressIds';
4343
public const FIELD_IS_EMAIL_VERIFIED = 'isEmailVerified';
4444
public const FIELD_CUSTOMER_GROUP = 'customerGroup';
45+
public const FIELD_CUSTOMER_GROUP_ASSIGNMENTS = 'customerGroupAssignments';
4546
public const FIELD_CUSTOM = 'custom';
4647
public const FIELD_LOCALE = 'locale';
4748
public const FIELD_SALUTATION = 'salutation';
4849
public const FIELD_STORES = 'stores';
4950
public const FIELD_AUTHENTICATION_MODE = 'authenticationMode';
50-
public const FIELD_CUSTOMER_GROUP_ASSIGNMENTS = 'customerGroupAssignments';
5151

5252
/**
5353
* <p>Unique identifier of the Customer.</p>
@@ -251,6 +251,15 @@ public function getIsEmailVerified();
251251
*/
252252
public function getCustomerGroup();
253253

254+
/**
255+
* <p>Customer Groups that the Customer belongs to.</p>
256+
* <p>Used for <a href="/../api/pricing-and-discounts-overview#line-item-price-selection">Line Item price selection</a>.</p>
257+
*
258+
259+
* @return null|CustomerGroupAssignmentCollection
260+
*/
261+
public function getCustomerGroupAssignments();
262+
254263
/**
255264
* <p>Custom Fields for the Customer.</p>
256265
*
@@ -295,14 +304,6 @@ public function getStores();
295304
*/
296305
public function getAuthenticationMode();
297306

298-
/**
299-
* <p>Customer Groups that the Customer belongs to.</p>
300-
*
301-
302-
* @return null|CustomerGroupAssignmentCollection
303-
*/
304-
public function getCustomerGroupAssignments();
305-
306307
/**
307308
* @param ?string $id
308309
*/
@@ -428,6 +429,11 @@ public function setIsEmailVerified(?bool $isEmailVerified): void;
428429
*/
429430
public function setCustomerGroup(?CustomerGroupReference $customerGroup): void;
430431

432+
/**
433+
* @param ?CustomerGroupAssignmentCollection $customerGroupAssignments
434+
*/
435+
public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void;
436+
431437
/**
432438
* @param ?CustomFields $custom
433439
*/
@@ -452,9 +458,4 @@ public function setStores(?StoreKeyReferenceCollection $stores): void;
452458
* @param ?string $authenticationMode
453459
*/
454460
public function setAuthenticationMode(?string $authenticationMode): void;
455-
456-
/**
457-
* @param ?CustomerGroupAssignmentCollection $customerGroupAssignments
458-
*/
459-
public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void;
460461
}

lib/commercetools-api/src/Models/Customer/CustomerBuilder.php

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ final class CustomerBuilder implements Builder
183183
*/
184184
private $customerGroup;
185185

186+
/**
187+
188+
* @var ?CustomerGroupAssignmentCollection
189+
*/
190+
private $customerGroupAssignments;
191+
186192
/**
187193
188194
* @var null|CustomFields|CustomFieldsBuilder
@@ -213,12 +219,6 @@ final class CustomerBuilder implements Builder
213219
*/
214220
private $authenticationMode;
215221

216-
/**
217-
218-
* @var ?CustomerGroupAssignmentCollection
219-
*/
220-
private $customerGroupAssignments;
221-
222222
/**
223223
* <p>Unique identifier of the Customer.</p>
224224
*
@@ -496,6 +496,18 @@ public function getCustomerGroup()
496496
return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
497497
}
498498

499+
/**
500+
* <p>Customer Groups that the Customer belongs to.</p>
501+
* <p>Used for <a href="/../api/pricing-and-discounts-overview#line-item-price-selection">Line Item price selection</a>.</p>
502+
*
503+
504+
* @return null|CustomerGroupAssignmentCollection
505+
*/
506+
public function getCustomerGroupAssignments()
507+
{
508+
return $this->customerGroupAssignments;
509+
}
510+
499511
/**
500512
* <p>Custom Fields for the Customer.</p>
501513
*
@@ -555,17 +567,6 @@ public function getAuthenticationMode()
555567
return $this->authenticationMode;
556568
}
557569

558-
/**
559-
* <p>Customer Groups that the Customer belongs to.</p>
560-
*
561-
562-
* @return null|CustomerGroupAssignmentCollection
563-
*/
564-
public function getCustomerGroupAssignments()
565-
{
566-
return $this->customerGroupAssignments;
567-
}
568-
569570
/**
570571
* @param ?string $id
571572
* @return $this
@@ -841,6 +842,17 @@ public function withCustomerGroup(?CustomerGroupReference $customerGroup)
841842
return $this;
842843
}
843844

845+
/**
846+
* @param ?CustomerGroupAssignmentCollection $customerGroupAssignments
847+
* @return $this
848+
*/
849+
public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments)
850+
{
851+
$this->customerGroupAssignments = $customerGroupAssignments;
852+
853+
return $this;
854+
}
855+
844856
/**
845857
* @param ?CustomFields $custom
846858
* @return $this
@@ -896,17 +908,6 @@ public function withAuthenticationMode(?string $authenticationMode)
896908
return $this;
897909
}
898910

899-
/**
900-
* @param ?CustomerGroupAssignmentCollection $customerGroupAssignments
901-
* @return $this
902-
*/
903-
public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments)
904-
{
905-
$this->customerGroupAssignments = $customerGroupAssignments;
906-
907-
return $this;
908-
}
909-
910911
/**
911912
* @deprecated use withLastModifiedBy() instead
912913
* @return $this
@@ -979,12 +980,12 @@ public function build(): Customer
979980
$this->billingAddressIds,
980981
$this->isEmailVerified,
981982
$this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
983+
$this->customerGroupAssignments,
982984
$this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
983985
$this->locale,
984986
$this->salutation,
985987
$this->stores,
986-
$this->authenticationMode,
987-
$this->customerGroupAssignments
988+
$this->authenticationMode
988989
);
989990
}
990991

lib/commercetools-api/src/Models/Customer/CustomerDraft.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ interface CustomerDraft extends JsonObject
4141
public const FIELD_BILLING_ADDRESSES = 'billingAddresses';
4242
public const FIELD_IS_EMAIL_VERIFIED = 'isEmailVerified';
4343
public const FIELD_CUSTOMER_GROUP = 'customerGroup';
44+
public const FIELD_CUSTOMER_GROUP_ASSIGNMENTS = 'customerGroupAssignments';
4445
public const FIELD_CUSTOM = 'custom';
4546
public const FIELD_LOCALE = 'locale';
4647
public const FIELD_SALUTATION = 'salutation';
4748
public const FIELD_STORES = 'stores';
4849
public const FIELD_AUTHENTICATION_MODE = 'authenticationMode';
49-
public const FIELD_CUSTOMER_GROUP_ASSIGNMENTS = 'customerGroupAssignments';
5050

5151
/**
5252
* <p>User-defined unique identifier for the Customer.
@@ -229,12 +229,22 @@ public function getIsEmailVerified();
229229

230230
/**
231231
* <p>Sets the <a href="ctp:api:type:CustomerGroup">CustomerGroup</a> for the Customer.</p>
232+
* <p>For new projects, use <code>customerGroupAssignments</code> instead. It supports assigning Customers to multiple Customer Groups and provides greater flexibility in complex pricing scenarios.</p>
232233
*
233234
234235
* @return null|CustomerGroupResourceIdentifier
235236
*/
236237
public function getCustomerGroup();
237238

239+
/**
240+
* <p>Customer Groups to assign the Customer to.</p>
241+
* <p>Used for <a href="/../api/pricing-and-discounts-overview#line-item-price-selection">Line Item price selection</a>.</p>
242+
*
243+
244+
* @return null|CustomerGroupAssignmentDraftCollection
245+
*/
246+
public function getCustomerGroupAssignments();
247+
238248
/**
239249
* <p>Custom Fields for the Customer.</p>
240250
*
@@ -283,14 +293,6 @@ public function getStores();
283293
*/
284294
public function getAuthenticationMode();
285295

286-
/**
287-
* <p>Customer Groups to assign the Customer to.</p>
288-
*
289-
290-
* @return null|CustomerGroupAssignmentDraftCollection
291-
*/
292-
public function getCustomerGroupAssignments();
293-
294296
/**
295297
* @param ?string $key
296298
*/
@@ -401,6 +403,11 @@ public function setIsEmailVerified(?bool $isEmailVerified): void;
401403
*/
402404
public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup): void;
403405

406+
/**
407+
* @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments
408+
*/
409+
public function setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments): void;
410+
404411
/**
405412
* @param ?CustomFieldsDraft $custom
406413
*/
@@ -425,9 +432,4 @@ public function setStores(?StoreResourceIdentifierCollection $stores): void;
425432
* @param ?string $authenticationMode
426433
*/
427434
public function setAuthenticationMode(?string $authenticationMode): void;
428-
429-
/**
430-
* @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments
431-
*/
432-
public function setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments): void;
433435
}

lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ final class CustomerDraftBuilder implements Builder
161161
*/
162162
private $customerGroup;
163163

164+
/**
165+
166+
* @var ?CustomerGroupAssignmentDraftCollection
167+
*/
168+
private $customerGroupAssignments;
169+
164170
/**
165171
166172
* @var null|CustomFieldsDraft|CustomFieldsDraftBuilder
@@ -191,12 +197,6 @@ final class CustomerDraftBuilder implements Builder
191197
*/
192198
private $authenticationMode;
193199

194-
/**
195-
196-
* @var ?CustomerGroupAssignmentDraftCollection
197-
*/
198-
private $customerGroupAssignments;
199-
200200
/**
201201
* <p>User-defined unique identifier for the Customer.
202202
* The <code>key</code> field is preferred over <code>customerNumber</code> as it is mutable and provides more flexibility.</p>
@@ -441,6 +441,7 @@ public function getIsEmailVerified()
441441

442442
/**
443443
* <p>Sets the <a href="ctp:api:type:CustomerGroup">CustomerGroup</a> for the Customer.</p>
444+
* <p>For new projects, use <code>customerGroupAssignments</code> instead. It supports assigning Customers to multiple Customer Groups and provides greater flexibility in complex pricing scenarios.</p>
444445
*
445446
446447
* @return null|CustomerGroupResourceIdentifier
@@ -450,6 +451,18 @@ public function getCustomerGroup()
450451
return $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup;
451452
}
452453

454+
/**
455+
* <p>Customer Groups to assign the Customer to.</p>
456+
* <p>Used for <a href="/../api/pricing-and-discounts-overview#line-item-price-selection">Line Item price selection</a>.</p>
457+
*
458+
459+
* @return null|CustomerGroupAssignmentDraftCollection
460+
*/
461+
public function getCustomerGroupAssignments()
462+
{
463+
return $this->customerGroupAssignments;
464+
}
465+
453466
/**
454467
* <p>Custom Fields for the Customer.</p>
455468
*
@@ -513,17 +526,6 @@ public function getAuthenticationMode()
513526
return $this->authenticationMode;
514527
}
515528

516-
/**
517-
* <p>Customer Groups to assign the Customer to.</p>
518-
*
519-
520-
* @return null|CustomerGroupAssignmentDraftCollection
521-
*/
522-
public function getCustomerGroupAssignments()
523-
{
524-
return $this->customerGroupAssignments;
525-
}
526-
527529
/**
528530
* @param ?string $key
529531
* @return $this
@@ -766,6 +768,17 @@ public function withCustomerGroup(?CustomerGroupResourceIdentifier $customerGrou
766768
return $this;
767769
}
768770

771+
/**
772+
* @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments
773+
* @return $this
774+
*/
775+
public function withCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments)
776+
{
777+
$this->customerGroupAssignments = $customerGroupAssignments;
778+
779+
return $this;
780+
}
781+
769782
/**
770783
* @param ?CustomFieldsDraft $custom
771784
* @return $this
@@ -821,17 +834,6 @@ public function withAuthenticationMode(?string $authenticationMode)
821834
return $this;
822835
}
823836

824-
/**
825-
* @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments
826-
* @return $this
827-
*/
828-
public function withCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments)
829-
{
830-
$this->customerGroupAssignments = $customerGroupAssignments;
831-
832-
return $this;
833-
}
834-
835837
/**
836838
* @deprecated use withAnonymousCart() instead
837839
* @return $this
@@ -890,12 +892,12 @@ public function build(): CustomerDraft
890892
$this->billingAddresses,
891893
$this->isEmailVerified,
892894
$this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup,
895+
$this->customerGroupAssignments,
893896
$this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
894897
$this->locale,
895898
$this->salutation,
896899
$this->stores,
897-
$this->authenticationMode,
898-
$this->customerGroupAssignments
900+
$this->authenticationMode
899901
);
900902
}
901903

0 commit comments

Comments
 (0)