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