|
| 1 | +/* |
| 2 | + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. |
| 3 | + * This product includes software developed at Datadog (https://www.datadoghq.com/). |
| 4 | + * Copyright 2019-Present Datadog, Inc. |
| 5 | + */ |
| 6 | + |
| 7 | +package com.datadog.api.client.v2.model; |
| 8 | + |
| 9 | +import com.fasterxml.jackson.annotation.JsonAnyGetter; |
| 10 | +import com.fasterxml.jackson.annotation.JsonAnySetter; |
| 11 | +import com.fasterxml.jackson.annotation.JsonIgnore; |
| 12 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 13 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 14 | +import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| 15 | +import java.util.HashMap; |
| 16 | +import java.util.Map; |
| 17 | +import java.util.Objects; |
| 18 | + |
| 19 | +/** References to the source of the error. */ |
| 20 | +@JsonPropertyOrder({ |
| 21 | + JSONAPIErrorItemSource.JSON_PROPERTY_HEADER, |
| 22 | + JSONAPIErrorItemSource.JSON_PROPERTY_PARAMETER, |
| 23 | + JSONAPIErrorItemSource.JSON_PROPERTY_POINTER |
| 24 | +}) |
| 25 | +@jakarta.annotation.Generated( |
| 26 | + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") |
| 27 | +public class JSONAPIErrorItemSource { |
| 28 | + @JsonIgnore public boolean unparsed = false; |
| 29 | + public static final String JSON_PROPERTY_HEADER = "header"; |
| 30 | + private String header; |
| 31 | + |
| 32 | + public static final String JSON_PROPERTY_PARAMETER = "parameter"; |
| 33 | + private String parameter; |
| 34 | + |
| 35 | + public static final String JSON_PROPERTY_POINTER = "pointer"; |
| 36 | + private String pointer; |
| 37 | + |
| 38 | + public JSONAPIErrorItemSource header(String header) { |
| 39 | + this.header = header; |
| 40 | + return this; |
| 41 | + } |
| 42 | + |
| 43 | + /** |
| 44 | + * A string indicating the name of a single request header which caused the error. |
| 45 | + * |
| 46 | + * @return header |
| 47 | + */ |
| 48 | + @jakarta.annotation.Nullable |
| 49 | + @JsonProperty(JSON_PROPERTY_HEADER) |
| 50 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 51 | + public String getHeader() { |
| 52 | + return header; |
| 53 | + } |
| 54 | + |
| 55 | + public void setHeader(String header) { |
| 56 | + this.header = header; |
| 57 | + } |
| 58 | + |
| 59 | + public JSONAPIErrorItemSource parameter(String parameter) { |
| 60 | + this.parameter = parameter; |
| 61 | + return this; |
| 62 | + } |
| 63 | + |
| 64 | + /** |
| 65 | + * A string indicating which URI query parameter caused the error. |
| 66 | + * |
| 67 | + * @return parameter |
| 68 | + */ |
| 69 | + @jakarta.annotation.Nullable |
| 70 | + @JsonProperty(JSON_PROPERTY_PARAMETER) |
| 71 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 72 | + public String getParameter() { |
| 73 | + return parameter; |
| 74 | + } |
| 75 | + |
| 76 | + public void setParameter(String parameter) { |
| 77 | + this.parameter = parameter; |
| 78 | + } |
| 79 | + |
| 80 | + public JSONAPIErrorItemSource pointer(String pointer) { |
| 81 | + this.pointer = pointer; |
| 82 | + return this; |
| 83 | + } |
| 84 | + |
| 85 | + /** |
| 86 | + * A JSON pointer to the value in the request document that caused the error. |
| 87 | + * |
| 88 | + * @return pointer |
| 89 | + */ |
| 90 | + @jakarta.annotation.Nullable |
| 91 | + @JsonProperty(JSON_PROPERTY_POINTER) |
| 92 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 93 | + public String getPointer() { |
| 94 | + return pointer; |
| 95 | + } |
| 96 | + |
| 97 | + public void setPointer(String pointer) { |
| 98 | + this.pointer = pointer; |
| 99 | + } |
| 100 | + |
| 101 | + /** |
| 102 | + * A container for additional, undeclared properties. This is a holder for any undeclared |
| 103 | + * properties as specified with the 'additionalProperties' keyword in the OAS document. |
| 104 | + */ |
| 105 | + private Map<String, Object> additionalProperties; |
| 106 | + |
| 107 | + /** |
| 108 | + * Set the additional (undeclared) property with the specified name and value. If the property |
| 109 | + * does not already exist, create it otherwise replace it. |
| 110 | + * |
| 111 | + * @param key The arbitrary key to set |
| 112 | + * @param value The associated value |
| 113 | + * @return JSONAPIErrorItemSource |
| 114 | + */ |
| 115 | + @JsonAnySetter |
| 116 | + public JSONAPIErrorItemSource putAdditionalProperty(String key, Object value) { |
| 117 | + if (this.additionalProperties == null) { |
| 118 | + this.additionalProperties = new HashMap<String, Object>(); |
| 119 | + } |
| 120 | + this.additionalProperties.put(key, value); |
| 121 | + return this; |
| 122 | + } |
| 123 | + |
| 124 | + /** |
| 125 | + * Return the additional (undeclared) property. |
| 126 | + * |
| 127 | + * @return The additional properties |
| 128 | + */ |
| 129 | + @JsonAnyGetter |
| 130 | + public Map<String, Object> getAdditionalProperties() { |
| 131 | + return additionalProperties; |
| 132 | + } |
| 133 | + |
| 134 | + /** |
| 135 | + * Return the additional (undeclared) property with the specified name. |
| 136 | + * |
| 137 | + * @param key The arbitrary key to get |
| 138 | + * @return The specific additional property for the given key |
| 139 | + */ |
| 140 | + public Object getAdditionalProperty(String key) { |
| 141 | + if (this.additionalProperties == null) { |
| 142 | + return null; |
| 143 | + } |
| 144 | + return this.additionalProperties.get(key); |
| 145 | + } |
| 146 | + |
| 147 | + /** Return true if this JSONAPIErrorItemSource object is equal to o. */ |
| 148 | + @Override |
| 149 | + public boolean equals(Object o) { |
| 150 | + if (this == o) { |
| 151 | + return true; |
| 152 | + } |
| 153 | + if (o == null || getClass() != o.getClass()) { |
| 154 | + return false; |
| 155 | + } |
| 156 | + JSONAPIErrorItemSource jsonapiErrorItemSource = (JSONAPIErrorItemSource) o; |
| 157 | + return Objects.equals(this.header, jsonapiErrorItemSource.header) |
| 158 | + && Objects.equals(this.parameter, jsonapiErrorItemSource.parameter) |
| 159 | + && Objects.equals(this.pointer, jsonapiErrorItemSource.pointer) |
| 160 | + && Objects.equals(this.additionalProperties, jsonapiErrorItemSource.additionalProperties); |
| 161 | + } |
| 162 | + |
| 163 | + @Override |
| 164 | + public int hashCode() { |
| 165 | + return Objects.hash(header, parameter, pointer, additionalProperties); |
| 166 | + } |
| 167 | + |
| 168 | + @Override |
| 169 | + public String toString() { |
| 170 | + StringBuilder sb = new StringBuilder(); |
| 171 | + sb.append("class JSONAPIErrorItemSource {\n"); |
| 172 | + sb.append(" header: ").append(toIndentedString(header)).append("\n"); |
| 173 | + sb.append(" parameter: ").append(toIndentedString(parameter)).append("\n"); |
| 174 | + sb.append(" pointer: ").append(toIndentedString(pointer)).append("\n"); |
| 175 | + sb.append(" additionalProperties: ") |
| 176 | + .append(toIndentedString(additionalProperties)) |
| 177 | + .append("\n"); |
| 178 | + sb.append('}'); |
| 179 | + return sb.toString(); |
| 180 | + } |
| 181 | + |
| 182 | + /** |
| 183 | + * Convert the given object to string with each line indented by 4 spaces (except the first line). |
| 184 | + */ |
| 185 | + private String toIndentedString(Object o) { |
| 186 | + if (o == null) { |
| 187 | + return "null"; |
| 188 | + } |
| 189 | + return o.toString().replace("\n", "\n "); |
| 190 | + } |
| 191 | +} |
0 commit comments