Skip to content
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
1 change: 1 addition & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<details>
<summary>Added Property(s)</summary>

- added property `makeInheritedAssociatesExplicit` to type `BusinessUnitChangeAssociateModeAction`
- added property `discountGroup` to type `CartDiscount`
- added property `discountGroup` to type `CartDiscountDraft`
- added property `priceRoundingMode` to type `Cart`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2388,6 +2388,7 @@ input ChangeBusinessUnitAssociate {

input ChangeBusinessUnitAssociateMode {
associateMode: BusinessUnitAssociateMode!
makeInheritedAssociatesExplicit: Boolean = false
}

input ChangeBusinessUnitName {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* <pre><code class='java'>
* BusinessUnitChangeAssociateModeAction businessUnitChangeAssociateModeAction = BusinessUnitChangeAssociateModeAction.builder()
* .associateMode(BusinessUnitAssociateMode.EXPLICIT)
* .makeInheritedAssociatesExplicit(true)
* .build()
* </code></pre>
* </div>
Expand All @@ -45,13 +46,28 @@ public interface BusinessUnitChangeAssociateModeAction extends BusinessUnitUpdat
@JsonProperty("associateMode")
public BusinessUnitAssociateMode getAssociateMode();

/**
* <p>If set to <code>true</code> during a change to <code>associateMode="Explicit"</code>, all inherited Associates will be converted to explicit Associates.</p>
* @return makeInheritedAssociatesExplicit
*/
@NotNull
@JsonProperty("makeInheritedAssociatesExplicit")
public Boolean getMakeInheritedAssociatesExplicit();

/**
* <p>The new value for <code>associateMode</code>.</p>
* @param associateMode value to be set
*/

public void setAssociateMode(final BusinessUnitAssociateMode associateMode);

/**
* <p>If set to <code>true</code> during a change to <code>associateMode="Explicit"</code>, all inherited Associates will be converted to explicit Associates.</p>
* @param makeInheritedAssociatesExplicit value to be set
*/

public void setMakeInheritedAssociatesExplicit(final Boolean makeInheritedAssociatesExplicit);

/**
* factory method
* @return instance of BusinessUnitChangeAssociateModeAction
Expand All @@ -68,6 +84,7 @@ public static BusinessUnitChangeAssociateModeAction of() {
public static BusinessUnitChangeAssociateModeAction of(final BusinessUnitChangeAssociateModeAction template) {
BusinessUnitChangeAssociateModeActionImpl instance = new BusinessUnitChangeAssociateModeActionImpl();
instance.setAssociateMode(template.getAssociateMode());
instance.setMakeInheritedAssociatesExplicit(template.getMakeInheritedAssociatesExplicit());
return instance;
}

Expand All @@ -86,6 +103,7 @@ public static BusinessUnitChangeAssociateModeAction deepCopy(
}
BusinessUnitChangeAssociateModeActionImpl instance = new BusinessUnitChangeAssociateModeActionImpl();
instance.setAssociateMode(template.getAssociateMode());
instance.setMakeInheritedAssociatesExplicit(template.getMakeInheritedAssociatesExplicit());
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* <pre><code class='java'>
* BusinessUnitChangeAssociateModeAction businessUnitChangeAssociateModeAction = BusinessUnitChangeAssociateModeAction.builder()
* .associateMode(BusinessUnitAssociateMode.EXPLICIT)
* .makeInheritedAssociatesExplicit(true)
* .build()
* </code></pre>
* </div>
Expand All @@ -23,6 +24,8 @@ public class BusinessUnitChangeAssociateModeActionBuilder implements Builder<Bus

private com.commercetools.api.models.business_unit.BusinessUnitAssociateMode associateMode;

private Boolean makeInheritedAssociatesExplicit;

/**
* <p>The new value for <code>associateMode</code>.</p>
* @param associateMode value to be set
Expand All @@ -35,6 +38,18 @@ public BusinessUnitChangeAssociateModeActionBuilder associateMode(
return this;
}

/**
* <p>If set to <code>true</code> during a change to <code>associateMode="Explicit"</code>, all inherited Associates will be converted to explicit Associates.</p>
* @param makeInheritedAssociatesExplicit value to be set
* @return Builder
*/

public BusinessUnitChangeAssociateModeActionBuilder makeInheritedAssociatesExplicit(
final Boolean makeInheritedAssociatesExplicit) {
this.makeInheritedAssociatesExplicit = makeInheritedAssociatesExplicit;
return this;
}

/**
* <p>The new value for <code>associateMode</code>.</p>
* @return associateMode
Expand All @@ -44,22 +59,33 @@ public com.commercetools.api.models.business_unit.BusinessUnitAssociateMode getA
return this.associateMode;
}

/**
* <p>If set to <code>true</code> during a change to <code>associateMode="Explicit"</code>, all inherited Associates will be converted to explicit Associates.</p>
* @return makeInheritedAssociatesExplicit
*/

public Boolean getMakeInheritedAssociatesExplicit() {
return this.makeInheritedAssociatesExplicit;
}

/**
* builds BusinessUnitChangeAssociateModeAction with checking for non-null required values
* @return BusinessUnitChangeAssociateModeAction
*/
public BusinessUnitChangeAssociateModeAction build() {
Objects.requireNonNull(associateMode,
BusinessUnitChangeAssociateModeAction.class + ": associateMode is missing");
return new BusinessUnitChangeAssociateModeActionImpl(associateMode);
Objects.requireNonNull(makeInheritedAssociatesExplicit,
BusinessUnitChangeAssociateModeAction.class + ": makeInheritedAssociatesExplicit is missing");
return new BusinessUnitChangeAssociateModeActionImpl(associateMode, makeInheritedAssociatesExplicit);
}

/**
* builds BusinessUnitChangeAssociateModeAction without checking for non-null required values
* @return BusinessUnitChangeAssociateModeAction
*/
public BusinessUnitChangeAssociateModeAction buildUnchecked() {
return new BusinessUnitChangeAssociateModeActionImpl(associateMode);
return new BusinessUnitChangeAssociateModeActionImpl(associateMode, makeInheritedAssociatesExplicit);
}

/**
Expand All @@ -79,6 +105,7 @@ public static BusinessUnitChangeAssociateModeActionBuilder of(
final BusinessUnitChangeAssociateModeAction template) {
BusinessUnitChangeAssociateModeActionBuilder builder = new BusinessUnitChangeAssociateModeActionBuilder();
builder.associateMode = template.getAssociateMode();
builder.makeInheritedAssociatesExplicit = template.getMakeInheritedAssociatesExplicit();
return builder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ public class BusinessUnitChangeAssociateModeActionImpl implements BusinessUnitCh

private com.commercetools.api.models.business_unit.BusinessUnitAssociateMode associateMode;

private Boolean makeInheritedAssociatesExplicit;

/**
* create instance with all properties
*/
@JsonCreator
BusinessUnitChangeAssociateModeActionImpl(
@JsonProperty("associateMode") final com.commercetools.api.models.business_unit.BusinessUnitAssociateMode associateMode) {
@JsonProperty("associateMode") final com.commercetools.api.models.business_unit.BusinessUnitAssociateMode associateMode,
@JsonProperty("makeInheritedAssociatesExplicit") final Boolean makeInheritedAssociatesExplicit) {
this.associateMode = associateMode;
this.makeInheritedAssociatesExplicit = makeInheritedAssociatesExplicit;
this.action = CHANGE_ASSOCIATE_MODE;
}

Expand All @@ -59,11 +63,23 @@ public com.commercetools.api.models.business_unit.BusinessUnitAssociateMode getA
return this.associateMode;
}

/**
* <p>If set to <code>true</code> during a change to <code>associateMode="Explicit"</code>, all inherited Associates will be converted to explicit Associates.</p>
*/

public Boolean getMakeInheritedAssociatesExplicit() {
return this.makeInheritedAssociatesExplicit;
}

public void setAssociateMode(
final com.commercetools.api.models.business_unit.BusinessUnitAssociateMode associateMode) {
this.associateMode = associateMode;
}

public void setMakeInheritedAssociatesExplicit(final Boolean makeInheritedAssociatesExplicit) {
this.makeInheritedAssociatesExplicit = makeInheritedAssociatesExplicit;
}

@Override
public boolean equals(Object o) {
if (this == o)
Expand All @@ -76,20 +92,26 @@ public boolean equals(Object o) {

return new EqualsBuilder().append(action, that.action)
.append(associateMode, that.associateMode)
.append(makeInheritedAssociatesExplicit, that.makeInheritedAssociatesExplicit)
.append(action, that.action)
.append(associateMode, that.associateMode)
.append(makeInheritedAssociatesExplicit, that.makeInheritedAssociatesExplicit)
.isEquals();
}

@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(action).append(associateMode).toHashCode();
return new HashCodeBuilder(17, 37).append(action)
.append(associateMode)
.append(makeInheritedAssociatesExplicit)
.toHashCode();
}

@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("action", action)
.append("associateMode", associateMode)
.append("makeInheritedAssociatesExplicit", makeInheritedAssociatesExplicit)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@
p -> new CombinationQueryPredicate<>(p, BusinessUnitChangeAssociateModeActionQueryBuilderDsl::of));
}

public BooleanComparisonPredicateBuilder<BusinessUnitChangeAssociateModeActionQueryBuilderDsl> makeInheritedAssociatesExplicit() {
return new BooleanComparisonPredicateBuilder<>(
BinaryQueryPredicate.of().left(new ConstantQueryPredicate("makeInheritedAssociatesExplicit")),
p -> new CombinationQueryPredicate<>(p, BusinessUnitChangeAssociateModeActionQueryBuilderDsl::of));

Check warning on line 29 in commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/BusinessUnitChangeAssociateModeActionQueryBuilderDsl.java

View check run for this annotation

Codecov / codecov/patch

commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/BusinessUnitChangeAssociateModeActionQueryBuilderDsl.java#L27-L29

Added lines #L27 - L29 were not covered by tests
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ public void buildUnchecked(String name, BusinessUnitChangeAssociateModeActionBui
}

public static Object[][] objectBuilder() {
return new Object[][] { new Object[] { "associateMode", BusinessUnitChangeAssociateModeAction.builder()
.associateMode(
com.commercetools.api.models.business_unit.BusinessUnitAssociateMode.findEnum("Explicit")) } };
return new Object[][] {
new Object[] { "associateMode",
BusinessUnitChangeAssociateModeAction.builder()
.associateMode(com.commercetools.api.models.business_unit.BusinessUnitAssociateMode
.findEnum("Explicit")) },
new Object[] { "makeInheritedAssociatesExplicit",
BusinessUnitChangeAssociateModeAction.builder().makeInheritedAssociatesExplicit(true) } };
}

@Test
Expand All @@ -30,4 +34,11 @@ public void associateMode() {
Assertions.assertThat(value.getAssociateMode())
.isEqualTo(com.commercetools.api.models.business_unit.BusinessUnitAssociateMode.findEnum("Explicit"));
}

@Test
public void makeInheritedAssociatesExplicit() {
BusinessUnitChangeAssociateModeAction value = BusinessUnitChangeAssociateModeAction.of();
value.setMakeInheritedAssociatesExplicit(true);
Assertions.assertThat(value.getMakeInheritedAssociatesExplicit()).isEqualTo(true);
}
}
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,4 @@ b3b0734e82abb3a4e20169e403628c592806bc96
5146ba6cde23ba6b8d5262bf6e064fd1258700ba
c388d876a51d22b2b8a73249fe4694b297db6cd5
bb49fa04d50e4e0267846c7d805ae8ebc254bdea
619fb89cb6ac5d2a1d5f1b7d2f51a51e13e7ace9