Skip to content

Commit c6ade82

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit b9e9ec0 of spec repo
1 parent 433b949 commit c6ade82

File tree

66 files changed

+10420
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+10420
-197
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 1193 additions & 165 deletions
Large diffs are not rendered by default.
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
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.JsonCreator;
10+
import com.fasterxml.jackson.annotation.JsonIgnore;
11+
import com.fasterxml.jackson.annotation.JsonInclude;
12+
import com.fasterxml.jackson.annotation.JsonProperty;
13+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
14+
import java.util.Objects;
15+
16+
/** Calendar interval definition. */
17+
@JsonPropertyOrder({
18+
CalendarInterval.JSON_PROPERTY_ALIGNMENT,
19+
CalendarInterval.JSON_PROPERTY_QUANTITY,
20+
CalendarInterval.JSON_PROPERTY_TIMEZONE,
21+
CalendarInterval.JSON_PROPERTY_TYPE
22+
})
23+
@jakarta.annotation.Generated(
24+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
25+
public class CalendarInterval {
26+
@JsonIgnore public boolean unparsed = false;
27+
public static final String JSON_PROPERTY_ALIGNMENT = "alignment";
28+
private String alignment;
29+
30+
public static final String JSON_PROPERTY_QUANTITY = "quantity";
31+
private Long quantity;
32+
33+
public static final String JSON_PROPERTY_TIMEZONE = "timezone";
34+
private String timezone;
35+
36+
public static final String JSON_PROPERTY_TYPE = "type";
37+
private CalendarIntervalType type;
38+
39+
public CalendarInterval() {}
40+
41+
@JsonCreator
42+
public CalendarInterval(
43+
@JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CalendarIntervalType type) {
44+
this.type = type;
45+
this.unparsed |= !type.isValid();
46+
}
47+
48+
public CalendarInterval alignment(String alignment) {
49+
this.alignment = alignment;
50+
return this;
51+
}
52+
53+
/**
54+
* Alignment of the interval. Valid values depend on the interval type. For <code>day</code>, use
55+
* hours (for example, <code>1am</code>, <code>2pm</code>, or <code>14</code>). For <code>week
56+
* </code>, use day names (for example, <code>monday</code>). For <code>month</code>, use
57+
* day-of-month ordinals (for example, <code>1st</code>, <code>15th</code>). For <code>year</code>
58+
* or <code>quarter</code>, use month names (for example, <code>january</code>).
59+
*
60+
* @return alignment
61+
*/
62+
@jakarta.annotation.Nullable
63+
@JsonProperty(JSON_PROPERTY_ALIGNMENT)
64+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
65+
public String getAlignment() {
66+
return alignment;
67+
}
68+
69+
public void setAlignment(String alignment) {
70+
this.alignment = alignment;
71+
}
72+
73+
public CalendarInterval quantity(Long quantity) {
74+
this.quantity = quantity;
75+
return this;
76+
}
77+
78+
/**
79+
* Quantity of the interval.
80+
*
81+
* @return quantity
82+
*/
83+
@jakarta.annotation.Nullable
84+
@JsonProperty(JSON_PROPERTY_QUANTITY)
85+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
86+
public Long getQuantity() {
87+
return quantity;
88+
}
89+
90+
public void setQuantity(Long quantity) {
91+
this.quantity = quantity;
92+
}
93+
94+
public CalendarInterval timezone(String timezone) {
95+
this.timezone = timezone;
96+
return this;
97+
}
98+
99+
/**
100+
* Timezone for the interval.
101+
*
102+
* @return timezone
103+
*/
104+
@jakarta.annotation.Nullable
105+
@JsonProperty(JSON_PROPERTY_TIMEZONE)
106+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
107+
public String getTimezone() {
108+
return timezone;
109+
}
110+
111+
public void setTimezone(String timezone) {
112+
this.timezone = timezone;
113+
}
114+
115+
public CalendarInterval type(CalendarIntervalType type) {
116+
this.type = type;
117+
this.unparsed |= !type.isValid();
118+
return this;
119+
}
120+
121+
/**
122+
* Type of calendar interval.
123+
*
124+
* @return type
125+
*/
126+
@JsonProperty(JSON_PROPERTY_TYPE)
127+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
128+
public CalendarIntervalType getType() {
129+
return type;
130+
}
131+
132+
public void setType(CalendarIntervalType type) {
133+
if (!type.isValid()) {
134+
this.unparsed = true;
135+
}
136+
this.type = type;
137+
}
138+
139+
/** Return true if this CalendarInterval object is equal to o. */
140+
@Override
141+
public boolean equals(Object o) {
142+
if (this == o) {
143+
return true;
144+
}
145+
if (o == null || getClass() != o.getClass()) {
146+
return false;
147+
}
148+
CalendarInterval calendarInterval = (CalendarInterval) o;
149+
return Objects.equals(this.alignment, calendarInterval.alignment)
150+
&& Objects.equals(this.quantity, calendarInterval.quantity)
151+
&& Objects.equals(this.timezone, calendarInterval.timezone)
152+
&& Objects.equals(this.type, calendarInterval.type);
153+
}
154+
155+
@Override
156+
public int hashCode() {
157+
return Objects.hash(alignment, quantity, timezone, type);
158+
}
159+
160+
@Override
161+
public String toString() {
162+
StringBuilder sb = new StringBuilder();
163+
sb.append("class CalendarInterval {\n");
164+
sb.append(" alignment: ").append(toIndentedString(alignment)).append("\n");
165+
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
166+
sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n");
167+
sb.append(" type: ").append(toIndentedString(type)).append("\n");
168+
sb.append('}');
169+
return sb.toString();
170+
}
171+
172+
/**
173+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
174+
*/
175+
private String toIndentedString(Object o) {
176+
if (o == null) {
177+
return "null";
178+
}
179+
return o.toString().replace("\n", "\n ");
180+
}
181+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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.datadog.api.client.ModelEnum;
10+
import com.fasterxml.jackson.annotation.JsonCreator;
11+
import com.fasterxml.jackson.core.JsonGenerator;
12+
import com.fasterxml.jackson.core.JsonProcessingException;
13+
import com.fasterxml.jackson.databind.SerializerProvider;
14+
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
15+
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
16+
import java.io.IOException;
17+
import java.util.Arrays;
18+
import java.util.HashSet;
19+
import java.util.Set;
20+
21+
/** Type of calendar interval. */
22+
@JsonSerialize(using = CalendarIntervalType.CalendarIntervalTypeSerializer.class)
23+
public class CalendarIntervalType extends ModelEnum<String> {
24+
25+
private static final Set<String> allowedValues =
26+
new HashSet<String>(
27+
Arrays.asList("day", "week", "month", "year", "quarter", "minute", "hour"));
28+
29+
public static final CalendarIntervalType DAY = new CalendarIntervalType("day");
30+
public static final CalendarIntervalType WEEK = new CalendarIntervalType("week");
31+
public static final CalendarIntervalType MONTH = new CalendarIntervalType("month");
32+
public static final CalendarIntervalType YEAR = new CalendarIntervalType("year");
33+
public static final CalendarIntervalType QUARTER = new CalendarIntervalType("quarter");
34+
public static final CalendarIntervalType MINUTE = new CalendarIntervalType("minute");
35+
public static final CalendarIntervalType HOUR = new CalendarIntervalType("hour");
36+
37+
CalendarIntervalType(String value) {
38+
super(value, allowedValues);
39+
}
40+
41+
public static class CalendarIntervalTypeSerializer extends StdSerializer<CalendarIntervalType> {
42+
public CalendarIntervalTypeSerializer(Class<CalendarIntervalType> t) {
43+
super(t);
44+
}
45+
46+
public CalendarIntervalTypeSerializer() {
47+
this(null);
48+
}
49+
50+
@Override
51+
public void serialize(
52+
CalendarIntervalType value, JsonGenerator jgen, SerializerProvider provider)
53+
throws IOException, JsonProcessingException {
54+
jgen.writeObject(value.value);
55+
}
56+
}
57+
58+
@JsonCreator
59+
public static CalendarIntervalType fromValue(String value) {
60+
return new CalendarIntervalType(value);
61+
}
62+
}

0 commit comments

Comments
 (0)