Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated SDKs #820

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
**Api changes**

<details>
<summary>Changed Property(s)</summary>
<summary>Added Type(s)</summary>

- :warning: changed property `discount` of type `DiscountedTotalPricePortion` from type `CartDiscountReference` to `Reference`
- added type `ShoppingListSetBusinessUnitAction`
</details>


<details>
<summary>Added Property(s)</summary>

- added property `businessUnit` to type `ShoppingList`
- added property `businessUnit` to type `ShoppingListDraft`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import javax.annotation.Nullable;

import com.commercetools.api.models.business_unit.BusinessUnitKeyReference;
import com.commercetools.api.models.common.BaseResource;
import com.commercetools.api.models.common.CreatedBy;
import com.commercetools.api.models.common.LastModifiedBy;
Expand Down Expand Up @@ -150,6 +151,14 @@ public interface ShoppingList
@JsonProperty("store")
public StoreKeyReference getStore();

/**
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
* @return businessUnit
*/
@Valid
@JsonProperty("businessUnit")
public BusinessUnitKeyReference getBusinessUnit();

/**
* <p>Custom Fields defined for the ShoppingList.</p>
* @return custom
Expand Down Expand Up @@ -290,6 +299,13 @@ public interface ShoppingList

public void setStore(final StoreKeyReference store);

/**
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
* @param businessUnit value to be set
*/

public void setBusinessUnit(final BusinessUnitKeyReference businessUnit);

/**
* <p>Custom Fields defined for the ShoppingList.</p>
* @param custom value to be set
Expand Down Expand Up @@ -354,6 +370,7 @@ public static ShoppingList of(final ShoppingList template) {
instance.setDeleteDaysAfterLastModification(template.getDeleteDaysAfterLastModification());
instance.setAnonymousId(template.getAnonymousId());
instance.setStore(template.getStore());
instance.setBusinessUnit(template.getBusinessUnit());
instance.setCustom(template.getCustom());
instance.setLastModifiedBy(template.getLastModifiedBy());
instance.setCreatedBy(template.getCreatedBy());
Expand Down Expand Up @@ -394,6 +411,8 @@ public static ShoppingList deepCopy(@Nullable final ShoppingList template) {
instance.setDeleteDaysAfterLastModification(template.getDeleteDaysAfterLastModification());
instance.setAnonymousId(template.getAnonymousId());
instance.setStore(com.commercetools.api.models.store.StoreKeyReference.deepCopy(template.getStore()));
instance.setBusinessUnit(
com.commercetools.api.models.business_unit.BusinessUnitKeyReference.deepCopy(template.getBusinessUnit()));
instance.setCustom(com.commercetools.api.models.type.CustomFields.deepCopy(template.getCustom()));
instance.setLastModifiedBy(
com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public class ShoppingListBuilder implements Builder<ShoppingList> {
@Nullable
private com.commercetools.api.models.store.StoreKeyReference store;

@Nullable
private com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit;

@Nullable
private com.commercetools.api.models.type.CustomFields custom;

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

/**
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
* @param builder function to build the businessUnit value
* @return Builder
*/

public ShoppingListBuilder businessUnit(
Function<com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceBuilder, com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceBuilder> builder) {
this.businessUnit = builder
.apply(com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceBuilder.of())
.build();
return this;
}

/**
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
* @param builder function to build the businessUnit value
* @return Builder
*/

public ShoppingListBuilder withBusinessUnit(
Function<com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceBuilder, com.commercetools.api.models.business_unit.BusinessUnitKeyReference> builder) {
this.businessUnit = builder
.apply(com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceBuilder.of());
return this;
}

/**
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
* @param businessUnit value to be set
* @return Builder
*/

public ShoppingListBuilder businessUnit(
@Nullable final com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit) {
this.businessUnit = businessUnit;
return this;
}

/**
* <p>Custom Fields defined for the ShoppingList.</p>
* @param builder function to build the custom value
Expand Down Expand Up @@ -750,6 +792,16 @@ public com.commercetools.api.models.store.StoreKeyReference getStore() {
return this.store;
}

/**
* <p>Reference to the Business Unit the Shopping List belongs to.</p>
* @return businessUnit
*/

@Nullable
public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getBusinessUnit() {
return this.businessUnit;
}

/**
* <p>Custom Fields defined for the ShoppingList.</p>
* @return custom
Expand Down Expand Up @@ -793,8 +845,8 @@ public ShoppingList build() {
Objects.requireNonNull(lineItems, ShoppingList.class + ": lineItems is missing");
Objects.requireNonNull(textLineItems, ShoppingList.class + ": textLineItems is missing");
return new ShoppingListImpl(id, version, createdAt, lastModifiedAt, name, key, customer, slug, description,
lineItems, textLineItems, deleteDaysAfterLastModification, anonymousId, store, custom, lastModifiedBy,
createdBy);
lineItems, textLineItems, deleteDaysAfterLastModification, anonymousId, store, businessUnit, custom,
lastModifiedBy, createdBy);
}

/**
Expand All @@ -803,8 +855,8 @@ public ShoppingList build() {
*/
public ShoppingList buildUnchecked() {
return new ShoppingListImpl(id, version, createdAt, lastModifiedAt, name, key, customer, slug, description,
lineItems, textLineItems, deleteDaysAfterLastModification, anonymousId, store, custom, lastModifiedBy,
createdBy);
lineItems, textLineItems, deleteDaysAfterLastModification, anonymousId, store, businessUnit, custom,
lastModifiedBy, createdBy);
}

/**
Expand Down Expand Up @@ -836,6 +888,7 @@ public static ShoppingListBuilder of(final ShoppingList template) {
builder.deleteDaysAfterLastModification = template.getDeleteDaysAfterLastModification();
builder.anonymousId = template.getAnonymousId();
builder.store = template.getStore();
builder.businessUnit = template.getBusinessUnit();
builder.custom = template.getCustom();
builder.lastModifiedBy = template.getLastModifiedBy();
builder.createdBy = template.getCreatedBy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import javax.annotation.Nullable;

import com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier;
import com.commercetools.api.models.common.LocalizedString;
import com.commercetools.api.models.customer.CustomerResourceIdentifier;
import com.commercetools.api.models.store.StoreResourceIdentifier;
Expand Down Expand Up @@ -119,6 +120,14 @@ public interface ShoppingListDraft extends com.commercetools.api.models.Customiz
@JsonProperty("store")
public StoreResourceIdentifier getStore();

/**
* <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>
* @return businessUnit
*/
@Valid
@JsonProperty("businessUnit")
public BusinessUnitResourceIdentifier getBusinessUnit();

/**
* <p>Custom Fields defined for the ShoppingList.</p>
* @return custom
Expand Down Expand Up @@ -213,6 +222,13 @@ public interface ShoppingListDraft extends com.commercetools.api.models.Customiz

public void setStore(final StoreResourceIdentifier store);

/**
* <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>
* @param businessUnit value to be set
*/

public void setBusinessUnit(final BusinessUnitResourceIdentifier businessUnit);

/**
* <p>Custom Fields defined for the ShoppingList.</p>
* @param custom value to be set
Expand Down Expand Up @@ -245,6 +261,7 @@ public static ShoppingListDraft of(final ShoppingListDraft template) {
instance.setLineItems(template.getLineItems());
instance.setTextLineItems(template.getTextLineItems());
instance.setStore(template.getStore());
instance.setBusinessUnit(template.getBusinessUnit());
instance.setCustom(template.getCustom());
return instance;
}
Expand Down Expand Up @@ -280,6 +297,8 @@ public static ShoppingListDraft deepCopy(@Nullable final ShoppingListDraft templ
.collect(Collectors.toList()))
.orElse(null));
instance.setStore(com.commercetools.api.models.store.StoreResourceIdentifier.deepCopy(template.getStore()));
instance.setBusinessUnit(com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier
.deepCopy(template.getBusinessUnit()));
instance.setCustom(com.commercetools.api.models.type.CustomFieldsDraft.deepCopy(template.getCustom()));
return instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public class ShoppingListDraftBuilder implements Builder<ShoppingListDraft> {
@Nullable
private com.commercetools.api.models.store.StoreResourceIdentifier store;

@Nullable
private com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit;

@Nullable
private com.commercetools.api.models.type.CustomFieldsDraft custom;

Expand Down Expand Up @@ -454,6 +457,45 @@ public ShoppingListDraftBuilder store(
return this;
}

/**
* <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>
* @param builder function to build the businessUnit value
* @return Builder
*/

public ShoppingListDraftBuilder businessUnit(
Function<com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder, com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder> builder) {
this.businessUnit = builder
.apply(com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder.of())
.build();
return this;
}

/**
* <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>
* @param builder function to build the businessUnit value
* @return Builder
*/

public ShoppingListDraftBuilder withBusinessUnit(
Function<com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder, com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier> builder) {
this.businessUnit = builder
.apply(com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder.of());
return this;
}

/**
* <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>
* @param businessUnit value to be set
* @return Builder
*/

public ShoppingListDraftBuilder businessUnit(
@Nullable final com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit) {
this.businessUnit = businessUnit;
return this;
}

/**
* <p>Custom Fields defined for the ShoppingList.</p>
* @param builder function to build the custom value
Expand Down Expand Up @@ -588,6 +630,16 @@ public com.commercetools.api.models.store.StoreResourceIdentifier getStore() {
return this.store;
}

/**
* <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>
* @return businessUnit
*/

@Nullable
public com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier getBusinessUnit() {
return this.businessUnit;
}

/**
* <p>Custom Fields defined for the ShoppingList.</p>
* @return custom
Expand All @@ -605,7 +657,7 @@ public com.commercetools.api.models.type.CustomFieldsDraft getCustom() {
public ShoppingListDraft build() {
Objects.requireNonNull(name, ShoppingListDraft.class + ": name is missing");
return new ShoppingListDraftImpl(name, slug, customer, key, description, anonymousId,
deleteDaysAfterLastModification, lineItems, textLineItems, store, custom);
deleteDaysAfterLastModification, lineItems, textLineItems, store, businessUnit, custom);
}

/**
Expand All @@ -614,7 +666,7 @@ public ShoppingListDraft build() {
*/
public ShoppingListDraft buildUnchecked() {
return new ShoppingListDraftImpl(name, slug, customer, key, description, anonymousId,
deleteDaysAfterLastModification, lineItems, textLineItems, store, custom);
deleteDaysAfterLastModification, lineItems, textLineItems, store, businessUnit, custom);
}

/**
Expand Down Expand Up @@ -642,6 +694,7 @@ public static ShoppingListDraftBuilder of(final ShoppingListDraft template) {
builder.lineItems = template.getLineItems();
builder.textLineItems = template.getTextLineItems();
builder.store = template.getStore();
builder.businessUnit = template.getBusinessUnit();
builder.custom = template.getCustom();
return builder;
}
Expand Down
Loading