Skip to content

Commit 581b8e4

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 795c134 of spec repo
1 parent a76fb76 commit 581b8e4

File tree

8 files changed

+478
-22
lines changed

8 files changed

+478
-22
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11481,6 +11481,60 @@ components:
1148111481
example: UTC
1148211482
type: string
1148311483
type: object
11484+
SLOCountCondition:
11485+
description: 'A metric SLI specification, composed of three parts: the good
11486+
events formula, the total events formula,
11487+
11488+
and the involved queries.'
11489+
example:
11490+
good_events_formula: query1 - query2
11491+
queries:
11492+
- data_source: metrics
11493+
name: query1
11494+
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
11495+
- data_source: metrics
11496+
name: query2
11497+
query: sum:trace.servlet.request.errors{*} by {env}.as_count()
11498+
total_events_formula: query1
11499+
properties:
11500+
good_events_formula:
11501+
$ref: '#/components/schemas/SLOFormula'
11502+
queries:
11503+
example:
11504+
- data_source: metrics
11505+
name: query1
11506+
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
11507+
items:
11508+
$ref: '#/components/schemas/SLODataSourceQueryDefinition'
11509+
minItems: 1
11510+
type: array
11511+
total_events_formula:
11512+
$ref: '#/components/schemas/SLOFormula'
11513+
required:
11514+
- good_events_formula
11515+
- total_events_formula
11516+
- queries
11517+
type: object
11518+
SLOCountSpec:
11519+
additionalProperties: false
11520+
description: A metric SLI specification.
11521+
example:
11522+
count:
11523+
good_events_formula: query1 - query2
11524+
queries:
11525+
- data_source: metrics
11526+
name: query1
11527+
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
11528+
- data_source: metrics
11529+
name: query2
11530+
query: sum:trace.servlet.request.errors{*} by {env}.as_count()
11531+
total_events_formula: query1
11532+
properties:
11533+
count:
11534+
$ref: '#/components/schemas/SLOCountCondition'
11535+
required:
11536+
- count
11537+
type: object
1148411538
SLOCreator:
1148511539
description: The creator of the SLO
1148611540
nullable: true
@@ -12328,8 +12382,16 @@ components:
1232812382
type: string
1232912383
query:
1233012384
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
12385+
description: 'The metric query of good / total events. This is not allowed
12386+
if the `sli_specification` field
12387+
12388+
is used in the same request.'
1233112389
sli_specification:
1233212390
$ref: '#/components/schemas/SLOSliSpec'
12391+
description: 'A generic SLI specification. This is currently used for time-slice
12392+
and metric SLOs only.
12393+
12394+
This is not allowed if the `query` field is used in the same request.'
1233312395
tags:
1233412396
description: 'A list of tags associated with this service level objective.
1233512397

@@ -12386,9 +12448,10 @@ components:
1238612448
type: object
1238712449
SLOSliSpec:
1238812450
description: A generic SLI specification. This is currently used for time-slice
12389-
SLOs only.
12451+
and metric SLOs only.
1239012452
oneOf:
1239112453
- $ref: '#/components/schemas/SLOTimeSliceSpec'
12454+
- $ref: '#/components/schemas/SLOCountSpec'
1239212455
SLOState:
1239312456
description: State of the SLO.
1239412457
enum:
@@ -13479,8 +13542,16 @@ components:
1347913542
type: string
1348013543
query:
1348113544
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
13545+
description: 'The metric query of good / total events. This is not allowed
13546+
if the `sli_specification` field
13547+
13548+
is used in the same request.'
1348213549
sli_specification:
1348313550
$ref: '#/components/schemas/SLOSliSpec'
13551+
description: 'A generic SLI specification. This is currently used for time-slice
13552+
and metric SLOs only.
13553+
13554+
This is not allowed if the `query` field is used in the same request.'
1348413555
tags:
1348513556
description: 'A list of tags associated with this service level objective.
1348613557

@@ -13540,8 +13611,8 @@ components:
1354013611
- type
1354113612
type: object
1354213613
ServiceLevelObjectiveQuery:
13543-
description: 'A metric-based SLO. **Required if type is `metric`**. Note that
13544-
Datadog only allows the sum by aggregator
13614+
description: 'A now deprecated metric SLO. Note that Datadog only allows the
13615+
sum by aggregator
1354513616

1354613617
to be used because this will sum up all request counts instead of averaging
1354713618
them, or taking the max or
@@ -13610,8 +13681,16 @@ components:
1361013681
type: string
1361113682
query:
1361213683
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
13684+
description: 'The metric query of good / total events. This is not allowed
13685+
if the `sli_specification` field
13686+
13687+
is used in the same request.'
1361313688
sli_specification:
1361413689
$ref: '#/components/schemas/SLOSliSpec'
13690+
description: 'A generic SLI specification. This is currently used for time-slice
13691+
and metric SLOs only.
13692+
13693+
This is not allowed if the `query` field is used in the same request.'
1361513694
tags:
1361613695
description: 'A list of tags associated with this service level objective.
1361713696

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
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.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+
/**
23+
* A metric SLI specification, composed of three parts: the good events formula, the total events
24+
* formula, and the involved queries.
25+
*/
26+
@JsonPropertyOrder({
27+
SLOCountCondition.JSON_PROPERTY_GOOD_EVENTS_FORMULA,
28+
SLOCountCondition.JSON_PROPERTY_QUERIES,
29+
SLOCountCondition.JSON_PROPERTY_TOTAL_EVENTS_FORMULA
30+
})
31+
@jakarta.annotation.Generated(
32+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
33+
public class SLOCountCondition {
34+
@JsonIgnore public boolean unparsed = false;
35+
public static final String JSON_PROPERTY_GOOD_EVENTS_FORMULA = "good_events_formula";
36+
private SLOFormula goodEventsFormula;
37+
38+
public static final String JSON_PROPERTY_QUERIES = "queries";
39+
private List<SLODataSourceQueryDefinition> queries = new ArrayList<>();
40+
41+
public static final String JSON_PROPERTY_TOTAL_EVENTS_FORMULA = "total_events_formula";
42+
private SLOFormula totalEventsFormula;
43+
44+
public SLOCountCondition() {}
45+
46+
@JsonCreator
47+
public SLOCountCondition(
48+
@JsonProperty(required = true, value = JSON_PROPERTY_GOOD_EVENTS_FORMULA)
49+
SLOFormula goodEventsFormula,
50+
@JsonProperty(required = true, value = JSON_PROPERTY_QUERIES)
51+
List<SLODataSourceQueryDefinition> queries,
52+
@JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_EVENTS_FORMULA)
53+
SLOFormula totalEventsFormula) {
54+
this.goodEventsFormula = goodEventsFormula;
55+
this.unparsed |= goodEventsFormula.unparsed;
56+
this.queries = queries;
57+
this.totalEventsFormula = totalEventsFormula;
58+
this.unparsed |= totalEventsFormula.unparsed;
59+
}
60+
61+
public SLOCountCondition goodEventsFormula(SLOFormula goodEventsFormula) {
62+
this.goodEventsFormula = goodEventsFormula;
63+
this.unparsed |= goodEventsFormula.unparsed;
64+
return this;
65+
}
66+
67+
/**
68+
* A formula that specifies how to combine the results of multiple queries.
69+
*
70+
* @return goodEventsFormula
71+
*/
72+
@JsonProperty(JSON_PROPERTY_GOOD_EVENTS_FORMULA)
73+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
74+
public SLOFormula getGoodEventsFormula() {
75+
return goodEventsFormula;
76+
}
77+
78+
public void setGoodEventsFormula(SLOFormula goodEventsFormula) {
79+
this.goodEventsFormula = goodEventsFormula;
80+
}
81+
82+
public SLOCountCondition queries(List<SLODataSourceQueryDefinition> queries) {
83+
this.queries = queries;
84+
for (SLODataSourceQueryDefinition item : queries) {
85+
this.unparsed |= item.unparsed;
86+
}
87+
return this;
88+
}
89+
90+
public SLOCountCondition addQueriesItem(SLODataSourceQueryDefinition queriesItem) {
91+
this.queries.add(queriesItem);
92+
this.unparsed |= queriesItem.unparsed;
93+
return this;
94+
}
95+
96+
/**
97+
* Getqueries
98+
*
99+
* @return queries
100+
*/
101+
@JsonProperty(JSON_PROPERTY_QUERIES)
102+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
103+
public List<SLODataSourceQueryDefinition> getQueries() {
104+
return queries;
105+
}
106+
107+
public void setQueries(List<SLODataSourceQueryDefinition> queries) {
108+
this.queries = queries;
109+
}
110+
111+
public SLOCountCondition totalEventsFormula(SLOFormula totalEventsFormula) {
112+
this.totalEventsFormula = totalEventsFormula;
113+
this.unparsed |= totalEventsFormula.unparsed;
114+
return this;
115+
}
116+
117+
/**
118+
* A formula that specifies how to combine the results of multiple queries.
119+
*
120+
* @return totalEventsFormula
121+
*/
122+
@JsonProperty(JSON_PROPERTY_TOTAL_EVENTS_FORMULA)
123+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
124+
public SLOFormula getTotalEventsFormula() {
125+
return totalEventsFormula;
126+
}
127+
128+
public void setTotalEventsFormula(SLOFormula totalEventsFormula) {
129+
this.totalEventsFormula = totalEventsFormula;
130+
}
131+
132+
/**
133+
* A container for additional, undeclared properties. This is a holder for any undeclared
134+
* properties as specified with the 'additionalProperties' keyword in the OAS document.
135+
*/
136+
private Map<String, Object> additionalProperties;
137+
138+
/**
139+
* Set the additional (undeclared) property with the specified name and value. If the property
140+
* does not already exist, create it otherwise replace it.
141+
*
142+
* @param key The arbitrary key to set
143+
* @param value The associated value
144+
* @return SLOCountCondition
145+
*/
146+
@JsonAnySetter
147+
public SLOCountCondition putAdditionalProperty(String key, Object value) {
148+
if (this.additionalProperties == null) {
149+
this.additionalProperties = new HashMap<String, Object>();
150+
}
151+
this.additionalProperties.put(key, value);
152+
return this;
153+
}
154+
155+
/**
156+
* Return the additional (undeclared) property.
157+
*
158+
* @return The additional properties
159+
*/
160+
@JsonAnyGetter
161+
public Map<String, Object> getAdditionalProperties() {
162+
return additionalProperties;
163+
}
164+
165+
/**
166+
* Return the additional (undeclared) property with the specified name.
167+
*
168+
* @param key The arbitrary key to get
169+
* @return The specific additional property for the given key
170+
*/
171+
public Object getAdditionalProperty(String key) {
172+
if (this.additionalProperties == null) {
173+
return null;
174+
}
175+
return this.additionalProperties.get(key);
176+
}
177+
178+
/** Return true if this SLOCountCondition object is equal to o. */
179+
@Override
180+
public boolean equals(Object o) {
181+
if (this == o) {
182+
return true;
183+
}
184+
if (o == null || getClass() != o.getClass()) {
185+
return false;
186+
}
187+
SLOCountCondition sloCountCondition = (SLOCountCondition) o;
188+
return Objects.equals(this.goodEventsFormula, sloCountCondition.goodEventsFormula)
189+
&& Objects.equals(this.queries, sloCountCondition.queries)
190+
&& Objects.equals(this.totalEventsFormula, sloCountCondition.totalEventsFormula)
191+
&& Objects.equals(this.additionalProperties, sloCountCondition.additionalProperties);
192+
}
193+
194+
@Override
195+
public int hashCode() {
196+
return Objects.hash(goodEventsFormula, queries, totalEventsFormula, additionalProperties);
197+
}
198+
199+
@Override
200+
public String toString() {
201+
StringBuilder sb = new StringBuilder();
202+
sb.append("class SLOCountCondition {\n");
203+
sb.append(" goodEventsFormula: ").append(toIndentedString(goodEventsFormula)).append("\n");
204+
sb.append(" queries: ").append(toIndentedString(queries)).append("\n");
205+
sb.append(" totalEventsFormula: ").append(toIndentedString(totalEventsFormula)).append("\n");
206+
sb.append(" additionalProperties: ")
207+
.append(toIndentedString(additionalProperties))
208+
.append("\n");
209+
sb.append('}');
210+
return sb.toString();
211+
}
212+
213+
/**
214+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
215+
*/
216+
private String toIndentedString(Object o) {
217+
if (o == null) {
218+
return "null";
219+
}
220+
return o.toString().replace("\n", "\n ");
221+
}
222+
}

0 commit comments

Comments
 (0)