Skip to content

Commit 689c355

Browse files
Merge pull request #820 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents 12802cb + 9625f8d commit 689c355

20 files changed

+676
-8
lines changed

changes.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
**Api changes**
22

33
<details>
4-
<summary>Changed Property(s)</summary>
4+
<summary>Added Type(s)</summary>
55

6-
- :warning: changed property `discount` of type `DiscountedTotalPricePortion` from type `CartDiscountReference` to `Reference`
6+
- added type `ShoppingListSetBusinessUnitAction`
7+
</details>
8+
9+
10+
<details>
11+
<summary>Added Property(s)</summary>
12+
13+
- added property `businessUnit` to type `ShoppingList`
14+
- added property `businessUnit` to type `ShoppingListDraft`
715
</details>
816

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/shopping_list/ShoppingList.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import javax.annotation.Nullable;
1111

12+
import com.commercetools.api.models.business_unit.BusinessUnitKeyReference;
1213
import com.commercetools.api.models.common.BaseResource;
1314
import com.commercetools.api.models.common.CreatedBy;
1415
import com.commercetools.api.models.common.LastModifiedBy;
@@ -150,6 +151,14 @@ public interface ShoppingList
150151
@JsonProperty("store")
151152
public StoreKeyReference getStore();
152153

154+
/**
155+
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
156+
* @return businessUnit
157+
*/
158+
@Valid
159+
@JsonProperty("businessUnit")
160+
public BusinessUnitKeyReference getBusinessUnit();
161+
153162
/**
154163
* <p>Custom Fields defined for the ShoppingList.</p>
155164
* @return custom
@@ -290,6 +299,13 @@ public interface ShoppingList
290299

291300
public void setStore(final StoreKeyReference store);
292301

302+
/**
303+
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
304+
* @param businessUnit value to be set
305+
*/
306+
307+
public void setBusinessUnit(final BusinessUnitKeyReference businessUnit);
308+
293309
/**
294310
* <p>Custom Fields defined for the ShoppingList.</p>
295311
* @param custom value to be set
@@ -354,6 +370,7 @@ public static ShoppingList of(final ShoppingList template) {
354370
instance.setDeleteDaysAfterLastModification(template.getDeleteDaysAfterLastModification());
355371
instance.setAnonymousId(template.getAnonymousId());
356372
instance.setStore(template.getStore());
373+
instance.setBusinessUnit(template.getBusinessUnit());
357374
instance.setCustom(template.getCustom());
358375
instance.setLastModifiedBy(template.getLastModifiedBy());
359376
instance.setCreatedBy(template.getCreatedBy());
@@ -394,6 +411,8 @@ public static ShoppingList deepCopy(@Nullable final ShoppingList template) {
394411
instance.setDeleteDaysAfterLastModification(template.getDeleteDaysAfterLastModification());
395412
instance.setAnonymousId(template.getAnonymousId());
396413
instance.setStore(com.commercetools.api.models.store.StoreKeyReference.deepCopy(template.getStore()));
414+
instance.setBusinessUnit(
415+
com.commercetools.api.models.business_unit.BusinessUnitKeyReference.deepCopy(template.getBusinessUnit()));
397416
instance.setCustom(com.commercetools.api.models.type.CustomFields.deepCopy(template.getCustom()));
398417
instance.setLastModifiedBy(
399418
com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy()));

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/shopping_list/ShoppingListBuilder.java

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public class ShoppingListBuilder implements Builder<ShoppingList> {
6565
@Nullable
6666
private com.commercetools.api.models.store.StoreKeyReference store;
6767

68+
@Nullable
69+
private com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit;
70+
6871
@Nullable
6972
private com.commercetools.api.models.type.CustomFields custom;
7073

@@ -511,6 +514,45 @@ public ShoppingListBuilder store(@Nullable final com.commercetools.api.models.st
511514
return this;
512515
}
513516

517+
/**
518+
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
519+
* @param builder function to build the businessUnit value
520+
* @return Builder
521+
*/
522+
523+
public ShoppingListBuilder businessUnit(
524+
Function<com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceBuilder, com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceBuilder> builder) {
525+
this.businessUnit = builder
526+
.apply(com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceBuilder.of())
527+
.build();
528+
return this;
529+
}
530+
531+
/**
532+
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
533+
* @param builder function to build the businessUnit value
534+
* @return Builder
535+
*/
536+
537+
public ShoppingListBuilder withBusinessUnit(
538+
Function<com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceBuilder, com.commercetools.api.models.business_unit.BusinessUnitKeyReference> builder) {
539+
this.businessUnit = builder
540+
.apply(com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceBuilder.of());
541+
return this;
542+
}
543+
544+
/**
545+
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
546+
* @param businessUnit value to be set
547+
* @return Builder
548+
*/
549+
550+
public ShoppingListBuilder businessUnit(
551+
@Nullable final com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit) {
552+
this.businessUnit = businessUnit;
553+
return this;
554+
}
555+
514556
/**
515557
* <p>Custom Fields defined for the ShoppingList.</p>
516558
* @param builder function to build the custom value
@@ -750,6 +792,16 @@ public com.commercetools.api.models.store.StoreKeyReference getStore() {
750792
return this.store;
751793
}
752794

795+
/**
796+
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
797+
* @return businessUnit
798+
*/
799+
800+
@Nullable
801+
public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getBusinessUnit() {
802+
return this.businessUnit;
803+
}
804+
753805
/**
754806
* <p>Custom Fields defined for the ShoppingList.</p>
755807
* @return custom
@@ -793,8 +845,8 @@ public ShoppingList build() {
793845
Objects.requireNonNull(lineItems, ShoppingList.class + ": lineItems is missing");
794846
Objects.requireNonNull(textLineItems, ShoppingList.class + ": textLineItems is missing");
795847
return new ShoppingListImpl(id, version, createdAt, lastModifiedAt, name, key, customer, slug, description,
796-
lineItems, textLineItems, deleteDaysAfterLastModification, anonymousId, store, custom, lastModifiedBy,
797-
createdBy);
848+
lineItems, textLineItems, deleteDaysAfterLastModification, anonymousId, store, businessUnit, custom,
849+
lastModifiedBy, createdBy);
798850
}
799851

800852
/**
@@ -803,8 +855,8 @@ public ShoppingList build() {
803855
*/
804856
public ShoppingList buildUnchecked() {
805857
return new ShoppingListImpl(id, version, createdAt, lastModifiedAt, name, key, customer, slug, description,
806-
lineItems, textLineItems, deleteDaysAfterLastModification, anonymousId, store, custom, lastModifiedBy,
807-
createdBy);
858+
lineItems, textLineItems, deleteDaysAfterLastModification, anonymousId, store, businessUnit, custom,
859+
lastModifiedBy, createdBy);
808860
}
809861

810862
/**
@@ -836,6 +888,7 @@ public static ShoppingListBuilder of(final ShoppingList template) {
836888
builder.deleteDaysAfterLastModification = template.getDeleteDaysAfterLastModification();
837889
builder.anonymousId = template.getAnonymousId();
838890
builder.store = template.getStore();
891+
builder.businessUnit = template.getBusinessUnit();
839892
builder.custom = template.getCustom();
840893
builder.lastModifiedBy = template.getLastModifiedBy();
841894
builder.createdBy = template.getCreatedBy();

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/shopping_list/ShoppingListDraft.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import javax.annotation.Nullable;
1010

11+
import com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier;
1112
import com.commercetools.api.models.common.LocalizedString;
1213
import com.commercetools.api.models.customer.CustomerResourceIdentifier;
1314
import com.commercetools.api.models.store.StoreResourceIdentifier;
@@ -119,6 +120,14 @@ public interface ShoppingListDraft extends com.commercetools.api.models.Customiz
119120
@JsonProperty("store")
120121
public StoreResourceIdentifier getStore();
121122

123+
/**
124+
* <p>ResourceIdentifier of the Business Unit the Shopping List should belong to. When the <code>customer</code> of the Shopping List is set, the Customer must be an Associate of the Business Unit.</p>
125+
* @return businessUnit
126+
*/
127+
@Valid
128+
@JsonProperty("businessUnit")
129+
public BusinessUnitResourceIdentifier getBusinessUnit();
130+
122131
/**
123132
* <p>Custom Fields defined for the ShoppingList.</p>
124133
* @return custom
@@ -213,6 +222,13 @@ public interface ShoppingListDraft extends com.commercetools.api.models.Customiz
213222

214223
public void setStore(final StoreResourceIdentifier store);
215224

225+
/**
226+
* <p>ResourceIdentifier of the Business Unit the Shopping List should belong to. When the <code>customer</code> of the Shopping List is set, the Customer must be an Associate of the Business Unit.</p>
227+
* @param businessUnit value to be set
228+
*/
229+
230+
public void setBusinessUnit(final BusinessUnitResourceIdentifier businessUnit);
231+
216232
/**
217233
* <p>Custom Fields defined for the ShoppingList.</p>
218234
* @param custom value to be set
@@ -245,6 +261,7 @@ public static ShoppingListDraft of(final ShoppingListDraft template) {
245261
instance.setLineItems(template.getLineItems());
246262
instance.setTextLineItems(template.getTextLineItems());
247263
instance.setStore(template.getStore());
264+
instance.setBusinessUnit(template.getBusinessUnit());
248265
instance.setCustom(template.getCustom());
249266
return instance;
250267
}
@@ -280,6 +297,8 @@ public static ShoppingListDraft deepCopy(@Nullable final ShoppingListDraft templ
280297
.collect(Collectors.toList()))
281298
.orElse(null));
282299
instance.setStore(com.commercetools.api.models.store.StoreResourceIdentifier.deepCopy(template.getStore()));
300+
instance.setBusinessUnit(com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier
301+
.deepCopy(template.getBusinessUnit()));
283302
instance.setCustom(com.commercetools.api.models.type.CustomFieldsDraft.deepCopy(template.getCustom()));
284303
return instance;
285304
}

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/shopping_list/ShoppingListDraftBuilder.java

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public class ShoppingListDraftBuilder implements Builder<ShoppingListDraft> {
5353
@Nullable
5454
private com.commercetools.api.models.store.StoreResourceIdentifier store;
5555

56+
@Nullable
57+
private com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit;
58+
5659
@Nullable
5760
private com.commercetools.api.models.type.CustomFieldsDraft custom;
5861

@@ -454,6 +457,45 @@ public ShoppingListDraftBuilder store(
454457
return this;
455458
}
456459

460+
/**
461+
* <p>ResourceIdentifier of the Business Unit the Shopping List should belong to. When the <code>customer</code> of the Shopping List is set, the Customer must be an Associate of the Business Unit.</p>
462+
* @param builder function to build the businessUnit value
463+
* @return Builder
464+
*/
465+
466+
public ShoppingListDraftBuilder businessUnit(
467+
Function<com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder, com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder> builder) {
468+
this.businessUnit = builder
469+
.apply(com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder.of())
470+
.build();
471+
return this;
472+
}
473+
474+
/**
475+
* <p>ResourceIdentifier of the Business Unit the Shopping List should belong to. When the <code>customer</code> of the Shopping List is set, the Customer must be an Associate of the Business Unit.</p>
476+
* @param builder function to build the businessUnit value
477+
* @return Builder
478+
*/
479+
480+
public ShoppingListDraftBuilder withBusinessUnit(
481+
Function<com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder, com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier> builder) {
482+
this.businessUnit = builder
483+
.apply(com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder.of());
484+
return this;
485+
}
486+
487+
/**
488+
* <p>ResourceIdentifier of the Business Unit the Shopping List should belong to. When the <code>customer</code> of the Shopping List is set, the Customer must be an Associate of the Business Unit.</p>
489+
* @param businessUnit value to be set
490+
* @return Builder
491+
*/
492+
493+
public ShoppingListDraftBuilder businessUnit(
494+
@Nullable final com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit) {
495+
this.businessUnit = businessUnit;
496+
return this;
497+
}
498+
457499
/**
458500
* <p>Custom Fields defined for the ShoppingList.</p>
459501
* @param builder function to build the custom value
@@ -588,6 +630,16 @@ public com.commercetools.api.models.store.StoreResourceIdentifier getStore() {
588630
return this.store;
589631
}
590632

633+
/**
634+
* <p>ResourceIdentifier of the Business Unit the Shopping List should belong to. When the <code>customer</code> of the Shopping List is set, the Customer must be an Associate of the Business Unit.</p>
635+
* @return businessUnit
636+
*/
637+
638+
@Nullable
639+
public com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier getBusinessUnit() {
640+
return this.businessUnit;
641+
}
642+
591643
/**
592644
* <p>Custom Fields defined for the ShoppingList.</p>
593645
* @return custom
@@ -605,7 +657,7 @@ public com.commercetools.api.models.type.CustomFieldsDraft getCustom() {
605657
public ShoppingListDraft build() {
606658
Objects.requireNonNull(name, ShoppingListDraft.class + ": name is missing");
607659
return new ShoppingListDraftImpl(name, slug, customer, key, description, anonymousId,
608-
deleteDaysAfterLastModification, lineItems, textLineItems, store, custom);
660+
deleteDaysAfterLastModification, lineItems, textLineItems, store, businessUnit, custom);
609661
}
610662

611663
/**
@@ -614,7 +666,7 @@ public ShoppingListDraft build() {
614666
*/
615667
public ShoppingListDraft buildUnchecked() {
616668
return new ShoppingListDraftImpl(name, slug, customer, key, description, anonymousId,
617-
deleteDaysAfterLastModification, lineItems, textLineItems, store, custom);
669+
deleteDaysAfterLastModification, lineItems, textLineItems, store, businessUnit, custom);
618670
}
619671

620672
/**
@@ -642,6 +694,7 @@ public static ShoppingListDraftBuilder of(final ShoppingListDraft template) {
642694
builder.lineItems = template.getLineItems();
643695
builder.textLineItems = template.getTextLineItems();
644696
builder.store = template.getStore();
697+
builder.businessUnit = template.getBusinessUnit();
645698
builder.custom = template.getCustom();
646699
return builder;
647700
}

0 commit comments

Comments
 (0)