001 002package com.commercetools.api.models.message; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.constraints.NotNull; 010 011import com.commercetools.api.models.product.ProductPriceModeEnum; 012import com.fasterxml.jackson.annotation.*; 013import com.fasterxml.jackson.databind.annotation.*; 014 015import io.vrap.rmf.base.client.utils.Generated; 016 017/** 018 * <p>Generated after a successful Set PriceMode update action.</p> 019 * 020 * <hr> 021 * Example to create an instance using the builder pattern 022 * <div class=code-example> 023 * <pre><code class='java'> 024 * ProductPriceModeSetMessagePayload productPriceModeSetMessagePayload = ProductPriceModeSetMessagePayload.builder() 025 * .to(ProductPriceModeEnum.EMBEDDED) 026 * .build() 027 * </code></pre> 028 * </div> 029 */ 030@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 031@JsonDeserialize(as = ProductPriceModeSetMessagePayloadImpl.class) 032public interface ProductPriceModeSetMessagePayload extends MessagePayload { 033 034 /** 035 * discriminator value for ProductPriceModeSetMessagePayload 036 */ 037 String PRODUCT_PRICE_MODE_SET = "ProductPriceModeSet"; 038 039 /** 040 * <p>The PriceMode that was set.</p> 041 * @return to 042 */ 043 @NotNull 044 @JsonProperty("to") 045 public ProductPriceModeEnum getTo(); 046 047 /** 048 * <p>The PriceMode that was set.</p> 049 * @param to value to be set 050 */ 051 052 public void setTo(final ProductPriceModeEnum to); 053 054 /** 055 * factory method 056 * @return instance of ProductPriceModeSetMessagePayload 057 */ 058 public static ProductPriceModeSetMessagePayload of() { 059 return new ProductPriceModeSetMessagePayloadImpl(); 060 } 061 062 /** 063 * factory method to create a shallow copy ProductPriceModeSetMessagePayload 064 * @param template instance to be copied 065 * @return copy instance 066 */ 067 public static ProductPriceModeSetMessagePayload of(final ProductPriceModeSetMessagePayload template) { 068 ProductPriceModeSetMessagePayloadImpl instance = new ProductPriceModeSetMessagePayloadImpl(); 069 instance.setTo(template.getTo()); 070 return instance; 071 } 072 073 /** 074 * factory method to create a deep copy of ProductPriceModeSetMessagePayload 075 * @param template instance to be copied 076 * @return copy instance 077 */ 078 @Nullable 079 public static ProductPriceModeSetMessagePayload deepCopy( 080 @Nullable final ProductPriceModeSetMessagePayload template) { 081 if (template == null) { 082 return null; 083 } 084 ProductPriceModeSetMessagePayloadImpl instance = new ProductPriceModeSetMessagePayloadImpl(); 085 instance.setTo(template.getTo()); 086 return instance; 087 } 088 089 /** 090 * builder factory method for ProductPriceModeSetMessagePayload 091 * @return builder 092 */ 093 public static ProductPriceModeSetMessagePayloadBuilder builder() { 094 return ProductPriceModeSetMessagePayloadBuilder.of(); 095 } 096 097 /** 098 * create builder for ProductPriceModeSetMessagePayload instance 099 * @param template instance with prefilled values for the builder 100 * @return builder 101 */ 102 public static ProductPriceModeSetMessagePayloadBuilder builder(final ProductPriceModeSetMessagePayload template) { 103 return ProductPriceModeSetMessagePayloadBuilder.of(template); 104 } 105 106 /** 107 * accessor map function 108 * @param <T> mapped type 109 * @param helper function to map the object 110 * @return mapped value 111 */ 112 default <T> T withProductPriceModeSetMessagePayload(Function<ProductPriceModeSetMessagePayload, T> helper) { 113 return helper.apply(this); 114 } 115 116 /** 117 * gives a TypeReference for usage with Jackson DataBind 118 * @return TypeReference 119 */ 120 public static com.fasterxml.jackson.core.type.TypeReference<ProductPriceModeSetMessagePayload> typeReference() { 121 return new com.fasterxml.jackson.core.type.TypeReference<ProductPriceModeSetMessagePayload>() { 122 @Override 123 public String toString() { 124 return "TypeReference<ProductPriceModeSetMessagePayload>"; 125 } 126 }; 127 } 128}