Skip to content

Commit

Permalink
build(codegen): updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Apr 24, 2024
1 parent c88df19 commit f215aca
Show file tree
Hide file tree
Showing 10 changed files with 199 additions and 84 deletions.
74 changes: 6 additions & 68 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,17 @@
**Api changes**

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

- :warning: changed property `custom` of type `MyBusinessUnitDraft` from type `CustomFields` to `CustomFieldsDraft`
- :warning: changed property `custom` of type `MyCompanyDraft` from type `CustomFields` to `CustomFieldsDraft`
- :warning: changed property `custom` of type `MyDivisionDraft` from type `CustomFields` to `CustomFieldsDraft`
</details>


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

- added property `attributedTo` to type `CreatedBy`
- added property `attributedTo` to type `LastModifiedBy`
- added property `postFilter` to type `ProductSearchRequest`
</details>


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

- :warning: changed property `stores` of type `BusinessUnit` to be required
- :warning: changed property `stores` of type `Company` to be required
- :warning: changed property `stores` of type `Division` to be required
- :warning: changed property `stores` of type `BusinessUnitSetStoresAction` to be required
- :warning: changed property `stores` of type `CartDiscountSetStoresAction` to be required
- :warning: changed property `stores` of type `Customer` to be required
- :warning: changed property `stores` of type `CustomerSetStoresAction` to be required
</details>


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

- added type `Attribution`
- added type `AttributionSource`
</details>


<details>
<summary>Removed Method(s)</summary>

- :warning: removed method `apiRoot.withProjectKey().products().search().head()`
</details>

**Import changes**

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

- added resource `/{projectKey}/discount-codes`
- added resource `/{projectKey}/discount-codes/import-containers`
- added resource `/{projectKey}/discount-codes/import-containers/{importContainerKey}`
</details>


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

- added method `apiRoot.withProjectKeyValue().discountCodes().importContainers().withImportContainerKeyValue().post()`
- marked property `PriceImport::publish` as deprecated
- marked property `ProductVariantImport::publish` as deprecated
</details>


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

- added type `DiscountCodeImportRequest`
- added type `DiscountCodeImport`
</details>


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

- added enum `discount-code` to type `ImportResourceType`
- added property `staged` to type `PriceImport`
- added property `staged` to type `ProductVariantImport`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,21 @@ public interface PriceImport extends ImportResource {
* <p>Only the Embedded Price updates will be published to <code>staged</code> and <code>current</code> projection.</p>
* @return publish
*/

@Deprecated
@JsonProperty("publish")
public Boolean getPublish();

/**
* <ul>
* <li>Set to <code>false</code> to update both the current and staged projections of the Product with the new Price data.</li>
* <li>Leave empty or set to <code>true</code> to only update the staged projection.</li>
* </ul>
* @return staged
*/

@JsonProperty("staged")
public Boolean getStaged();

/**
* <p>The tiered prices for this price.</p>
* @return tiers
Expand Down Expand Up @@ -212,9 +223,19 @@ public interface PriceImport extends ImportResource {
* <p>Only the Embedded Price updates will be published to <code>staged</code> and <code>current</code> projection.</p>
* @param publish value to be set
*/

@Deprecated
public void setPublish(final Boolean publish);

/**
* <ul>
* <li>Set to <code>false</code> to update both the current and staged projections of the Product with the new Price data.</li>
* <li>Leave empty or set to <code>true</code> to only update the staged projection.</li>
* </ul>
* @param staged value to be set
*/

public void setStaged(final Boolean staged);

/**
* <p>The tiered prices for this price.</p>
* @param tiers values to be set
Expand Down Expand Up @@ -275,6 +296,7 @@ public static PriceImport of(final PriceImport template) {
instance.setChannel(template.getChannel());
instance.setDiscounted(template.getDiscounted());
instance.setPublish(template.getPublish());
instance.setStaged(template.getStaged());
instance.setTiers(template.getTiers());
instance.setCustom(template.getCustom());
instance.setProductVariant(template.getProductVariant());
Expand Down Expand Up @@ -305,6 +327,7 @@ public static PriceImport deepCopy(@Nullable final PriceImport template) {
instance.setDiscounted(
com.commercetools.importapi.models.common.DiscountedPrice.deepCopy(template.getDiscounted()));
instance.setPublish(template.getPublish());
instance.setStaged(template.getStaged());
instance.setTiers(Optional.ofNullable(template.getTiers())
.map(t -> t.stream()
.map(com.commercetools.importapi.models.common.PriceTier::deepCopy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ public class PriceImportBuilder implements Builder<PriceImport> {
@Nullable
private com.commercetools.importapi.models.common.DiscountedPrice discounted;

@Deprecated
@Nullable
private Boolean publish;

@Nullable
private Boolean staged;

@Nullable
private java.util.List<com.commercetools.importapi.models.common.PriceTier> tiers;

Expand Down Expand Up @@ -245,12 +249,26 @@ public PriceImportBuilder discounted(
* @param publish value to be set
* @return Builder
*/

@Deprecated
public PriceImportBuilder publish(@Nullable final Boolean publish) {
this.publish = publish;
return this;
}

/**
* <ul>
* <li>Set to <code>false</code> to update both the current and staged projections of the Product with the new Price data.</li>
* <li>Leave empty or set to <code>true</code> to only update the staged projection.</li>
* </ul>
* @param staged value to be set
* @return Builder
*/

public PriceImportBuilder staged(@Nullable final Boolean staged) {
this.staged = staged;
return this;
}

/**
* <p>The tiered prices for this price.</p>
* @param tiers value to be set
Expand Down Expand Up @@ -529,12 +547,25 @@ public com.commercetools.importapi.models.common.DiscountedPrice getDiscounted()
* <p>Only the Embedded Price updates will be published to <code>staged</code> and <code>current</code> projection.</p>
* @return publish
*/

@Deprecated
@Nullable
public Boolean getPublish() {
return this.publish;
}

/**
* <ul>
* <li>Set to <code>false</code> to update both the current and staged projections of the Product with the new Price data.</li>
* <li>Leave empty or set to <code>true</code> to only update the staged projection.</li>
* </ul>
* @return staged
*/

@Nullable
public Boolean getStaged() {
return this.staged;
}

/**
* <p>The tiered prices for this price.</p>
* @return tiers
Expand Down Expand Up @@ -583,7 +614,7 @@ public PriceImport build() {
Objects.requireNonNull(productVariant, PriceImport.class + ": productVariant is missing");
Objects.requireNonNull(product, PriceImport.class + ": product is missing");
return new PriceImportImpl(key, value, country, validFrom, validUntil, customerGroup, channel, discounted,
publish, tiers, custom, productVariant, product);
publish, staged, tiers, custom, productVariant, product);
}

/**
Expand All @@ -592,7 +623,7 @@ public PriceImport build() {
*/
public PriceImport buildUnchecked() {
return new PriceImportImpl(key, value, country, validFrom, validUntil, customerGroup, channel, discounted,
publish, tiers, custom, productVariant, product);
publish, staged, tiers, custom, productVariant, product);
}

/**
Expand All @@ -619,6 +650,7 @@ public static PriceImportBuilder of(final PriceImport template) {
builder.channel = template.getChannel();
builder.discounted = template.getDiscounted();
builder.publish = template.getPublish();
builder.staged = template.getStaged();
builder.tiers = template.getTiers();
builder.custom = template.getCustom();
builder.productVariant = template.getProductVariant();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ public class PriceImportImpl implements PriceImport, ModelBase {

private com.commercetools.importapi.models.common.DiscountedPrice discounted;

@Deprecated
private Boolean publish;

private Boolean staged;

private java.util.List<com.commercetools.importapi.models.common.PriceTier> tiers;

private com.commercetools.importapi.models.customfields.Custom custom;
Expand All @@ -60,7 +63,7 @@ public class PriceImportImpl implements PriceImport, ModelBase {
@JsonProperty("customerGroup") final com.commercetools.importapi.models.common.CustomerGroupKeyReference customerGroup,
@JsonProperty("channel") final com.commercetools.importapi.models.common.ChannelKeyReference channel,
@JsonProperty("discounted") final com.commercetools.importapi.models.common.DiscountedPrice discounted,
@JsonProperty("publish") final Boolean publish,
@JsonProperty("publish") final Boolean publish, @JsonProperty("staged") final Boolean staged,
@JsonProperty("tiers") final java.util.List<com.commercetools.importapi.models.common.PriceTier> tiers,
@JsonProperty("custom") final com.commercetools.importapi.models.customfields.Custom custom,
@JsonProperty("productVariant") final com.commercetools.importapi.models.common.ProductVariantKeyReference productVariant,
Expand All @@ -74,6 +77,7 @@ public class PriceImportImpl implements PriceImport, ModelBase {
this.channel = channel;
this.discounted = discounted;
this.publish = publish;
this.staged = staged;
this.tiers = tiers;
this.custom = custom;
this.productVariant = productVariant;
Expand Down Expand Up @@ -153,11 +157,22 @@ public com.commercetools.importapi.models.common.DiscountedPrice getDiscounted()
/**
* <p>Only the Embedded Price updates will be published to <code>staged</code> and <code>current</code> projection.</p>
*/

@Deprecated
public Boolean getPublish() {
return this.publish;
}

/**
* <ul>
* <li>Set to <code>false</code> to update both the current and staged projections of the Product with the new Price data.</li>
* <li>Leave empty or set to <code>true</code> to only update the staged projection.</li>
* </ul>
*/

public Boolean getStaged() {
return this.staged;
}

/**
* <p>The tiered prices for this price.</p>
*/
Expand Down Expand Up @@ -223,10 +238,15 @@ public void setDiscounted(final com.commercetools.importapi.models.common.Discou
this.discounted = discounted;
}

@Deprecated
public void setPublish(final Boolean publish) {
this.publish = publish;
}

public void setStaged(final Boolean staged) {
this.staged = staged;
}

public void setTiers(final com.commercetools.importapi.models.common.PriceTier... tiers) {
this.tiers = new ArrayList<>(Arrays.asList(tiers));
}
Expand Down Expand Up @@ -267,6 +287,7 @@ public boolean equals(Object o) {
.append(channel, that.channel)
.append(discounted, that.discounted)
.append(publish, that.publish)
.append(staged, that.staged)
.append(tiers, that.tiers)
.append(custom, that.custom)
.append(productVariant, that.productVariant)
Expand All @@ -280,6 +301,7 @@ public boolean equals(Object o) {
.append(channel, that.channel)
.append(discounted, that.discounted)
.append(publish, that.publish)
.append(staged, that.staged)
.append(tiers, that.tiers)
.append(custom, that.custom)
.append(productVariant, that.productVariant)
Expand All @@ -298,6 +320,7 @@ public int hashCode() {
.append(channel)
.append(discounted)
.append(publish)
.append(staged)
.append(tiers)
.append(custom)
.append(productVariant)
Expand All @@ -316,6 +339,7 @@ public String toString() {
.append("channel", channel)
.append("discounted", discounted)
.append("publish", publish)
.append("staged", staged)
.append("tiers", tiers)
.append("custom", custom)
.append("productVariant", productVariant)
Expand Down
Loading

0 comments on commit f215aca

Please sign in to comment.