Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customer_impact_scope to fields #1349

Merged
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.4",
"regenerated": "2023-05-01 17:21:07.376995",
"spec_repo_commit": "4d58341b"
"regenerated": "2023-05-01 17:53:02.534170",
"spec_repo_commit": "6b2e8b39"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-05-01 17:21:07.389895",
"spec_repo_commit": "4d58341b"
"regenerated": "2023-05-01 17:53:02.546706",
"spec_repo_commit": "6b2e8b39"
}
}
}
5 changes: 5 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4498,6 +4498,11 @@ components:
IncidentCreateAttributes:
description: The incident's attributes for a create request.
properties:
customer_impact_scope:
description: Required if `customer_impacted:"true"`. A summary of the impact
customers experienced during the incident.
example: Example customer impact scope
type: string
customer_impacted:
description: A flag indicating whether the incident caused customer impact.
example: false
Expand Down
4 changes: 2 additions & 2 deletions features/v2/incidents.feature
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,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_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "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"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "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 @@ -86,7 +86,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_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "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"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "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
12 changes: 11 additions & 1 deletion lib/datadog_api_client/v2/models/incident_create_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class IncidentCreateAttributes
# @!visibility private
attr_accessor :_unparsed

# Required if `customer_impacted:"true"`. A summary of the impact customers experienced during the incident.
attr_accessor :customer_impact_scope

# A flag indicating whether the incident caused customer impact.
attr_reader :customer_impacted

Expand All @@ -44,6 +47,7 @@ class IncidentCreateAttributes
# @!visibility private
def self.attribute_map
{
:'customer_impact_scope' => :'customer_impact_scope',
:'customer_impacted' => :'customer_impacted',
:'fields' => :'fields',
:'initial_cells' => :'initial_cells',
Expand All @@ -56,6 +60,7 @@ def self.attribute_map
# @!visibility private
def self.openapi_types
{
:'customer_impact_scope' => :'String',
:'customer_impacted' => :'Boolean',
:'fields' => :'Hash<String, IncidentFieldAttributes>',
:'initial_cells' => :'Array<IncidentTimelineCellCreateAttributes>',
Expand All @@ -80,6 +85,10 @@ def initialize(attributes = {})
h[k.to_sym] = v
}

if attributes.key?(:'customer_impact_scope')
self.customer_impact_scope = attributes[:'customer_impact_scope']
end

if attributes.key?(:'customer_impacted')
self.customer_impacted = attributes[:'customer_impacted']
end
Expand Down Expand Up @@ -140,6 +149,7 @@ def title=(title)
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
customer_impact_scope == o.customer_impact_scope &&
customer_impacted == o.customer_impacted &&
fields == o.fields &&
initial_cells == o.initial_cells &&
Expand All @@ -151,7 +161,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[customer_impacted, fields, initial_cells, notification_handles, title].hash
[customer_impact_scope, customer_impacted, fields, initial_cells, notification_handles, title].hash
end
end
end