001 002package com.commercetools.api.models.order_edit; 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.cart.ExternalTaxAmountDraft; 013import com.commercetools.api.models.order.StagedOrderUpdateAction; 014import com.fasterxml.jackson.annotation.*; 015import com.fasterxml.jackson.databind.annotation.*; 016 017import io.vrap.rmf.base.client.utils.Generated; 018 019/** 020 * StagedOrderSetCustomLineItemTaxAmountAction 021 * 022 * <hr> 023 * Example to create an instance using the builder pattern 024 * <div class=code-example> 025 * <pre><code class='java'> 026 * StagedOrderSetCustomLineItemTaxAmountAction stagedOrderSetCustomLineItemTaxAmountAction = StagedOrderSetCustomLineItemTaxAmountAction.builder() 027 * .customLineItemId("{customLineItemId}") 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 = StagedOrderSetCustomLineItemTaxAmountActionImpl.class) 034public interface StagedOrderSetCustomLineItemTaxAmountAction extends StagedOrderUpdateAction { 035 036 /** 037 * discriminator value for StagedOrderSetCustomLineItemTaxAmountAction 038 */ 039 String SET_CUSTOM_LINE_ITEM_TAX_AMOUNT = "setCustomLineItemTaxAmount"; 040 041 /** 042 * 043 * @return customLineItemId 044 */ 045 @NotNull 046 @JsonProperty("customLineItemId") 047 public String getCustomLineItemId(); 048 049 /** 050 * <p>Cannot be used in LineItemDraft or CustomLineItemDraft.</p> 051 * <p>Can only be set by these update actions:</p> 052 * <ul> 053 * <li>Set LineItem TaxAmount, Set CustomLineItem TaxAmount, or Set ShippingMethod TaxAmount on Carts</li> 054 * <li>Set LineItem TaxAmount, Set CustomLineItem TaxAmount, or Set ShippingMethod TaxAmount on Order Edits</li> 055 * </ul> 056 * @return externalTaxAmount 057 */ 058 @Valid 059 @JsonProperty("externalTaxAmount") 060 public ExternalTaxAmountDraft getExternalTaxAmount(); 061 062 /** 063 * set customLineItemId 064 * @param customLineItemId value to be set 065 */ 066 067 public void setCustomLineItemId(final String customLineItemId); 068 069 /** 070 * <p>Cannot be used in LineItemDraft or CustomLineItemDraft.</p> 071 * <p>Can only be set by these update actions:</p> 072 * <ul> 073 * <li>Set LineItem TaxAmount, Set CustomLineItem TaxAmount, or Set ShippingMethod TaxAmount on Carts</li> 074 * <li>Set LineItem TaxAmount, Set CustomLineItem TaxAmount, or Set ShippingMethod TaxAmount on Order Edits</li> 075 * </ul> 076 * @param externalTaxAmount value to be set 077 */ 078 079 public void setExternalTaxAmount(final ExternalTaxAmountDraft externalTaxAmount); 080 081 /** 082 * factory method 083 * @return instance of StagedOrderSetCustomLineItemTaxAmountAction 084 */ 085 public static StagedOrderSetCustomLineItemTaxAmountAction of() { 086 return new StagedOrderSetCustomLineItemTaxAmountActionImpl(); 087 } 088 089 /** 090 * factory method to create a shallow copy StagedOrderSetCustomLineItemTaxAmountAction 091 * @param template instance to be copied 092 * @return copy instance 093 */ 094 public static StagedOrderSetCustomLineItemTaxAmountAction of( 095 final StagedOrderSetCustomLineItemTaxAmountAction template) { 096 StagedOrderSetCustomLineItemTaxAmountActionImpl instance = new StagedOrderSetCustomLineItemTaxAmountActionImpl(); 097 instance.setCustomLineItemId(template.getCustomLineItemId()); 098 instance.setExternalTaxAmount(template.getExternalTaxAmount()); 099 return instance; 100 } 101 102 /** 103 * factory method to create a deep copy of StagedOrderSetCustomLineItemTaxAmountAction 104 * @param template instance to be copied 105 * @return copy instance 106 */ 107 @Nullable 108 public static StagedOrderSetCustomLineItemTaxAmountAction deepCopy( 109 @Nullable final StagedOrderSetCustomLineItemTaxAmountAction template) { 110 if (template == null) { 111 return null; 112 } 113 StagedOrderSetCustomLineItemTaxAmountActionImpl instance = new StagedOrderSetCustomLineItemTaxAmountActionImpl(); 114 instance.setCustomLineItemId(template.getCustomLineItemId()); 115 instance.setExternalTaxAmount( 116 com.commercetools.api.models.cart.ExternalTaxAmountDraft.deepCopy(template.getExternalTaxAmount())); 117 return instance; 118 } 119 120 /** 121 * builder factory method for StagedOrderSetCustomLineItemTaxAmountAction 122 * @return builder 123 */ 124 public static StagedOrderSetCustomLineItemTaxAmountActionBuilder builder() { 125 return StagedOrderSetCustomLineItemTaxAmountActionBuilder.of(); 126 } 127 128 /** 129 * create builder for StagedOrderSetCustomLineItemTaxAmountAction instance 130 * @param template instance with prefilled values for the builder 131 * @return builder 132 */ 133 public static StagedOrderSetCustomLineItemTaxAmountActionBuilder builder( 134 final StagedOrderSetCustomLineItemTaxAmountAction template) { 135 return StagedOrderSetCustomLineItemTaxAmountActionBuilder.of(template); 136 } 137 138 /** 139 * accessor map function 140 * @param <T> mapped type 141 * @param helper function to map the object 142 * @return mapped value 143 */ 144 default <T> T withStagedOrderSetCustomLineItemTaxAmountAction( 145 Function<StagedOrderSetCustomLineItemTaxAmountAction, T> helper) { 146 return helper.apply(this); 147 } 148 149 /** 150 * gives a TypeReference for usage with Jackson DataBind 151 * @return TypeReference 152 */ 153 public static com.fasterxml.jackson.core.type.TypeReference<StagedOrderSetCustomLineItemTaxAmountAction> typeReference() { 154 return new com.fasterxml.jackson.core.type.TypeReference<StagedOrderSetCustomLineItemTaxAmountAction>() { 155 @Override 156 public String toString() { 157 return "TypeReference<StagedOrderSetCustomLineItemTaxAmountAction>"; 158 } 159 }; 160 } 161}