001 002package com.commercetools.api.models.store; 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.product_selection.ProductSelectionResourceIdentifier; 013import com.fasterxml.jackson.annotation.*; 014import com.fasterxml.jackson.databind.annotation.*; 015 016import io.vrap.rmf.base.client.utils.Generated; 017 018/** 019 * <p>ProductSelection in a Store can be activated or deactivated using this update action.</p> 020 * 021 * <hr> 022 * Example to create an instance using the builder pattern 023 * <div class=code-example> 024 * <pre><code class='java'> 025 * StoreChangeProductSelectionAction storeChangeProductSelectionAction = StoreChangeProductSelectionAction.builder() 026 * .productSelection(productSelectionBuilder -> productSelectionBuilder) 027 * .build() 028 * </code></pre> 029 * </div> 030 */ 031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 032@JsonDeserialize(as = StoreChangeProductSelectionActionImpl.class) 033public interface StoreChangeProductSelectionAction extends StoreUpdateAction { 034 035 /** 036 * discriminator value for StoreChangeProductSelectionAction 037 */ 038 String CHANGE_PRODUCT_SELECTION_ACTIVE = "changeProductSelectionActive"; 039 040 /** 041 * <p>Current Product Selection of the Store to be activated or deactivated.</p> 042 * @return productSelection 043 */ 044 @NotNull 045 @Valid 046 @JsonProperty("productSelection") 047 public ProductSelectionResourceIdentifier getProductSelection(); 048 049 /** 050 * <p>Set to <code>true</code> if all Products assigned to the Product Selection should become part of the Store's assortment.</p> 051 * @return active 052 */ 053 054 @JsonProperty("active") 055 public Boolean getActive(); 056 057 /** 058 * <p>Current Product Selection of the Store to be activated or deactivated.</p> 059 * @param productSelection value to be set 060 */ 061 062 public void setProductSelection(final ProductSelectionResourceIdentifier productSelection); 063 064 /** 065 * <p>Set to <code>true</code> if all Products assigned to the Product Selection should become part of the Store's assortment.</p> 066 * @param active value to be set 067 */ 068 069 public void setActive(final Boolean active); 070 071 /** 072 * factory method 073 * @return instance of StoreChangeProductSelectionAction 074 */ 075 public static StoreChangeProductSelectionAction of() { 076 return new StoreChangeProductSelectionActionImpl(); 077 } 078 079 /** 080 * factory method to create a shallow copy StoreChangeProductSelectionAction 081 * @param template instance to be copied 082 * @return copy instance 083 */ 084 public static StoreChangeProductSelectionAction of(final StoreChangeProductSelectionAction template) { 085 StoreChangeProductSelectionActionImpl instance = new StoreChangeProductSelectionActionImpl(); 086 instance.setProductSelection(template.getProductSelection()); 087 instance.setActive(template.getActive()); 088 return instance; 089 } 090 091 /** 092 * factory method to create a deep copy of StoreChangeProductSelectionAction 093 * @param template instance to be copied 094 * @return copy instance 095 */ 096 @Nullable 097 public static StoreChangeProductSelectionAction deepCopy( 098 @Nullable final StoreChangeProductSelectionAction template) { 099 if (template == null) { 100 return null; 101 } 102 StoreChangeProductSelectionActionImpl instance = new StoreChangeProductSelectionActionImpl(); 103 instance.setProductSelection(com.commercetools.api.models.product_selection.ProductSelectionResourceIdentifier 104 .deepCopy(template.getProductSelection())); 105 instance.setActive(template.getActive()); 106 return instance; 107 } 108 109 /** 110 * builder factory method for StoreChangeProductSelectionAction 111 * @return builder 112 */ 113 public static StoreChangeProductSelectionActionBuilder builder() { 114 return StoreChangeProductSelectionActionBuilder.of(); 115 } 116 117 /** 118 * create builder for StoreChangeProductSelectionAction instance 119 * @param template instance with prefilled values for the builder 120 * @return builder 121 */ 122 public static StoreChangeProductSelectionActionBuilder builder(final StoreChangeProductSelectionAction template) { 123 return StoreChangeProductSelectionActionBuilder.of(template); 124 } 125 126 /** 127 * accessor map function 128 * @param <T> mapped type 129 * @param helper function to map the object 130 * @return mapped value 131 */ 132 default <T> T withStoreChangeProductSelectionAction(Function<StoreChangeProductSelectionAction, T> helper) { 133 return helper.apply(this); 134 } 135 136 /** 137 * gives a TypeReference for usage with Jackson DataBind 138 * @return TypeReference 139 */ 140 public static com.fasterxml.jackson.core.type.TypeReference<StoreChangeProductSelectionAction> typeReference() { 141 return new com.fasterxml.jackson.core.type.TypeReference<StoreChangeProductSelectionAction>() { 142 @Override 143 public String toString() { 144 return "TypeReference<StoreChangeProductSelectionAction>"; 145 } 146 }; 147 } 148}