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