|
| 1 | + |
| 2 | +package com.commercetools.importapi.models.errors; |
| 3 | + |
| 4 | +import java.time.*; |
| 5 | +import java.util.*; |
| 6 | +import java.util.function.Function; |
| 7 | + |
| 8 | +import javax.annotation.Nullable; |
| 9 | + |
| 10 | +import com.commercetools.importapi.models.common.ReferenceType; |
| 11 | +import com.fasterxml.jackson.annotation.*; |
| 12 | +import com.fasterxml.jackson.databind.annotation.*; |
| 13 | + |
| 14 | +import io.vrap.rmf.base.client.utils.Generated; |
| 15 | + |
| 16 | +import jakarta.validation.constraints.NotNull; |
| 17 | + |
| 18 | +/** |
| 19 | + * <p>Returned when a resource referenced by a Reference or a ResourceIdentifier could not be found.</p> |
| 20 | + * |
| 21 | + * <hr> |
| 22 | + * Example to create an instance using the builder pattern |
| 23 | + * <div class=code-example> |
| 24 | + * <pre><code class='java'> |
| 25 | + * ReferencedResourceNotFound referencedResourceNotFound = ReferencedResourceNotFound.builder() |
| 26 | + * .message("{message}") |
| 27 | + * .typeId(ReferenceType.CART) |
| 28 | + * .build() |
| 29 | + * </code></pre> |
| 30 | + * </div> |
| 31 | + */ |
| 32 | +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") |
| 33 | +@JsonDeserialize(as = ReferencedResourceNotFoundImpl.class) |
| 34 | +public interface ReferencedResourceNotFound extends ErrorObject { |
| 35 | + |
| 36 | + /** |
| 37 | + * discriminator value for ReferencedResourceNotFound |
| 38 | + */ |
| 39 | + String REFERENCED_RESOURCE_NOT_FOUND = "ReferencedResourceNotFound"; |
| 40 | + |
| 41 | + /** |
| 42 | + * |
| 43 | + * @return code |
| 44 | + */ |
| 45 | + @NotNull |
| 46 | + @JsonProperty("code") |
| 47 | + public String getCode(); |
| 48 | + |
| 49 | + /** |
| 50 | + * <p><code>"The referenced object of type $typeId $predicate was not found. It either doesn't exist, or it can't be accessed from this endpoint (e.g., if the endpoint filters by store or customer account)."</code></p> |
| 51 | + * @return message |
| 52 | + */ |
| 53 | + @NotNull |
| 54 | + @JsonProperty("message") |
| 55 | + public String getMessage(); |
| 56 | + |
| 57 | + /** |
| 58 | + * <p>Type of referenced resource.</p> |
| 59 | + * @return typeId |
| 60 | + */ |
| 61 | + @NotNull |
| 62 | + @JsonProperty("typeId") |
| 63 | + public ReferenceType getTypeId(); |
| 64 | + |
| 65 | + /** |
| 66 | + * <p>Unique identifier of the referenced resource, if known.</p> |
| 67 | + * @return id |
| 68 | + */ |
| 69 | + |
| 70 | + @JsonProperty("id") |
| 71 | + public String getId(); |
| 72 | + |
| 73 | + /** |
| 74 | + * <p>User-defined unique identifier of the referenced resource, if known.</p> |
| 75 | + * @return key |
| 76 | + */ |
| 77 | + |
| 78 | + @JsonProperty("key") |
| 79 | + public String getKey(); |
| 80 | + |
| 81 | + /** |
| 82 | + * <p><code>"The referenced object of type $typeId $predicate was not found. It either doesn't exist, or it can't be accessed from this endpoint (e.g., if the endpoint filters by store or customer account)."</code></p> |
| 83 | + * @param message value to be set |
| 84 | + */ |
| 85 | + |
| 86 | + public void setMessage(final String message); |
| 87 | + |
| 88 | + /** |
| 89 | + * <p>Type of referenced resource.</p> |
| 90 | + * @param typeId value to be set |
| 91 | + */ |
| 92 | + |
| 93 | + public void setTypeId(final ReferenceType typeId); |
| 94 | + |
| 95 | + /** |
| 96 | + * <p>Unique identifier of the referenced resource, if known.</p> |
| 97 | + * @param id value to be set |
| 98 | + */ |
| 99 | + |
| 100 | + public void setId(final String id); |
| 101 | + |
| 102 | + /** |
| 103 | + * <p>User-defined unique identifier of the referenced resource, if known.</p> |
| 104 | + * @param key value to be set |
| 105 | + */ |
| 106 | + |
| 107 | + public void setKey(final String key); |
| 108 | + |
| 109 | + /** |
| 110 | + * factory method |
| 111 | + * @return instance of ReferencedResourceNotFound |
| 112 | + */ |
| 113 | + public static ReferencedResourceNotFound of() { |
| 114 | + return new ReferencedResourceNotFoundImpl(); |
| 115 | + } |
| 116 | + |
| 117 | + /** |
| 118 | + * factory method to create a shallow copy ReferencedResourceNotFound |
| 119 | + * @param template instance to be copied |
| 120 | + * @return copy instance |
| 121 | + */ |
| 122 | + public static ReferencedResourceNotFound of(final ReferencedResourceNotFound template) { |
| 123 | + ReferencedResourceNotFoundImpl instance = new ReferencedResourceNotFoundImpl(); |
| 124 | + instance.setMessage(template.getMessage()); |
| 125 | + instance.setTypeId(template.getTypeId()); |
| 126 | + instance.setId(template.getId()); |
| 127 | + instance.setKey(template.getKey()); |
| 128 | + return instance; |
| 129 | + } |
| 130 | + |
| 131 | + /** |
| 132 | + * factory method to create a deep copy of ReferencedResourceNotFound |
| 133 | + * @param template instance to be copied |
| 134 | + * @return copy instance |
| 135 | + */ |
| 136 | + @Nullable |
| 137 | + public static ReferencedResourceNotFound deepCopy(@Nullable final ReferencedResourceNotFound template) { |
| 138 | + if (template == null) { |
| 139 | + return null; |
| 140 | + } |
| 141 | + ReferencedResourceNotFoundImpl instance = new ReferencedResourceNotFoundImpl(); |
| 142 | + instance.setMessage(template.getMessage()); |
| 143 | + instance.setTypeId(template.getTypeId()); |
| 144 | + instance.setId(template.getId()); |
| 145 | + instance.setKey(template.getKey()); |
| 146 | + return instance; |
| 147 | + } |
| 148 | + |
| 149 | + /** |
| 150 | + * builder factory method for ReferencedResourceNotFound |
| 151 | + * @return builder |
| 152 | + */ |
| 153 | + public static ReferencedResourceNotFoundBuilder builder() { |
| 154 | + return ReferencedResourceNotFoundBuilder.of(); |
| 155 | + } |
| 156 | + |
| 157 | + /** |
| 158 | + * create builder for ReferencedResourceNotFound instance |
| 159 | + * @param template instance with prefilled values for the builder |
| 160 | + * @return builder |
| 161 | + */ |
| 162 | + public static ReferencedResourceNotFoundBuilder builder(final ReferencedResourceNotFound template) { |
| 163 | + return ReferencedResourceNotFoundBuilder.of(template); |
| 164 | + } |
| 165 | + |
| 166 | + /** |
| 167 | + * accessor map function |
| 168 | + * @param <T> mapped type |
| 169 | + * @param helper function to map the object |
| 170 | + * @return mapped value |
| 171 | + */ |
| 172 | + default <T> T withReferencedResourceNotFound(Function<ReferencedResourceNotFound, T> helper) { |
| 173 | + return helper.apply(this); |
| 174 | + } |
| 175 | + |
| 176 | + /** |
| 177 | + * gives a TypeReference for usage with Jackson DataBind |
| 178 | + * @return TypeReference |
| 179 | + */ |
| 180 | + public static com.fasterxml.jackson.core.type.TypeReference<ReferencedResourceNotFound> typeReference() { |
| 181 | + return new com.fasterxml.jackson.core.type.TypeReference<ReferencedResourceNotFound>() { |
| 182 | + @Override |
| 183 | + public String toString() { |
| 184 | + return "TypeReference<ReferencedResourceNotFound>"; |
| 185 | + } |
| 186 | + }; |
| 187 | + } |
| 188 | +} |
0 commit comments