From 8ba69c6fb468be03a68f5ecf19ed952afe698d7c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 8 Oct 2021 07:02:26 +0000 Subject: [PATCH] Regenerate client from commit 36ec328 of spec repo --- .apigentools-info | 8 +- api/v1/datadog/api/openapi.yaml | 53 +++++++- .../SLOCorrectionCreateRequestAttributes.md | 61 ++++++++- .../docs/SLOCorrectionResponseAttributes.md | 52 ++++++++ .../SLOCorrectionUpdateRequestAttributes.md | 52 ++++++++ ...lo_correction_create_request_attributes.go | 117 +++++++++++++++--- ...odel_slo_correction_response_attributes.go | 78 ++++++++++++ ...lo_correction_update_request_attributes.go | 78 ++++++++++++ ...ervice_level_objective_corrections.feature | 10 +- 9 files changed, 483 insertions(+), 26 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index a80be2cc771..7022d5823ed 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.5.1.dev2", - "regenerated": "2021-10-07 07:33:09.399541", - "spec_repo_commit": "7a4f3f3" + "regenerated": "2021-10-08 07:01:42.572082", + "spec_repo_commit": "36ec328" }, "v2": { "apigentools_version": "1.5.1.dev2", - "regenerated": "2021-10-07 07:33:49.411339", - "spec_repo_commit": "7a4f3f3" + "regenerated": "2021-10-08 07:02:19.427934", + "spec_repo_commit": "36ec328" } } } \ No newline at end of file diff --git a/api/v1/datadog/api/openapi.yaml b/api/v1/datadog/api/openapi.yaml index 778ecd63d55..c51d0cce273 100644 --- a/api/v1/datadog/api/openapi.yaml +++ b/api/v1/datadog/api/openapi.yaml @@ -19448,10 +19448,12 @@ components: description: The response object of a list of SLO corrections. example: attributes: + duration: 1600000000 creator: name: name handle: handle email: email + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: timezone slo_id: slo_id start: 6 @@ -19487,6 +19489,8 @@ components: description: The data object associated with the SLO correction to be created. example: attributes: + duration: 1600000000 + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: UTC slo_id: sloId start: 1600000000 @@ -19507,6 +19511,8 @@ components: example: data: attributes: + duration: 1600000000 + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: UTC slo_id: sloId start: 1600000000 @@ -19521,6 +19527,8 @@ components: SLOCorrectionCreateRequestAttributes: description: The attribute object associated with the SLO correction to be created. example: + duration: 1600000000 + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: UTC slo_id: sloId start: 1600000000 @@ -19533,11 +19541,21 @@ components: description: description: Description of the correction being made. type: string + duration: + description: Length of time (in seconds) for a specified `rrule` recurring + SLO correction. + example: 1600000000 + format: int64 + type: integer end: description: Ending time of the correction in epoch seconds. example: 1600000000 format: int64 type: integer + rrule: + description: Recurrence rules as defined in the iCalendar RFC 5545. + example: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 + type: string slo_id: description: ID of the SLO that this correction will be applied to. example: sloId @@ -19554,7 +19572,6 @@ components: type: string required: - category - - end - slo_id - start type: object @@ -19563,10 +19580,12 @@ components: example: data: - attributes: + duration: 1600000000 creator: name: name handle: handle email: email + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: timezone slo_id: slo_id start: 6 @@ -19576,10 +19595,12 @@ components: id: id type: correction - attributes: + duration: 1600000000 creator: name: name handle: handle email: email + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: timezone slo_id: slo_id start: 6 @@ -19606,10 +19627,12 @@ components: example: data: attributes: + duration: 1600000000 creator: name: name handle: handle email: email + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: timezone slo_id: slo_id start: 6 @@ -19625,10 +19648,12 @@ components: SLOCorrectionResponseAttributes: description: The attribute object associated with the SLO correction. example: + duration: 1600000000 creator: name: name handle: handle email: email + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: timezone slo_id: slo_id start: 6 @@ -19643,10 +19668,20 @@ components: description: description: Description of the correction being made. type: string + duration: + description: Length of time (in seconds) for a specified `rrule` recurring + SLO correction. + example: 1600000000 + format: int64 + type: integer end: description: Ending time of the correction in epoch seconds. format: int64 type: integer + rrule: + description: Recurrence rules as defined in the iCalendar RFC 5545. + example: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 + type: string slo_id: description: ID of the SLO that this correction will be applied to. type: string @@ -19672,6 +19707,8 @@ components: description: The data object associated with the SLO correction to be updated. example: attributes: + duration: 1600000000 + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: UTC start: 1600000000 description: description @@ -19689,6 +19726,8 @@ components: example: data: attributes: + duration: 1600000000 + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: UTC start: 1600000000 description: description @@ -19702,6 +19741,8 @@ components: SLOCorrectionUpdateRequestAttributes: description: The attribute object associated with the SLO correction to be updated. example: + duration: 1600000000 + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: UTC start: 1600000000 description: description @@ -19713,11 +19754,21 @@ components: description: description: Description of the correction being made. type: string + duration: + description: Length of time (in seconds) for a specified `rrule` recurring + SLO correction. + example: 1600000000 + format: int64 + type: integer end: description: Ending time of the correction in epoch seconds. example: 1600000000 format: int64 type: integer + rrule: + description: Recurrence rules as defined in the iCalendar RFC 5545. + example: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 + type: string start: description: Starting time of the correction in epoch seconds. example: 1600000000 diff --git a/api/v1/datadog/docs/SLOCorrectionCreateRequestAttributes.md b/api/v1/datadog/docs/SLOCorrectionCreateRequestAttributes.md index ab89909bad6..b9db6ab43ac 100644 --- a/api/v1/datadog/docs/SLOCorrectionCreateRequestAttributes.md +++ b/api/v1/datadog/docs/SLOCorrectionCreateRequestAttributes.md @@ -6,7 +6,9 @@ Name | Type | Description | Notes ---- | ---- | ----------- | ------ **Category** | [**SLOCorrectionCategory**](SLOCorrectionCategory.md) | | **Description** | Pointer to **string** | Description of the correction being made. | [optional] -**End** | **int64** | Ending time of the correction in epoch seconds. | +**Duration** | Pointer to **int64** | Length of time (in seconds) for a specified `rrule` recurring SLO correction. | [optional] +**End** | Pointer to **int64** | Ending time of the correction in epoch seconds. | [optional] +**Rrule** | Pointer to **string** | Recurrence rules as defined in the iCalendar RFC 5545. | [optional] **SloId** | **string** | ID of the SLO that this correction will be applied to. | **Start** | **int64** | Starting time of the correction in epoch seconds. | **Timezone** | Pointer to **string** | The timezone to display in the UI for the correction times (defaults to \"UTC\"). | [optional] @@ -15,7 +17,7 @@ Name | Type | Description | Notes ### NewSLOCorrectionCreateRequestAttributes -`func NewSLOCorrectionCreateRequestAttributes(category SLOCorrectionCategory, end int64, sloId string, start int64) *SLOCorrectionCreateRequestAttributes` +`func NewSLOCorrectionCreateRequestAttributes(category SLOCorrectionCategory, sloId string, start int64) *SLOCorrectionCreateRequestAttributes` NewSLOCorrectionCreateRequestAttributes instantiates a new SLOCorrectionCreateRequestAttributes object. This constructor will assign default values to properties that have it defined, @@ -75,6 +77,31 @@ SetDescription sets Description field to given value. HasDescription returns a boolean if a field has been set. +### GetDuration + +`func (o *SLOCorrectionCreateRequestAttributes) GetDuration() int64` + +GetDuration returns the Duration field if non-nil, zero value otherwise. + +### GetDurationOk + +`func (o *SLOCorrectionCreateRequestAttributes) GetDurationOk() (*int64, bool)` + +GetDurationOk returns a tuple with the Duration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDuration + +`func (o *SLOCorrectionCreateRequestAttributes) SetDuration(v int64)` + +SetDuration sets Duration field to given value. + +### HasDuration + +`func (o *SLOCorrectionCreateRequestAttributes) HasDuration() bool` + +HasDuration returns a boolean if a field has been set. + ### GetEnd `func (o *SLOCorrectionCreateRequestAttributes) GetEnd() int64` @@ -94,6 +121,36 @@ and a boolean to check if the value has been set. SetEnd sets End field to given value. +### HasEnd + +`func (o *SLOCorrectionCreateRequestAttributes) HasEnd() bool` + +HasEnd returns a boolean if a field has been set. + +### GetRrule + +`func (o *SLOCorrectionCreateRequestAttributes) GetRrule() string` + +GetRrule returns the Rrule field if non-nil, zero value otherwise. + +### GetRruleOk + +`func (o *SLOCorrectionCreateRequestAttributes) GetRruleOk() (*string, bool)` + +GetRruleOk returns a tuple with the Rrule field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRrule + +`func (o *SLOCorrectionCreateRequestAttributes) SetRrule(v string)` + +SetRrule sets Rrule field to given value. + +### HasRrule + +`func (o *SLOCorrectionCreateRequestAttributes) HasRrule() bool` + +HasRrule returns a boolean if a field has been set. ### GetSloId diff --git a/api/v1/datadog/docs/SLOCorrectionResponseAttributes.md b/api/v1/datadog/docs/SLOCorrectionResponseAttributes.md index 82cf72c5c87..38fb155cfe1 100644 --- a/api/v1/datadog/docs/SLOCorrectionResponseAttributes.md +++ b/api/v1/datadog/docs/SLOCorrectionResponseAttributes.md @@ -7,7 +7,9 @@ Name | Type | Description | Notes **Category** | Pointer to [**SLOCorrectionCategory**](SLOCorrectionCategory.md) | | [optional] **Creator** | Pointer to [**Creator**](Creator.md) | | [optional] **Description** | Pointer to **string** | Description of the correction being made. | [optional] +**Duration** | Pointer to **int64** | Length of time (in seconds) for a specified `rrule` recurring SLO correction. | [optional] **End** | Pointer to **int64** | Ending time of the correction in epoch seconds. | [optional] +**Rrule** | Pointer to **string** | Recurrence rules as defined in the iCalendar RFC 5545. | [optional] **SloId** | Pointer to **string** | ID of the SLO that this correction will be applied to. | [optional] **Start** | Pointer to **int64** | Starting time of the correction in epoch seconds. | [optional] **Timezone** | Pointer to **string** | The timezone to display in the UI for the correction times (defaults to \"UTC\"). | [optional] @@ -106,6 +108,31 @@ SetDescription sets Description field to given value. HasDescription returns a boolean if a field has been set. +### GetDuration + +`func (o *SLOCorrectionResponseAttributes) GetDuration() int64` + +GetDuration returns the Duration field if non-nil, zero value otherwise. + +### GetDurationOk + +`func (o *SLOCorrectionResponseAttributes) GetDurationOk() (*int64, bool)` + +GetDurationOk returns a tuple with the Duration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDuration + +`func (o *SLOCorrectionResponseAttributes) SetDuration(v int64)` + +SetDuration sets Duration field to given value. + +### HasDuration + +`func (o *SLOCorrectionResponseAttributes) HasDuration() bool` + +HasDuration returns a boolean if a field has been set. + ### GetEnd `func (o *SLOCorrectionResponseAttributes) GetEnd() int64` @@ -131,6 +158,31 @@ SetEnd sets End field to given value. HasEnd returns a boolean if a field has been set. +### GetRrule + +`func (o *SLOCorrectionResponseAttributes) GetRrule() string` + +GetRrule returns the Rrule field if non-nil, zero value otherwise. + +### GetRruleOk + +`func (o *SLOCorrectionResponseAttributes) GetRruleOk() (*string, bool)` + +GetRruleOk returns a tuple with the Rrule field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRrule + +`func (o *SLOCorrectionResponseAttributes) SetRrule(v string)` + +SetRrule sets Rrule field to given value. + +### HasRrule + +`func (o *SLOCorrectionResponseAttributes) HasRrule() bool` + +HasRrule returns a boolean if a field has been set. + ### GetSloId `func (o *SLOCorrectionResponseAttributes) GetSloId() string` diff --git a/api/v1/datadog/docs/SLOCorrectionUpdateRequestAttributes.md b/api/v1/datadog/docs/SLOCorrectionUpdateRequestAttributes.md index aa15b60e452..8e8d3fabd47 100644 --- a/api/v1/datadog/docs/SLOCorrectionUpdateRequestAttributes.md +++ b/api/v1/datadog/docs/SLOCorrectionUpdateRequestAttributes.md @@ -6,7 +6,9 @@ Name | Type | Description | Notes ---- | ---- | ----------- | ------ **Category** | Pointer to [**SLOCorrectionCategory**](SLOCorrectionCategory.md) | | [optional] **Description** | Pointer to **string** | Description of the correction being made. | [optional] +**Duration** | Pointer to **int64** | Length of time (in seconds) for a specified `rrule` recurring SLO correction. | [optional] **End** | Pointer to **int64** | Ending time of the correction in epoch seconds. | [optional] +**Rrule** | Pointer to **string** | Recurrence rules as defined in the iCalendar RFC 5545. | [optional] **Start** | Pointer to **int64** | Starting time of the correction in epoch seconds. | [optional] **Timezone** | Pointer to **string** | The timezone to display in the UI for the correction times (defaults to \"UTC\"). | [optional] @@ -79,6 +81,31 @@ SetDescription sets Description field to given value. HasDescription returns a boolean if a field has been set. +### GetDuration + +`func (o *SLOCorrectionUpdateRequestAttributes) GetDuration() int64` + +GetDuration returns the Duration field if non-nil, zero value otherwise. + +### GetDurationOk + +`func (o *SLOCorrectionUpdateRequestAttributes) GetDurationOk() (*int64, bool)` + +GetDurationOk returns a tuple with the Duration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDuration + +`func (o *SLOCorrectionUpdateRequestAttributes) SetDuration(v int64)` + +SetDuration sets Duration field to given value. + +### HasDuration + +`func (o *SLOCorrectionUpdateRequestAttributes) HasDuration() bool` + +HasDuration returns a boolean if a field has been set. + ### GetEnd `func (o *SLOCorrectionUpdateRequestAttributes) GetEnd() int64` @@ -104,6 +131,31 @@ SetEnd sets End field to given value. HasEnd returns a boolean if a field has been set. +### GetRrule + +`func (o *SLOCorrectionUpdateRequestAttributes) GetRrule() string` + +GetRrule returns the Rrule field if non-nil, zero value otherwise. + +### GetRruleOk + +`func (o *SLOCorrectionUpdateRequestAttributes) GetRruleOk() (*string, bool)` + +GetRruleOk returns a tuple with the Rrule field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRrule + +`func (o *SLOCorrectionUpdateRequestAttributes) SetRrule(v string)` + +SetRrule sets Rrule field to given value. + +### HasRrule + +`func (o *SLOCorrectionUpdateRequestAttributes) HasRrule() bool` + +HasRrule returns a boolean if a field has been set. + ### GetStart `func (o *SLOCorrectionUpdateRequestAttributes) GetStart() int64` diff --git a/api/v1/datadog/model_slo_correction_create_request_attributes.go b/api/v1/datadog/model_slo_correction_create_request_attributes.go index 600a1fb6e01..134f829e40f 100644 --- a/api/v1/datadog/model_slo_correction_create_request_attributes.go +++ b/api/v1/datadog/model_slo_correction_create_request_attributes.go @@ -18,8 +18,12 @@ type SLOCorrectionCreateRequestAttributes struct { Category SLOCorrectionCategory `json:"category"` // Description of the correction being made. Description *string `json:"description,omitempty"` + // Length of time (in seconds) for a specified `rrule` recurring SLO correction. + Duration *int64 `json:"duration,omitempty"` // Ending time of the correction in epoch seconds. - End int64 `json:"end"` + End *int64 `json:"end,omitempty"` + // Recurrence rules as defined in the iCalendar RFC 5545. + Rrule *string `json:"rrule,omitempty"` // ID of the SLO that this correction will be applied to. SloId string `json:"slo_id"` // Starting time of the correction in epoch seconds. @@ -34,10 +38,9 @@ type SLOCorrectionCreateRequestAttributes struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewSLOCorrectionCreateRequestAttributes(category SLOCorrectionCategory, end int64, sloId string, start int64) *SLOCorrectionCreateRequestAttributes { +func NewSLOCorrectionCreateRequestAttributes(category SLOCorrectionCategory, sloId string, start int64) *SLOCorrectionCreateRequestAttributes { this := SLOCorrectionCreateRequestAttributes{} this.Category = category - this.End = end this.SloId = sloId this.Start = start return &this @@ -107,28 +110,100 @@ func (o *SLOCorrectionCreateRequestAttributes) SetDescription(v string) { o.Description = &v } -// GetEnd returns the End field value -func (o *SLOCorrectionCreateRequestAttributes) GetEnd() int64 { - if o == nil { +// GetDuration returns the Duration field value if set, zero value otherwise. +func (o *SLOCorrectionCreateRequestAttributes) GetDuration() int64 { + if o == nil || o.Duration == nil { var ret int64 return ret } + return *o.Duration +} - return o.End +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionCreateRequestAttributes) GetDurationOk() (*int64, bool) { + if o == nil || o.Duration == nil { + return nil, false + } + return o.Duration, true } -// GetEndOk returns a tuple with the End field value +// HasDuration returns a boolean if a field has been set. +func (o *SLOCorrectionCreateRequestAttributes) HasDuration() bool { + if o != nil && o.Duration != nil { + return true + } + + return false +} + +// SetDuration gets a reference to the given int64 and assigns it to the Duration field. +func (o *SLOCorrectionCreateRequestAttributes) SetDuration(v int64) { + o.Duration = &v +} + +// GetEnd returns the End field value if set, zero value otherwise. +func (o *SLOCorrectionCreateRequestAttributes) GetEnd() int64 { + if o == nil || o.End == nil { + var ret int64 + return ret + } + return *o.End +} + +// GetEndOk returns a tuple with the End field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SLOCorrectionCreateRequestAttributes) GetEndOk() (*int64, bool) { - if o == nil { + if o == nil || o.End == nil { return nil, false } - return &o.End, true + return o.End, true } -// SetEnd sets field value +// HasEnd returns a boolean if a field has been set. +func (o *SLOCorrectionCreateRequestAttributes) HasEnd() bool { + if o != nil && o.End != nil { + return true + } + + return false +} + +// SetEnd gets a reference to the given int64 and assigns it to the End field. func (o *SLOCorrectionCreateRequestAttributes) SetEnd(v int64) { - o.End = v + o.End = &v +} + +// GetRrule returns the Rrule field value if set, zero value otherwise. +func (o *SLOCorrectionCreateRequestAttributes) GetRrule() string { + if o == nil || o.Rrule == nil { + var ret string + return ret + } + return *o.Rrule +} + +// GetRruleOk returns a tuple with the Rrule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionCreateRequestAttributes) GetRruleOk() (*string, bool) { + if o == nil || o.Rrule == nil { + return nil, false + } + return o.Rrule, true +} + +// HasRrule returns a boolean if a field has been set. +func (o *SLOCorrectionCreateRequestAttributes) HasRrule() bool { + if o != nil && o.Rrule != nil { + return true + } + + return false +} + +// SetRrule gets a reference to the given string and assigns it to the Rrule field. +func (o *SLOCorrectionCreateRequestAttributes) SetRrule(v string) { + o.Rrule = &v } // GetSloId returns the SloId field value @@ -222,9 +297,15 @@ func (o SLOCorrectionCreateRequestAttributes) MarshalJSON() ([]byte, error) { if o.Description != nil { toSerialize["description"] = o.Description } - if true { + if o.Duration != nil { + toSerialize["duration"] = o.Duration + } + if o.End != nil { toSerialize["end"] = o.End } + if o.Rrule != nil { + toSerialize["rrule"] = o.Rrule + } if true { toSerialize["slo_id"] = o.SloId } @@ -241,14 +322,15 @@ func (o *SLOCorrectionCreateRequestAttributes) UnmarshalJSON(bytes []byte) (err raw := map[string]interface{}{} required := struct { Category *SLOCorrectionCategory `json:"category"` - End *int64 `json:"end"` SloId *string `json:"slo_id"` Start *int64 `json:"start"` }{} all := struct { Category SLOCorrectionCategory `json:"category"` Description *string `json:"description,omitempty"` - End int64 `json:"end"` + Duration *int64 `json:"duration,omitempty"` + End *int64 `json:"end,omitempty"` + Rrule *string `json:"rrule,omitempty"` SloId string `json:"slo_id"` Start int64 `json:"start"` Timezone *string `json:"timezone,omitempty"` @@ -260,9 +342,6 @@ func (o *SLOCorrectionCreateRequestAttributes) UnmarshalJSON(bytes []byte) (err if required.Category == nil { return fmt.Errorf("Required field category missing") } - if required.End == nil { - return fmt.Errorf("Required field end missing") - } if required.SloId == nil { return fmt.Errorf("Required field slo_id missing") } @@ -288,7 +367,9 @@ func (o *SLOCorrectionCreateRequestAttributes) UnmarshalJSON(bytes []byte) (err } o.Category = all.Category o.Description = all.Description + o.Duration = all.Duration o.End = all.End + o.Rrule = all.Rrule o.SloId = all.SloId o.Start = all.Start o.Timezone = all.Timezone diff --git a/api/v1/datadog/model_slo_correction_response_attributes.go b/api/v1/datadog/model_slo_correction_response_attributes.go index bd34c75d237..0aadbcd6bb0 100644 --- a/api/v1/datadog/model_slo_correction_response_attributes.go +++ b/api/v1/datadog/model_slo_correction_response_attributes.go @@ -18,8 +18,12 @@ type SLOCorrectionResponseAttributes struct { Creator *Creator `json:"creator,omitempty"` // Description of the correction being made. Description *string `json:"description,omitempty"` + // Length of time (in seconds) for a specified `rrule` recurring SLO correction. + Duration *int64 `json:"duration,omitempty"` // Ending time of the correction in epoch seconds. End *int64 `json:"end,omitempty"` + // Recurrence rules as defined in the iCalendar RFC 5545. + Rrule *string `json:"rrule,omitempty"` // ID of the SLO that this correction will be applied to. SloId *string `json:"slo_id,omitempty"` // Starting time of the correction in epoch seconds. @@ -143,6 +147,38 @@ func (o *SLOCorrectionResponseAttributes) SetDescription(v string) { o.Description = &v } +// GetDuration returns the Duration field value if set, zero value otherwise. +func (o *SLOCorrectionResponseAttributes) GetDuration() int64 { + if o == nil || o.Duration == nil { + var ret int64 + return ret + } + return *o.Duration +} + +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseAttributes) GetDurationOk() (*int64, bool) { + if o == nil || o.Duration == nil { + return nil, false + } + return o.Duration, true +} + +// HasDuration returns a boolean if a field has been set. +func (o *SLOCorrectionResponseAttributes) HasDuration() bool { + if o != nil && o.Duration != nil { + return true + } + + return false +} + +// SetDuration gets a reference to the given int64 and assigns it to the Duration field. +func (o *SLOCorrectionResponseAttributes) SetDuration(v int64) { + o.Duration = &v +} + // GetEnd returns the End field value if set, zero value otherwise. func (o *SLOCorrectionResponseAttributes) GetEnd() int64 { if o == nil || o.End == nil { @@ -175,6 +211,38 @@ func (o *SLOCorrectionResponseAttributes) SetEnd(v int64) { o.End = &v } +// GetRrule returns the Rrule field value if set, zero value otherwise. +func (o *SLOCorrectionResponseAttributes) GetRrule() string { + if o == nil || o.Rrule == nil { + var ret string + return ret + } + return *o.Rrule +} + +// GetRruleOk returns a tuple with the Rrule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseAttributes) GetRruleOk() (*string, bool) { + if o == nil || o.Rrule == nil { + return nil, false + } + return o.Rrule, true +} + +// HasRrule returns a boolean if a field has been set. +func (o *SLOCorrectionResponseAttributes) HasRrule() bool { + if o != nil && o.Rrule != nil { + return true + } + + return false +} + +// SetRrule gets a reference to the given string and assigns it to the Rrule field. +func (o *SLOCorrectionResponseAttributes) SetRrule(v string) { + o.Rrule = &v +} + // GetSloId returns the SloId field value if set, zero value otherwise. func (o *SLOCorrectionResponseAttributes) GetSloId() string { if o == nil || o.SloId == nil { @@ -285,9 +353,15 @@ func (o SLOCorrectionResponseAttributes) MarshalJSON() ([]byte, error) { if o.Description != nil { toSerialize["description"] = o.Description } + if o.Duration != nil { + toSerialize["duration"] = o.Duration + } if o.End != nil { toSerialize["end"] = o.End } + if o.Rrule != nil { + toSerialize["rrule"] = o.Rrule + } if o.SloId != nil { toSerialize["slo_id"] = o.SloId } @@ -306,7 +380,9 @@ func (o *SLOCorrectionResponseAttributes) UnmarshalJSON(bytes []byte) (err error Category *SLOCorrectionCategory `json:"category,omitempty"` Creator *Creator `json:"creator,omitempty"` Description *string `json:"description,omitempty"` + Duration *int64 `json:"duration,omitempty"` End *int64 `json:"end,omitempty"` + Rrule *string `json:"rrule,omitempty"` SloId *string `json:"slo_id,omitempty"` Start *int64 `json:"start,omitempty"` Timezone *string `json:"timezone,omitempty"` @@ -331,7 +407,9 @@ func (o *SLOCorrectionResponseAttributes) UnmarshalJSON(bytes []byte) (err error o.Category = all.Category o.Creator = all.Creator o.Description = all.Description + o.Duration = all.Duration o.End = all.End + o.Rrule = all.Rrule o.SloId = all.SloId o.Start = all.Start o.Timezone = all.Timezone diff --git a/api/v1/datadog/model_slo_correction_update_request_attributes.go b/api/v1/datadog/model_slo_correction_update_request_attributes.go index eee35618166..9fa5797c4e0 100644 --- a/api/v1/datadog/model_slo_correction_update_request_attributes.go +++ b/api/v1/datadog/model_slo_correction_update_request_attributes.go @@ -17,8 +17,12 @@ type SLOCorrectionUpdateRequestAttributes struct { Category *SLOCorrectionCategory `json:"category,omitempty"` // Description of the correction being made. Description *string `json:"description,omitempty"` + // Length of time (in seconds) for a specified `rrule` recurring SLO correction. + Duration *int64 `json:"duration,omitempty"` // Ending time of the correction in epoch seconds. End *int64 `json:"end,omitempty"` + // Recurrence rules as defined in the iCalendar RFC 5545. + Rrule *string `json:"rrule,omitempty"` // Starting time of the correction in epoch seconds. Start *int64 `json:"start,omitempty"` // The timezone to display in the UI for the correction times (defaults to \"UTC\"). @@ -108,6 +112,38 @@ func (o *SLOCorrectionUpdateRequestAttributes) SetDescription(v string) { o.Description = &v } +// GetDuration returns the Duration field value if set, zero value otherwise. +func (o *SLOCorrectionUpdateRequestAttributes) GetDuration() int64 { + if o == nil || o.Duration == nil { + var ret int64 + return ret + } + return *o.Duration +} + +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionUpdateRequestAttributes) GetDurationOk() (*int64, bool) { + if o == nil || o.Duration == nil { + return nil, false + } + return o.Duration, true +} + +// HasDuration returns a boolean if a field has been set. +func (o *SLOCorrectionUpdateRequestAttributes) HasDuration() bool { + if o != nil && o.Duration != nil { + return true + } + + return false +} + +// SetDuration gets a reference to the given int64 and assigns it to the Duration field. +func (o *SLOCorrectionUpdateRequestAttributes) SetDuration(v int64) { + o.Duration = &v +} + // GetEnd returns the End field value if set, zero value otherwise. func (o *SLOCorrectionUpdateRequestAttributes) GetEnd() int64 { if o == nil || o.End == nil { @@ -140,6 +176,38 @@ func (o *SLOCorrectionUpdateRequestAttributes) SetEnd(v int64) { o.End = &v } +// GetRrule returns the Rrule field value if set, zero value otherwise. +func (o *SLOCorrectionUpdateRequestAttributes) GetRrule() string { + if o == nil || o.Rrule == nil { + var ret string + return ret + } + return *o.Rrule +} + +// GetRruleOk returns a tuple with the Rrule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionUpdateRequestAttributes) GetRruleOk() (*string, bool) { + if o == nil || o.Rrule == nil { + return nil, false + } + return o.Rrule, true +} + +// HasRrule returns a boolean if a field has been set. +func (o *SLOCorrectionUpdateRequestAttributes) HasRrule() bool { + if o != nil && o.Rrule != nil { + return true + } + + return false +} + +// SetRrule gets a reference to the given string and assigns it to the Rrule field. +func (o *SLOCorrectionUpdateRequestAttributes) SetRrule(v string) { + o.Rrule = &v +} + // GetStart returns the Start field value if set, zero value otherwise. func (o *SLOCorrectionUpdateRequestAttributes) GetStart() int64 { if o == nil || o.Start == nil { @@ -215,9 +283,15 @@ func (o SLOCorrectionUpdateRequestAttributes) MarshalJSON() ([]byte, error) { if o.Description != nil { toSerialize["description"] = o.Description } + if o.Duration != nil { + toSerialize["duration"] = o.Duration + } if o.End != nil { toSerialize["end"] = o.End } + if o.Rrule != nil { + toSerialize["rrule"] = o.Rrule + } if o.Start != nil { toSerialize["start"] = o.Start } @@ -232,7 +306,9 @@ func (o *SLOCorrectionUpdateRequestAttributes) UnmarshalJSON(bytes []byte) (err all := struct { Category *SLOCorrectionCategory `json:"category,omitempty"` Description *string `json:"description,omitempty"` + Duration *int64 `json:"duration,omitempty"` End *int64 `json:"end,omitempty"` + Rrule *string `json:"rrule,omitempty"` Start *int64 `json:"start,omitempty"` Timezone *string `json:"timezone,omitempty"` }{} @@ -255,7 +331,9 @@ func (o *SLOCorrectionUpdateRequestAttributes) UnmarshalJSON(bytes []byte) (err } o.Category = all.Category o.Description = all.Description + o.Duration = all.Duration o.End = all.End + o.Rrule = all.Rrule o.Start = all.Start o.Timezone = all.Timezone return nil diff --git a/tests/scenarios/features/v1/service_level_objective_corrections.feature b/tests/scenarios/features/v1/service_level_objective_corrections.feature index 0608bb685af..ee38d61897f 100644 --- a/tests/scenarios/features/v1/service_level_objective_corrections.feature +++ b/tests/scenarios/features/v1/service_level_objective_corrections.feature @@ -36,6 +36,14 @@ Feature: Service Level Objective Corrections When the request is sent Then the response status is 404 SLO Not Found + Scenario: Create an SLO correction with rrule returns "OK" response + Given there is a valid "slo" in the system + And operation "CreateSLOCorrection" enabled + And new "CreateSLOCorrection" request + And body with value {"data": {"attributes": {"category": "Scheduled Maintenance", "description": "{{ unique }}", "slo_id": "{{ slo.data[0].id }}", "start": {{ timestamp("now") }}, "duration": 1600000000, "rrule": "RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5", "timezone": "UTC"}, "type": "correction"}} + When the request is sent + Then the response status is 200 OK + @generated @skip Scenario: Delete an SLO correction returns "Not found" response Given operation "DeleteSLOCorrection" enabled @@ -93,7 +101,7 @@ Feature: Service Level Objective Corrections Given operation "UpdateSLOCorrection" enabled And new "UpdateSLOCorrection" request And request contains "slo_correction_id" parameter from "" - And body with value {"data": {"attributes": {"category": "Scheduled Maintenance", "description": null, "end": 1600000000, "start": 1600000000, "timezone": "UTC"}, "type": "correction"}} + And body with value {"data": {"attributes": {"category": "Scheduled Maintenance", "description": null, "duration": 1600000000, "end": 1600000000, "rrule": "RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5", "start": 1600000000, "timezone": "UTC"}, "type": "correction"}} When the request is sent Then the response status is 404 Not Found