-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #838 from commercetools/gen-sdk-updates
Update generated SDKs
- Loading branch information
Showing
31 changed files
with
1,184 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
...ools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDeal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
|
||
package com.commercetools.api.models.cart; | ||
|
||
import java.time.*; | ||
import java.util.*; | ||
import java.util.function.Function; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
import com.fasterxml.jackson.annotation.*; | ||
import com.fasterxml.jackson.databind.annotation.*; | ||
|
||
import io.vrap.rmf.base.client.utils.Generated; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
|
||
/** | ||
* <p>Indicates the best deal logic applies to a Cart or Order and indicates the discount type that offers the best deal.</p> | ||
* | ||
* <hr> | ||
* Example to create an instance using the builder pattern | ||
* <div class=code-example> | ||
* <pre><code class='java'> | ||
* BestDeal bestDeal = BestDeal.builder() | ||
* .chosenDiscountType("{chosenDiscountType}") | ||
* .build() | ||
* </code></pre> | ||
* </div> | ||
*/ | ||
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") | ||
@JsonDeserialize(as = BestDealImpl.class) | ||
public interface BestDeal extends DiscountTypeCombination { | ||
|
||
/** | ||
* discriminator value for BestDeal | ||
*/ | ||
String BEST_DEAL = "BestDeal"; | ||
|
||
/** | ||
* <p>Discount type that offers the best deal; the value can be <code>product-discount</code> or <code>cart-discount</code>.</p> | ||
* @return chosenDiscountType | ||
*/ | ||
@NotNull | ||
@JsonProperty("chosenDiscountType") | ||
public String getChosenDiscountType(); | ||
|
||
/** | ||
* <p>Discount type that offers the best deal; the value can be <code>product-discount</code> or <code>cart-discount</code>.</p> | ||
* @param chosenDiscountType value to be set | ||
*/ | ||
|
||
public void setChosenDiscountType(final String chosenDiscountType); | ||
|
||
/** | ||
* factory method | ||
* @return instance of BestDeal | ||
*/ | ||
public static BestDeal of() { | ||
return new BestDealImpl(); | ||
} | ||
|
||
/** | ||
* factory method to create a shallow copy BestDeal | ||
* @param template instance to be copied | ||
* @return copy instance | ||
*/ | ||
public static BestDeal of(final BestDeal template) { | ||
BestDealImpl instance = new BestDealImpl(); | ||
instance.setChosenDiscountType(template.getChosenDiscountType()); | ||
return instance; | ||
} | ||
|
||
/** | ||
* factory method to create a deep copy of BestDeal | ||
* @param template instance to be copied | ||
* @return copy instance | ||
*/ | ||
@Nullable | ||
public static BestDeal deepCopy(@Nullable final BestDeal template) { | ||
if (template == null) { | ||
return null; | ||
} | ||
BestDealImpl instance = new BestDealImpl(); | ||
instance.setChosenDiscountType(template.getChosenDiscountType()); | ||
return instance; | ||
} | ||
|
||
/** | ||
* builder factory method for BestDeal | ||
* @return builder | ||
*/ | ||
public static BestDealBuilder builder() { | ||
return BestDealBuilder.of(); | ||
} | ||
|
||
/** | ||
* create builder for BestDeal instance | ||
* @param template instance with prefilled values for the builder | ||
* @return builder | ||
*/ | ||
public static BestDealBuilder builder(final BestDeal template) { | ||
return BestDealBuilder.of(template); | ||
} | ||
|
||
/** | ||
* accessor map function | ||
* @param <T> mapped type | ||
* @param helper function to map the object | ||
* @return mapped value | ||
*/ | ||
default <T> T withBestDeal(Function<BestDeal, T> helper) { | ||
return helper.apply(this); | ||
} | ||
|
||
/** | ||
* gives a TypeReference for usage with Jackson DataBind | ||
* @return TypeReference | ||
*/ | ||
public static com.fasterxml.jackson.core.type.TypeReference<BestDeal> typeReference() { | ||
return new com.fasterxml.jackson.core.type.TypeReference<BestDeal>() { | ||
@Override | ||
public String toString() { | ||
return "TypeReference<BestDeal>"; | ||
} | ||
}; | ||
} | ||
} |
82 changes: 82 additions & 0 deletions
82
...k-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDealBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
|
||
package com.commercetools.api.models.cart; | ||
|
||
import java.util.*; | ||
|
||
import io.vrap.rmf.base.client.Builder; | ||
import io.vrap.rmf.base.client.utils.Generated; | ||
|
||
/** | ||
* BestDealBuilder | ||
* <hr> | ||
* Example to create an instance using the builder pattern | ||
* <div class=code-example> | ||
* <pre><code class='java'> | ||
* BestDeal bestDeal = BestDeal.builder() | ||
* .chosenDiscountType("{chosenDiscountType}") | ||
* .build() | ||
* </code></pre> | ||
* </div> | ||
*/ | ||
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") | ||
public class BestDealBuilder implements Builder<BestDeal> { | ||
|
||
private String chosenDiscountType; | ||
|
||
/** | ||
* <p>Discount type that offers the best deal; the value can be <code>product-discount</code> or <code>cart-discount</code>.</p> | ||
* @param chosenDiscountType value to be set | ||
* @return Builder | ||
*/ | ||
|
||
public BestDealBuilder chosenDiscountType(final String chosenDiscountType) { | ||
this.chosenDiscountType = chosenDiscountType; | ||
return this; | ||
} | ||
|
||
/** | ||
* <p>Discount type that offers the best deal; the value can be <code>product-discount</code> or <code>cart-discount</code>.</p> | ||
* @return chosenDiscountType | ||
*/ | ||
|
||
public String getChosenDiscountType() { | ||
return this.chosenDiscountType; | ||
} | ||
|
||
/** | ||
* builds BestDeal with checking for non-null required values | ||
* @return BestDeal | ||
*/ | ||
public BestDeal build() { | ||
Objects.requireNonNull(chosenDiscountType, BestDeal.class + ": chosenDiscountType is missing"); | ||
return new BestDealImpl(chosenDiscountType); | ||
} | ||
|
||
/** | ||
* builds BestDeal without checking for non-null required values | ||
* @return BestDeal | ||
*/ | ||
public BestDeal buildUnchecked() { | ||
return new BestDealImpl(chosenDiscountType); | ||
} | ||
|
||
/** | ||
* factory method for an instance of BestDealBuilder | ||
* @return builder | ||
*/ | ||
public static BestDealBuilder of() { | ||
return new BestDealBuilder(); | ||
} | ||
|
||
/** | ||
* create builder for BestDeal instance | ||
* @param template instance with prefilled values for the builder | ||
* @return builder | ||
*/ | ||
public static BestDealBuilder of(final BestDeal template) { | ||
BestDealBuilder builder = new BestDealBuilder(); | ||
builder.chosenDiscountType = template.getChosenDiscountType(); | ||
return builder; | ||
} | ||
|
||
} |
94 changes: 94 additions & 0 deletions
94
...-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/BestDealImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
|
||
package com.commercetools.api.models.cart; | ||
|
||
import java.time.*; | ||
import java.util.*; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.*; | ||
|
||
import io.vrap.rmf.base.client.ModelBase; | ||
import io.vrap.rmf.base.client.utils.Generated; | ||
|
||
import org.apache.commons.lang3.builder.EqualsBuilder; | ||
import org.apache.commons.lang3.builder.HashCodeBuilder; | ||
import org.apache.commons.lang3.builder.ToStringBuilder; | ||
import org.apache.commons.lang3.builder.ToStringStyle; | ||
|
||
/** | ||
* <p>Indicates the best deal logic applies to a Cart or Order and indicates the discount type that offers the best deal.</p> | ||
*/ | ||
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") | ||
public class BestDealImpl implements BestDeal, ModelBase { | ||
|
||
private String type; | ||
|
||
private String chosenDiscountType; | ||
|
||
/** | ||
* create instance with all properties | ||
*/ | ||
@JsonCreator | ||
BestDealImpl(@JsonProperty("chosenDiscountType") final String chosenDiscountType) { | ||
this.chosenDiscountType = chosenDiscountType; | ||
this.type = BEST_DEAL; | ||
} | ||
|
||
/** | ||
* create empty instance | ||
*/ | ||
public BestDealImpl() { | ||
this.type = BEST_DEAL; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
|
||
public String getType() { | ||
return this.type; | ||
} | ||
|
||
/** | ||
* <p>Discount type that offers the best deal; the value can be <code>product-discount</code> or <code>cart-discount</code>.</p> | ||
*/ | ||
|
||
public String getChosenDiscountType() { | ||
return this.chosenDiscountType; | ||
} | ||
|
||
public void setChosenDiscountType(final String chosenDiscountType) { | ||
this.chosenDiscountType = chosenDiscountType; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
|
||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
|
||
BestDealImpl that = (BestDealImpl) o; | ||
|
||
return new EqualsBuilder().append(type, that.type) | ||
.append(chosenDiscountType, that.chosenDiscountType) | ||
.append(type, that.type) | ||
.append(chosenDiscountType, that.chosenDiscountType) | ||
.isEquals(); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return new HashCodeBuilder(17, 37).append(type).append(chosenDiscountType).toHashCode(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type) | ||
.append("chosenDiscountType", chosenDiscountType) | ||
.build(); | ||
} | ||
|
||
} |
Oops, something went wrong.