@@ -11,6 +11,8 @@ import (
1111)
1212
1313// SLOCorrectionCreateRequestAttributes The attribute object associated with the SLO correction to be created.
14+ //
15+ // Exactly one of `slo_id` or `slo_query` must be provided.
1416type SLOCorrectionCreateRequestAttributes struct {
1517 // Category the SLO correction belongs to.
1618 Category SLOCorrectionCategory `json:"category"`
@@ -23,8 +25,12 @@ type SLOCorrectionCreateRequestAttributes struct {
2325 // The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections
2426 // are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`.
2527 Rrule * string `json:"rrule,omitempty"`
26- // ID of the SLO that this correction applies to.
27- SloId string `json:"slo_id"`
28+ // ID of the single SLO that this correction applies to.
29+ SloId * string `json:"slo_id,omitempty"`
30+ // Query that matches the SLOs this correction applies to.
31+ // The query uses the [Events search syntax](https://docs.datadoghq.com/events/explorer/searching/)
32+ // and can filter SLOs by SLO tags.
33+ SloQuery * string `json:"slo_query,omitempty"`
2834 // Starting time of the correction in epoch seconds.
2935 Start int64 `json:"start"`
3036 // The timezone to display in the UI for the correction times (defaults to "UTC").
@@ -38,10 +44,9 @@ type SLOCorrectionCreateRequestAttributes struct {
3844// This constructor will assign default values to properties that have it defined,
3945// and makes sure properties required by API are set, but the set of arguments
4046// will change when the set of required properties is changed.
41- func NewSLOCorrectionCreateRequestAttributes (category SLOCorrectionCategory , sloId string , start int64 ) * SLOCorrectionCreateRequestAttributes {
47+ func NewSLOCorrectionCreateRequestAttributes (category SLOCorrectionCategory , start int64 ) * SLOCorrectionCreateRequestAttributes {
4248 this := SLOCorrectionCreateRequestAttributes {}
4349 this .Category = category
44- this .SloId = sloId
4550 this .Start = start
4651 return & this
4752}
@@ -189,27 +194,60 @@ func (o *SLOCorrectionCreateRequestAttributes) SetRrule(v string) {
189194 o .Rrule = & v
190195}
191196
192- // GetSloId returns the SloId field value.
197+ // GetSloId returns the SloId field value if set, zero value otherwise .
193198func (o * SLOCorrectionCreateRequestAttributes ) GetSloId () string {
194- if o == nil {
199+ if o == nil || o . SloId == nil {
195200 var ret string
196201 return ret
197202 }
198- return o .SloId
203+ return * o .SloId
199204}
200205
201- // GetSloIdOk returns a tuple with the SloId field value
206+ // GetSloIdOk returns a tuple with the SloId field value if set, nil otherwise
202207// and a boolean to check if the value has been set.
203208func (o * SLOCorrectionCreateRequestAttributes ) GetSloIdOk () (* string , bool ) {
204- if o == nil {
209+ if o == nil || o . SloId == nil {
205210 return nil , false
206211 }
207- return & o .SloId , true
212+ return o .SloId , true
213+ }
214+
215+ // HasSloId returns a boolean if a field has been set.
216+ func (o * SLOCorrectionCreateRequestAttributes ) HasSloId () bool {
217+ return o != nil && o .SloId != nil
208218}
209219
210- // SetSloId sets field value .
220+ // SetSloId gets a reference to the given string and assigns it to the SloId field .
211221func (o * SLOCorrectionCreateRequestAttributes ) SetSloId (v string ) {
212- o .SloId = v
222+ o .SloId = & v
223+ }
224+
225+ // GetSloQuery returns the SloQuery field value if set, zero value otherwise.
226+ func (o * SLOCorrectionCreateRequestAttributes ) GetSloQuery () string {
227+ if o == nil || o .SloQuery == nil {
228+ var ret string
229+ return ret
230+ }
231+ return * o .SloQuery
232+ }
233+
234+ // GetSloQueryOk returns a tuple with the SloQuery field value if set, nil otherwise
235+ // and a boolean to check if the value has been set.
236+ func (o * SLOCorrectionCreateRequestAttributes ) GetSloQueryOk () (* string , bool ) {
237+ if o == nil || o .SloQuery == nil {
238+ return nil , false
239+ }
240+ return o .SloQuery , true
241+ }
242+
243+ // HasSloQuery returns a boolean if a field has been set.
244+ func (o * SLOCorrectionCreateRequestAttributes ) HasSloQuery () bool {
245+ return o != nil && o .SloQuery != nil
246+ }
247+
248+ // SetSloQuery gets a reference to the given string and assigns it to the SloQuery field.
249+ func (o * SLOCorrectionCreateRequestAttributes ) SetSloQuery (v string ) {
250+ o .SloQuery = & v
213251}
214252
215253// GetStart returns the Start field value.
@@ -282,7 +320,12 @@ func (o SLOCorrectionCreateRequestAttributes) MarshalJSON() ([]byte, error) {
282320 if o .Rrule != nil {
283321 toSerialize ["rrule" ] = o .Rrule
284322 }
285- toSerialize ["slo_id" ] = o .SloId
323+ if o .SloId != nil {
324+ toSerialize ["slo_id" ] = o .SloId
325+ }
326+ if o .SloQuery != nil {
327+ toSerialize ["slo_query" ] = o .SloQuery
328+ }
286329 toSerialize ["start" ] = o .Start
287330 if o .Timezone != nil {
288331 toSerialize ["timezone" ] = o .Timezone
@@ -302,7 +345,8 @@ func (o *SLOCorrectionCreateRequestAttributes) UnmarshalJSON(bytes []byte) (err
302345 Duration * int64 `json:"duration,omitempty"`
303346 End * int64 `json:"end,omitempty"`
304347 Rrule * string `json:"rrule,omitempty"`
305- SloId * string `json:"slo_id"`
348+ SloId * string `json:"slo_id,omitempty"`
349+ SloQuery * string `json:"slo_query,omitempty"`
306350 Start * int64 `json:"start"`
307351 Timezone * string `json:"timezone,omitempty"`
308352 }{}
@@ -312,15 +356,12 @@ func (o *SLOCorrectionCreateRequestAttributes) UnmarshalJSON(bytes []byte) (err
312356 if all .Category == nil {
313357 return fmt .Errorf ("required field category missing" )
314358 }
315- if all .SloId == nil {
316- return fmt .Errorf ("required field slo_id missing" )
317- }
318359 if all .Start == nil {
319360 return fmt .Errorf ("required field start missing" )
320361 }
321362 additionalProperties := make (map [string ]interface {})
322363 if err = datadog .UnmarshalUseNumber (bytes , & additionalProperties ); err == nil {
323- datadog .DeleteKeys (additionalProperties , & []string {"category" , "description" , "duration" , "end" , "rrule" , "slo_id" , "start" , "timezone" })
364+ datadog .DeleteKeys (additionalProperties , & []string {"category" , "description" , "duration" , "end" , "rrule" , "slo_id" , "slo_query" , " start" , "timezone" })
324365 } else {
325366 return err
326367 }
@@ -335,7 +376,8 @@ func (o *SLOCorrectionCreateRequestAttributes) UnmarshalJSON(bytes []byte) (err
335376 o .Duration = all .Duration
336377 o .End = all .End
337378 o .Rrule = all .Rrule
338- o .SloId = * all .SloId
379+ o .SloId = all .SloId
380+ o .SloQuery = all .SloQuery
339381 o .Start = * all .Start
340382 o .Timezone = all .Timezone
341383
0 commit comments