1717import java .util .Map ;
1818import java .util .Objects ;
1919
20- /** The attribute object associated with the SLO correction to be created. */
20+ /**
21+ * The attribute object associated with the SLO correction to be created.
22+ *
23+ * <p>Exactly one of <code>slo_id</code> or <code>slo_query</code> must be provided.
24+ */
2125@ JsonPropertyOrder ({
2226 SLOCorrectionCreateRequestAttributes .JSON_PROPERTY_CATEGORY ,
2327 SLOCorrectionCreateRequestAttributes .JSON_PROPERTY_DESCRIPTION ,
2428 SLOCorrectionCreateRequestAttributes .JSON_PROPERTY_DURATION ,
2529 SLOCorrectionCreateRequestAttributes .JSON_PROPERTY_END ,
2630 SLOCorrectionCreateRequestAttributes .JSON_PROPERTY_RRULE ,
2731 SLOCorrectionCreateRequestAttributes .JSON_PROPERTY_SLO_ID ,
32+ SLOCorrectionCreateRequestAttributes .JSON_PROPERTY_SLO_QUERY ,
2833 SLOCorrectionCreateRequestAttributes .JSON_PROPERTY_START ,
2934 SLOCorrectionCreateRequestAttributes .JSON_PROPERTY_TIMEZONE
3035})
@@ -50,6 +55,9 @@ public class SLOCorrectionCreateRequestAttributes {
5055 public static final String JSON_PROPERTY_SLO_ID = "slo_id" ;
5156 private String sloId ;
5257
58+ public static final String JSON_PROPERTY_SLO_QUERY = "slo_query" ;
59+ private String sloQuery ;
60+
5361 public static final String JSON_PROPERTY_START = "start" ;
5462 private Long start ;
5563
@@ -61,11 +69,9 @@ public SLOCorrectionCreateRequestAttributes() {}
6169 @ JsonCreator
6270 public SLOCorrectionCreateRequestAttributes (
6371 @ JsonProperty (required = true , value = JSON_PROPERTY_CATEGORY ) SLOCorrectionCategory category ,
64- @ JsonProperty (required = true , value = JSON_PROPERTY_SLO_ID ) String sloId ,
6572 @ JsonProperty (required = true , value = JSON_PROPERTY_START ) Long start ) {
6673 this .category = category ;
6774 this .unparsed |= !category .isValid ();
68- this .sloId = sloId ;
6975 this .start = start ;
7076 }
7177
@@ -185,12 +191,13 @@ public SLOCorrectionCreateRequestAttributes sloId(String sloId) {
185191 }
186192
187193 /**
188- * ID of the SLO that this correction applies to.
194+ * ID of the single SLO that this correction applies to.
189195 *
190196 * @return sloId
191197 */
198+ @ jakarta .annotation .Nullable
192199 @ JsonProperty (JSON_PROPERTY_SLO_ID )
193- @ JsonInclude (value = JsonInclude .Include .ALWAYS )
200+ @ JsonInclude (value = JsonInclude .Include .USE_DEFAULTS )
194201 public String getSloId () {
195202 return sloId ;
196203 }
@@ -199,6 +206,29 @@ public void setSloId(String sloId) {
199206 this .sloId = sloId ;
200207 }
201208
209+ public SLOCorrectionCreateRequestAttributes sloQuery (String sloQuery ) {
210+ this .sloQuery = sloQuery ;
211+ return this ;
212+ }
213+
214+ /**
215+ * Query that matches the SLOs this correction applies to. The query uses the <a
216+ * href="https://docs.datadoghq.com/events/explorer/searching/">Events search syntax</a> and can
217+ * filter SLOs by SLO tags.
218+ *
219+ * @return sloQuery
220+ */
221+ @ jakarta .annotation .Nullable
222+ @ JsonProperty (JSON_PROPERTY_SLO_QUERY )
223+ @ JsonInclude (value = JsonInclude .Include .USE_DEFAULTS )
224+ public String getSloQuery () {
225+ return sloQuery ;
226+ }
227+
228+ public void setSloQuery (String sloQuery ) {
229+ this .sloQuery = sloQuery ;
230+ }
231+
202232 public SLOCorrectionCreateRequestAttributes start (Long start ) {
203233 this .start = start ;
204234 return this ;
@@ -303,6 +333,7 @@ public boolean equals(Object o) {
303333 && Objects .equals (this .end , sloCorrectionCreateRequestAttributes .end )
304334 && Objects .equals (this .rrule , sloCorrectionCreateRequestAttributes .rrule )
305335 && Objects .equals (this .sloId , sloCorrectionCreateRequestAttributes .sloId )
336+ && Objects .equals (this .sloQuery , sloCorrectionCreateRequestAttributes .sloQuery )
306337 && Objects .equals (this .start , sloCorrectionCreateRequestAttributes .start )
307338 && Objects .equals (this .timezone , sloCorrectionCreateRequestAttributes .timezone )
308339 && Objects .equals (
@@ -312,7 +343,16 @@ public boolean equals(Object o) {
312343 @ Override
313344 public int hashCode () {
314345 return Objects .hash (
315- category , description , duration , end , rrule , sloId , start , timezone , additionalProperties );
346+ category ,
347+ description ,
348+ duration ,
349+ end ,
350+ rrule ,
351+ sloId ,
352+ sloQuery ,
353+ start ,
354+ timezone ,
355+ additionalProperties );
316356 }
317357
318358 @ Override
@@ -325,6 +365,7 @@ public String toString() {
325365 sb .append (" end: " ).append (toIndentedString (end )).append ("\n " );
326366 sb .append (" rrule: " ).append (toIndentedString (rrule )).append ("\n " );
327367 sb .append (" sloId: " ).append (toIndentedString (sloId )).append ("\n " );
368+ sb .append (" sloQuery: " ).append (toIndentedString (sloQuery )).append ("\n " );
328369 sb .append (" start: " ).append (toIndentedString (start )).append ("\n " );
329370 sb .append (" timezone: " ).append (toIndentedString (timezone )).append ("\n " );
330371 sb .append (" additionalProperties: " )
0 commit comments