001 002package com.commercetools.api.models.me; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.Valid; 010 011import com.commercetools.api.models.channel.ChannelResourceIdentifier; 012import com.fasterxml.jackson.annotation.*; 013import com.fasterxml.jackson.databind.annotation.*; 014 015import io.vrap.rmf.base.client.utils.Generated; 016 017/** 018 * <p>Performing this action has no impact on inventory that should be reserved.</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 * MyCartSetLineItemSupplyChannelAction myCartSetLineItemSupplyChannelAction = MyCartSetLineItemSupplyChannelAction.builder() 025 * .build() 026 * </code></pre> 027 * </div> 028 */ 029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 030@JsonDeserialize(as = MyCartSetLineItemSupplyChannelActionImpl.class) 031public interface MyCartSetLineItemSupplyChannelAction extends MyCartUpdateAction { 032 033 /** 034 * discriminator value for MyCartSetLineItemSupplyChannelAction 035 */ 036 String SET_LINE_ITEM_SUPPLY_CHANNEL = "setLineItemSupplyChannel"; 037 038 /** 039 * <p><code>id</code> of the LineItem to update. Either <code>lineItemId</code> or <code>lineItemKey</code> is required.</p> 040 * @return lineItemId 041 */ 042 043 @JsonProperty("lineItemId") 044 public String getLineItemId(); 045 046 /** 047 * <p><code>key</code> of the LineItem to update. Either <code>lineItemId</code> or <code>lineItemKey</code> is required.</p> 048 * @return lineItemKey 049 */ 050 051 @JsonProperty("lineItemKey") 052 public String getLineItemKey(); 053 054 /** 055 * <ul> 056 * <li>If present, a Reference to the Channel is set for the LineItem specified by <code>lineItemId</code>.</li> 057 * <li>If not present, the current Reference to a supply channel will be removed from the LineItem specified by <code>lineItemId</code>. The Channel must have the <code>InventorySupply</code> ChannelRoleEnum.</li> 058 * </ul> 059 * @return supplyChannel 060 */ 061 @Valid 062 @JsonProperty("supplyChannel") 063 public ChannelResourceIdentifier getSupplyChannel(); 064 065 /** 066 * <p><code>id</code> of the LineItem to update. Either <code>lineItemId</code> or <code>lineItemKey</code> is required.</p> 067 * @param lineItemId value to be set 068 */ 069 070 public void setLineItemId(final String lineItemId); 071 072 /** 073 * <p><code>key</code> of the LineItem to update. Either <code>lineItemId</code> or <code>lineItemKey</code> is required.</p> 074 * @param lineItemKey value to be set 075 */ 076 077 public void setLineItemKey(final String lineItemKey); 078 079 /** 080 * <ul> 081 * <li>If present, a Reference to the Channel is set for the LineItem specified by <code>lineItemId</code>.</li> 082 * <li>If not present, the current Reference to a supply channel will be removed from the LineItem specified by <code>lineItemId</code>. The Channel must have the <code>InventorySupply</code> ChannelRoleEnum.</li> 083 * </ul> 084 * @param supplyChannel value to be set 085 */ 086 087 public void setSupplyChannel(final ChannelResourceIdentifier supplyChannel); 088 089 /** 090 * factory method 091 * @return instance of MyCartSetLineItemSupplyChannelAction 092 */ 093 public static MyCartSetLineItemSupplyChannelAction of() { 094 return new MyCartSetLineItemSupplyChannelActionImpl(); 095 } 096 097 /** 098 * factory method to create a shallow copy MyCartSetLineItemSupplyChannelAction 099 * @param template instance to be copied 100 * @return copy instance 101 */ 102 public static MyCartSetLineItemSupplyChannelAction of(final MyCartSetLineItemSupplyChannelAction template) { 103 MyCartSetLineItemSupplyChannelActionImpl instance = new MyCartSetLineItemSupplyChannelActionImpl(); 104 instance.setLineItemId(template.getLineItemId()); 105 instance.setLineItemKey(template.getLineItemKey()); 106 instance.setSupplyChannel(template.getSupplyChannel()); 107 return instance; 108 } 109 110 /** 111 * factory method to create a deep copy of MyCartSetLineItemSupplyChannelAction 112 * @param template instance to be copied 113 * @return copy instance 114 */ 115 @Nullable 116 public static MyCartSetLineItemSupplyChannelAction deepCopy( 117 @Nullable final MyCartSetLineItemSupplyChannelAction template) { 118 if (template == null) { 119 return null; 120 } 121 MyCartSetLineItemSupplyChannelActionImpl instance = new MyCartSetLineItemSupplyChannelActionImpl(); 122 instance.setLineItemId(template.getLineItemId()); 123 instance.setLineItemKey(template.getLineItemKey()); 124 instance.setSupplyChannel( 125 com.commercetools.api.models.channel.ChannelResourceIdentifier.deepCopy(template.getSupplyChannel())); 126 return instance; 127 } 128 129 /** 130 * builder factory method for MyCartSetLineItemSupplyChannelAction 131 * @return builder 132 */ 133 public static MyCartSetLineItemSupplyChannelActionBuilder builder() { 134 return MyCartSetLineItemSupplyChannelActionBuilder.of(); 135 } 136 137 /** 138 * create builder for MyCartSetLineItemSupplyChannelAction instance 139 * @param template instance with prefilled values for the builder 140 * @return builder 141 */ 142 public static MyCartSetLineItemSupplyChannelActionBuilder builder( 143 final MyCartSetLineItemSupplyChannelAction template) { 144 return MyCartSetLineItemSupplyChannelActionBuilder.of(template); 145 } 146 147 /** 148 * accessor map function 149 * @param <T> mapped type 150 * @param helper function to map the object 151 * @return mapped value 152 */ 153 default <T> T withMyCartSetLineItemSupplyChannelAction(Function<MyCartSetLineItemSupplyChannelAction, T> helper) { 154 return helper.apply(this); 155 } 156 157 /** 158 * gives a TypeReference for usage with Jackson DataBind 159 * @return TypeReference 160 */ 161 public static com.fasterxml.jackson.core.type.TypeReference<MyCartSetLineItemSupplyChannelAction> typeReference() { 162 return new com.fasterxml.jackson.core.type.TypeReference<MyCartSetLineItemSupplyChannelAction>() { 163 @Override 164 public String toString() { 165 return "TypeReference<MyCartSetLineItemSupplyChannelAction>"; 166 } 167 }; 168 } 169}