001 002package com.commercetools.api.models.customer; 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.Cart; 013import com.fasterxml.jackson.annotation.*; 014import com.fasterxml.jackson.databind.annotation.*; 015 016import io.vrap.rmf.base.client.utils.Generated; 017 018/** 019 * CustomerSignInResult 020 * 021 * <hr> 022 * Example to create an instance using the builder pattern 023 * <div class=code-example> 024 * <pre><code class='java'> 025 * CustomerSignInResult customerSignInResult = CustomerSignInResult.builder() 026 * .customer(customerBuilder -> customerBuilder) 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 = CustomerSignInResultImpl.class) 033public interface CustomerSignInResult { 034 035 /** 036 * <p>Customer signed up or signed in after authentication.</p> 037 * @return customer 038 */ 039 @NotNull 040 @Valid 041 @JsonProperty("customer") 042 public Customer getCustomer(); 043 044 /** 045 * <p>Cart associated with the Customer. If empty, the Customer does not have a Cart assigned.</p> 046 * @return cart 047 */ 048 @Valid 049 @JsonProperty("cart") 050 public Cart getCart(); 051 052 /** 053 * <p>Customer signed up or signed in after authentication.</p> 054 * @param customer value to be set 055 */ 056 057 public void setCustomer(final Customer customer); 058 059 /** 060 * <p>Cart associated with the Customer. If empty, the Customer does not have a Cart assigned.</p> 061 * @param cart value to be set 062 */ 063 064 public void setCart(final Cart cart); 065 066 /** 067 * factory method 068 * @return instance of CustomerSignInResult 069 */ 070 public static CustomerSignInResult of() { 071 return new CustomerSignInResultImpl(); 072 } 073 074 /** 075 * factory method to create a shallow copy CustomerSignInResult 076 * @param template instance to be copied 077 * @return copy instance 078 */ 079 public static CustomerSignInResult of(final CustomerSignInResult template) { 080 CustomerSignInResultImpl instance = new CustomerSignInResultImpl(); 081 instance.setCustomer(template.getCustomer()); 082 instance.setCart(template.getCart()); 083 return instance; 084 } 085 086 /** 087 * factory method to create a deep copy of CustomerSignInResult 088 * @param template instance to be copied 089 * @return copy instance 090 */ 091 @Nullable 092 public static CustomerSignInResult deepCopy(@Nullable final CustomerSignInResult template) { 093 if (template == null) { 094 return null; 095 } 096 CustomerSignInResultImpl instance = new CustomerSignInResultImpl(); 097 instance.setCustomer(com.commercetools.api.models.customer.Customer.deepCopy(template.getCustomer())); 098 instance.setCart(com.commercetools.api.models.cart.Cart.deepCopy(template.getCart())); 099 return instance; 100 } 101 102 /** 103 * builder factory method for CustomerSignInResult 104 * @return builder 105 */ 106 public static CustomerSignInResultBuilder builder() { 107 return CustomerSignInResultBuilder.of(); 108 } 109 110 /** 111 * create builder for CustomerSignInResult instance 112 * @param template instance with prefilled values for the builder 113 * @return builder 114 */ 115 public static CustomerSignInResultBuilder builder(final CustomerSignInResult template) { 116 return CustomerSignInResultBuilder.of(template); 117 } 118 119 /** 120 * accessor map function 121 * @param <T> mapped type 122 * @param helper function to map the object 123 * @return mapped value 124 */ 125 default <T> T withCustomerSignInResult(Function<CustomerSignInResult, T> helper) { 126 return helper.apply(this); 127 } 128 129 /** 130 * gives a TypeReference for usage with Jackson DataBind 131 * @return TypeReference 132 */ 133 public static com.fasterxml.jackson.core.type.TypeReference<CustomerSignInResult> typeReference() { 134 return new com.fasterxml.jackson.core.type.TypeReference<CustomerSignInResult>() { 135 @Override 136 public String toString() { 137 return "TypeReference<CustomerSignInResult>"; 138 } 139 }; 140 } 141}