Skip to content

Commit

Permalink
Merge pull request #580 from commercetools/gen-sdk-updates
Browse files Browse the repository at this point in the history
Update generated SDKs
  • Loading branch information
kodiakhq[bot] authored Feb 16, 2024
2 parents 69b6c9e + 333332e commit ee58b00
Show file tree
Hide file tree
Showing 15 changed files with 512 additions and 77 deletions.
34 changes: 4 additions & 30 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,15 @@
**Api changes**

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

- added method `apiRoot.withProjectKey().discountCodes().withKey().get()`
- added method `apiRoot.withProjectKey().discountCodes().withKey().head()`
- added method `apiRoot.withProjectKey().discountCodes().withKey().post()`
- added method `apiRoot.withProjectKey().discountCodes().withKey().delete()`
</details>


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

- added property `perMethodExternalTaxRate` to type `CartAddLineItemAction`
- added property `key` to type `DiscountCode`
- added property `key` to type `DiscountCodeDraft`
- added property `shippingMode` to type `MyCartDraft`
</details>


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

- added resource `/{projectKey}/discount-codes/key={key}`
- added type `DiscountedLineItemPortionDraft`
</details>


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

- added type `DiscountCodeSetKeyAction`
- added type `DiscountCodeCreatedMessage`
- added type `DiscountCodeDeletedMessage`
- added type `DiscountCodeKeySetMessage`
- added type `DiscountCodeCreatedMessagePayload`
- added type `DiscountCodeDeletedMessagePayload`
- added type `DiscountCodeKeySetMessagePayload`
- :warning: changed property `includedDiscounts` of type `DiscountedLineItemPriceDraft` from type `DiscountedLineItemPortion[]` to `DiscountedLineItemPortionDraft[]`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public interface DiscountedLineItemPortion {

/**
* <p>A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.</p>
* <p>A CartDiscountReference or DirectDiscountReference of the applicable discount on the Line Item.</p>
* @return discount
*/
@NotNull
Expand All @@ -44,7 +44,7 @@ public interface DiscountedLineItemPortion {
public Reference getDiscount();

/**
* <p>Money value of the discount applicable.</p>
* <p>Money value of the applicable discount.</p>
* @return discountedAmount
*/
@NotNull
Expand All @@ -53,14 +53,14 @@ public interface DiscountedLineItemPortion {
public TypedMoney getDiscountedAmount();

/**
* <p>A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.</p>
* <p>A CartDiscountReference or DirectDiscountReference of the applicable discount on the Line Item.</p>
* @param discount value to be set
*/

public void setDiscount(final Reference discount);

/**
* <p>Money value of the discount applicable.</p>
* <p>Money value of the applicable discount.</p>
* @param discountedAmount value to be set
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class DiscountedLineItemPortionBuilder implements Builder<DiscountedLineI
private com.commercetools.api.models.common.TypedMoney discountedAmount;

/**
* <p>A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.</p>
* <p>A CartDiscountReference or DirectDiscountReference of the applicable discount on the Line Item.</p>
* @param discount value to be set
* @return Builder
*/
Expand All @@ -39,7 +39,7 @@ public DiscountedLineItemPortionBuilder discount(final com.commercetools.api.mod
}

/**
* <p>A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.</p>
* <p>A CartDiscountReference or DirectDiscountReference of the applicable discount on the Line Item.</p>
* @param builder function to build the discount value
* @return Builder
*/
Expand All @@ -51,7 +51,7 @@ public DiscountedLineItemPortionBuilder discount(
}

/**
* <p>Money value of the discount applicable.</p>
* <p>Money value of the applicable discount.</p>
* @param discountedAmount value to be set
* @return Builder
*/
Expand All @@ -63,7 +63,7 @@ public DiscountedLineItemPortionBuilder discountedAmount(
}

/**
* <p>Money value of the discount applicable.</p>
* <p>Money value of the applicable discount.</p>
* @param builder function to build the discountedAmount value
* @return Builder
*/
Expand All @@ -75,7 +75,7 @@ public DiscountedLineItemPortionBuilder discountedAmount(
}

/**
* <p>A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.</p>
* <p>A CartDiscountReference or DirectDiscountReference of the applicable discount on the Line Item.</p>
* @return discount
*/

Expand All @@ -84,7 +84,7 @@ public com.commercetools.api.models.common.Reference getDiscount() {
}

/**
* <p>Money value of the discount applicable.</p>
* <p>Money value of the applicable discount.</p>
* @return discountedAmount
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@

package com.commercetools.api.models.cart;

import java.time.*;
import java.util.*;
import java.util.function.Function;

import javax.annotation.Nullable;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import com.commercetools.api.models.common.Reference;
import com.commercetools.api.models.common.TypedMoneyDraft;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;

import io.vrap.rmf.base.client.utils.Generated;

/**
* DiscountedLineItemPortionDraft
*
* <hr>
* Example to create an instance using the builder pattern
* <div class=code-example>
* <pre><code class='java'>
* DiscountedLineItemPortionDraft discountedLineItemPortionDraft = DiscountedLineItemPortionDraft.builder()
* .discount(discountBuilder -> discountBuilder)
* .discountedAmount(discountedAmountBuilder -> discountedAmountBuilder)
* .build()
* </code></pre>
* </div>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
@JsonDeserialize(as = DiscountedLineItemPortionDraftImpl.class)
public interface DiscountedLineItemPortionDraft extends io.vrap.rmf.base.client.Draft<DiscountedLineItemPortionDraft> {

/**
* <p>A CartDiscountReference or DirectDiscountReference for the discount applicable on the Line Item.</p>
* @return discount
*/
@NotNull
@Valid
@JsonProperty("discount")
public Reference getDiscount();

/**
* <p>Money value for the discount applicable.</p>
* @return discountedAmount
*/
@NotNull
@Valid
@JsonProperty("discountedAmount")
public TypedMoneyDraft getDiscountedAmount();

/**
* <p>A CartDiscountReference or DirectDiscountReference for the discount applicable on the Line Item.</p>
* @param discount value to be set
*/

public void setDiscount(final Reference discount);

/**
* <p>Money value for the discount applicable.</p>
* @param discountedAmount value to be set
*/

public void setDiscountedAmount(final TypedMoneyDraft discountedAmount);

/**
* factory method
* @return instance of DiscountedLineItemPortionDraft
*/
public static DiscountedLineItemPortionDraft of() {
return new DiscountedLineItemPortionDraftImpl();
}

/**
* factory method to create a shallow copy DiscountedLineItemPortionDraft
* @param template instance to be copied
* @return copy instance
*/
public static DiscountedLineItemPortionDraft of(final DiscountedLineItemPortionDraft template) {
DiscountedLineItemPortionDraftImpl instance = new DiscountedLineItemPortionDraftImpl();
instance.setDiscount(template.getDiscount());
instance.setDiscountedAmount(template.getDiscountedAmount());
return instance;
}

/**
* factory method to create a deep copy of DiscountedLineItemPortionDraft
* @param template instance to be copied
* @return copy instance
*/
@Nullable
public static DiscountedLineItemPortionDraft deepCopy(@Nullable final DiscountedLineItemPortionDraft template) {
if (template == null) {
return null;
}
DiscountedLineItemPortionDraftImpl instance = new DiscountedLineItemPortionDraftImpl();
instance.setDiscount(com.commercetools.api.models.common.Reference.deepCopy(template.getDiscount()));
instance.setDiscountedAmount(
com.commercetools.api.models.common.TypedMoneyDraft.deepCopy(template.getDiscountedAmount()));
return instance;
}

/**
* builder factory method for DiscountedLineItemPortionDraft
* @return builder
*/
public static DiscountedLineItemPortionDraftBuilder builder() {
return DiscountedLineItemPortionDraftBuilder.of();
}

/**
* create builder for DiscountedLineItemPortionDraft instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static DiscountedLineItemPortionDraftBuilder builder(final DiscountedLineItemPortionDraft template) {
return DiscountedLineItemPortionDraftBuilder.of(template);
}

/**
* accessor map function
* @param <T> mapped type
* @param helper function to map the object
* @return mapped value
*/
default <T> T withDiscountedLineItemPortionDraft(Function<DiscountedLineItemPortionDraft, T> helper) {
return helper.apply(this);
}

/**
* gives a TypeReference for usage with Jackson DataBind
* @return TypeReference
*/
public static com.fasterxml.jackson.core.type.TypeReference<DiscountedLineItemPortionDraft> typeReference() {
return new com.fasterxml.jackson.core.type.TypeReference<DiscountedLineItemPortionDraft>() {
@Override
public String toString() {
return "TypeReference<DiscountedLineItemPortionDraft>";
}
};
}
}
Loading

0 comments on commit ee58b00

Please sign in to comment.