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 requested resource was not found.</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 *     GraphQLObjectNotFoundError graphQLObjectNotFoundError = GraphQLObjectNotFoundError.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 = GraphQLObjectNotFoundErrorImpl.class)
030public interface GraphQLObjectNotFoundError extends GraphQLErrorObject {
031
032    /**
033     * discriminator value for GraphQLObjectNotFoundError
034     */
035    String OBJECT_NOT_FOUND = "ObjectNotFound";
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 GraphQLObjectNotFoundError
048     */
049    public static GraphQLObjectNotFoundError of() {
050        return new GraphQLObjectNotFoundErrorImpl();
051    }
052
053    /**
054     * factory method to create a shallow copy GraphQLObjectNotFoundError
055     * @param template instance to be copied
056     * @return copy instance
057     */
058    public static GraphQLObjectNotFoundError of(final GraphQLObjectNotFoundError template) {
059        GraphQLObjectNotFoundErrorImpl instance = new GraphQLObjectNotFoundErrorImpl();
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 GraphQLObjectNotFoundError
066     * @param template instance to be copied
067     * @return copy instance
068     */
069    @Nullable
070    public static GraphQLObjectNotFoundError deepCopy(@Nullable final GraphQLObjectNotFoundError template) {
071        if (template == null) {
072            return null;
073        }
074        GraphQLObjectNotFoundErrorImpl instance = new GraphQLObjectNotFoundErrorImpl();
075        Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue));
076        return instance;
077    }
078
079    /**
080     * builder factory method for GraphQLObjectNotFoundError
081     * @return builder
082     */
083    public static GraphQLObjectNotFoundErrorBuilder builder() {
084        return GraphQLObjectNotFoundErrorBuilder.of();
085    }
086
087    /**
088     * create builder for GraphQLObjectNotFoundError instance
089     * @param template instance with prefilled values for the builder
090     * @return builder
091     */
092    public static GraphQLObjectNotFoundErrorBuilder builder(final GraphQLObjectNotFoundError template) {
093        return GraphQLObjectNotFoundErrorBuilder.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 withGraphQLObjectNotFoundError(Function<GraphQLObjectNotFoundError, 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<GraphQLObjectNotFoundError> typeReference() {
111        return new com.fasterxml.jackson.core.type.TypeReference<GraphQLObjectNotFoundError>() {
112            @Override
113            public String toString() {
114                return "TypeReference<GraphQLObjectNotFoundError>";
115            }
116        };
117    }
118}