|
| 1 | +/* |
| 2 | + * Grounding |
| 3 | + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. |
| 4 | + * |
| 5 | + * |
| 6 | + * |
| 7 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 8 | + * https://openapi-generator.tech |
| 9 | + * Do not edit the class manually. |
| 10 | + */ |
| 11 | + |
| 12 | +package com.sap.ai.sdk.grounding.model; |
| 13 | + |
| 14 | +import com.fasterxml.jackson.annotation.JsonAnyGetter; |
| 15 | +import com.fasterxml.jackson.annotation.JsonAnySetter; |
| 16 | +import com.fasterxml.jackson.annotation.JsonIgnore; |
| 17 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 18 | +import java.util.ArrayList; |
| 19 | +import java.util.Arrays; |
| 20 | +import java.util.LinkedHashMap; |
| 21 | +import java.util.List; |
| 22 | +import java.util.Map; |
| 23 | +import java.util.NoSuchElementException; |
| 24 | +import java.util.Objects; |
| 25 | +import java.util.Set; |
| 26 | +import java.util.UUID; |
| 27 | +import javax.annotation.Nonnull; |
| 28 | +import javax.annotation.Nullable; |
| 29 | + |
| 30 | +/** A request to delete documents by their IDs. */ |
| 31 | +// CHECKSTYLE:OFF |
| 32 | +public class DocumentBulkDeleteRequest |
| 33 | +// CHECKSTYLE:ON |
| 34 | +{ |
| 35 | + @JsonProperty("ids") |
| 36 | + private List<UUID> ids = new ArrayList<>(); |
| 37 | + |
| 38 | + @JsonAnySetter @JsonAnyGetter |
| 39 | + private final Map<String, Object> cloudSdkCustomFields = new LinkedHashMap<>(); |
| 40 | + |
| 41 | + /** Default constructor for DocumentBulkDeleteRequest. */ |
| 42 | + protected DocumentBulkDeleteRequest() {} |
| 43 | + |
| 44 | + /** |
| 45 | + * Set the ids of this {@link DocumentBulkDeleteRequest} instance and return the same instance. |
| 46 | + * |
| 47 | + * @param ids List of document IDs to delete |
| 48 | + * @return The same instance of this {@link DocumentBulkDeleteRequest} class |
| 49 | + */ |
| 50 | + @Nonnull |
| 51 | + public DocumentBulkDeleteRequest ids(@Nonnull final List<UUID> ids) { |
| 52 | + this.ids = ids; |
| 53 | + return this; |
| 54 | + } |
| 55 | + |
| 56 | + /** |
| 57 | + * Add one ids instance to this {@link DocumentBulkDeleteRequest}. |
| 58 | + * |
| 59 | + * @param idsItem The ids that should be added |
| 60 | + * @return The same instance of type {@link DocumentBulkDeleteRequest} |
| 61 | + */ |
| 62 | + @Nonnull |
| 63 | + public DocumentBulkDeleteRequest addIdsItem(@Nonnull final UUID idsItem) { |
| 64 | + if (this.ids == null) { |
| 65 | + this.ids = new ArrayList<>(); |
| 66 | + } |
| 67 | + this.ids.add(idsItem); |
| 68 | + return this; |
| 69 | + } |
| 70 | + |
| 71 | + /** |
| 72 | + * List of document IDs to delete |
| 73 | + * |
| 74 | + * @return ids The ids of this {@link DocumentBulkDeleteRequest} instance. |
| 75 | + */ |
| 76 | + @Nonnull |
| 77 | + public List<UUID> getIds() { |
| 78 | + return ids; |
| 79 | + } |
| 80 | + |
| 81 | + /** |
| 82 | + * Set the ids of this {@link DocumentBulkDeleteRequest} instance. |
| 83 | + * |
| 84 | + * @param ids List of document IDs to delete |
| 85 | + */ |
| 86 | + public void setIds(@Nonnull final List<UUID> ids) { |
| 87 | + this.ids = ids; |
| 88 | + } |
| 89 | + |
| 90 | + /** |
| 91 | + * Get the names of the unrecognizable properties of the {@link DocumentBulkDeleteRequest}. |
| 92 | + * |
| 93 | + * @return The set of properties names |
| 94 | + */ |
| 95 | + @JsonIgnore |
| 96 | + @Nonnull |
| 97 | + public Set<String> getCustomFieldNames() { |
| 98 | + return cloudSdkCustomFields.keySet(); |
| 99 | + } |
| 100 | + |
| 101 | + /** |
| 102 | + * Get the value of an unrecognizable property of this {@link DocumentBulkDeleteRequest} instance. |
| 103 | + * |
| 104 | + * @deprecated Use {@link #toMap()} instead. |
| 105 | + * @param name The name of the property |
| 106 | + * @return The value of the property |
| 107 | + * @throws NoSuchElementException If no property with the given name could be found. |
| 108 | + */ |
| 109 | + @Nullable |
| 110 | + @Deprecated |
| 111 | + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { |
| 112 | + if (!cloudSdkCustomFields.containsKey(name)) { |
| 113 | + throw new NoSuchElementException( |
| 114 | + "DocumentBulkDeleteRequest has no field with name '" + name + "'."); |
| 115 | + } |
| 116 | + return cloudSdkCustomFields.get(name); |
| 117 | + } |
| 118 | + |
| 119 | + /** |
| 120 | + * Get the value of all properties of this {@link DocumentBulkDeleteRequest} instance including |
| 121 | + * unrecognized properties. |
| 122 | + * |
| 123 | + * @return The map of all properties |
| 124 | + */ |
| 125 | + @JsonIgnore |
| 126 | + @Nonnull |
| 127 | + public Map<String, Object> toMap() { |
| 128 | + final Map<String, Object> declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); |
| 129 | + if (ids != null) declaredFields.put("ids", ids); |
| 130 | + return declaredFields; |
| 131 | + } |
| 132 | + |
| 133 | + /** |
| 134 | + * Set an unrecognizable property of this {@link DocumentBulkDeleteRequest} instance. If the map |
| 135 | + * previously contained a mapping for the key, the old value is replaced by the specified value. |
| 136 | + * |
| 137 | + * @param customFieldName The name of the property |
| 138 | + * @param customFieldValue The value of the property |
| 139 | + */ |
| 140 | + @JsonIgnore |
| 141 | + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { |
| 142 | + cloudSdkCustomFields.put(customFieldName, customFieldValue); |
| 143 | + } |
| 144 | + |
| 145 | + @Override |
| 146 | + public boolean equals(@Nullable final java.lang.Object o) { |
| 147 | + if (this == o) { |
| 148 | + return true; |
| 149 | + } |
| 150 | + if (o == null || getClass() != o.getClass()) { |
| 151 | + return false; |
| 152 | + } |
| 153 | + final DocumentBulkDeleteRequest documentBulkDeleteRequest = (DocumentBulkDeleteRequest) o; |
| 154 | + return Objects.equals(this.cloudSdkCustomFields, documentBulkDeleteRequest.cloudSdkCustomFields) |
| 155 | + && Objects.equals(this.ids, documentBulkDeleteRequest.ids); |
| 156 | + } |
| 157 | + |
| 158 | + @Override |
| 159 | + public int hashCode() { |
| 160 | + return Objects.hash(ids, cloudSdkCustomFields); |
| 161 | + } |
| 162 | + |
| 163 | + @Override |
| 164 | + @Nonnull |
| 165 | + public String toString() { |
| 166 | + final StringBuilder sb = new StringBuilder(); |
| 167 | + sb.append("class DocumentBulkDeleteRequest {\n"); |
| 168 | + sb.append(" ids: ").append(toIndentedString(ids)).append("\n"); |
| 169 | + cloudSdkCustomFields.forEach( |
| 170 | + (k, v) -> |
| 171 | + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); |
| 172 | + sb.append("}"); |
| 173 | + return sb.toString(); |
| 174 | + } |
| 175 | + |
| 176 | + /** |
| 177 | + * Convert the given object to string with each line indented by 4 spaces (except the first line). |
| 178 | + */ |
| 179 | + private String toIndentedString(final java.lang.Object o) { |
| 180 | + if (o == null) { |
| 181 | + return "null"; |
| 182 | + } |
| 183 | + return o.toString().replace("\n", "\n "); |
| 184 | + } |
| 185 | + |
| 186 | + /** |
| 187 | + * Create a type-safe, fluent-api builder object to construct a new {@link |
| 188 | + * DocumentBulkDeleteRequest} instance with all required arguments. |
| 189 | + */ |
| 190 | + public static Builder create() { |
| 191 | + return (ids) -> new DocumentBulkDeleteRequest().ids(ids); |
| 192 | + } |
| 193 | + |
| 194 | + /** Builder helper class. */ |
| 195 | + public interface Builder { |
| 196 | + /** |
| 197 | + * Set the ids of this {@link DocumentBulkDeleteRequest} instance. |
| 198 | + * |
| 199 | + * @param ids List of document IDs to delete |
| 200 | + * @return The DocumentBulkDeleteRequest instance. |
| 201 | + */ |
| 202 | + DocumentBulkDeleteRequest ids(@Nonnull final List<UUID> ids); |
| 203 | + |
| 204 | + /** |
| 205 | + * Set the ids of this {@link DocumentBulkDeleteRequest} instance. |
| 206 | + * |
| 207 | + * @param ids List of document IDs to delete |
| 208 | + * @return The DocumentBulkDeleteRequest instance. |
| 209 | + */ |
| 210 | + default DocumentBulkDeleteRequest ids(@Nonnull final UUID... ids) { |
| 211 | + return ids(Arrays.asList(ids)); |
| 212 | + } |
| 213 | + } |
| 214 | +} |
0 commit comments