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 request results in too much data being returned from the API. Adjust the request query to reduce the size of the data returned.</p>
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     GraphQLContentTooLargeError graphQLContentTooLargeError = GraphQLContentTooLargeError.builder()
024 *             .build()
025 * </code></pre>
026 * </div>
027 */
028@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
029@JsonDeserialize(as = GraphQLContentTooLargeErrorImpl.class)
030public interface GraphQLContentTooLargeError extends GraphQLErrorObject {
031
032    /**
033     * discriminator value for GraphQLContentTooLargeError
034     */
035    String CONTENT_TOO_LARGE = "ContentTooLarge";
036
037    /**
038     *
039     * @return code
040     */
041    @NotNull
042    @JsonProperty("code")
043    public String getCode();
044
045    /**
046     * factory method
047     * @return instance of GraphQLContentTooLargeError
048     */
049    public static GraphQLContentTooLargeError of() {
050        return new GraphQLContentTooLargeErrorImpl();
051    }
052
053    /**
054     * factory method to create a shallow copy GraphQLContentTooLargeError
055     * @param template instance to be copied
056     * @return copy instance
057     */
058    public static GraphQLContentTooLargeError of(final GraphQLContentTooLargeError template) {
059        GraphQLContentTooLargeErrorImpl instance = new GraphQLContentTooLargeErrorImpl();
060        Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue));
061        return instance;
062    }
063
064    /**
065     * factory method to create a deep copy of GraphQLContentTooLargeError
066     * @param template instance to be copied
067     * @return copy instance
068     */
069    @Nullable
070    public static GraphQLContentTooLargeError deepCopy(@Nullable final GraphQLContentTooLargeError template) {
071        if (template == null) {
072            return null;
073        }
074        GraphQLContentTooLargeErrorImpl instance = new GraphQLContentTooLargeErrorImpl();
075        Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue));
076        return instance;
077    }
078
079    /**
080     * builder factory method for GraphQLContentTooLargeError
081     * @return builder
082     */
083    public static GraphQLContentTooLargeErrorBuilder builder() {
084        return GraphQLContentTooLargeErrorBuilder.of();
085    }
086
087    /**
088     * create builder for GraphQLContentTooLargeError instance
089     * @param template instance with prefilled values for the builder
090     * @return builder
091     */
092    public static GraphQLContentTooLargeErrorBuilder builder(final GraphQLContentTooLargeError template) {
093        return GraphQLContentTooLargeErrorBuilder.of(template);
094    }
095
096    /**
097     * accessor map function
098     * @param <T> mapped type
099     * @param helper function to map the object
100     * @return mapped value
101     */
102    default <T> T withGraphQLContentTooLargeError(Function<GraphQLContentTooLargeError, T> helper) {
103        return helper.apply(this);
104    }
105
106    /**
107     * gives a TypeReference for usage with Jackson DataBind
108     * @return TypeReference
109     */
110    public static com.fasterxml.jackson.core.type.TypeReference<GraphQLContentTooLargeError> typeReference() {
111        return new com.fasterxml.jackson.core.type.TypeReference<GraphQLContentTooLargeError>() {
112            @Override
113            public String toString() {
114                return "TypeReference<GraphQLContentTooLargeError>";
115            }
116        };
117    }
118}