|
| 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.v1.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.HashMap; |
| 17 | +import java.util.Map; |
| 18 | +import java.util.Objects; |
| 19 | + |
| 20 | +/** |
| 21 | + * Use this processor to remove an attribute from a log during processing. The processor strips the |
| 22 | + * specified attribute from the log event, which is useful when the attribute contains sensitive |
| 23 | + * data or is no longer needed downstream. |
| 24 | + */ |
| 25 | +@JsonPropertyOrder({ |
| 26 | + LogsExcludeAttributeProcessor.JSON_PROPERTY_ATTRIBUTE_TO_EXCLUDE, |
| 27 | + LogsExcludeAttributeProcessor.JSON_PROPERTY_IS_ENABLED, |
| 28 | + LogsExcludeAttributeProcessor.JSON_PROPERTY_NAME, |
| 29 | + LogsExcludeAttributeProcessor.JSON_PROPERTY_TYPE |
| 30 | +}) |
| 31 | +@jakarta.annotation.Generated( |
| 32 | + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") |
| 33 | +public class LogsExcludeAttributeProcessor { |
| 34 | + @JsonIgnore public boolean unparsed = false; |
| 35 | + public static final String JSON_PROPERTY_ATTRIBUTE_TO_EXCLUDE = "attribute_to_exclude"; |
| 36 | + private String attributeToExclude; |
| 37 | + |
| 38 | + public static final String JSON_PROPERTY_IS_ENABLED = "is_enabled"; |
| 39 | + private Boolean isEnabled = false; |
| 40 | + |
| 41 | + public static final String JSON_PROPERTY_NAME = "name"; |
| 42 | + private String name; |
| 43 | + |
| 44 | + public static final String JSON_PROPERTY_TYPE = "type"; |
| 45 | + private LogsExcludeAttributeProcessorType type = |
| 46 | + LogsExcludeAttributeProcessorType.EXCLUDE_ATTRIBUTE; |
| 47 | + |
| 48 | + public LogsExcludeAttributeProcessor() {} |
| 49 | + |
| 50 | + @JsonCreator |
| 51 | + public LogsExcludeAttributeProcessor( |
| 52 | + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTE_TO_EXCLUDE) |
| 53 | + String attributeToExclude, |
| 54 | + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) |
| 55 | + LogsExcludeAttributeProcessorType type) { |
| 56 | + this.attributeToExclude = attributeToExclude; |
| 57 | + this.type = type; |
| 58 | + this.unparsed |= !type.isValid(); |
| 59 | + } |
| 60 | + |
| 61 | + public LogsExcludeAttributeProcessor attributeToExclude(String attributeToExclude) { |
| 62 | + this.attributeToExclude = attributeToExclude; |
| 63 | + return this; |
| 64 | + } |
| 65 | + |
| 66 | + /** |
| 67 | + * Name of the log attribute to remove from the log event. |
| 68 | + * |
| 69 | + * @return attributeToExclude |
| 70 | + */ |
| 71 | + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_TO_EXCLUDE) |
| 72 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 73 | + public String getAttributeToExclude() { |
| 74 | + return attributeToExclude; |
| 75 | + } |
| 76 | + |
| 77 | + public void setAttributeToExclude(String attributeToExclude) { |
| 78 | + this.attributeToExclude = attributeToExclude; |
| 79 | + } |
| 80 | + |
| 81 | + public LogsExcludeAttributeProcessor isEnabled(Boolean isEnabled) { |
| 82 | + this.isEnabled = isEnabled; |
| 83 | + return this; |
| 84 | + } |
| 85 | + |
| 86 | + /** |
| 87 | + * Whether or not the processor is enabled. |
| 88 | + * |
| 89 | + * @return isEnabled |
| 90 | + */ |
| 91 | + @jakarta.annotation.Nullable |
| 92 | + @JsonProperty(JSON_PROPERTY_IS_ENABLED) |
| 93 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 94 | + public Boolean getIsEnabled() { |
| 95 | + return isEnabled; |
| 96 | + } |
| 97 | + |
| 98 | + public void setIsEnabled(Boolean isEnabled) { |
| 99 | + this.isEnabled = isEnabled; |
| 100 | + } |
| 101 | + |
| 102 | + public LogsExcludeAttributeProcessor name(String name) { |
| 103 | + this.name = name; |
| 104 | + return this; |
| 105 | + } |
| 106 | + |
| 107 | + /** |
| 108 | + * Name of the processor. |
| 109 | + * |
| 110 | + * @return name |
| 111 | + */ |
| 112 | + @jakarta.annotation.Nullable |
| 113 | + @JsonProperty(JSON_PROPERTY_NAME) |
| 114 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 115 | + public String getName() { |
| 116 | + return name; |
| 117 | + } |
| 118 | + |
| 119 | + public void setName(String name) { |
| 120 | + this.name = name; |
| 121 | + } |
| 122 | + |
| 123 | + public LogsExcludeAttributeProcessor type(LogsExcludeAttributeProcessorType type) { |
| 124 | + this.type = type; |
| 125 | + this.unparsed |= !type.isValid(); |
| 126 | + return this; |
| 127 | + } |
| 128 | + |
| 129 | + /** |
| 130 | + * Type of logs exclude attribute processor. |
| 131 | + * |
| 132 | + * @return type |
| 133 | + */ |
| 134 | + @JsonProperty(JSON_PROPERTY_TYPE) |
| 135 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 136 | + public LogsExcludeAttributeProcessorType getType() { |
| 137 | + return type; |
| 138 | + } |
| 139 | + |
| 140 | + public void setType(LogsExcludeAttributeProcessorType type) { |
| 141 | + if (!type.isValid()) { |
| 142 | + this.unparsed = true; |
| 143 | + } |
| 144 | + this.type = type; |
| 145 | + } |
| 146 | + |
| 147 | + /** |
| 148 | + * A container for additional, undeclared properties. This is a holder for any undeclared |
| 149 | + * properties as specified with the 'additionalProperties' keyword in the OAS document. |
| 150 | + */ |
| 151 | + private Map<String, Object> additionalProperties; |
| 152 | + |
| 153 | + /** |
| 154 | + * Set the additional (undeclared) property with the specified name and value. If the property |
| 155 | + * does not already exist, create it otherwise replace it. |
| 156 | + * |
| 157 | + * @param key The arbitrary key to set |
| 158 | + * @param value The associated value |
| 159 | + * @return LogsExcludeAttributeProcessor |
| 160 | + */ |
| 161 | + @JsonAnySetter |
| 162 | + public LogsExcludeAttributeProcessor putAdditionalProperty(String key, Object value) { |
| 163 | + if (this.additionalProperties == null) { |
| 164 | + this.additionalProperties = new HashMap<String, Object>(); |
| 165 | + } |
| 166 | + this.additionalProperties.put(key, value); |
| 167 | + return this; |
| 168 | + } |
| 169 | + |
| 170 | + /** |
| 171 | + * Return the additional (undeclared) property. |
| 172 | + * |
| 173 | + * @return The additional properties |
| 174 | + */ |
| 175 | + @JsonAnyGetter |
| 176 | + public Map<String, Object> getAdditionalProperties() { |
| 177 | + return additionalProperties; |
| 178 | + } |
| 179 | + |
| 180 | + /** |
| 181 | + * Return the additional (undeclared) property with the specified name. |
| 182 | + * |
| 183 | + * @param key The arbitrary key to get |
| 184 | + * @return The specific additional property for the given key |
| 185 | + */ |
| 186 | + public Object getAdditionalProperty(String key) { |
| 187 | + if (this.additionalProperties == null) { |
| 188 | + return null; |
| 189 | + } |
| 190 | + return this.additionalProperties.get(key); |
| 191 | + } |
| 192 | + |
| 193 | + /** Return true if this LogsExcludeAttributeProcessor object is equal to o. */ |
| 194 | + @Override |
| 195 | + public boolean equals(Object o) { |
| 196 | + if (this == o) { |
| 197 | + return true; |
| 198 | + } |
| 199 | + if (o == null || getClass() != o.getClass()) { |
| 200 | + return false; |
| 201 | + } |
| 202 | + LogsExcludeAttributeProcessor logsExcludeAttributeProcessor = (LogsExcludeAttributeProcessor) o; |
| 203 | + return Objects.equals(this.attributeToExclude, logsExcludeAttributeProcessor.attributeToExclude) |
| 204 | + && Objects.equals(this.isEnabled, logsExcludeAttributeProcessor.isEnabled) |
| 205 | + && Objects.equals(this.name, logsExcludeAttributeProcessor.name) |
| 206 | + && Objects.equals(this.type, logsExcludeAttributeProcessor.type) |
| 207 | + && Objects.equals( |
| 208 | + this.additionalProperties, logsExcludeAttributeProcessor.additionalProperties); |
| 209 | + } |
| 210 | + |
| 211 | + @Override |
| 212 | + public int hashCode() { |
| 213 | + return Objects.hash(attributeToExclude, isEnabled, name, type, additionalProperties); |
| 214 | + } |
| 215 | + |
| 216 | + @Override |
| 217 | + public String toString() { |
| 218 | + StringBuilder sb = new StringBuilder(); |
| 219 | + sb.append("class LogsExcludeAttributeProcessor {\n"); |
| 220 | + sb.append(" attributeToExclude: ").append(toIndentedString(attributeToExclude)).append("\n"); |
| 221 | + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); |
| 222 | + sb.append(" name: ").append(toIndentedString(name)).append("\n"); |
| 223 | + sb.append(" type: ").append(toIndentedString(type)).append("\n"); |
| 224 | + sb.append(" additionalProperties: ") |
| 225 | + .append(toIndentedString(additionalProperties)) |
| 226 | + .append("\n"); |
| 227 | + sb.append('}'); |
| 228 | + return sb.toString(); |
| 229 | + } |
| 230 | + |
| 231 | + /** |
| 232 | + * Convert the given object to string with each line indented by 4 spaces (except the first line). |
| 233 | + */ |
| 234 | + private String toIndentedString(Object o) { |
| 235 | + if (o == null) { |
| 236 | + return "null"; |
| 237 | + } |
| 238 | + return o.toString().replace("\n", "\n "); |
| 239 | + } |
| 240 | +} |
0 commit comments