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 resource addressed by the request URL does not exist.</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 *     ResourceNotFoundError resourceNotFoundError = ResourceNotFoundError.builder()
024 *             .message("{message}")
025 *             .build()
026 * </code></pre>
027 * </div>
028 */
029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
030@JsonDeserialize(as = ResourceNotFoundErrorImpl.class)
031public interface ResourceNotFoundError extends ErrorObject {
032
033    /**
034     * discriminator value for ResourceNotFoundError
035     */
036    String RESOURCE_NOT_FOUND = "ResourceNotFound";
037
038    /**
039     *
040     * @return code
041     */
042    @NotNull
043    @JsonProperty("code")
044    public String getCode();
045
046    /**
047     *  <p><code>"The Resource with ID $resourceId was not found."</code></p>
048     * @return message
049     */
050    @NotNull
051    @JsonProperty("message")
052    public String getMessage();
053
054    /**
055     *  <p><code>"The Resource with ID $resourceId was not found."</code></p>
056     * @param message value to be set
057     */
058
059    public void setMessage(final String message);
060
061    /**
062     * factory method
063     * @return instance of ResourceNotFoundError
064     */
065    public static ResourceNotFoundError of() {
066        return new ResourceNotFoundErrorImpl();
067    }
068
069    /**
070     * factory method to create a shallow copy ResourceNotFoundError
071     * @param template instance to be copied
072     * @return copy instance
073     */
074    public static ResourceNotFoundError of(final ResourceNotFoundError template) {
075        ResourceNotFoundErrorImpl instance = new ResourceNotFoundErrorImpl();
076        instance.setMessage(template.getMessage());
077        Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue));
078        return instance;
079    }
080
081    /**
082     * factory method to create a deep copy of ResourceNotFoundError
083     * @param template instance to be copied
084     * @return copy instance
085     */
086    @Nullable
087    public static ResourceNotFoundError deepCopy(@Nullable final ResourceNotFoundError template) {
088        if (template == null) {
089            return null;
090        }
091        ResourceNotFoundErrorImpl instance = new ResourceNotFoundErrorImpl();
092        instance.setMessage(template.getMessage());
093        Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue));
094        return instance;
095    }
096
097    /**
098     * builder factory method for ResourceNotFoundError
099     * @return builder
100     */
101    public static ResourceNotFoundErrorBuilder builder() {
102        return ResourceNotFoundErrorBuilder.of();
103    }
104
105    /**
106     * create builder for ResourceNotFoundError instance
107     * @param template instance with prefilled values for the builder
108     * @return builder
109     */
110    public static ResourceNotFoundErrorBuilder builder(final ResourceNotFoundError template) {
111        return ResourceNotFoundErrorBuilder.of(template);
112    }
113
114    /**
115     * accessor map function
116     * @param <T> mapped type
117     * @param helper function to map the object
118     * @return mapped value
119     */
120    default <T> T withResourceNotFoundError(Function<ResourceNotFoundError, T> helper) {
121        return helper.apply(this);
122    }
123
124    /**
125     * gives a TypeReference for usage with Jackson DataBind
126     * @return TypeReference
127     */
128    public static com.fasterxml.jackson.core.type.TypeReference<ResourceNotFoundError> typeReference() {
129        return new com.fasterxml.jackson.core.type.TypeReference<ResourceNotFoundError>() {
130            @Override
131            public String toString() {
132                return "TypeReference<ResourceNotFoundError>";
133            }
134        };
135    }
136}