001 002package com.commercetools.api.models.error; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.constraints.NotNull; 010 011import com.fasterxml.jackson.annotation.*; 012import com.fasterxml.jackson.databind.annotation.*; 013 014import io.vrap.rmf.base.client.utils.Generated; 015 016/** 017 * <p>Returned when the current password of the Customer does not match.</p> 018 * <p>The error is returned as a failed response to:</p> 019 * <ul> 020 * <li>Change Customer Password and Change Customer Password in a Store requests on Customers.</li> 021 * <li>Change Customer Password and Change Customer Password in a Store requests on My Customer Profile.</li> 022 * </ul> 023 * 024 * <hr> 025 * Example to create an instance using the builder pattern 026 * <div class=code-example> 027 * <pre><code class='java'> 028 * GraphQLInvalidCurrentPasswordError graphQLInvalidCurrentPasswordError = GraphQLInvalidCurrentPasswordError.builder() 029 * .build() 030 * </code></pre> 031 * </div> 032 */ 033@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 034@JsonDeserialize(as = GraphQLInvalidCurrentPasswordErrorImpl.class) 035public interface GraphQLInvalidCurrentPasswordError extends GraphQLErrorObject { 036 037 /** 038 * discriminator value for GraphQLInvalidCurrentPasswordError 039 */ 040 String INVALID_CURRENT_PASSWORD = "InvalidCurrentPassword"; 041 042 /** 043 * 044 * @return code 045 */ 046 @NotNull 047 @JsonProperty("code") 048 public String getCode(); 049 050 /** 051 * factory method 052 * @return instance of GraphQLInvalidCurrentPasswordError 053 */ 054 public static GraphQLInvalidCurrentPasswordError of() { 055 return new GraphQLInvalidCurrentPasswordErrorImpl(); 056 } 057 058 /** 059 * factory method to create a shallow copy GraphQLInvalidCurrentPasswordError 060 * @param template instance to be copied 061 * @return copy instance 062 */ 063 public static GraphQLInvalidCurrentPasswordError of(final GraphQLInvalidCurrentPasswordError template) { 064 GraphQLInvalidCurrentPasswordErrorImpl instance = new GraphQLInvalidCurrentPasswordErrorImpl(); 065 Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue)); 066 return instance; 067 } 068 069 /** 070 * factory method to create a deep copy of GraphQLInvalidCurrentPasswordError 071 * @param template instance to be copied 072 * @return copy instance 073 */ 074 @Nullable 075 public static GraphQLInvalidCurrentPasswordError deepCopy( 076 @Nullable final GraphQLInvalidCurrentPasswordError template) { 077 if (template == null) { 078 return null; 079 } 080 GraphQLInvalidCurrentPasswordErrorImpl instance = new GraphQLInvalidCurrentPasswordErrorImpl(); 081 Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue)); 082 return instance; 083 } 084 085 /** 086 * builder factory method for GraphQLInvalidCurrentPasswordError 087 * @return builder 088 */ 089 public static GraphQLInvalidCurrentPasswordErrorBuilder builder() { 090 return GraphQLInvalidCurrentPasswordErrorBuilder.of(); 091 } 092 093 /** 094 * create builder for GraphQLInvalidCurrentPasswordError instance 095 * @param template instance with prefilled values for the builder 096 * @return builder 097 */ 098 public static GraphQLInvalidCurrentPasswordErrorBuilder builder(final GraphQLInvalidCurrentPasswordError template) { 099 return GraphQLInvalidCurrentPasswordErrorBuilder.of(template); 100 } 101 102 /** 103 * accessor map function 104 * @param <T> mapped type 105 * @param helper function to map the object 106 * @return mapped value 107 */ 108 default <T> T withGraphQLInvalidCurrentPasswordError(Function<GraphQLInvalidCurrentPasswordError, T> helper) { 109 return helper.apply(this); 110 } 111 112 /** 113 * gives a TypeReference for usage with Jackson DataBind 114 * @return TypeReference 115 */ 116 public static com.fasterxml.jackson.core.type.TypeReference<GraphQLInvalidCurrentPasswordError> typeReference() { 117 return new com.fasterxml.jackson.core.type.TypeReference<GraphQLInvalidCurrentPasswordError>() { 118 @Override 119 public String toString() { 120 return "TypeReference<GraphQLInvalidCurrentPasswordError>"; 121 } 122 }; 123 } 124}