Skip to content

Commit b2b9356

Browse files
committed
build(codegen): updating SDK
1 parent 21dba51 commit b2b9356

31 files changed

+1184
-26
lines changed

changes.md

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,17 @@
33
<details>
44
<summary>Added Type(s)</summary>
55

6-
- added type `AssociateRoleNameSetMessage`
7-
- added type `AssociateRoleNameSetMessagePayload`
6+
- added type `BestDeal`
7+
- added type `DiscountTypeCombination`
8+
- added type `Stacking`
89
</details>
910

1011

1112
<details>
12-
<summary>Removed Type(s)</summary>
13+
<summary>Added Property(s)</summary>
1314

14-
- :warning: removed type `AssociateRoleNameChangedMessage`
15-
- :warning: removed type `AssociateRoleNameChangedMessagePayload`
16-
</details>
17-
18-
**History changes**
19-
20-
<details>
21-
<summary>Removed Enum(s)</summary>
22-
23-
- :warning: removed enum `setAsssetKey` from type `UpdateType`
24-
</details>
25-
26-
27-
<details>
28-
<summary>Added Enum(s)</summary>
29-
30-
- added enum `setAssetKey` to type `UpdateType`
15+
- added property `discountTypeCombination` to type `Cart`
16+
- added property `discountTypeCombination` to type `StagedOrder`
17+
- added property `discountTypeCombination` to type `Order`
3118
</details>
3219

commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,7 @@ type Cart implements Versioned & ReferenceExpandable {
17371737
taxedShippingPrice: TaxedPrice
17381738
shippingMode: ShippingMode!
17391739
shippingCustomFields: CustomFieldsType
1740+
discountTypeCombination: DiscountTypeCombination
17401741
cartState: CartState!
17411742
key: String
17421743
custom: CustomFieldsType
@@ -1963,6 +1964,25 @@ input CartDiscountValueInput {
19631964
giftLineItem: GiftLineItemValueInput
19641965
}
19651966

1967+
"Chosen discount type for the cart as part of best deal"
1968+
enum ChosenDiscountType {
1969+
CartDiscount
1970+
ProductDiscount
1971+
}
1972+
1973+
interface DiscountTypeCombination {
1974+
type: String!
1975+
}
1976+
1977+
type Stacking implements DiscountTypeCombination {
1978+
type: String!
1979+
}
1980+
1981+
type BestDeal implements DiscountTypeCombination {
1982+
type: String!
1983+
chosenDiscountType: ChosenDiscountType
1984+
}
1985+
19661986
input CartDraft {
19671987
currency: Currency!
19681988
country: Country
@@ -6820,6 +6840,7 @@ type Order implements Versioned & ReferenceExpandable {
68206840
shippingInfo: ShippingInfo
68216841
discountCodes: [DiscountCodeInfo!]!
68226842
directDiscounts: [DirectDiscount!]!
6843+
discountTypeCombination: DiscountTypeCombination
68236844
refusedGifts: [CartDiscount!]!
68246845
refusedGiftsRefs: [Reference!]!
68256846
paymentInfo: PaymentInfo
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
2+
package com.commercetools.api.models.cart;
3+
4+
import java.time.*;
5+
import java.util.*;
6+
import java.util.function.Function;
7+
8+
import javax.annotation.Nullable;
9+
10+
import com.fasterxml.jackson.annotation.*;
11+
import com.fasterxml.jackson.databind.annotation.*;
12+
13+
import io.vrap.rmf.base.client.utils.Generated;
14+
15+
import jakarta.validation.constraints.NotNull;
16+
17+
/**
18+
* <p>Indicates the best deal logic applies to a Cart or Order and indicates the discount type that offers the best deal.</p>
19+
*
20+
* <hr>
21+
* Example to create an instance using the builder pattern
22+
* <div class=code-example>
23+
* <pre><code class='java'>
24+
* BestDeal bestDeal = BestDeal.builder()
25+
* .chosenDiscountType("{chosenDiscountType}")
26+
* .build()
27+
* </code></pre>
28+
* </div>
29+
*/
30+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
31+
@JsonDeserialize(as = BestDealImpl.class)
32+
public interface BestDeal extends DiscountTypeCombination {
33+
34+
/**
35+
* discriminator value for BestDeal
36+
*/
37+
String BEST_DEAL = "BestDeal";
38+
39+
/**
40+
* <p>Discount type that offers the best deal; the value can be <code>product-discount</code> or <code>cart-discount</code>.</p>
41+
* @return chosenDiscountType
42+
*/
43+
@NotNull
44+
@JsonProperty("chosenDiscountType")
45+
public String getChosenDiscountType();
46+
47+
/**
48+
* <p>Discount type that offers the best deal; the value can be <code>product-discount</code> or <code>cart-discount</code>.</p>
49+
* @param chosenDiscountType value to be set
50+
*/
51+
52+
public void setChosenDiscountType(final String chosenDiscountType);
53+
54+
/**
55+
* factory method
56+
* @return instance of BestDeal
57+
*/
58+
public static BestDeal of() {
59+
return new BestDealImpl();
60+
}
61+
62+
/**
63+
* factory method to create a shallow copy BestDeal
64+
* @param template instance to be copied
65+
* @return copy instance
66+
*/
67+
public static BestDeal of(final BestDeal template) {
68+
BestDealImpl instance = new BestDealImpl();
69+
instance.setChosenDiscountType(template.getChosenDiscountType());
70+
return instance;
71+
}
72+
73+
/**
74+
* factory method to create a deep copy of BestDeal
75+
* @param template instance to be copied
76+
* @return copy instance
77+
*/
78+
@Nullable
79+
public static BestDeal deepCopy(@Nullable final BestDeal template) {
80+
if (template == null) {
81+
return null;
82+
}
83+
BestDealImpl instance = new BestDealImpl();
84+
instance.setChosenDiscountType(template.getChosenDiscountType());
85+
return instance;
86+
}
87+
88+
/**
89+
* builder factory method for BestDeal
90+
* @return builder
91+
*/
92+
public static BestDealBuilder builder() {
93+
return BestDealBuilder.of();
94+
}
95+
96+
/**
97+
* create builder for BestDeal instance
98+
* @param template instance with prefilled values for the builder
99+
* @return builder
100+
*/
101+
public static BestDealBuilder builder(final BestDeal template) {
102+
return BestDealBuilder.of(template);
103+
}
104+
105+
/**
106+
* accessor map function
107+
* @param <T> mapped type
108+
* @param helper function to map the object
109+
* @return mapped value
110+
*/
111+
default <T> T withBestDeal(Function<BestDeal, T> helper) {
112+
return helper.apply(this);
113+
}
114+
115+
/**
116+
* gives a TypeReference for usage with Jackson DataBind
117+
* @return TypeReference
118+
*/
119+
public static com.fasterxml.jackson.core.type.TypeReference<BestDeal> typeReference() {
120+
return new com.fasterxml.jackson.core.type.TypeReference<BestDeal>() {
121+
@Override
122+
public String toString() {
123+
return "TypeReference<BestDeal>";
124+
}
125+
};
126+
}
127+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
2+
package com.commercetools.api.models.cart;
3+
4+
import java.util.*;
5+
6+
import io.vrap.rmf.base.client.Builder;
7+
import io.vrap.rmf.base.client.utils.Generated;
8+
9+
/**
10+
* BestDealBuilder
11+
* <hr>
12+
* Example to create an instance using the builder pattern
13+
* <div class=code-example>
14+
* <pre><code class='java'>
15+
* BestDeal bestDeal = BestDeal.builder()
16+
* .chosenDiscountType("{chosenDiscountType}")
17+
* .build()
18+
* </code></pre>
19+
* </div>
20+
*/
21+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
22+
public class BestDealBuilder implements Builder<BestDeal> {
23+
24+
private String chosenDiscountType;
25+
26+
/**
27+
* <p>Discount type that offers the best deal; the value can be <code>product-discount</code> or <code>cart-discount</code>.</p>
28+
* @param chosenDiscountType value to be set
29+
* @return Builder
30+
*/
31+
32+
public BestDealBuilder chosenDiscountType(final String chosenDiscountType) {
33+
this.chosenDiscountType = chosenDiscountType;
34+
return this;
35+
}
36+
37+
/**
38+
* <p>Discount type that offers the best deal; the value can be <code>product-discount</code> or <code>cart-discount</code>.</p>
39+
* @return chosenDiscountType
40+
*/
41+
42+
public String getChosenDiscountType() {
43+
return this.chosenDiscountType;
44+
}
45+
46+
/**
47+
* builds BestDeal with checking for non-null required values
48+
* @return BestDeal
49+
*/
50+
public BestDeal build() {
51+
Objects.requireNonNull(chosenDiscountType, BestDeal.class + ": chosenDiscountType is missing");
52+
return new BestDealImpl(chosenDiscountType);
53+
}
54+
55+
/**
56+
* builds BestDeal without checking for non-null required values
57+
* @return BestDeal
58+
*/
59+
public BestDeal buildUnchecked() {
60+
return new BestDealImpl(chosenDiscountType);
61+
}
62+
63+
/**
64+
* factory method for an instance of BestDealBuilder
65+
* @return builder
66+
*/
67+
public static BestDealBuilder of() {
68+
return new BestDealBuilder();
69+
}
70+
71+
/**
72+
* create builder for BestDeal instance
73+
* @param template instance with prefilled values for the builder
74+
* @return builder
75+
*/
76+
public static BestDealBuilder of(final BestDeal template) {
77+
BestDealBuilder builder = new BestDealBuilder();
78+
builder.chosenDiscountType = template.getChosenDiscountType();
79+
return builder;
80+
}
81+
82+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
package com.commercetools.api.models.cart;
3+
4+
import java.time.*;
5+
import java.util.*;
6+
7+
import com.fasterxml.jackson.annotation.JsonCreator;
8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
import com.fasterxml.jackson.databind.annotation.*;
10+
11+
import io.vrap.rmf.base.client.ModelBase;
12+
import io.vrap.rmf.base.client.utils.Generated;
13+
14+
import org.apache.commons.lang3.builder.EqualsBuilder;
15+
import org.apache.commons.lang3.builder.HashCodeBuilder;
16+
import org.apache.commons.lang3.builder.ToStringBuilder;
17+
import org.apache.commons.lang3.builder.ToStringStyle;
18+
19+
/**
20+
* <p>Indicates the best deal logic applies to a Cart or Order and indicates the discount type that offers the best deal.</p>
21+
*/
22+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
23+
public class BestDealImpl implements BestDeal, ModelBase {
24+
25+
private String type;
26+
27+
private String chosenDiscountType;
28+
29+
/**
30+
* create instance with all properties
31+
*/
32+
@JsonCreator
33+
BestDealImpl(@JsonProperty("chosenDiscountType") final String chosenDiscountType) {
34+
this.chosenDiscountType = chosenDiscountType;
35+
this.type = BEST_DEAL;
36+
}
37+
38+
/**
39+
* create empty instance
40+
*/
41+
public BestDealImpl() {
42+
this.type = BEST_DEAL;
43+
}
44+
45+
/**
46+
*
47+
*/
48+
49+
public String getType() {
50+
return this.type;
51+
}
52+
53+
/**
54+
* <p>Discount type that offers the best deal; the value can be <code>product-discount</code> or <code>cart-discount</code>.</p>
55+
*/
56+
57+
public String getChosenDiscountType() {
58+
return this.chosenDiscountType;
59+
}
60+
61+
public void setChosenDiscountType(final String chosenDiscountType) {
62+
this.chosenDiscountType = chosenDiscountType;
63+
}
64+
65+
@Override
66+
public boolean equals(Object o) {
67+
if (this == o)
68+
return true;
69+
70+
if (o == null || getClass() != o.getClass())
71+
return false;
72+
73+
BestDealImpl that = (BestDealImpl) o;
74+
75+
return new EqualsBuilder().append(type, that.type)
76+
.append(chosenDiscountType, that.chosenDiscountType)
77+
.append(type, that.type)
78+
.append(chosenDiscountType, that.chosenDiscountType)
79+
.isEquals();
80+
}
81+
82+
@Override
83+
public int hashCode() {
84+
return new HashCodeBuilder(17, 37).append(type).append(chosenDiscountType).toHashCode();
85+
}
86+
87+
@Override
88+
public String toString() {
89+
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type)
90+
.append("chosenDiscountType", chosenDiscountType)
91+
.build();
92+
}
93+
94+
}

0 commit comments

Comments
 (0)