|
| 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 | +/** A condition evaluated against incident tags. */ |
| 23 | +@JsonPropertyOrder({IncidentCondition.JSON_PROPERTY_TAGS}) |
| 24 | +@jakarta.annotation.Generated( |
| 25 | + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") |
| 26 | +public class IncidentCondition { |
| 27 | + @JsonIgnore public boolean unparsed = false; |
| 28 | + public static final String JSON_PROPERTY_TAGS = "tags"; |
| 29 | + private List<String> tags = new ArrayList<>(); |
| 30 | + |
| 31 | + public IncidentCondition() {} |
| 32 | + |
| 33 | + @JsonCreator |
| 34 | + public IncidentCondition( |
| 35 | + @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List<String> tags) { |
| 36 | + this.tags = tags; |
| 37 | + } |
| 38 | + |
| 39 | + public IncidentCondition tags(List<String> tags) { |
| 40 | + this.tags = tags; |
| 41 | + return this; |
| 42 | + } |
| 43 | + |
| 44 | + public IncidentCondition addTagsItem(String tagsItem) { |
| 45 | + this.tags.add(tagsItem); |
| 46 | + return this; |
| 47 | + } |
| 48 | + |
| 49 | + /** |
| 50 | + * Tags that must match for the condition to pass. |
| 51 | + * |
| 52 | + * @return tags |
| 53 | + */ |
| 54 | + @JsonProperty(JSON_PROPERTY_TAGS) |
| 55 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 56 | + public List<String> getTags() { |
| 57 | + return tags; |
| 58 | + } |
| 59 | + |
| 60 | + public void setTags(List<String> tags) { |
| 61 | + this.tags = tags; |
| 62 | + } |
| 63 | + |
| 64 | + /** |
| 65 | + * A container for additional, undeclared properties. This is a holder for any undeclared |
| 66 | + * properties as specified with the 'additionalProperties' keyword in the OAS document. |
| 67 | + */ |
| 68 | + private Map<String, Object> additionalProperties; |
| 69 | + |
| 70 | + /** |
| 71 | + * Set the additional (undeclared) property with the specified name and value. If the property |
| 72 | + * does not already exist, create it otherwise replace it. |
| 73 | + * |
| 74 | + * @param key The arbitrary key to set |
| 75 | + * @param value The associated value |
| 76 | + * @return IncidentCondition |
| 77 | + */ |
| 78 | + @JsonAnySetter |
| 79 | + public IncidentCondition putAdditionalProperty(String key, Object value) { |
| 80 | + if (this.additionalProperties == null) { |
| 81 | + this.additionalProperties = new HashMap<String, Object>(); |
| 82 | + } |
| 83 | + this.additionalProperties.put(key, value); |
| 84 | + return this; |
| 85 | + } |
| 86 | + |
| 87 | + /** |
| 88 | + * Return the additional (undeclared) property. |
| 89 | + * |
| 90 | + * @return The additional properties |
| 91 | + */ |
| 92 | + @JsonAnyGetter |
| 93 | + public Map<String, Object> getAdditionalProperties() { |
| 94 | + return additionalProperties; |
| 95 | + } |
| 96 | + |
| 97 | + /** |
| 98 | + * Return the additional (undeclared) property with the specified name. |
| 99 | + * |
| 100 | + * @param key The arbitrary key to get |
| 101 | + * @return The specific additional property for the given key |
| 102 | + */ |
| 103 | + public Object getAdditionalProperty(String key) { |
| 104 | + if (this.additionalProperties == null) { |
| 105 | + return null; |
| 106 | + } |
| 107 | + return this.additionalProperties.get(key); |
| 108 | + } |
| 109 | + |
| 110 | + /** Return true if this IncidentCondition object is equal to o. */ |
| 111 | + @Override |
| 112 | + public boolean equals(Object o) { |
| 113 | + if (this == o) { |
| 114 | + return true; |
| 115 | + } |
| 116 | + if (o == null || getClass() != o.getClass()) { |
| 117 | + return false; |
| 118 | + } |
| 119 | + IncidentCondition incidentCondition = (IncidentCondition) o; |
| 120 | + return Objects.equals(this.tags, incidentCondition.tags) |
| 121 | + && Objects.equals(this.additionalProperties, incidentCondition.additionalProperties); |
| 122 | + } |
| 123 | + |
| 124 | + @Override |
| 125 | + public int hashCode() { |
| 126 | + return Objects.hash(tags, additionalProperties); |
| 127 | + } |
| 128 | + |
| 129 | + @Override |
| 130 | + public String toString() { |
| 131 | + StringBuilder sb = new StringBuilder(); |
| 132 | + sb.append("class IncidentCondition {\n"); |
| 133 | + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); |
| 134 | + sb.append(" additionalProperties: ") |
| 135 | + .append(toIndentedString(additionalProperties)) |
| 136 | + .append("\n"); |
| 137 | + sb.append('}'); |
| 138 | + return sb.toString(); |
| 139 | + } |
| 140 | + |
| 141 | + /** |
| 142 | + * Convert the given object to string with each line indented by 4 spaces (except the first line). |
| 143 | + */ |
| 144 | + private String toIndentedString(Object o) { |
| 145 | + if (o == null) { |
| 146 | + return "null"; |
| 147 | + } |
| 148 | + return o.toString().replace("\n", "\n "); |
| 149 | + } |
| 150 | +} |
0 commit comments