|
| 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.JsonCreator; |
| 12 | +import com.fasterxml.jackson.annotation.JsonIgnore; |
| 13 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 14 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 15 | +import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| 16 | +import java.util.ArrayList; |
| 17 | +import java.util.HashMap; |
| 18 | +import java.util.List; |
| 19 | +import java.util.Map; |
| 20 | +import java.util.Objects; |
| 21 | + |
| 22 | +/** |
| 23 | + * The <code>datadog_traces</code> destination forwards traces to Datadog. |
| 24 | + * |
| 25 | + * <p><strong>Supported pipeline types:</strong> traces |
| 26 | + */ |
| 27 | +@JsonPropertyOrder({ |
| 28 | + ObservabilityPipelineDatadogTracesDestination.JSON_PROPERTY_BUFFER, |
| 29 | + ObservabilityPipelineDatadogTracesDestination.JSON_PROPERTY_ID, |
| 30 | + ObservabilityPipelineDatadogTracesDestination.JSON_PROPERTY_INPUTS, |
| 31 | + ObservabilityPipelineDatadogTracesDestination.JSON_PROPERTY_TYPE |
| 32 | +}) |
| 33 | +@jakarta.annotation.Generated( |
| 34 | + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") |
| 35 | +public class ObservabilityPipelineDatadogTracesDestination { |
| 36 | + @JsonIgnore public boolean unparsed = false; |
| 37 | + public static final String JSON_PROPERTY_BUFFER = "buffer"; |
| 38 | + private ObservabilityPipelineBufferOptions buffer; |
| 39 | + |
| 40 | + public static final String JSON_PROPERTY_ID = "id"; |
| 41 | + private String id; |
| 42 | + |
| 43 | + public static final String JSON_PROPERTY_INPUTS = "inputs"; |
| 44 | + private List<String> inputs = new ArrayList<>(); |
| 45 | + |
| 46 | + public static final String JSON_PROPERTY_TYPE = "type"; |
| 47 | + private ObservabilityPipelineDatadogTracesDestinationType type = |
| 48 | + ObservabilityPipelineDatadogTracesDestinationType.DATADOG_TRACES; |
| 49 | + |
| 50 | + public ObservabilityPipelineDatadogTracesDestination() {} |
| 51 | + |
| 52 | + @JsonCreator |
| 53 | + public ObservabilityPipelineDatadogTracesDestination( |
| 54 | + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, |
| 55 | + @JsonProperty(required = true, value = JSON_PROPERTY_INPUTS) List<String> inputs, |
| 56 | + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) |
| 57 | + ObservabilityPipelineDatadogTracesDestinationType type) { |
| 58 | + this.id = id; |
| 59 | + this.inputs = inputs; |
| 60 | + this.type = type; |
| 61 | + this.unparsed |= !type.isValid(); |
| 62 | + } |
| 63 | + |
| 64 | + public ObservabilityPipelineDatadogTracesDestination buffer( |
| 65 | + ObservabilityPipelineBufferOptions buffer) { |
| 66 | + this.buffer = buffer; |
| 67 | + this.unparsed |= buffer.unparsed; |
| 68 | + return this; |
| 69 | + } |
| 70 | + |
| 71 | + /** |
| 72 | + * Configuration for buffer settings on destination components. |
| 73 | + * |
| 74 | + * @return buffer |
| 75 | + */ |
| 76 | + @jakarta.annotation.Nullable |
| 77 | + @JsonProperty(JSON_PROPERTY_BUFFER) |
| 78 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 79 | + public ObservabilityPipelineBufferOptions getBuffer() { |
| 80 | + return buffer; |
| 81 | + } |
| 82 | + |
| 83 | + public void setBuffer(ObservabilityPipelineBufferOptions buffer) { |
| 84 | + this.buffer = buffer; |
| 85 | + if (buffer != null) { |
| 86 | + this.unparsed |= buffer.unparsed; |
| 87 | + } |
| 88 | + } |
| 89 | + |
| 90 | + public ObservabilityPipelineDatadogTracesDestination id(String id) { |
| 91 | + this.id = id; |
| 92 | + return this; |
| 93 | + } |
| 94 | + |
| 95 | + /** |
| 96 | + * The unique identifier for this component. |
| 97 | + * |
| 98 | + * @return id |
| 99 | + */ |
| 100 | + @JsonProperty(JSON_PROPERTY_ID) |
| 101 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 102 | + public String getId() { |
| 103 | + return id; |
| 104 | + } |
| 105 | + |
| 106 | + public void setId(String id) { |
| 107 | + this.id = id; |
| 108 | + } |
| 109 | + |
| 110 | + public ObservabilityPipelineDatadogTracesDestination inputs(List<String> inputs) { |
| 111 | + this.inputs = inputs; |
| 112 | + return this; |
| 113 | + } |
| 114 | + |
| 115 | + public ObservabilityPipelineDatadogTracesDestination addInputsItem(String inputsItem) { |
| 116 | + this.inputs.add(inputsItem); |
| 117 | + return this; |
| 118 | + } |
| 119 | + |
| 120 | + /** |
| 121 | + * A list of component IDs whose output is used as the input for this component. |
| 122 | + * |
| 123 | + * @return inputs |
| 124 | + */ |
| 125 | + @JsonProperty(JSON_PROPERTY_INPUTS) |
| 126 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 127 | + public List<String> getInputs() { |
| 128 | + return inputs; |
| 129 | + } |
| 130 | + |
| 131 | + public void setInputs(List<String> inputs) { |
| 132 | + this.inputs = inputs; |
| 133 | + } |
| 134 | + |
| 135 | + public ObservabilityPipelineDatadogTracesDestination type( |
| 136 | + ObservabilityPipelineDatadogTracesDestinationType type) { |
| 137 | + this.type = type; |
| 138 | + this.unparsed |= !type.isValid(); |
| 139 | + return this; |
| 140 | + } |
| 141 | + |
| 142 | + /** |
| 143 | + * The destination type. The value should always be <code>datadog_traces</code>. |
| 144 | + * |
| 145 | + * @return type |
| 146 | + */ |
| 147 | + @JsonProperty(JSON_PROPERTY_TYPE) |
| 148 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 149 | + public ObservabilityPipelineDatadogTracesDestinationType getType() { |
| 150 | + return type; |
| 151 | + } |
| 152 | + |
| 153 | + public void setType(ObservabilityPipelineDatadogTracesDestinationType type) { |
| 154 | + if (!type.isValid()) { |
| 155 | + this.unparsed = true; |
| 156 | + } |
| 157 | + this.type = type; |
| 158 | + } |
| 159 | + |
| 160 | + /** |
| 161 | + * A container for additional, undeclared properties. This is a holder for any undeclared |
| 162 | + * properties as specified with the 'additionalProperties' keyword in the OAS document. |
| 163 | + */ |
| 164 | + private Map<String, Object> additionalProperties; |
| 165 | + |
| 166 | + /** |
| 167 | + * Set the additional (undeclared) property with the specified name and value. If the property |
| 168 | + * does not already exist, create it otherwise replace it. |
| 169 | + * |
| 170 | + * @param key The arbitrary key to set |
| 171 | + * @param value The associated value |
| 172 | + * @return ObservabilityPipelineDatadogTracesDestination |
| 173 | + */ |
| 174 | + @JsonAnySetter |
| 175 | + public ObservabilityPipelineDatadogTracesDestination putAdditionalProperty( |
| 176 | + String key, Object value) { |
| 177 | + if (this.additionalProperties == null) { |
| 178 | + this.additionalProperties = new HashMap<String, Object>(); |
| 179 | + } |
| 180 | + this.additionalProperties.put(key, value); |
| 181 | + return this; |
| 182 | + } |
| 183 | + |
| 184 | + /** |
| 185 | + * Return the additional (undeclared) property. |
| 186 | + * |
| 187 | + * @return The additional properties |
| 188 | + */ |
| 189 | + @JsonAnyGetter |
| 190 | + public Map<String, Object> getAdditionalProperties() { |
| 191 | + return additionalProperties; |
| 192 | + } |
| 193 | + |
| 194 | + /** |
| 195 | + * Return the additional (undeclared) property with the specified name. |
| 196 | + * |
| 197 | + * @param key The arbitrary key to get |
| 198 | + * @return The specific additional property for the given key |
| 199 | + */ |
| 200 | + public Object getAdditionalProperty(String key) { |
| 201 | + if (this.additionalProperties == null) { |
| 202 | + return null; |
| 203 | + } |
| 204 | + return this.additionalProperties.get(key); |
| 205 | + } |
| 206 | + |
| 207 | + /** Return true if this ObservabilityPipelineDatadogTracesDestination object is equal to o. */ |
| 208 | + @Override |
| 209 | + public boolean equals(Object o) { |
| 210 | + if (this == o) { |
| 211 | + return true; |
| 212 | + } |
| 213 | + if (o == null || getClass() != o.getClass()) { |
| 214 | + return false; |
| 215 | + } |
| 216 | + ObservabilityPipelineDatadogTracesDestination observabilityPipelineDatadogTracesDestination = |
| 217 | + (ObservabilityPipelineDatadogTracesDestination) o; |
| 218 | + return Objects.equals(this.buffer, observabilityPipelineDatadogTracesDestination.buffer) |
| 219 | + && Objects.equals(this.id, observabilityPipelineDatadogTracesDestination.id) |
| 220 | + && Objects.equals(this.inputs, observabilityPipelineDatadogTracesDestination.inputs) |
| 221 | + && Objects.equals(this.type, observabilityPipelineDatadogTracesDestination.type) |
| 222 | + && Objects.equals( |
| 223 | + this.additionalProperties, |
| 224 | + observabilityPipelineDatadogTracesDestination.additionalProperties); |
| 225 | + } |
| 226 | + |
| 227 | + @Override |
| 228 | + public int hashCode() { |
| 229 | + return Objects.hash(buffer, id, inputs, type, additionalProperties); |
| 230 | + } |
| 231 | + |
| 232 | + @Override |
| 233 | + public String toString() { |
| 234 | + StringBuilder sb = new StringBuilder(); |
| 235 | + sb.append("class ObservabilityPipelineDatadogTracesDestination {\n"); |
| 236 | + sb.append(" buffer: ").append(toIndentedString(buffer)).append("\n"); |
| 237 | + sb.append(" id: ").append(toIndentedString(id)).append("\n"); |
| 238 | + sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n"); |
| 239 | + sb.append(" type: ").append(toIndentedString(type)).append("\n"); |
| 240 | + sb.append(" additionalProperties: ") |
| 241 | + .append(toIndentedString(additionalProperties)) |
| 242 | + .append("\n"); |
| 243 | + sb.append('}'); |
| 244 | + return sb.toString(); |
| 245 | + } |
| 246 | + |
| 247 | + /** |
| 248 | + * Convert the given object to string with each line indented by 4 spaces (except the first line). |
| 249 | + */ |
| 250 | + private String toIndentedString(Object o) { |
| 251 | + if (o == null) { |
| 252 | + return "null"; |
| 253 | + } |
| 254 | + return o.toString().replace("\n", "\n "); |
| 255 | + } |
| 256 | +} |
0 commit comments