001
002package com.commercetools.api.models.error;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009
010import com.fasterxml.jackson.annotation.*;
011import com.fasterxml.jackson.databind.annotation.*;
012
013import io.vrap.rmf.base.client.utils.Generated;
014
015/**
016 * GraphQLInsufficientScopeError
017 *
018 * <hr>
019 * Example to create an instance using the builder pattern
020 * <div class=code-example>
021 * <pre><code class='java'>
022 *     GraphQLInsufficientScopeError graphQLInsufficientScopeError = GraphQLInsufficientScopeError.builder()
023 *             .build()
024 * </code></pre>
025 * </div>
026 */
027@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
028@JsonDeserialize(as = GraphQLInsufficientScopeErrorImpl.class)
029public interface GraphQLInsufficientScopeError extends GraphQLErrorObject {
030
031    /**
032     * discriminator value for GraphQLInsufficientScopeError
033     */
034    String INSUFFICIENT_SCOPE = "insufficient_scope";
035
036    /**
037     * factory method
038     * @return instance of GraphQLInsufficientScopeError
039     */
040    public static GraphQLInsufficientScopeError of() {
041        return new GraphQLInsufficientScopeErrorImpl();
042    }
043
044    /**
045     * factory method to create a shallow copy GraphQLInsufficientScopeError
046     * @param template instance to be copied
047     * @return copy instance
048     */
049    public static GraphQLInsufficientScopeError of(final GraphQLInsufficientScopeError template) {
050        GraphQLInsufficientScopeErrorImpl instance = new GraphQLInsufficientScopeErrorImpl();
051        Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue));
052        return instance;
053    }
054
055    /**
056     * factory method to create a deep copy of GraphQLInsufficientScopeError
057     * @param template instance to be copied
058     * @return copy instance
059     */
060    @Nullable
061    public static GraphQLInsufficientScopeError deepCopy(@Nullable final GraphQLInsufficientScopeError template) {
062        if (template == null) {
063            return null;
064        }
065        GraphQLInsufficientScopeErrorImpl instance = new GraphQLInsufficientScopeErrorImpl();
066        Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue));
067        return instance;
068    }
069
070    /**
071     * builder factory method for GraphQLInsufficientScopeError
072     * @return builder
073     */
074    public static GraphQLInsufficientScopeErrorBuilder builder() {
075        return GraphQLInsufficientScopeErrorBuilder.of();
076    }
077
078    /**
079     * create builder for GraphQLInsufficientScopeError instance
080     * @param template instance with prefilled values for the builder
081     * @return builder
082     */
083    public static GraphQLInsufficientScopeErrorBuilder builder(final GraphQLInsufficientScopeError template) {
084        return GraphQLInsufficientScopeErrorBuilder.of(template);
085    }
086
087    /**
088     * accessor map function
089     * @param <T> mapped type
090     * @param helper function to map the object
091     * @return mapped value
092     */
093    default <T> T withGraphQLInsufficientScopeError(Function<GraphQLInsufficientScopeError, T> helper) {
094        return helper.apply(this);
095    }
096
097    /**
098     * gives a TypeReference for usage with Jackson DataBind
099     * @return TypeReference
100     */
101    public static com.fasterxml.jackson.core.type.TypeReference<GraphQLInsufficientScopeError> typeReference() {
102        return new com.fasterxml.jackson.core.type.TypeReference<GraphQLInsufficientScopeError>() {
103            @Override
104            public String toString() {
105                return "TypeReference<GraphQLInsufficientScopeError>";
106            }
107        };
108    }
109}