Skip to content

Commit 86512dc

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit ed6da01 of spec repo
1 parent 93086d1 commit 86512dc

File tree

58 files changed

+7644
-39
lines changed

Some content is hidden

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

58 files changed

+7644
-39
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 702 additions & 1 deletion
Large diffs are not rendered by default.
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
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.
55+
*
56+
* @return alignment
57+
*/
58+
@jakarta.annotation.Nullable
59+
@JsonProperty(JSON_PROPERTY_ALIGNMENT)
60+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
61+
public String getAlignment() {
62+
return alignment;
63+
}
64+
65+
public void setAlignment(String alignment) {
66+
this.alignment = alignment;
67+
}
68+
69+
public CalendarInterval quantity(Long quantity) {
70+
this.quantity = quantity;
71+
return this;
72+
}
73+
74+
/**
75+
* Quantity of the interval.
76+
*
77+
* @return quantity
78+
*/
79+
@jakarta.annotation.Nullable
80+
@JsonProperty(JSON_PROPERTY_QUANTITY)
81+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
82+
public Long getQuantity() {
83+
return quantity;
84+
}
85+
86+
public void setQuantity(Long quantity) {
87+
this.quantity = quantity;
88+
}
89+
90+
public CalendarInterval timezone(String timezone) {
91+
this.timezone = timezone;
92+
return this;
93+
}
94+
95+
/**
96+
* Timezone for the interval.
97+
*
98+
* @return timezone
99+
*/
100+
@jakarta.annotation.Nullable
101+
@JsonProperty(JSON_PROPERTY_TIMEZONE)
102+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
103+
public String getTimezone() {
104+
return timezone;
105+
}
106+
107+
public void setTimezone(String timezone) {
108+
this.timezone = timezone;
109+
}
110+
111+
public CalendarInterval type(CalendarIntervalType type) {
112+
this.type = type;
113+
this.unparsed |= !type.isValid();
114+
return this;
115+
}
116+
117+
/**
118+
* Type of calendar interval.
119+
*
120+
* @return type
121+
*/
122+
@JsonProperty(JSON_PROPERTY_TYPE)
123+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
124+
public CalendarIntervalType getType() {
125+
return type;
126+
}
127+
128+
public void setType(CalendarIntervalType type) {
129+
if (!type.isValid()) {
130+
this.unparsed = true;
131+
}
132+
this.type = type;
133+
}
134+
135+
/** Return true if this CalendarInterval object is equal to o. */
136+
@Override
137+
public boolean equals(Object o) {
138+
if (this == o) {
139+
return true;
140+
}
141+
if (o == null || getClass() != o.getClass()) {
142+
return false;
143+
}
144+
CalendarInterval calendarInterval = (CalendarInterval) o;
145+
return Objects.equals(this.alignment, calendarInterval.alignment)
146+
&& Objects.equals(this.quantity, calendarInterval.quantity)
147+
&& Objects.equals(this.timezone, calendarInterval.timezone)
148+
&& Objects.equals(this.type, calendarInterval.type);
149+
}
150+
151+
@Override
152+
public int hashCode() {
153+
return Objects.hash(alignment, quantity, timezone, type);
154+
}
155+
156+
@Override
157+
public String toString() {
158+
StringBuilder sb = new StringBuilder();
159+
sb.append("class CalendarInterval {\n");
160+
sb.append(" alignment: ").append(toIndentedString(alignment)).append("\n");
161+
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
162+
sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n");
163+
sb.append(" type: ").append(toIndentedString(type)).append("\n");
164+
sb.append('}');
165+
return sb.toString();
166+
}
167+
168+
/**
169+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
170+
*/
171+
private String toIndentedString(Object o) {
172+
if (o == null) {
173+
return "null";
174+
}
175+
return o.toString().replace("\n", "\n ");
176+
}
177+
}
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+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
/** Display mode for legacy cohort queries. */
22+
@JsonSerialize(using = CohortLegacyDisplayMode.CohortLegacyDisplayModeSerializer.class)
23+
public class CohortLegacyDisplayMode extends ModelEnum<String> {
24+
25+
private static final Set<String> allowedValues =
26+
new HashSet<String>(Arrays.asList("absolute", "percentage"));
27+
28+
public static final CohortLegacyDisplayMode ABSOLUTE = new CohortLegacyDisplayMode("absolute");
29+
public static final CohortLegacyDisplayMode PERCENTAGE =
30+
new CohortLegacyDisplayMode("percentage");
31+
32+
CohortLegacyDisplayMode(String value) {
33+
super(value, allowedValues);
34+
}
35+
36+
public static class CohortLegacyDisplayModeSerializer
37+
extends StdSerializer<CohortLegacyDisplayMode> {
38+
public CohortLegacyDisplayModeSerializer(Class<CohortLegacyDisplayMode> t) {
39+
super(t);
40+
}
41+
42+
public CohortLegacyDisplayModeSerializer() {
43+
this(null);
44+
}
45+
46+
@Override
47+
public void serialize(
48+
CohortLegacyDisplayMode value, JsonGenerator jgen, SerializerProvider provider)
49+
throws IOException, JsonProcessingException {
50+
jgen.writeObject(value.value);
51+
}
52+
}
53+
54+
@JsonCreator
55+
public static CohortLegacyDisplayMode fromValue(String value) {
56+
return new CohortLegacyDisplayMode(value);
57+
}
58+
}

0 commit comments

Comments
 (0)