Skip to content

Commit d04f1e2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 3847a9b of spec repo (#3504)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 8998eca commit d04f1e2

32 files changed

Lines changed: 2779 additions & 54 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 404 additions & 25 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Edit degradation update returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::StatusPagesAPI.new
5+
6+
body = DatadogAPIClient::V2::PatchDegradationUpdateRequest.new({
7+
data: DatadogAPIClient::V2::PatchDegradationUpdateRequestData.new({
8+
attributes: DatadogAPIClient::V2::PatchDegradationUpdateRequestDataAttributes.new({
9+
description: "We've identified the source of the latency increase and are deploying a fix.",
10+
status: DatadogAPIClient::V2::PatchDegradationUpdateRequestDataAttributesStatus::IDENTIFIED,
11+
}),
12+
id: "00000000-0000-0000-0000-000000000000",
13+
type: DatadogAPIClient::V2::PatchDegradationUpdateRequestDataType::DEGRADATION_UPDATES,
14+
}),
15+
})
16+
p api_instance.edit_degradation_update("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Soft delete degradation update returns "No Content" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::StatusPagesAPI.new
5+
api_instance.soft_delete_degradation_update("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")

features/scenarios_model_mapping.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5550,6 +5550,18 @@
55505550
"include" => "String",
55515551
"body" => "PatchDegradationRequest",
55525552
},
5553+
"v2.SoftDeleteDegradationUpdate" => {
5554+
"degradation_id" => "UUID",
5555+
"page_id" => "UUID",
5556+
"update_id" => "UUID",
5557+
},
5558+
"v2.EditDegradationUpdate" => {
5559+
"degradation_id" => "UUID",
5560+
"include" => "String",
5561+
"page_id" => "UUID",
5562+
"update_id" => "UUID",
5563+
"body" => "PatchDegradationUpdateRequest",
5564+
},
55535565
"v2.CreateMaintenance" => {
55545566
"page_id" => "UUID",
55555567
"notify_subscribers" => "Boolean",

features/v2/status_pages.feature

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ Feature: Status Pages
9494
When the request is sent
9595
Then the response status is 204 No Content
9696

97+
@generated @skip @team:DataDog/incident-app
98+
Scenario: Edit degradation update returns "OK" response
99+
Given new "EditDegradationUpdate" request
100+
And request contains "degradation_id" parameter from "REPLACE.ME"
101+
And request contains "page_id" parameter from "REPLACE.ME"
102+
And request contains "update_id" parameter from "REPLACE.ME"
103+
And body with value {"data": {"attributes": {"description": "We've identified the source of the latency increase and are deploying a fix.", "status": "identified"}, "id": "00000000-0000-0000-0000-000000000000", "type": "degradation_updates"}}
104+
When the request is sent
105+
Then the response status is 200 OK
106+
97107
@team:DataDog/incident-app
98108
Scenario: Get component returns "OK" response
99109
Given new "GetComponent" request
@@ -178,6 +188,15 @@ Feature: Status Pages
178188
When the request is sent
179189
Then the response status is 201 Created
180190

191+
@generated @skip @team:DataDog/incident-app
192+
Scenario: Soft delete degradation update returns "No Content" response
193+
Given new "SoftDeleteDegradationUpdate" request
194+
And request contains "degradation_id" parameter from "REPLACE.ME"
195+
And request contains "page_id" parameter from "REPLACE.ME"
196+
And request contains "update_id" parameter from "REPLACE.ME"
197+
When the request is sent
198+
Then the response status is 204 No Content
199+
181200
@generated @skip @team:DataDog/incident-app
182201
Scenario: Unpublish status page returns "No Content" response
183202
Given new "UnpublishStatusPage" request

features/v2/undo.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8521,6 +8521,18 @@
85218521
"type": "idempotent"
85228522
}
85238523
},
8524+
"SoftDeleteDegradationUpdate": {
8525+
"tag": "Status Pages",
8526+
"undo": {
8527+
"type": "idempotent"
8528+
}
8529+
},
8530+
"EditDegradationUpdate": {
8531+
"tag": "Status Pages",
8532+
"undo": {
8533+
"type": "idempotent"
8534+
}
8535+
},
85248536
"CreateMaintenance": {
85258537
"tag": "Status Pages",
85268538
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,6 +2753,18 @@ def overrides
27532753
"v2.degradation_data_relationships_status_page" => "DegradationDataRelationshipsStatusPage",
27542754
"v2.degradation_data_relationships_status_page_data" => "DegradationDataRelationshipsStatusPageData",
27552755
"v2.degradation_included" => "DegradationIncluded",
2756+
"v2.degradation_update" => "DegradationUpdate",
2757+
"v2.degradation_update_data" => "DegradationUpdateData",
2758+
"v2.degradation_update_data_attributes" => "DegradationUpdateDataAttributes",
2759+
"v2.degradation_update_data_attributes_components_affected_items" => "DegradationUpdateDataAttributesComponentsAffectedItems",
2760+
"v2.degradation_update_data_relationships" => "DegradationUpdateDataRelationships",
2761+
"v2.degradation_update_data_relationships_degradation" => "DegradationUpdateDataRelationshipsDegradation",
2762+
"v2.degradation_update_data_relationships_degradation_data" => "DegradationUpdateDataRelationshipsDegradationData",
2763+
"v2.degradation_update_data_relationships_status_page" => "DegradationUpdateDataRelationshipsStatusPage",
2764+
"v2.degradation_update_data_relationships_status_page_data" => "DegradationUpdateDataRelationshipsStatusPageData",
2765+
"v2.degradation_update_data_relationships_user" => "DegradationUpdateDataRelationshipsUser",
2766+
"v2.degradation_update_data_relationships_user_data" => "DegradationUpdateDataRelationshipsUserData",
2767+
"v2.degradation_update_included" => "DegradationUpdateIncluded",
27562768
"v2.delete_app_response" => "DeleteAppResponse",
27572769
"v2.delete_app_response_data" => "DeleteAppResponseData",
27582770
"v2.delete_apps_datastore_item_request" => "DeleteAppsDatastoreItemRequest",
@@ -5433,6 +5445,11 @@ def overrides
54335445
"v2.patch_degradation_request_data_attributes_components_affected_items" => "PatchDegradationRequestDataAttributesComponentsAffectedItems",
54345446
"v2.patch_degradation_request_data_attributes_status" => "PatchDegradationRequestDataAttributesStatus",
54355447
"v2.patch_degradation_request_data_type" => "PatchDegradationRequestDataType",
5448+
"v2.patch_degradation_update_request" => "PatchDegradationUpdateRequest",
5449+
"v2.patch_degradation_update_request_data" => "PatchDegradationUpdateRequestData",
5450+
"v2.patch_degradation_update_request_data_attributes" => "PatchDegradationUpdateRequestDataAttributes",
5451+
"v2.patch_degradation_update_request_data_attributes_status" => "PatchDegradationUpdateRequestDataAttributesStatus",
5452+
"v2.patch_degradation_update_request_data_type" => "PatchDegradationUpdateRequestDataType",
54365453
"v2.patch_incident_notification_template_request" => "PatchIncidentNotificationTemplateRequest",
54375454
"v2.patch_maintenance_request" => "PatchMaintenanceRequest",
54385455
"v2.patch_maintenance_request_data" => "PatchMaintenanceRequestData",

lib/datadog_api_client/v2/api/status_pages_api.rb

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,90 @@ def delete_status_page_with_http_info(page_id, opts = {})
671671
return data, status_code, headers
672672
end
673673

674+
# Edit degradation update.
675+
#
676+
# @see #edit_degradation_update_with_http_info
677+
def edit_degradation_update(degradation_id, page_id, update_id, body, opts = {})
678+
data, _status_code, _headers = edit_degradation_update_with_http_info(degradation_id, page_id, update_id, body, opts)
679+
data
680+
end
681+
682+
# Edit degradation update.
683+
#
684+
# Edits a specific degradation update.
685+
#
686+
# @param degradation_id [UUID] The ID of the degradation.
687+
# @param page_id [UUID] The ID of the status page.
688+
# @param update_id [UUID] The ID of the degradation update.
689+
# @param body [PatchDegradationUpdateRequest]
690+
# @param opts [Hash] the optional parameters
691+
# @option opts [String] :include Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, degradation, status_page.
692+
# @return [Array<(DegradationUpdate, Integer, Hash)>] DegradationUpdate data, response status code and response headers
693+
def edit_degradation_update_with_http_info(degradation_id, page_id, update_id, body, opts = {})
694+
695+
if @api_client.config.debugging
696+
@api_client.config.logger.debug 'Calling API: StatusPagesAPI.edit_degradation_update ...'
697+
end
698+
# verify the required parameter 'degradation_id' is set
699+
if @api_client.config.client_side_validation && degradation_id.nil?
700+
fail ArgumentError, "Missing the required parameter 'degradation_id' when calling StatusPagesAPI.edit_degradation_update"
701+
end
702+
# verify the required parameter 'page_id' is set
703+
if @api_client.config.client_side_validation && page_id.nil?
704+
fail ArgumentError, "Missing the required parameter 'page_id' when calling StatusPagesAPI.edit_degradation_update"
705+
end
706+
# verify the required parameter 'update_id' is set
707+
if @api_client.config.client_side_validation && update_id.nil?
708+
fail ArgumentError, "Missing the required parameter 'update_id' when calling StatusPagesAPI.edit_degradation_update"
709+
end
710+
# verify the required parameter 'body' is set
711+
if @api_client.config.client_side_validation && body.nil?
712+
fail ArgumentError, "Missing the required parameter 'body' when calling StatusPagesAPI.edit_degradation_update"
713+
end
714+
# resource path
715+
local_var_path = '/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}'.sub('{degradation_id}', CGI.escape(degradation_id.to_s).gsub('%2F', '/')).sub('{page_id}', CGI.escape(page_id.to_s).gsub('%2F', '/')).sub('{update_id}', CGI.escape(update_id.to_s).gsub('%2F', '/'))
716+
717+
# query parameters
718+
query_params = opts[:query_params] || {}
719+
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
720+
721+
# header parameters
722+
header_params = opts[:header_params] || {}
723+
# HTTP header 'Accept' (if needed)
724+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
725+
# HTTP header 'Content-Type'
726+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
727+
728+
# form parameters
729+
form_params = opts[:form_params] || {}
730+
731+
# http body (model)
732+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
733+
734+
# return_type
735+
return_type = opts[:debug_return_type] || 'DegradationUpdate'
736+
737+
# auth_names
738+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
739+
740+
new_options = opts.merge(
741+
:operation => :edit_degradation_update,
742+
:header_params => header_params,
743+
:query_params => query_params,
744+
:form_params => form_params,
745+
:body => post_body,
746+
:auth_names => auth_names,
747+
:return_type => return_type,
748+
:api_version => "V2"
749+
)
750+
751+
data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
752+
if @api_client.config.debugging
753+
@api_client.config.logger.debug "API called: StatusPagesAPI#edit_degradation_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
754+
end
755+
return data, status_code, headers
756+
end
757+
674758
# Get component.
675759
#
676760
# @see #get_component_with_http_info
@@ -1298,6 +1382,81 @@ def publish_status_page_with_http_info(page_id, opts = {})
12981382
return data, status_code, headers
12991383
end
13001384

1385+
# Soft delete degradation update.
1386+
#
1387+
# @see #soft_delete_degradation_update_with_http_info
1388+
def soft_delete_degradation_update(degradation_id, page_id, update_id, opts = {})
1389+
soft_delete_degradation_update_with_http_info(degradation_id, page_id, update_id, opts)
1390+
nil
1391+
end
1392+
1393+
# Soft delete degradation update.
1394+
#
1395+
# Soft-deletes a degradation update.
1396+
#
1397+
# @param degradation_id [UUID] The ID of the degradation.
1398+
# @param page_id [UUID] The ID of the status page.
1399+
# @param update_id [UUID] The ID of the degradation update.
1400+
# @param opts [Hash] the optional parameters
1401+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1402+
def soft_delete_degradation_update_with_http_info(degradation_id, page_id, update_id, opts = {})
1403+
1404+
if @api_client.config.debugging
1405+
@api_client.config.logger.debug 'Calling API: StatusPagesAPI.soft_delete_degradation_update ...'
1406+
end
1407+
# verify the required parameter 'degradation_id' is set
1408+
if @api_client.config.client_side_validation && degradation_id.nil?
1409+
fail ArgumentError, "Missing the required parameter 'degradation_id' when calling StatusPagesAPI.soft_delete_degradation_update"
1410+
end
1411+
# verify the required parameter 'page_id' is set
1412+
if @api_client.config.client_side_validation && page_id.nil?
1413+
fail ArgumentError, "Missing the required parameter 'page_id' when calling StatusPagesAPI.soft_delete_degradation_update"
1414+
end
1415+
# verify the required parameter 'update_id' is set
1416+
if @api_client.config.client_side_validation && update_id.nil?
1417+
fail ArgumentError, "Missing the required parameter 'update_id' when calling StatusPagesAPI.soft_delete_degradation_update"
1418+
end
1419+
# resource path
1420+
local_var_path = '/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}'.sub('{degradation_id}', CGI.escape(degradation_id.to_s).gsub('%2F', '/')).sub('{page_id}', CGI.escape(page_id.to_s).gsub('%2F', '/')).sub('{update_id}', CGI.escape(update_id.to_s).gsub('%2F', '/'))
1421+
1422+
# query parameters
1423+
query_params = opts[:query_params] || {}
1424+
1425+
# header parameters
1426+
header_params = opts[:header_params] || {}
1427+
# HTTP header 'Accept' (if needed)
1428+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
1429+
1430+
# form parameters
1431+
form_params = opts[:form_params] || {}
1432+
1433+
# http body (model)
1434+
post_body = opts[:debug_body]
1435+
1436+
# return_type
1437+
return_type = opts[:debug_return_type]
1438+
1439+
# auth_names
1440+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
1441+
1442+
new_options = opts.merge(
1443+
:operation => :soft_delete_degradation_update,
1444+
:header_params => header_params,
1445+
:query_params => query_params,
1446+
:form_params => form_params,
1447+
:body => post_body,
1448+
:auth_names => auth_names,
1449+
:return_type => return_type,
1450+
:api_version => "V2"
1451+
)
1452+
1453+
data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
1454+
if @api_client.config.debugging
1455+
@api_client.config.logger.debug "API called: StatusPagesAPI#soft_delete_degradation_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1456+
end
1457+
return data, status_code, headers
1458+
end
1459+
13011460
# Unpublish status page.
13021461
#
13031462
# @see #unpublish_status_page_with_http_info

lib/datadog_api_client/v2/models/create_backfilled_maintenance_request_data_attributes_updates_items.rb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems
2222
include BaseGenericModel
2323

2424
# The components affected.
25-
attr_reader :components_affected
25+
attr_accessor :components_affected
2626

2727
# A description of the update.
2828
attr_reader :description
@@ -98,23 +98,12 @@ def initialize(attributes = {})
9898
# @return true if the model is valid
9999
# @!visibility private
100100
def valid?
101-
return false if @components_affected.nil?
102101
return false if @description.nil?
103102
return false if @started_at.nil?
104103
return false if @status.nil?
105104
true
106105
end
107106

108-
# Custom attribute writer method with validation
109-
# @param components_affected [Object] Object to be assigned
110-
# @!visibility private
111-
def components_affected=(components_affected)
112-
if components_affected.nil?
113-
fail ArgumentError, 'invalid value for "components_affected", components_affected cannot be nil.'
114-
end
115-
@components_affected = components_affected
116-
end
117-
118107
# Custom attribute writer method with validation
119108
# @param description [Object] Object to be assigned
120109
# @!visibility private

lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes.rb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CreateMaintenanceRequestDataAttributes
2828
attr_reader :completed_description
2929

3030
# The components affected by the maintenance.
31-
attr_reader :components_affected
31+
attr_accessor :components_affected
3232

3333
# The description shown while the maintenance is in progress.
3434
attr_reader :in_progress_description
@@ -127,7 +127,6 @@ def initialize(attributes = {})
127127
def valid?
128128
return false if @completed_date.nil?
129129
return false if @completed_description.nil?
130-
return false if @components_affected.nil?
131130
return false if @in_progress_description.nil?
132131
return false if @scheduled_description.nil?
133132
return false if @start_date.nil?
@@ -155,16 +154,6 @@ def completed_description=(completed_description)
155154
@completed_description = completed_description
156155
end
157156

158-
# Custom attribute writer method with validation
159-
# @param components_affected [Object] Object to be assigned
160-
# @!visibility private
161-
def components_affected=(components_affected)
162-
if components_affected.nil?
163-
fail ArgumentError, 'invalid value for "components_affected", components_affected cannot be nil.'
164-
end
165-
@components_affected = components_affected
166-
end
167-
168157
# Custom attribute writer method with validation
169158
# @param in_progress_description [Object] Object to be assigned
170159
# @!visibility private

0 commit comments

Comments
 (0)