Skip to content
Open
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
276 changes: 239 additions & 37 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion examples/v2/incidents/CreateIncidentPostmortemTemplate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,30 @@
body = DatadogAPIClient::V2::PostmortemTemplateRequest.new({
data: DatadogAPIClient::V2::PostmortemTemplateDataRequest.new({
attributes: DatadogAPIClient::V2::PostmortemTemplateAttributesRequest.new({
confluence_postmortem_settings: DatadogAPIClient::V2::ConfluencePostmortemSettings.new({
account_id: "123456",
parent_id: "345678",
space_id: "789012",
}),
content: '# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items',
google_docs_postmortem_settings: DatadogAPIClient::V2::GoogleDocsPostmortemSettings.new({
account_id: "123456",
parent_folder_id: "789012",
}),
is_default: "2024-01-01T00:00:00+00:00",
location: DatadogAPIClient::V2::PostmortemTemplateLocation::DATADOG_NOTEBOOKS,
name: "Standard Postmortem Template",
}),
type: DatadogAPIClient::V2::PostmortemTemplateType::POSTMORTEM_TEMPLATE,
id: "00000000-0000-0000-0000-000000000000",
relationships: DatadogAPIClient::V2::PostmortemTemplateCreateRelationships.new({
incident_type: DatadogAPIClient::V2::PostmortemTemplateIncidentTypeRelationship.new({
data: DatadogAPIClient::V2::PostmortemTemplateIncidentTypeRelationshipData.new({
id: "00000000-0000-0000-0000-000000000009",
type: "incident_types",
}),
}),
}),
type: DatadogAPIClient::V2::PostmortemTemplateType::POSTMORTEM_TEMPLATES,
}),
})
p api_instance.create_incident_postmortem_template(body)
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
config.unstable_operations["v2.delete_incident_postmortem_template".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
api_instance.delete_incident_postmortem_template("template-456")
api_instance.delete_incident_postmortem_template("template_id")
2 changes: 1 addition & 1 deletion examples/v2/incidents/GetIncidentPostmortemTemplate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
config.unstable_operations["v2.get_incident_postmortem_template".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.get_incident_postmortem_template("template-456")
p api_instance.get_incident_postmortem_template("template_id")
25 changes: 23 additions & 2 deletions examples/v2/incidents/UpdateIncidentPostmortemTemplate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,30 @@
body = DatadogAPIClient::V2::PostmortemTemplateRequest.new({
data: DatadogAPIClient::V2::PostmortemTemplateDataRequest.new({
attributes: DatadogAPIClient::V2::PostmortemTemplateAttributesRequest.new({
confluence_postmortem_settings: DatadogAPIClient::V2::ConfluencePostmortemSettings.new({
account_id: "123456",
parent_id: "345678",
space_id: "789012",
}),
content: '# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items',
google_docs_postmortem_settings: DatadogAPIClient::V2::GoogleDocsPostmortemSettings.new({
account_id: "123456",
parent_folder_id: "789012",
}),
is_default: "2024-01-01T00:00:00+00:00",
location: DatadogAPIClient::V2::PostmortemTemplateLocation::DATADOG_NOTEBOOKS,
name: "Standard Postmortem Template",
}),
type: DatadogAPIClient::V2::PostmortemTemplateType::POSTMORTEM_TEMPLATE,
id: "00000000-0000-0000-0000-000000000000",
relationships: DatadogAPIClient::V2::PostmortemTemplateCreateRelationships.new({
incident_type: DatadogAPIClient::V2::PostmortemTemplateIncidentTypeRelationship.new({
data: DatadogAPIClient::V2::PostmortemTemplateIncidentTypeRelationshipData.new({
id: "00000000-0000-0000-0000-000000000009",
type: "incident_types",
}),
}),
}),
type: DatadogAPIClient::V2::PostmortemTemplateType::POSTMORTEM_TEMPLATES,
}),
})
p api_instance.update_incident_postmortem_template("template-456", body)
p api_instance.update_incident_postmortem_template("template_id", body)
4 changes: 4 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3551,6 +3551,10 @@
"include" => "String",
"body" => "PatchIncidentNotificationTemplateRequest",
},
"v2.ListIncidentPostmortemTemplates" => {
"filter_incident_type" => "UUID",
"sort" => "String",
},
"v2.CreateIncidentPostmortemTemplate" => {
"body" => "PostmortemTemplateRequest",
},
Expand Down
10 changes: 5 additions & 5 deletions features/v2/incidents.feature
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,15 @@ Feature: Incidents
Scenario: Create postmortem template returns "Bad Request" response
Given operation "CreateIncidentPostmortemTemplate" enabled
And new "CreateIncidentPostmortemTemplate" request
And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}}
And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/incident-app
Scenario: Create postmortem template returns "Created" response
Given operation "CreateIncidentPostmortemTemplate" enabled
And new "CreateIncidentPostmortemTemplate" request
And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}}
And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}}
When the request is sent
Then the response status is 201 Created

Expand Down Expand Up @@ -1590,7 +1590,7 @@ Feature: Incidents
Given operation "UpdateIncidentPostmortemTemplate" enabled
And new "UpdateIncidentPostmortemTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}}
And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}}
When the request is sent
Then the response status is 400 Bad Request

Expand All @@ -1599,7 +1599,7 @@ Feature: Incidents
Given operation "UpdateIncidentPostmortemTemplate" enabled
And new "UpdateIncidentPostmortemTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}}
And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}}
When the request is sent
Then the response status is 404 Not Found

Expand All @@ -1608,6 +1608,6 @@ Feature: Incidents
Given operation "UpdateIncidentPostmortemTemplate" enabled
And new "UpdateIncidentPostmortemTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}}
And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}}
When the request is sent
Then the response status is 200 OK
2 changes: 1 addition & 1 deletion features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3047,7 +3047,7 @@
"parameters": [
{
"name": "template_id",
"source": "<RESPONSE_PATH>"
"source": "data.id"
}
],
"type": "unsafe"
Expand Down
9 changes: 9 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2268,6 +2268,7 @@ def overrides
"v2.configured_schedule_target_relationships" => "ConfiguredScheduleTargetRelationships",
"v2.configured_schedule_target_relationships_schedule" => "ConfiguredScheduleTargetRelationshipsSchedule",
"v2.configured_schedule_target_type" => "ConfiguredScheduleTargetType",
"v2.confluence_postmortem_settings" => "ConfluencePostmortemSettings",
"v2.confluent_account_create_request" => "ConfluentAccountCreateRequest",
"v2.confluent_account_create_request_attributes" => "ConfluentAccountCreateRequestAttributes",
"v2.confluent_account_create_request_data" => "ConfluentAccountCreateRequestData",
Expand Down Expand Up @@ -3658,6 +3659,7 @@ def overrides
"v2.google_chat_update_organization_handle_request" => "GoogleChatUpdateOrganizationHandleRequest",
"v2.google_chat_update_organization_handle_request_attributes" => "GoogleChatUpdateOrganizationHandleRequestAttributes",
"v2.google_chat_update_organization_handle_request_data" => "GoogleChatUpdateOrganizationHandleRequestData",
"v2.google_docs_postmortem_settings" => "GoogleDocsPostmortemSettings",
"v2.google_meet_configuration_reference" => "GoogleMeetConfigurationReference",
"v2.google_meet_configuration_reference_data" => "GoogleMeetConfigurationReferenceData",
"v2.governance_best_practice_definition" => "GovernanceBestPracticeDefinition",
Expand Down Expand Up @@ -5775,12 +5777,19 @@ def overrides
"v2.postmortem_cell_type" => "PostmortemCellType",
"v2.postmortem_template_attributes_request" => "PostmortemTemplateAttributesRequest",
"v2.postmortem_template_attributes_response" => "PostmortemTemplateAttributesResponse",
"v2.postmortem_template_create_relationships" => "PostmortemTemplateCreateRelationships",
"v2.postmortem_template_data_request" => "PostmortemTemplateDataRequest",
"v2.postmortem_template_data_response" => "PostmortemTemplateDataResponse",
"v2.postmortem_template_incident_type_relationship" => "PostmortemTemplateIncidentTypeRelationship",
"v2.postmortem_template_incident_type_relationship_data" => "PostmortemTemplateIncidentTypeRelationshipData",
"v2.postmortem_template_location" => "PostmortemTemplateLocation",
"v2.postmortem_template_request" => "PostmortemTemplateRequest",
"v2.postmortem_template_response" => "PostmortemTemplateResponse",
"v2.postmortem_template_response_relationships" => "PostmortemTemplateResponseRelationships",
"v2.postmortem_templates_response" => "PostmortemTemplatesResponse",
"v2.postmortem_template_type" => "PostmortemTemplateType",
"v2.postmortem_template_user_relationship" => "PostmortemTemplateUserRelationship",
"v2.postmortem_template_user_relationship_data" => "PostmortemTemplateUserRelationshipData",
"v2.powerpack" => "Powerpack",
"v2.powerpack_attributes" => "PowerpackAttributes",
"v2.powerpack_data" => "PowerpackData",
Expand Down
10 changes: 7 additions & 3 deletions lib/datadog_api_client/v2/api/incidents_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ def delete_incident_postmortem_template(template_id, opts = {})
#
# Delete a postmortem template.
#
# @param template_id [String] The ID of the postmortem template
# @param template_id [String] The ID of the postmortem template.
# @param opts [Hash] the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def delete_incident_postmortem_template_with_http_info(template_id, opts = {})
Expand Down Expand Up @@ -2240,7 +2240,7 @@ def get_incident_postmortem_template(template_id, opts = {})
#
# Retrieve details of a specific postmortem template.
#
# @param template_id [String] The ID of the postmortem template
# @param template_id [String] The ID of the postmortem template.
# @param opts [Hash] the optional parameters
# @return [Array<(PostmortemTemplateResponse, Integer, Hash)>] PostmortemTemplateResponse data, response status code and response headers
def get_incident_postmortem_template_with_http_info(template_id, opts = {})
Expand Down Expand Up @@ -3101,6 +3101,8 @@ def list_incident_postmortem_templates(opts = {})
# Retrieve a list of all postmortem templates for incidents.
#
# @param opts [Hash] the optional parameters
# @option opts [UUID] :filter_incident_type Filter postmortem templates by the associated incident type ID.
# @option opts [String] :sort The attribute to sort results by. Prefix with `-` for descending order.
# @return [Array<(PostmortemTemplatesResponse, Integer, Hash)>] PostmortemTemplatesResponse data, response status code and response headers
def list_incident_postmortem_templates_with_http_info(opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_postmortem_templates".to_sym]
Expand All @@ -3118,6 +3120,8 @@ def list_incident_postmortem_templates_with_http_info(opts = {})

# query parameters
query_params = opts[:query_params] || {}
query_params[:'filter[incident-type]'] = opts[:'filter_incident_type'] if !opts[:'filter_incident_type'].nil?
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

# header parameters
header_params = opts[:header_params] || {}
Expand Down Expand Up @@ -4215,7 +4219,7 @@ def update_incident_postmortem_template(template_id, body, opts = {})
#
# Update an existing postmortem template.
#
# @param template_id [String] The ID of the postmortem template
# @param template_id [String] The ID of the postmortem template.
# @param body [PostmortemTemplateRequest]
# @param opts [Hash] the optional parameters
# @return [Array<(PostmortemTemplateResponse, Integer, Hash)>] PostmortemTemplateResponse data, response status code and response headers
Expand Down
Loading
Loading