001 002package com.commercetools.api.models.product_type; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.Valid; 010import javax.validation.constraints.NotNull; 011 012import com.commercetools.api.models.common.LocalizedString; 013import com.fasterxml.jackson.annotation.*; 014import com.fasterxml.jackson.databind.annotation.*; 015 016import io.vrap.rmf.base.client.utils.Generated; 017 018/** 019 * ProductTypeChangeLabelAction 020 * 021 * <hr> 022 * Example to create an instance using the builder pattern 023 * <div class=code-example> 024 * <pre><code class='java'> 025 * ProductTypeChangeLabelAction productTypeChangeLabelAction = ProductTypeChangeLabelAction.builder() 026 * .attributeName("{attributeName}") 027 * .label(labelBuilder -> labelBuilder) 028 * .build() 029 * </code></pre> 030 * </div> 031 */ 032@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 033@JsonDeserialize(as = ProductTypeChangeLabelActionImpl.class) 034public interface ProductTypeChangeLabelAction extends ProductTypeUpdateAction { 035 036 /** 037 * discriminator value for ProductTypeChangeLabelAction 038 */ 039 String CHANGE_LABEL = "changeLabel"; 040 041 /** 042 * <p>Name of the AttributeDefinition to update.</p> 043 * @return attributeName 044 */ 045 @NotNull 046 @JsonProperty("attributeName") 047 public String getAttributeName(); 048 049 /** 050 * <p>New value to set. Must not be empty.</p> 051 * @return label 052 */ 053 @NotNull 054 @Valid 055 @JsonProperty("label") 056 public LocalizedString getLabel(); 057 058 /** 059 * <p>Name of the AttributeDefinition to update.</p> 060 * @param attributeName value to be set 061 */ 062 063 public void setAttributeName(final String attributeName); 064 065 /** 066 * <p>New value to set. Must not be empty.</p> 067 * @param label value to be set 068 */ 069 070 public void setLabel(final LocalizedString label); 071 072 /** 073 * factory method 074 * @return instance of ProductTypeChangeLabelAction 075 */ 076 public static ProductTypeChangeLabelAction of() { 077 return new ProductTypeChangeLabelActionImpl(); 078 } 079 080 /** 081 * factory method to create a shallow copy ProductTypeChangeLabelAction 082 * @param template instance to be copied 083 * @return copy instance 084 */ 085 public static ProductTypeChangeLabelAction of(final ProductTypeChangeLabelAction template) { 086 ProductTypeChangeLabelActionImpl instance = new ProductTypeChangeLabelActionImpl(); 087 instance.setAttributeName(template.getAttributeName()); 088 instance.setLabel(template.getLabel()); 089 return instance; 090 } 091 092 /** 093 * factory method to create a deep copy of ProductTypeChangeLabelAction 094 * @param template instance to be copied 095 * @return copy instance 096 */ 097 @Nullable 098 public static ProductTypeChangeLabelAction deepCopy(@Nullable final ProductTypeChangeLabelAction template) { 099 if (template == null) { 100 return null; 101 } 102 ProductTypeChangeLabelActionImpl instance = new ProductTypeChangeLabelActionImpl(); 103 instance.setAttributeName(template.getAttributeName()); 104 instance.setLabel(com.commercetools.api.models.common.LocalizedString.deepCopy(template.getLabel())); 105 return instance; 106 } 107 108 /** 109 * builder factory method for ProductTypeChangeLabelAction 110 * @return builder 111 */ 112 public static ProductTypeChangeLabelActionBuilder builder() { 113 return ProductTypeChangeLabelActionBuilder.of(); 114 } 115 116 /** 117 * create builder for ProductTypeChangeLabelAction instance 118 * @param template instance with prefilled values for the builder 119 * @return builder 120 */ 121 public static ProductTypeChangeLabelActionBuilder builder(final ProductTypeChangeLabelAction template) { 122 return ProductTypeChangeLabelActionBuilder.of(template); 123 } 124 125 /** 126 * accessor map function 127 * @param <T> mapped type 128 * @param helper function to map the object 129 * @return mapped value 130 */ 131 default <T> T withProductTypeChangeLabelAction(Function<ProductTypeChangeLabelAction, T> helper) { 132 return helper.apply(this); 133 } 134 135 /** 136 * gives a TypeReference for usage with Jackson DataBind 137 * @return TypeReference 138 */ 139 public static com.fasterxml.jackson.core.type.TypeReference<ProductTypeChangeLabelAction> typeReference() { 140 return new com.fasterxml.jackson.core.type.TypeReference<ProductTypeChangeLabelAction>() { 141 @Override 142 public String toString() { 143 return "TypeReference<ProductTypeChangeLabelAction>"; 144 } 145 }; 146 } 147}