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 indexing of Product information is still in progress for Projects that have indexing activated.</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 *     GraphQLSearchIndexingInProgressError graphQLSearchIndexingInProgressError = GraphQLSearchIndexingInProgressError.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 = GraphQLSearchIndexingInProgressErrorImpl.class)
030public interface GraphQLSearchIndexingInProgressError extends GraphQLErrorObject {
031
032    /**
033     * discriminator value for GraphQLSearchIndexingInProgressError
034     */
035    String SEARCH_INDEXING_IN_PROGRESS = "SearchIndexingInProgress";
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 GraphQLSearchIndexingInProgressError
048     */
049    public static GraphQLSearchIndexingInProgressError of() {
050        return new GraphQLSearchIndexingInProgressErrorImpl();
051    }
052
053    /**
054     * factory method to create a shallow copy GraphQLSearchIndexingInProgressError
055     * @param template instance to be copied
056     * @return copy instance
057     */
058    public static GraphQLSearchIndexingInProgressError of(final GraphQLSearchIndexingInProgressError template) {
059        GraphQLSearchIndexingInProgressErrorImpl instance = new GraphQLSearchIndexingInProgressErrorImpl();
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 GraphQLSearchIndexingInProgressError
066     * @param template instance to be copied
067     * @return copy instance
068     */
069    @Nullable
070    public static GraphQLSearchIndexingInProgressError deepCopy(
071            @Nullable final GraphQLSearchIndexingInProgressError template) {
072        if (template == null) {
073            return null;
074        }
075        GraphQLSearchIndexingInProgressErrorImpl instance = new GraphQLSearchIndexingInProgressErrorImpl();
076        Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue));
077        return instance;
078    }
079
080    /**
081     * builder factory method for GraphQLSearchIndexingInProgressError
082     * @return builder
083     */
084    public static GraphQLSearchIndexingInProgressErrorBuilder builder() {
085        return GraphQLSearchIndexingInProgressErrorBuilder.of();
086    }
087
088    /**
089     * create builder for GraphQLSearchIndexingInProgressError instance
090     * @param template instance with prefilled values for the builder
091     * @return builder
092     */
093    public static GraphQLSearchIndexingInProgressErrorBuilder builder(
094            final GraphQLSearchIndexingInProgressError template) {
095        return GraphQLSearchIndexingInProgressErrorBuilder.of(template);
096    }
097
098    /**
099     * accessor map function
100     * @param <T> mapped type
101     * @param helper function to map the object
102     * @return mapped value
103     */
104    default <T> T withGraphQLSearchIndexingInProgressError(Function<GraphQLSearchIndexingInProgressError, T> helper) {
105        return helper.apply(this);
106    }
107
108    /**
109     * gives a TypeReference for usage with Jackson DataBind
110     * @return TypeReference
111     */
112    public static com.fasterxml.jackson.core.type.TypeReference<GraphQLSearchIndexingInProgressError> typeReference() {
113        return new com.fasterxml.jackson.core.type.TypeReference<GraphQLSearchIndexingInProgressError>() {
114            @Override
115            public String toString() {
116                return "TypeReference<GraphQLSearchIndexingInProgressError>";
117            }
118        };
119    }
120}