Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-25 17:36:54.585671",
"spec_repo_commit": "51c17453"
"regenerated": "2025-06-25 21:28:45.538861",
"spec_repo_commit": "31044eb9"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-25 17:36:54.602053",
"spec_repo_commit": "51c17453"
"regenerated": "2025-06-25 21:28:45.554520",
"spec_repo_commit": "31044eb9"
}
}
}
8 changes: 8 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17419,6 +17419,10 @@ components:
items:
$ref: '#/components/schemas/IncidentTimelineCellCreateAttributes'
type: array
is_test:
description: A flag indicating whether the incident is a test incident.
example: false
type: boolean
notification_handles:
description: Notification handles that will be notified of the incident
at creation.
Expand Down Expand Up @@ -17824,6 +17828,10 @@ components:
description: A unique identifier that represents an incident type.
example: 00000000-0000-0000-0000-000000000000
type: string
is_test:
description: A flag indicating whether the incident is a test incident.
example: false
type: boolean
modified:
description: Timestamp when the incident was last modified.
format: date-time
Expand Down
37 changes: 36 additions & 1 deletion api/datadogV2/model_incident_create_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ type IncidentCreateAttributes struct {
IncidentTypeUuid *string `json:"incident_type_uuid,omitempty"`
// An array of initial timeline cells to be placed at the beginning of the incident timeline.
InitialCells []IncidentTimelineCellCreateAttributes `json:"initial_cells,omitempty"`
// A flag indicating whether the incident is a test incident.
IsTest *bool `json:"is_test,omitempty"`
// Notification handles that will be notified of the incident at creation.
NotificationHandles []IncidentNotificationHandle `json:"notification_handles,omitempty"`
// The title of the incident, which summarizes what happened.
Expand Down Expand Up @@ -185,6 +187,34 @@ func (o *IncidentCreateAttributes) SetInitialCells(v []IncidentTimelineCellCreat
o.InitialCells = v
}

// GetIsTest returns the IsTest field value if set, zero value otherwise.
func (o *IncidentCreateAttributes) GetIsTest() bool {
if o == nil || o.IsTest == nil {
var ret bool
return ret
}
return *o.IsTest
}

// GetIsTestOk returns a tuple with the IsTest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IncidentCreateAttributes) GetIsTestOk() (*bool, bool) {
if o == nil || o.IsTest == nil {
return nil, false
}
return o.IsTest, true
}

// HasIsTest returns a boolean if a field has been set.
func (o *IncidentCreateAttributes) HasIsTest() bool {
return o != nil && o.IsTest != nil
}

// SetIsTest gets a reference to the given bool and assigns it to the IsTest field.
func (o *IncidentCreateAttributes) SetIsTest(v bool) {
o.IsTest = &v
}

// GetNotificationHandles returns the NotificationHandles field value if set, zero value otherwise.
func (o *IncidentCreateAttributes) GetNotificationHandles() []IncidentNotificationHandle {
if o == nil || o.NotificationHandles == nil {
Expand Down Expand Up @@ -255,6 +285,9 @@ func (o IncidentCreateAttributes) MarshalJSON() ([]byte, error) {
if o.InitialCells != nil {
toSerialize["initial_cells"] = o.InitialCells
}
if o.IsTest != nil {
toSerialize["is_test"] = o.IsTest
}
if o.NotificationHandles != nil {
toSerialize["notification_handles"] = o.NotificationHandles
}
Expand All @@ -274,6 +307,7 @@ func (o *IncidentCreateAttributes) UnmarshalJSON(bytes []byte) (err error) {
Fields map[string]IncidentFieldAttributes `json:"fields,omitempty"`
IncidentTypeUuid *string `json:"incident_type_uuid,omitempty"`
InitialCells []IncidentTimelineCellCreateAttributes `json:"initial_cells,omitempty"`
IsTest *bool `json:"is_test,omitempty"`
NotificationHandles []IncidentNotificationHandle `json:"notification_handles,omitempty"`
Title *string `json:"title"`
}{}
Expand All @@ -288,7 +322,7 @@ func (o *IncidentCreateAttributes) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"customer_impact_scope", "customer_impacted", "fields", "incident_type_uuid", "initial_cells", "notification_handles", "title"})
datadog.DeleteKeys(additionalProperties, &[]string{"customer_impact_scope", "customer_impacted", "fields", "incident_type_uuid", "initial_cells", "is_test", "notification_handles", "title"})
} else {
return err
}
Expand All @@ -297,6 +331,7 @@ func (o *IncidentCreateAttributes) UnmarshalJSON(bytes []byte) (err error) {
o.Fields = all.Fields
o.IncidentTypeUuid = all.IncidentTypeUuid
o.InitialCells = all.InitialCells
o.IsTest = all.IsTest
o.NotificationHandles = all.NotificationHandles
o.Title = *all.Title

Expand Down
37 changes: 36 additions & 1 deletion api/datadogV2/model_incident_response_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ type IncidentResponseAttributes struct {
Fields map[string]IncidentFieldAttributes `json:"fields,omitempty"`
// A unique identifier that represents an incident type.
IncidentTypeUuid *string `json:"incident_type_uuid,omitempty"`
// A flag indicating whether the incident is a test incident.
IsTest *bool `json:"is_test,omitempty"`
// Timestamp when the incident was last modified.
Modified *time.Time `json:"modified,omitempty"`
// Incident's non Datadog creator.
Expand Down Expand Up @@ -460,6 +462,34 @@ func (o *IncidentResponseAttributes) SetIncidentTypeUuid(v string) {
o.IncidentTypeUuid = &v
}

// GetIsTest returns the IsTest field value if set, zero value otherwise.
func (o *IncidentResponseAttributes) GetIsTest() bool {
if o == nil || o.IsTest == nil {
var ret bool
return ret
}
return *o.IsTest
}

// GetIsTestOk returns a tuple with the IsTest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IncidentResponseAttributes) GetIsTestOk() (*bool, bool) {
if o == nil || o.IsTest == nil {
return nil, false
}
return o.IsTest, true
}

// HasIsTest returns a boolean if a field has been set.
func (o *IncidentResponseAttributes) HasIsTest() bool {
return o != nil && o.IsTest != nil
}

// SetIsTest gets a reference to the given bool and assigns it to the IsTest field.
func (o *IncidentResponseAttributes) SetIsTest(v bool) {
o.IsTest = &v
}

// GetModified returns the Modified field value if set, zero value otherwise.
func (o *IncidentResponseAttributes) GetModified() time.Time {
if o == nil || o.Modified == nil {
Expand Down Expand Up @@ -907,6 +937,9 @@ func (o IncidentResponseAttributes) MarshalJSON() ([]byte, error) {
if o.IncidentTypeUuid != nil {
toSerialize["incident_type_uuid"] = o.IncidentTypeUuid
}
if o.IsTest != nil {
toSerialize["is_test"] = o.IsTest
}
if o.Modified != nil {
if o.Modified.Nanosecond() == 0 {
toSerialize["modified"] = o.Modified.Format("2006-01-02T15:04:05Z07:00")
Expand Down Expand Up @@ -969,6 +1002,7 @@ func (o *IncidentResponseAttributes) UnmarshalJSON(bytes []byte) (err error) {
Detected datadog.NullableTime `json:"detected,omitempty"`
Fields map[string]IncidentFieldAttributes `json:"fields,omitempty"`
IncidentTypeUuid *string `json:"incident_type_uuid,omitempty"`
IsTest *bool `json:"is_test,omitempty"`
Modified *time.Time `json:"modified,omitempty"`
NonDatadogCreator NullableIncidentNonDatadogCreator `json:"non_datadog_creator,omitempty"`
NotificationHandles []IncidentNotificationHandle `json:"notification_handles,omitempty"`
Expand All @@ -991,7 +1025,7 @@ func (o *IncidentResponseAttributes) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"archived", "case_id", "created", "customer_impact_duration", "customer_impact_end", "customer_impact_scope", "customer_impact_start", "customer_impacted", "detected", "fields", "incident_type_uuid", "modified", "non_datadog_creator", "notification_handles", "public_id", "resolved", "severity", "state", "time_to_detect", "time_to_internal_response", "time_to_repair", "time_to_resolve", "title", "visibility"})
datadog.DeleteKeys(additionalProperties, &[]string{"archived", "case_id", "created", "customer_impact_duration", "customer_impact_end", "customer_impact_scope", "customer_impact_start", "customer_impacted", "detected", "fields", "incident_type_uuid", "is_test", "modified", "non_datadog_creator", "notification_handles", "public_id", "resolved", "severity", "state", "time_to_detect", "time_to_internal_response", "time_to_repair", "time_to_resolve", "title", "visibility"})
} else {
return err
}
Expand All @@ -1008,6 +1042,7 @@ func (o *IncidentResponseAttributes) UnmarshalJSON(bytes []byte) (err error) {
o.Detected = all.Detected
o.Fields = all.Fields
o.IncidentTypeUuid = all.IncidentTypeUuid
o.IsTest = all.IsTest
o.Modified = all.Modified
o.NonDatadogCreator = all.NonDatadogCreator
o.NotificationHandles = all.NotificationHandles
Expand Down
4 changes: 2 additions & 2 deletions tests/scenarios/features/v2/incidents.feature
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Feature: Incidents
Scenario: Create an incident returns "Bad Request" response
Given operation "CreateIncident" enabled
And new "CreateIncident" request
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "incident_type_uuid": "00000000-0000-0000-0000-000000000000", "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "incident_type_uuid": "00000000-0000-0000-0000-000000000000", "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "is_test": false, "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
When the request is sent
Then the response status is 400 Bad Request

Expand All @@ -89,7 +89,7 @@ Feature: Incidents
Scenario: Create an incident returns "Not Found" response
Given operation "CreateIncident" enabled
And new "CreateIncident" request
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "incident_type_uuid": "00000000-0000-0000-0000-000000000000", "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "incident_type_uuid": "00000000-0000-0000-0000-000000000000", "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "is_test": false, "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
When the request is sent
Then the response status is 404 Not Found

Expand Down