From 11d983cf92d3ddbb9a0bc4ff17606c85f2b82e48 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 28 Oct 2021 07:43:40 +0000 Subject: [PATCH] Regenerate client from commit 40adf3b of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 31 ++- 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 ++++++ ...tion_with_rrule_returns_OK_response.freeze | 1 + ...ection_with_rrule_returns_OK_response.yaml | 225 ++++++++++++++++++ ...ervice_level_objective_corrections.feature | 10 +- 12 files changed, 739 insertions(+), 27 deletions(-) create mode 100644 tests/scenarios/cassettes/TestScenarios/v1/Feature_Service_Level_Objective_Corrections/Scenario_Create_an_SLO_correction_with_rrule_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v1/Feature_Service_Level_Objective_Corrections/Scenario_Create_an_SLO_correction_with_rrule_returns_OK_response.yaml diff --git a/.apigentools-info b/.apigentools-info index 0f115ce899a..260c5a1088f 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.5.1.dev2", - "regenerated": "2021-10-27 12:49:52.775829", - "spec_repo_commit": "0b58986" + "regenerated": "2021-10-28 07:43:08.006758", + "spec_repo_commit": "40adf3b" }, "v2": { "apigentools_version": "1.5.1.dev2", - "regenerated": "2021-10-27 12:49:52.790161", - "spec_repo_commit": "0b58986" + "regenerated": "2021-10-28 07:43:08.022172", + "spec_repo_commit": "40adf3b" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 62bc08821a5..fdb6db3ac7f 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -7570,11 +7570,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 @@ -7592,7 +7602,6 @@ components: required: - slo_id - start - - end - category type: object SLOCorrectionListResponse: @@ -7622,10 +7631,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: 3600 + 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 @@ -7669,11 +7688,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: 3600 + 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/api/openapi.yaml b/api/v1/datadog/api/openapi.yaml index 024fd9659a4..0cacfb19e10 100644 --- a/api/v1/datadog/api/openapi.yaml +++ b/api/v1/datadog/api/openapi.yaml @@ -19941,10 +19941,12 @@ components: description: The response object of a list of SLO corrections. example: attributes: + duration: 3600 creator: name: name handle: handle email: email + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: timezone slo_id: slo_id start: 6 @@ -19980,6 +19982,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 @@ -20000,6 +20004,8 @@ components: example: data: attributes: + duration: 1600000000 + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: UTC slo_id: sloId start: 1600000000 @@ -20014,6 +20020,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 @@ -20026,11 +20034,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 @@ -20047,7 +20065,6 @@ components: type: string required: - category - - end - slo_id - start type: object @@ -20056,10 +20073,12 @@ components: example: data: - attributes: + duration: 3600 creator: name: name handle: handle email: email + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: timezone slo_id: slo_id start: 6 @@ -20069,10 +20088,12 @@ components: id: id type: correction - attributes: + duration: 3600 creator: name: name handle: handle email: email + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: timezone slo_id: slo_id start: 6 @@ -20099,10 +20120,12 @@ components: example: data: attributes: + duration: 3600 creator: name: name handle: handle email: email + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: timezone slo_id: slo_id start: 6 @@ -20118,10 +20141,12 @@ components: SLOCorrectionResponseAttributes: description: The attribute object associated with the SLO correction. example: + duration: 3600 creator: name: name handle: handle email: email + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: timezone slo_id: slo_id start: 6 @@ -20136,10 +20161,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: 3600 + 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 @@ -20165,6 +20200,8 @@ components: description: The data object associated with the SLO correction to be updated. example: attributes: + duration: 3600 + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: UTC start: 1600000000 description: description @@ -20182,6 +20219,8 @@ components: example: data: attributes: + duration: 3600 + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: UTC start: 1600000000 description: description @@ -20195,6 +20234,8 @@ components: SLOCorrectionUpdateRequestAttributes: description: The attribute object associated with the SLO correction to be updated. example: + duration: 3600 + rrule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 timezone: UTC start: 1600000000 description: description @@ -20206,11 +20247,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: 3600 + 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/cassettes/TestScenarios/v1/Feature_Service_Level_Objective_Corrections/Scenario_Create_an_SLO_correction_with_rrule_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Service_Level_Objective_Corrections/Scenario_Create_an_SLO_correction_with_rrule_returns_OK_response.freeze new file mode 100644 index 00000000000..3d2fb7dada8 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Service_Level_Objective_Corrections/Scenario_Create_an_SLO_correction_with_rrule_returns_OK_response.freeze @@ -0,0 +1 @@ +2021-10-27T15:58:58.689Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Service_Level_Objective_Corrections/Scenario_Create_an_SLO_correction_with_rrule_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Service_Level_Objective_Corrections/Scenario_Create_an_SLO_correction_with_rrule_returns_OK_response.yaml new file mode 100644 index 00000000000..437d11d057f --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Service_Level_Objective_Corrections/Scenario_Create_an_SLO_correction_with_rrule_returns_OK_response.yaml @@ -0,0 +1,225 @@ +interactions: +- request: + body: | + {"name":"Test-Create_an_SLO_correction_with_rrule_returns_OK_response-1635350338","query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"thresholds":[{"target":95,"timeframe":"7d","warning":98}],"type":"metric"} + form: {} + headers: + Accept: + - application/json, */*;q=0.8 + Connection: + - close + Content-Length: + - '282' + Content-Type: + - application/json + Host: + - api.datadoghq.com + User-Agent: + - datadog-api-client-typescript/1.0.0-beta.5 (node 14.18.1; os Linux; arch x64) + X-Datadog-Parent-Id: + - '522305678773838283' + X-Datadog-Trace-Id: + - '2881426433693695619' + method: POST + url: https://api.datadoghq.com/api/v1/slo + response: + body: '{"data":[{"description":"","monitor_tags":[],"creator":{"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"thresholds":[{"warning":98.0,"warning_display":"98.","target":95.0,"target_display":"95.","timeframe":"7d"}],"type_id":1,"query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"id":"b602d1e488095f08960f099a0d60c27f","name":"Test-Create_an_SLO_correction_with_rrule_returns_OK_response-1635350338","created_at":1635350339,"tags":[],"modified_at":1635350339,"type":"metric"}],"error":null}' + code: 200 + duration: '' + headers: + Cache-Control: + - no-cache + Connection: + - close + Content-Length: + - '586' + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Wed, 27 Oct 2021 15:58:59 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - '500' + X-Ratelimit-Period: + - '60' + X-Ratelimit-Remaining: + - '499' + X-Ratelimit-Reset: + - '1' + status: 200 OK +- request: + body: | + {"data":{"attributes":{"category":"Scheduled Maintenance","description":"Test-Create_an_SLO_correction_with_rrule_returns_OK_response-1635350338","duration":3600,"rrule":"RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5","slo_id":"b602d1e488095f08960f099a0d60c27f","start":1635350338,"timezone":"UTC"},"type":"correction"}} + form: {} + headers: + Accept: + - application/json, */*;q=0.8 + Connection: + - close + Content-Length: + - '311' + Content-Type: + - application/json + Host: + - api.datadoghq.com + User-Agent: + - datadog-api-client-typescript/1.0.0-beta.5 (node 14.18.1; os Linux; arch x64) + X-Datadog-Parent-Id: + - '4030689137576896723' + X-Datadog-Trace-Id: + - '2881426433693695619' + method: POST + url: https://api.datadoghq.com/api/v1/slo/correction + response: + body: '{"data":{"type":"correction","id":"cc357bf6-373e-11ec-9aa4-da7ad0900002","attributes":{"slo_id":"b602d1e488095f08960f099a0d60c27f","start":1635350338,"end":null,"description":"Test-Create_an_SLO_correction_with_rrule_returns_OK_response-1635350338","category":"Scheduled + Maintenance","timezone":"UTC","created_at":null,"modified_at":null,"rrule":"RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5","duration":3600,"creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}},"modifier":null}}}' + code: 200 + duration: '' + headers: + Cache-Control: + - no-cache + Connection: + - close + Content-Length: + - '721' + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Wed, 27 Oct 2021 15:58:59 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - '12000' + X-Ratelimit-Period: + - '60' + X-Ratelimit-Remaining: + - '11999' + X-Ratelimit-Reset: + - '1' + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json, */*;q=0.8 + Connection: + - close + Host: + - api.datadoghq.com + User-Agent: + - datadog-api-client-typescript/1.0.0-beta.5 (node 14.18.1; os Linux; arch x64) + X-Datadog-Parent-Id: + - '58094956646997013' + X-Datadog-Trace-Id: + - '2881426433693695619' + method: DELETE + url: https://api.datadoghq.com/api/v1/slo/correction/cc357bf6-373e-11ec-9aa4-da7ad0900002 + response: + body: '' + code: 204 + duration: '' + headers: + Cache-Control: + - no-cache + Connection: + - close + Content-Length: + - '0' + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Date: + - Wed, 27 Oct 2021 15:59:00 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - '12000' + X-Ratelimit-Period: + - '60' + X-Ratelimit-Remaining: + - '11999' + X-Ratelimit-Reset: + - '60' + status: 204 No Content +- request: + body: '' + form: {} + headers: + Accept: + - application/json, */*;q=0.8 + Connection: + - close + Host: + - api.datadoghq.com + User-Agent: + - datadog-api-client-typescript/1.0.0-beta.5 (node 14.18.1; os Linux; arch x64) + X-Datadog-Parent-Id: + - '8592101216552609256' + X-Datadog-Trace-Id: + - '2881426433693695619' + method: DELETE + url: https://api.datadoghq.com/api/v1/slo/b602d1e488095f08960f099a0d60c27f + response: + body: '{"data":["b602d1e488095f08960f099a0d60c27f"],"error":null}' + code: 200 + duration: '' + headers: + Cache-Control: + - no-cache + Connection: + - close + Content-Length: + - '58' + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Wed, 27 Oct 2021 15:59:00 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - '3000' + X-Ratelimit-Period: + - '10' + X-Ratelimit-Remaining: + - '2999' + X-Ratelimit-Reset: + - '10' + status: 200 OK +version: 1 diff --git a/tests/scenarios/features/v1/service_level_objective_corrections.feature b/tests/scenarios/features/v1/service_level_objective_corrections.feature index 0608bb685af..03a36441402 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": 3600, "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": 3600, "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